[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r2137 - in /trunk/ports: ./ sysdeps/unix/sysv/linux/arm/ sysdeps/unix/sysv/linux/arm/eabi/ sysdeps/unix/sysv/linux/arm/nptl/



Author: joseph
Date: Tue May  1 14:00:50 2007
New Revision: 2137

Log:
	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	(__ASSUME_SIGFRAME_V2): Define for 2.6.18 and later.
	* sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
	(__default_sa_restorer): Rename to __default_sa_restorer_v1.
	Don't define if __ASSUME_SIGFRAME_V2.
	(__default_rt_sa_restorer): Rename to
	__default_rt_sa_restorer_v1.  Don't define if
	__ASSUME_SIGFRAME_V2.
	(__default_sa_restorer_v2, __default_rt_sa_restorer_v2): New.
	* sysdeps/unix/sysv/linux/arm/nptl/Versions
	(__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
	__default_sa_restorer_v2, __default_rt_sa_restorer_v2): Add to
	GLIBC_PRIVATE.
	* sysdeps/unix/sysv/linux/arm/sigaction.c [__ARM_EABI__]
	(__default_sa_restorer_v1, __default_sa_restorer_v2,
	__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2):
	Declare.
	(__default_sa_restorer, __default_rt_sa_restorer): Define as
	macros depending on kernel version.

Modified:
    trunk/ports/ChangeLog.eglibc
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
    trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
    trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions
    trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c

Modified: trunk/ports/ChangeLog.eglibc
==============================================================================
--- trunk/ports/ChangeLog.eglibc (original)
+++ trunk/ports/ChangeLog.eglibc Tue May  1 14:00:50 2007
@@ -1,3 +1,25 @@
+2007-05-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h
+	(__ASSUME_SIGFRAME_V2): Define for 2.6.18 and later.
+	* sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+	(__default_sa_restorer): Rename to __default_sa_restorer_v1.
+	Don't define if __ASSUME_SIGFRAME_V2.
+	(__default_rt_sa_restorer): Rename to
+	__default_rt_sa_restorer_v1.  Don't define if
+	__ASSUME_SIGFRAME_V2.
+	(__default_sa_restorer_v2, __default_rt_sa_restorer_v2): New.
+	* sysdeps/unix/sysv/linux/arm/nptl/Versions
+	(__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
+	__default_sa_restorer_v2, __default_rt_sa_restorer_v2): Add to
+	GLIBC_PRIVATE.
+	* sysdeps/unix/sysv/linux/arm/sigaction.c [__ARM_EABI__]
+	(__default_sa_restorer_v1, __default_sa_restorer_v2,
+	__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2):
+	Declare.
+	(__default_sa_restorer, __default_rt_sa_restorer): Define as
+	macros depending on kernel version.
+
 2007-04-16  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext-extra.S:

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S Tue May  1 14:00:50 2007
@@ -29,24 +29,49 @@
 
    Start the unwind tables at least one instruction before the signal
    trampoline, because the unwinder will assume we are returning after
-   a call site.  */
+   a call site.
 
+   Because the signal frame layout changed in 2.6.18, we provide two
+   copies of these functions with different unwind information.  */
+
+#ifndef __ASSUME_SIGFRAME_V2
 	.fnstart
 	.save {r0-r15}
 	.pad #12
 	nop
-ENTRY(__default_sa_restorer)
+ENTRY(__default_sa_restorer_v1)
+	mov	r7, $SYS_ify(sigreturn)
+	swi	0x0
+	.fnend
+#endif
+
+	.fnstart
+	.save {r0-r15}
+	.pad #32
+	nop
+ENTRY(__default_sa_restorer_v2)
 	mov	r7, $SYS_ify(sigreturn)
 	swi	0x0
 	.fnend
 
 #ifdef __NR_rt_sigreturn
 
+#ifndef __ASSUME_SIGFRAME_V2
 	.fnstart
 	.save {r0-r15}
 	.pad #168
 	nop
-ENTRY(__default_rt_sa_restorer)
+ENTRY(__default_rt_sa_restorer_v1)
+	mov	r7, $SYS_ify(rt_sigreturn)
+	swi	0x0
+	.fnend
+#endif
+
+	.fnstart
+	.save {r0-r15}
+	.pad #160
+	nop
+ENTRY(__default_rt_sa_restorer_v2)
 	mov	r7, $SYS_ify(rt_sigreturn)
 	swi	0x0
 	.fnend

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h Tue May  1 14:00:50 2007
@@ -46,4 +46,9 @@
 # define __ASSUME_VFORK_SYSCALL		1
 #endif
 
+/* The signal frame layout changed in 2.6.18.  */
+#if __LINUX_KERNEL_VERSION >= 132626
+# define __ASSUME_SIGFRAME_V2	1
+#endif
+
 #include_next <kernel-features.h>

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions Tue May  1 14:00:50 2007
@@ -2,5 +2,7 @@
   GLIBC_PRIVATE {
     # A copy of sigaction lives in NPTL, and needs these.
     __default_sa_restorer; __default_rt_sa_restorer;
+    __default_sa_restorer_v1; __default_rt_sa_restorer_v1;
+    __default_sa_restorer_v2; __default_rt_sa_restorer_v2;
   }
 }

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c Tue May  1 14:00:50 2007
@@ -36,8 +36,27 @@
 
 #define SA_RESTORER	0x04000000
 
+#ifdef __ARM_EABI__
+extern void __default_sa_restorer_v1(void);
+extern void __default_sa_restorer_v2(void);
+extern void __default_rt_sa_restorer_v1(void);
+extern void __default_rt_sa_restorer_v2(void);
+# ifdef __ASSUME_SIGFRAME_V2
+#  define __default_sa_restorer __default_sa_restorer_v2
+#  define __default_rt_sa_restorer __default_rt_sa_restorer_v2
+# else
+#  include <ldsodefs.h>
+#  define __default_sa_restorer (GLRO(dl_osversion) >= 0x020612	\
+				 ? __default_sa_restorer_v2	\
+				 : __default_sa_restorer_v1)
+#  define __default_rt_sa_restorer (GLRO(dl_osversion) >= 0x020612	\
+				    ? __default_rt_sa_restorer_v2	\
+				    : __default_rt_sa_restorer_v1)
+# endif
+#else
 extern void __default_sa_restorer(void);
 extern void __default_rt_sa_restorer(void);
+#endif
 
 /* When RT signals are in use we need to use a different return stub.  */
 #ifdef __NR_rt_sigreturn