This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[patch] fix MIPS n32/n64 sysdep headers.
- From: cgd at broadcom dot com
- To: libc-alpha at sources dot redhat dot com
- Date: 10 Sep 2003 11:13:16 -0700
- Subject: [patch] fix MIPS n32/n64 sysdep headers.
It said:
#if 0 /* untested */
and now it has been. 8-)
(in glibc sources as of 2003-08-16, with other mods that i'm
continuing to post. 8-)
The changes:
* get rid of that pesky #if 0!
* redo the #ifdefs slightly and define SYSCALL_ERROR_LABEL
to more closely match the behaviour of the 32-bit version.
(things try to use SYSCALL_ERROR_LABEL, otherwise i wouldn't
have bothered.)
* fix clobbers list (it didn't include $10, and should).
(In fact, until yesterday, the 64-bit kernel also
erroneously clobbered $8 and $9, but that was a bug.
Clobbering $10 is reasonable since...)
* get rid of internal_syscall7, since there are no 7-arg
syscalls in n32 or n64.
Mmm, deleting bogus, unused code. 8-)
cgd
--
2003-09-10 Chris Demetriou <cgd@broadcom.com>
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Remove
"#if 0" surrounding most of contents.
(SYSCALL_ERROR_LABEL): Define.
(__SYSCALL_CLOBBERS): Add $10.
(internal_syscall7): Remove.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
Index: sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
--- sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Fri Aug 15 19:35:02 2003
+++ sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Wed Sep 10 11:00:07 2003
@@ -33,9 +33,16 @@
# define SYS_ify(syscall_name) __NR_N32_/**/syscall_name
#endif
+#ifdef __ASSEMBLER__
-#ifndef __ASSEMBLER__
-#if 0 /* untested */
+/* We don't want the label for the error handler to be visible in the symbol
+ table when we define it here. */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 99b
+#endif
+
+#else /* ! __ASSEMBLER__ */
+
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
@@ -227,37 +234,8 @@
} \
_sys_result; \
})
-
-#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
-({ \
- long _sys_result; \
- \
- { \
- register long long __v0 asm("$2"); \
- register long long __a0 asm("$4") = (long long) arg1; \
- register long long __a1 asm("$5") = (long long) arg2; \
- register long long __a2 asm("$6") = (long long) arg3; \
- register long long __a3 asm("$7") = (long long) arg4; \
- register long long __a4 asm("$8") = (long long) arg5; \
- register long long __a5 asm("$9") = (long long) arg6; \
- register long long __a6 asm("$10") = (long long) arg7; \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
- "r" (__a4), "r" (__a5), "r" (__a6) \
- : __SYSCALL_CLOBBERS); \
- err = __a3; \
- _sys_result = __v0; \
- } \
- _sys_result; \
-})
-#define __SYSCALL_CLOBBERS "$1", "$3", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
-#endif /* untested */
+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
#endif /* __ASSEMBLER__ */
#endif /* linux/mips/sysdep.h */
Index: sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
--- sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Fri Aug 15 19:35:02 2003
+++ sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Wed Sep 10 11:00:07 2003
@@ -33,9 +33,16 @@
# define SYS_ify(syscall_name) __NR_N64_/**/syscall_name
#endif
+#ifdef __ASSEMBLER__
-#ifndef __ASSEMBLER__
-#if 0 /* untested */
+/* We don't want the label for the error handler to be visible in the symbol
+ table when we define it here. */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 99b
+#endif
+
+#else /* ! __ASSEMBLER__ */
+
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
@@ -227,37 +234,8 @@
} \
_sys_result; \
})
-
-#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
-({ \
- long _sys_result; \
- \
- { \
- register long __v0 asm("$2"); \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
- register long __a4 asm("$8") = (long) arg5; \
- register long __a5 asm("$9") = (long) arg6; \
- register long __a6 asm("$10") = (long) arg7; \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
- "r" (__a4), "r" (__a5), "r" (__a6) \
- : __SYSCALL_CLOBBERS); \
- err = __a3; \
- _sys_result = __v0; \
- } \
- _sys_result; \
-})
-#define __SYSCALL_CLOBBERS "$1", "$3", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
-#endif /* untested */
+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
#endif /* __ASSEMBLER__ */
#endif /* linux/mips/sysdep.h */