public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] INTERNAL_SYSCALL_NCS for SH
@ 2004-09-23 22:43 Kaz Kojima
  2004-09-23 22:52 ` Kaz Kojima
  2004-09-24  6:20 ` Ulrich Drepper
  0 siblings, 2 replies; 5+ messages in thread
From: Kaz Kojima @ 2004-09-23 22:43 UTC (permalink / raw)
  To: libc-hacker

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)
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-24  6:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-23 22:43 [PATCH] INTERNAL_SYSCALL_NCS for SH Kaz Kojima
2004-09-23 22:52 ` Kaz Kojima
2004-09-23 23:25   ` Kaz Kojima
2004-09-24  1:22     ` Kaz Kojima
2004-09-24  6:20 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).