RISC-V: Moved syscalls to separate files to fix aliasing problems.
This commit is contained in:
@ -54,31 +54,4 @@
|
||||
#define SYS_time 1062
|
||||
#define SYS_getmainvars 2011
|
||||
|
||||
extern long __syscall_error(long);
|
||||
|
||||
static inline long
|
||||
__internal_syscall(long n, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
|
||||
{
|
||||
register long a0 asm("a0") = _a0;
|
||||
register long a1 asm("a1") = _a1;
|
||||
register long a2 asm("a2") = _a2;
|
||||
register long a3 asm("a3") = _a3;
|
||||
register long a4 asm("a4") = _a4;
|
||||
register long a5 asm("a5") = _a5;
|
||||
|
||||
#ifdef __riscv_32e
|
||||
register long syscall_id asm("t0") = n;
|
||||
#else
|
||||
register long syscall_id asm("a7") = n;
|
||||
#endif
|
||||
|
||||
asm volatile ("scall"
|
||||
: "+r"(a0) : "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5), "r"(syscall_id));
|
||||
|
||||
if (a0 < 0)
|
||||
return __syscall_error (a0);
|
||||
else
|
||||
return a0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user