public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix ppc32 INTERNAL_SYSCALL/INLINE_SYSCALL
@ 2003-05-21 15:30 Jakub Jelinek
  2003-05-21 19:04 ` [PATCH] Fix ppc32+ppc64 INTERNAL_SYSCALL/INLINE_SYSCALL Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2003-05-21 15:30 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

Hi!

ppc32/NPTL doesn't build ATM since nptl/unwind.c (unwind_cleanup)
uses INTERNAL_SYSCALL with string literal. Instead of adding (const char *)
forever to such uses, I think it is better to change ppc sysdep.h.
If an argument is a pointer type, no matter what sizeof tells it fits
into a single word register.

2003-05-21  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (LOADARGS_0,
	LOADARGS_1, LOADARGS_2, LOADARGS_3, LOADARGS_4, LOADARGS_5,
	LOADARGS_6): Don't error if syscall argument is a string literal.

--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h.jj	2003-01-12 14:38:14.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h	2003-05-21 09:22:43.000000000 -0400
@@ -117,32 +117,38 @@
 # define LOADARGS_1(name, arg1) \
 	LOADARGS_0(name, 0); \
 	extern void __illegally_sized_syscall_##name##_arg1 (void); \
-	if (sizeof (arg1) > 4) __illegally_sized_syscall_##name##_arg1 (); \
+	if (__builtin_classify_type (arg1) != 5 && sizeof (arg1) > 4) \
+	  __illegally_sized_syscall_##name##_arg1 (); \
 	r3 = (long) (arg1)
 # define LOADARGS_2(name, arg1, arg2) \
 	LOADARGS_1(name, arg1); \
 	extern void __illegally_sized_syscall_##name##_arg2 (void); \
-	if (sizeof (arg2) > 4) __illegally_sized_syscall_##name##_arg2 (); \
+	if (__builtin_classify_type (arg2) != 5 && sizeof (arg2) > 4) \
+	  __illegally_sized_syscall_##name##_arg2 (); \
 	r4 = (long) (arg2)
 # define LOADARGS_3(name, arg1, arg2, arg3) \
 	LOADARGS_2(name, arg1, arg2); \
 	extern void __illegally_sized_syscall_##name##_arg3 (void); \
-	if (sizeof (arg3) > 4) __illegally_sized_syscall_##name##_arg3 (); \
+	if (__builtin_classify_type (arg3) != 5 && sizeof (arg3) > 4) \
+	  __illegally_sized_syscall_##name##_arg3 (); \
 	r5 = (long) (arg3)
 # define LOADARGS_4(name, arg1, arg2, arg3, arg4) \
 	LOADARGS_3(name, arg1, arg2, arg3); \
 	extern void __illegally_sized_syscall_##name##_arg4 (void); \
-	if (sizeof (arg4) > 4) __illegally_sized_syscall_##name##_arg4 (); \
+	if (__builtin_classify_type (arg4) != 5 && sizeof (arg4) > 4) \
+	  __illegally_sized_syscall_##name##_arg4 (); \
 	r6 = (long) (arg4)
 # define LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5) \
 	LOADARGS_4(name, arg1, arg2, arg3, arg4); \
 	extern void __illegally_sized_syscall_##name##_arg5 (void); \
-	if (sizeof (arg5) > 4) __illegally_sized_syscall_##name##_arg5 (); \
+	if (__builtin_classify_type (arg5) != 5 && sizeof (arg5) > 4) \
+	  __illegally_sized_syscall_##name##_arg5 (); \
 	r7 = (long) (arg5)
 # define LOADARGS_6(name, arg1, arg2, arg3, arg4, arg5, arg6) \
 	LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5); \
 	extern void __illegally_sized_syscall_##name##_arg6 (void); \
-	if (sizeof (arg6) > 4) __illegally_sized_syscall_##name##_arg6 (); \
+	if (__builtin_classify_type (arg6) != 5 && sizeof (arg6) > 4) \
+	  __illegally_sized_syscall_##name##_arg6 (); \
 	r8 = (long) (arg6)
 
 # define ASM_INPUT_0 "0" (r0)

	Jakub

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

* [PATCH] Fix ppc32+ppc64 INTERNAL_SYSCALL/INLINE_SYSCALL
  2003-05-21 15:30 [PATCH] Fix ppc32 INTERNAL_SYSCALL/INLINE_SYSCALL Jakub Jelinek
@ 2003-05-21 19:04 ` Jakub Jelinek
  2003-05-21 19:18   ` Ulrich Drepper
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2003-05-21 19:04 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

On Wed, May 21, 2003 at 05:30:53PM +0200, Jakub Jelinek wrote:
> Hi!
> 
> ppc32/NPTL doesn't build ATM since nptl/unwind.c (unwind_cleanup)
> uses INTERNAL_SYSCALL with string literal. Instead of adding (const char *)
> forever to such uses, I think it is better to change ppc sysdep.h.
> If an argument is a pointer type, no matter what sizeof tells it fits
> into a single word register.

Oops, ppc64 needs the same change.

2003-05-21  Jakub Jelinek  <jakub@redhat.com>
 
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (LOADARGS_0,
	LOADARGS_1, LOADARGS_2, LOADARGS_3, LOADARGS_4, LOADARGS_5,
	LOADARGS_6): Don't error if syscall argument is a string literal.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (LOADARGS_0,
	LOADARGS_1, LOADARGS_2, LOADARGS_3, LOADARGS_4, LOADARGS_5,
	LOADARGS_6): Likewise.

--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h.jj	2003-01-12 14:38:14.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h	2003-05-21 09:22:43.000000000 -0400
@@ -117,32 +117,38 @@
 # define LOADARGS_1(name, arg1) \
 	LOADARGS_0(name, 0); \
 	extern void __illegally_sized_syscall_##name##_arg1 (void); \
-	if (sizeof (arg1) > 4) __illegally_sized_syscall_##name##_arg1 (); \
+	if (__builtin_classify_type (arg1) != 5 && sizeof (arg1) > 4) \
+	  __illegally_sized_syscall_##name##_arg1 (); \
 	r3 = (long) (arg1)
 # define LOADARGS_2(name, arg1, arg2) \
 	LOADARGS_1(name, arg1); \
 	extern void __illegally_sized_syscall_##name##_arg2 (void); \
-	if (sizeof (arg2) > 4) __illegally_sized_syscall_##name##_arg2 (); \
+	if (__builtin_classify_type (arg2) != 5 && sizeof (arg2) > 4) \
+	  __illegally_sized_syscall_##name##_arg2 (); \
 	r4 = (long) (arg2)
 # define LOADARGS_3(name, arg1, arg2, arg3) \
 	LOADARGS_2(name, arg1, arg2); \
 	extern void __illegally_sized_syscall_##name##_arg3 (void); \
-	if (sizeof (arg3) > 4) __illegally_sized_syscall_##name##_arg3 (); \
+	if (__builtin_classify_type (arg3) != 5 && sizeof (arg3) > 4) \
+	  __illegally_sized_syscall_##name##_arg3 (); \
 	r5 = (long) (arg3)
 # define LOADARGS_4(name, arg1, arg2, arg3, arg4) \
 	LOADARGS_3(name, arg1, arg2, arg3); \
 	extern void __illegally_sized_syscall_##name##_arg4 (void); \
-	if (sizeof (arg4) > 4) __illegally_sized_syscall_##name##_arg4 (); \
+	if (__builtin_classify_type (arg4) != 5 && sizeof (arg4) > 4) \
+	  __illegally_sized_syscall_##name##_arg4 (); \
 	r6 = (long) (arg4)
 # define LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5) \
 	LOADARGS_4(name, arg1, arg2, arg3, arg4); \
 	extern void __illegally_sized_syscall_##name##_arg5 (void); \
-	if (sizeof (arg5) > 4) __illegally_sized_syscall_##name##_arg5 (); \
+	if (__builtin_classify_type (arg5) != 5 && sizeof (arg5) > 4) \
+	  __illegally_sized_syscall_##name##_arg5 (); \
 	r7 = (long) (arg5)
 # define LOADARGS_6(name, arg1, arg2, arg3, arg4, arg5, arg6) \
 	LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5); \
 	extern void __illegally_sized_syscall_##name##_arg6 (void); \
-	if (sizeof (arg6) > 4) __illegally_sized_syscall_##name##_arg6 (); \
+	if (__builtin_classify_type (arg6) != 5 && sizeof (arg6) > 4) \
+	  __illegally_sized_syscall_##name##_arg6 (); \
 	r8 = (long) (arg6)
 
 # define ASM_INPUT_0 "0" (r0)
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h.jj	2003-01-28 22:15:58.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h	2003-05-21 13:51:35.000000000 -0400
@@ -130,32 +130,38 @@
 #define LOADARGS_1(name, arg1) \
 	LOADARGS_0(name, 0); \
 	extern void __illegally_sized_syscall_##name##_arg1 (void); \
-	if (sizeof (arg1) > 8) __illegally_sized_syscall_##name##_arg1 (); \
+	if (__builtin_classify_type (arg1) != 5 && sizeof (arg1) > 8) \
+	  __illegally_sized_syscall_##name##_arg1 (); \
 	r3 = (long) (arg1)
 #define LOADARGS_2(name, arg1, arg2) \
 	LOADARGS_1(name, arg1); \
 	extern void __illegally_sized_syscall_##name##_arg2 (void); \
-	if (sizeof (arg2) > 8) __illegally_sized_syscall_##name##_arg2 (); \
+	if (__builtin_classify_type (arg2) != 5 && sizeof (arg2) > 8) \
+	  __illegally_sized_syscall_##name##_arg2 (); \
 	r4 = (long) (arg2)
 #define LOADARGS_3(name, arg1, arg2, arg3) \
 	LOADARGS_2(name, arg1, arg2); \
 	extern void __illegally_sized_syscall_##name##_arg3 (void); \
-	if (sizeof (arg3) > 8) __illegally_sized_syscall_##name##_arg3 (); \
+	if (__builtin_classify_type (arg3) != 5 && sizeof (arg3) > 8) \
+	  __illegally_sized_syscall_##name##_arg3 (); \
 	r5 = (long) (arg3)
 #define LOADARGS_4(name, arg1, arg2, arg3, arg4) \
 	LOADARGS_3(name, arg1, arg2, arg3); \
 	extern void __illegally_sized_syscall_##name##_arg4 (void); \
-	if (sizeof (arg4) > 8) __illegally_sized_syscall_##name##_arg4 (); \
+	if (__builtin_classify_type (arg4) != 5 && sizeof (arg4) > 8) \
+	  __illegally_sized_syscall_##name##_arg4 (); \
 	r6 = (long) (arg4)
 #define LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5) \
 	LOADARGS_4(name, arg1, arg2, arg3, arg4); \
 	extern void __illegally_sized_syscall_##name##_arg5 (void); \
-	if (sizeof (arg5) > 8) __illegally_sized_syscall_##name##_arg5 (); \
+	if (__builtin_classify_type (arg5) != 5 && sizeof (arg5) > 8) \
+	  __illegally_sized_syscall_##name##_arg5 (); \
 	r7 = (long) (arg5)
 #define LOADARGS_6(name, arg1, arg2, arg3, arg4, arg5, arg6) \
 	LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5); \
 	extern void __illegally_sized_syscall_##name##_arg6 (void); \
-	if (sizeof (arg6) > 8) __illegally_sized_syscall_##name##_arg6 (); \
+	if (__builtin_classify_type (arg6) != 5 && sizeof (arg6) > 8) \
+	  __illegally_sized_syscall_##name##_arg6 (); \
 	r8 = (long) (arg6)
 
 #define ASM_INPUT_0 "0" (r0)


	Jakub

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

* Re: [PATCH] Fix ppc32+ppc64 INTERNAL_SYSCALL/INLINE_SYSCALL
  2003-05-21 19:04 ` [PATCH] Fix ppc32+ppc64 INTERNAL_SYSCALL/INLINE_SYSCALL Jakub Jelinek
@ 2003-05-21 19:18   ` Ulrich Drepper
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Drepper @ 2003-05-21 19:18 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Roland McGrath, Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakub Jelinek wrote:

> Oops, ppc64 needs the same change.

Thanks, I've applied the patch.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+y9Dj2ijCOnn/RHQRAuotAKCCXv2U8rvUu9FtPo0Kzo4UX8YFsgCgrNoV
Kib9+WESzvlyqflCcIxlgMs=
=8wCE
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2003-05-21 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-21 15:30 [PATCH] Fix ppc32 INTERNAL_SYSCALL/INLINE_SYSCALL Jakub Jelinek
2003-05-21 19:04 ` [PATCH] Fix ppc32+ppc64 INTERNAL_SYSCALL/INLINE_SYSCALL Jakub Jelinek
2003-05-21 19:18   ` 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).