diff options
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/sh/sysdep.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h index 35b8a58afa..aeec279de0 100644 --- a/sysdeps/unix/sysv/linux/sh/sysdep.h +++ b/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -333,6 +333,20 @@ \ (int) resultvar; }) +/* The _NCS variant allows non-constant syscall numbers. */ +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ \ + unsigned long int resultvar; \ + register long int r3 asm ("%r3") = (name); \ + SUBSTITUTE_ARGS_##nr(args); \ + \ + asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD \ + : "=z" (resultvar) \ + : "r" (r3) ASMFMT_##nr \ + : "memory"); \ + \ + (int) resultvar; }) + #undef INTERNAL_SYSCALL_DECL #define INTERNAL_SYSCALL_DECL(err) do { } while (0) |