This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: INTERNAL_SYSCALL and function calls in arguments


Hi,

Andreas Jaeger <aj@suse.de> wrote:
> But we should check all other platforms, a brief look shows:
[snip]
> - ppc,ppc64, sparc, alpha, sh, mips, hppa, : Might need changes

The appended patch is for SH.

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

	* sysdeps/unix/sysv/linux/sh/sysdep.h (SUBSTITUTE_ARGS_1)
	(SUBSTITUTE_ARGS_2, SUBSTITUTE_ARGS_3, SUBSTITUTE_ARGS_4)
	(SUBSTITUTE_ARGS_5, SUBSTITUTE_ARGS_6, SUBSTITUTE_ARGS_7): Load
	argument values into temporary variables.

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	Sun Nov  9 14:42:35 2003
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h	Tue Apr 13 11:20:33 2004
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+   2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
    Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@@ -244,40 +245,68 @@
 
 #define SUBSTITUTE_ARGS_0()
 #define SUBSTITUTE_ARGS_1(arg1)					\
-	register long r4 asm ("%r4") = (long)(arg1)
+	long _arg1 = (long) (arg1);				\
+	register long r4 asm ("%r4") = (long)(_arg1)
 #define SUBSTITUTE_ARGS_2(arg1, arg2)				\
-	register long r4 asm ("%r4") = (long)(arg1);		\
-	register long r5 asm ("%r5") = (long)(arg2)
+	long _arg1 = (long) (arg1);				\
+	long _arg2 = (long) (arg2);				\
+	register long r4 asm ("%r4") = (long)(_arg1);		\
+	register long r5 asm ("%r5") = (long)(_arg2)
 #define SUBSTITUTE_ARGS_3(arg1, arg2, arg3)			\
-	register long r4 asm ("%r4") = (long)(arg1);		\
-	register long r5 asm ("%r5") = (long)(arg2);		\
-	register long r6 asm ("%r6") = (long)(arg3)
+	long _arg1 = (long) (arg1);				\
+	long _arg2 = (long) (arg2);				\
+	long _arg3 = (long) (arg3);				\
+	register long r4 asm ("%r4") = (long)(_arg1);		\
+	register long r5 asm ("%r5") = (long)(_arg2);		\
+	register long r6 asm ("%r6") = (long)(_arg3)
 #define SUBSTITUTE_ARGS_4(arg1, arg2, arg3, arg4)		\
-	register long r4 asm ("%r4") = (long)(arg1);		\
-	register long r5 asm ("%r5") = (long)(arg2);		\
-	register long r6 asm ("%r6") = (long)(arg3);		\
-	register long r7 asm ("%r7") = (long)(arg4)
+	long _arg1 = (long) (arg1);				\
+	long _arg2 = (long) (arg2);				\
+	long _arg3 = (long) (arg3);				\
+	long _arg4 = (long) (arg4);				\
+	register long r4 asm ("%r4") = (long)(_arg1);		\
+	register long r5 asm ("%r5") = (long)(_arg2);		\
+	register long r6 asm ("%r6") = (long)(_arg3);		\
+	register long r7 asm ("%r7") = (long)(_arg4)
 #define SUBSTITUTE_ARGS_5(arg1, arg2, arg3, arg4, arg5) 	\
-	register long r4 asm ("%r4") = (long)(arg1);		\
-	register long r5 asm ("%r5") = (long)(arg2);		\
-	register long r6 asm ("%r6") = (long)(arg3);		\
-	register long r7 asm ("%r7") = (long)(arg4);		\
-	register long r0 asm ("%r0") = (long)(arg5)
+	long _arg1 = (long) (arg1);				\
+	long _arg2 = (long) (arg2);				\
+	long _arg3 = (long) (arg3);				\
+	long _arg4 = (long) (arg4);				\
+	long _arg5 = (long) (arg5);				\
+	register long r4 asm ("%r4") = (long)(_arg1);		\
+	register long r5 asm ("%r5") = (long)(_arg2);		\
+	register long r6 asm ("%r6") = (long)(_arg3);		\
+	register long r7 asm ("%r7") = (long)(_arg4);		\
+	register long r0 asm ("%r0") = (long)(_arg5)
 #define SUBSTITUTE_ARGS_6(arg1, arg2, arg3, arg4, arg5, arg6)		\
-	register long r4 asm ("%r4") = (long)(arg1);			\
-	register long r5 asm ("%r5") = (long)(arg2);			\
-	register long r6 asm ("%r6") = (long)(arg3);			\
-	register long r7 asm ("%r7") = (long)(arg4);			\
-	register long r0 asm ("%r0") = (long)(arg5);			\
-	register long r1 asm ("%r1") = (long)(arg6)
+	long _arg1 = (long) (arg1);					\
+	long _arg2 = (long) (arg2);					\
+	long _arg3 = (long) (arg3);					\
+	long _arg4 = (long) (arg4);					\
+	long _arg5 = (long) (arg5);					\
+	long _arg6 = (long) (arg6);					\
+	register long r4 asm ("%r4") = (long)(_arg1);			\
+	register long r5 asm ("%r5") = (long)(_arg2);			\
+	register long r6 asm ("%r6") = (long)(_arg3);			\
+	register long r7 asm ("%r7") = (long)(_arg4);			\
+	register long r0 asm ("%r0") = (long)(_arg5);			\
+	register long r1 asm ("%r1") = (long)(_arg6)
 #define SUBSTITUTE_ARGS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7)	\
-	register long r4 asm ("%r4") = (long)(arg1);			\
-	register long r5 asm ("%r5") = (long)(arg2);			\
-	register long r6 asm ("%r6") = (long)(arg3);			\
-	register long r7 asm ("%r7") = (long)(arg4);			\
-	register long r0 asm ("%r0") = (long)(arg5)			\
-	register long r1 asm ("%r1") = (long)(arg6);			\
-	register long r2 asm ("%r2") = (long)(arg7)
+	long _arg1 = (long) (arg1);					\
+	long _arg2 = (long) (arg2);					\
+	long _arg3 = (long) (arg3);					\
+	long _arg4 = (long) (arg4);					\
+	long _arg5 = (long) (arg5);					\
+	long _arg6 = (long) (arg6);					\
+	long _arg7 = (long) (arg7);					\
+	register long r4 asm ("%r4") = (long)(_arg1);			\
+	register long r5 asm ("%r5") = (long)(_arg2);			\
+	register long r6 asm ("%r6") = (long)(_arg3);			\
+	register long r7 asm ("%r7") = (long)(_arg4);			\
+	register long r0 asm ("%r0") = (long)(_arg5);			\
+	register long r1 asm ("%r1") = (long)(_arg6);			\
+	register long r2 asm ("%r2") = (long)(_arg7)
 
 #undef INLINE_SYSCALL
 #define INLINE_SYSCALL(name, nr, args...) \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]