[PATCH] INTERNAL_SYSCALL_NCS for SH

Kaz Kojima kkojima@rr.iij4u.or.jp
Thu Sep 23 22:43:00 GMT 2004


Hi,

The appended patch is an SH version of INTERNAL_SYSCALL_NCS.

BTW, SH port has a few problems with setXid changes.  I'll report
them in the next mail.

Regards,
	kaz
--
2004-09-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/unix/sysv/linux/sh/sysdep.h (INTERNAL_SYSCALL_NCS): Define.

diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h	Mon Jul  5 11:14:22 2004
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h	Mon Sep 20 10:10:41 2004
@@ -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)
 



More information about the Libc-hacker mailing list