asm/syscall: add simple fast syscall test

This commit is contained in:
Denis Drakhnia 2024-02-28 20:49:55 +02:00
parent 1f94097b8f
commit a7aa47c752
3 changed files with 37 additions and 3 deletions

View File

@ -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

View File

@ -205,6 +205,7 @@ asm_tests = {
'invalid-nr-hi-1': {},
'invalid-arg-1': {},
'invalid-arg-hi-1': {},
'fast-gettimeofday-1': {},
},
'f80': {
'movif-movfi-1': {},

View File

@ -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