diff options
| author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-30 14:50:02 +0000 |
|---|---|---|
| committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-30 14:50:02 +0000 |
| commit | 47309e6b2281574bcbc23895b800d37fd2808c53 (patch) | |
| tree | 9928a38a8f4b929addd89297adffc713f7faffce /libjava/include | |
| parent | 46382bc023039eecf4cb7fd864c7f8fd6ef784ab (diff) | |
| download | ppe42-gcc-47309e6b2281574bcbc23895b800d37fd2808c53.tar.gz ppe42-gcc-47309e6b2281574bcbc23895b800d37fd2808c53.zip | |
2003-07-08 Andrew Haley <aph@redhat.com>
* include/i386-signal.h (RESTORE): New.
(INIT_SEGV): Set restorer.
(INIT_FPE): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69957 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include')
| -rw-r--r-- | libjava/include/i386-signal.h | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h index 869a928332c..280b72e5586 100644 --- a/libjava/include/i386-signal.h +++ b/libjava/include/i386-signal.h @@ -108,26 +108,44 @@ struct old_i386_kernel_sigaction { void (*sa_restorer) (void); }; +#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 \ { \ struct old_i386_kernel_sigaction kact; \ kact.k_sa_handler = catch_segv; \ kact.k_sa_mask = 0; \ - kact.k_sa_flags = 0; \ + kact.k_sa_flags = 0x4000000; \ + kact.sa_restorer = restore; \ syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \ } \ while (0) -#define INIT_FPE \ -do \ - { \ - struct old_i386_kernel_sigaction kact; \ - kact.k_sa_handler = catch_fpe; \ - kact.k_sa_mask = 0; \ - kact.k_sa_flags = 0; \ - syscall (SYS_sigaction, SIGFPE, &kact, NULL); \ - } \ +#define INIT_FPE \ +do \ + { \ + struct old_i386_kernel_sigaction kact; \ + 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); \ + } \ while (0) /* You might wonder why we use syscall(SYS_sigaction) in INIT_FPE @@ -144,10 +162,7 @@ while (0) * Also, there is at the present time no unwind info in the * linuxthreads library's signal handlers and so we can't unwind - * through them anyway. - - * Finally, the code that glibc uses to return from a signal handler - * is subject to change. */ + * through them anyway. */ #endif /* JAVA_SIGNAL_H */ |

