X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=arch%2Fx86_64%2Fbits%2Fsyscall.h;h=217515f3e0bc4694a9b1f678c5874e7200d4f248;hb=c8ea985748a6857ac5db9ef50f9c92e2966c04d5;hp=ca75019dac2ba9a171fab1139315098574862b9a;hpb=d00ff2950eacc375d57e44d65c7697f636c67625;p=musl diff --git a/arch/x86_64/bits/syscall.h b/arch/x86_64/bits/syscall.h index ca75019d..217515f3 100644 --- a/arch/x86_64/bits/syscall.h +++ b/arch/x86_64/bits/syscall.h @@ -1,3 +1,71 @@ +#define __SYSCALL_LL_E(x) (x) +#define __SYSCALL_LL_O(x) (x) + +#define __SYSCALL_SSLEN 8 + +static __inline long __syscall0(long __n) +{ + unsigned long __ret; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n) : "rcx", "r11", "memory"); + return __ret; +} + +static __inline long __syscall1(long __n, long __a1) +{ + unsigned long __ret; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n), "D"(__a1) : "rcx", "r11", "memory"); + return __ret; +} + +static __inline long __syscall2(long __n, long __a1, long __a2) +{ + unsigned long __ret; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n), "D"(__a1), "S"(__a2) + : "rcx", "r11", "memory"); + return __ret; +} + +static __inline long __syscall3(long __n, long __a1, long __a2, long __a3) +{ + unsigned long __ret; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n), "D"(__a1), "S"(__a2), + "d"(__a3) : "rcx", "r11", "memory"); + return __ret; +} + +static __inline long __syscall4(long __n, long __a1, long __a2, long __a3, long __a4) +{ + unsigned long __ret; + register long __r10 __asm__("r10") = __a4; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n), "D"(__a1), "S"(__a2), + "d"(__a3), "r"(__r10): "rcx", "r11", "memory"); + return __ret; +} + +static __inline long __syscall5(long __n, long __a1, long __a2, long __a3, long __a4, long __a5) +{ + unsigned long __ret; + register long __r10 __asm__("r10") = __a4; + register long __r8 __asm__("r8") = __a5; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n), "D"(__a1), "S"(__a2), + "d"(__a3), "r"(__r10), "r"(__r8) : "rcx", "r11", "memory"); + return __ret; +} + +static __inline long __syscall6(long __n, long __a1, long __a2, long __a3, long __a4, long __a5, long __a6) +{ + unsigned long __ret; + register long __r10 __asm__("r10") = __a4; + register long __r8 __asm__("r8") = __a5; + register long __r9 __asm__("r9") = __a6; + __asm__ __volatile__ ("syscall" : "=a"(__ret) : "a"(__n), "D"(__a1), "S"(__a2), + "d"(__a3), "r"(__r10), "r"(__r8), "r"(__r9) : "rcx", "r11", "memory"); + return __ret; +} + +#define __socketcall(nm,a,b,c,d,e,f) syscall(__NR_##nm, a, b, c, d, e, f) +#define __socketcall_cp(nm,a,b,c,d,e,f) syscall_cp(__NR_##nm, a, b, c, d, e, f) + #define __NR_read 0 #define __NR_write 1 #define __NR_open 2 @@ -301,6 +369,15 @@ #define __NR_fanotify_init 300 #define __NR_fanotify_mark 301 #define __NR_prlimit64 302 +#define __NR_name_to_handle_at 303 +#define __NR_open_by_handle_at 304 +#define __NR_clock_adjtime 305 +#define __NR_syncfs 306 +#define __NR_sendmmsg 307 +#define __NR_setns 308 +#define __NR_getcpu 309 +#define __NR_process_vm_readv 310 +#define __NR_process_vm_writev 311 #undef __NR_fstatat #undef __NR_pread @@ -310,6 +387,7 @@ #define __NR_pread __NR_pread64 #define __NR_pwrite __NR_pwrite64 #define __NR_getdents __NR_getdents64 +#define __NR_fadvise __NR_fadvise64 @@ -618,6 +696,15 @@ #define SYS_fanotify_init 300 #define SYS_fanotify_mark 301 #define SYS_prlimit64 302 +#define SYS_name_to_handle_at 303 +#define SYS_open_by_handle_at 304 +#define SYS_clock_adjtime 305 +#define SYS_syncfs 306 +#define SYS_sendmmsg 307 +#define SYS_setns 308 +#define SYS_getcpu 309 +#define SYS_process_vm_readv 310 +#define SYS_process_vm_writev 311 #undef SYS_fstatat #undef SYS_pread @@ -627,5 +714,6 @@ #define SYS_pread SYS_pread64 #define SYS_pwrite SYS_pwrite64 #define SYS_getdents SYS_getdents64 +#define SYS_fadvise SYS_fadvise64