This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Provide returner for signal handler
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 29 Jul 2003 14:46:32 +0100
- Subject: Provide returner for signal handler
This brings the i386 signal handler in line with glibc and matches
what we do on other targets.
Andrew.
2003-07-08 Andrew Haley <aph@redhat.com>
* include/i386-signal.h (RESTORE): New.
(INIT_SEGV): Set restorer.
(INIT_FPE): Likewise.
Index: libjava/include/i386-signal.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/i386-signal.h,v
retrieving revision 1.14
diff -p -2 -c -r1.14 i386-signal.h
*** libjava/include/i386-signal.h 18 Mar 2002 17:11:43 -0000 1.14
--- libjava/include/i386-signal.h 9 Jul 2003 13:47:40 -0000
*************** struct old_i386_kernel_sigaction {
*** 109,112 ****
--- 109,128 ----
};
+ #define RESTORE(name, syscall) RESTORE2 (name, syscall)
+ # define RESTORE2(name, syscall) \
+ asm \
+ ( \
+ ".text\n" \
+ ".byte 0 # Yes, this really is necessary\n" \
+ " .align 8\n" \
+ "__" #name ":\n" \
+ " popl %eax\n" \
+ " movl $" #syscall ", %eax\n" \
+ " int $0x80" \
+ );
+
+ RESTORE (restore, __NR_sigreturn)
+ static void restore (void) asm ("__restore");
+
#define INIT_SEGV \
do \
*************** do \
*** 116,120 ****
kact.k_sa_handler = catch_segv; \
kact.k_sa_mask = 0; \
! kact.k_sa_flags = 0; \
syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \
} \
--- 132,137 ----
kact.k_sa_handler = catch_segv; \
kact.k_sa_mask = 0; \
! kact.k_sa_flags = 0x4000000; \
! kact.sa_restorer = restore; \
syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \
} \
*************** do \
*** 129,133 ****
kact.k_sa_handler = catch_fpe; \
kact.k_sa_mask = 0; \
! kact.k_sa_flags = 0; \
syscall (SYS_sigaction, SIGFPE, &kact, NULL); \
} \
--- 146,151 ----
kact.k_sa_handler = catch_fpe; \
kact.k_sa_mask = 0; \
! kact.k_sa_flags = 0x4000000; \
! kact.sa_restorer = restore; \
syscall (SYS_sigaction, SIGFPE, &kact, NULL); \
} \