(INTERNAL_SYSCALL_NCS): Define.
authordrepper <drepper>
Fri, 24 Sep 2004 06:19:53 +0000 (06:19 +0000)
committerdrepper <drepper>
Fri, 24 Sep 2004 06:19:53 +0000 (06:19 +0000)
sysdeps/unix/sysv/linux/sh/sysdep.h

index 35b8a58..aeec279 100644 (file)
                                                                              \
     (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)