From a7aa47c752fd0eab1290ec9541118cc4b8649118 Mon Sep 17 00:00:00 2001 From: Denis Drakhnia Date: Wed, 28 Feb 2024 20:49:55 +0200 Subject: [PATCH] asm/syscall: add simple fast syscall test --- tests/asm/include/common/syscall_nr.h | 14 +++++++++++--- tests/asm/meson.build | 1 + tests/asm/syscall/fast-gettimeofday-1.S | 25 +++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 tests/asm/syscall/fast-gettimeofday-1.S diff --git a/tests/asm/include/common/syscall_nr.h b/tests/asm/include/common/syscall_nr.h index b897916..20e2689 100644 --- a/tests/asm/include/common/syscall_nr.h +++ b/tests/asm/include/common/syscall_nr.h @@ -1,11 +1,19 @@ #ifndef COMMON_SYSCALL_NR_H #define COMMON_SYSCALL_NR_H -#define NR_exit 1 -#define NR_write 4 -#define NR_mmap 90 +#define NR_exit 1 +#define NR_write 4 +#define NR_gettimeofday 78 +#define NR_mmap 90 #define NR_rt_sigaction 174 #define NR_rt_sigreturn 173 #define NR_access_hw_stacks 254 +#define NR_fast_sys_gettimeofday 0 +#define NR_fast_sys_clock_gettime 1 +#define NR_fast_sys_getcpu 2 +#define NR_fast_sys_siggetmask 3 +#define NR_fast_sys_getcontext 4 +#define NR_fast_sys_set_return 5 + #endif // COMMON_SYSCALL_NR_H diff --git a/tests/asm/meson.build b/tests/asm/meson.build index 3a18ffc..3896ad7 100644 --- a/tests/asm/meson.build +++ b/tests/asm/meson.build @@ -205,6 +205,7 @@ asm_tests = { 'invalid-nr-hi-1': {}, 'invalid-arg-1': {}, 'invalid-arg-hi-1': {}, + 'fast-gettimeofday-1': {}, }, 'f80': { 'movif-movfi-1': {}, diff --git a/tests/asm/syscall/fast-gettimeofday-1.S b/tests/asm/syscall/fast-gettimeofday-1.S new file mode 100644 index 0000000..4709d64 --- /dev/null +++ b/tests/asm/syscall/fast-gettimeofday-1.S @@ -0,0 +1,25 @@ +#include "test_start.S" + + { + setwd wsz=8, nfx=1 + setbn rsz=3, rbs=4, rcur=0 + } + { + addd,0 0, NR_fast_sys_gettimeofday, %b[0] + sdisp %ctpr1, 0x6 + } + { + addd,1 0, tv, %b[1] + addd,2 0, tz, %b[2] + call %ctpr1, wbs=4 + } + +#include "test_end.S" + + .data + .balign 8 +tv: + .fill 16, 1, 0 +tz: + .fill 16, 1, 0 +