]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386-signal.h (RESTORE): New.
authorAndrew Haley <aph@redhat.com>
Wed, 30 Jul 2003 14:50:02 +0000 (14:50 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Wed, 30 Jul 2003 14:50:02 +0000 (14:50 +0000)
2003-07-08  Andrew Haley  <aph@redhat.com>

        * include/i386-signal.h (RESTORE): New.
        (INIT_SEGV): Set restorer.
        (INIT_FPE): Likewise.

From-SVN: r69957

libjava/ChangeLog
libjava/include/i386-signal.h

index 51626bd0cbb8edddcbc1dcdd043d356814a996d5..97ebc3797f0e571cebc963ce22365ca4232b0618 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-08  Andrew Haley  <aph@redhat.com>
+
+        * include/i386-signal.h (RESTORE): New.
+        (INIT_SEGV): Set restorer.
+        (INIT_FPE): Likewise.
+
 2003-07-29  Thomas Fitzsimmons  <fitzsim@redhat.com>
 
        * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Call getName rather
index 869a928332c17886c954d185a8fffae3d2e43486..280b72e55860733aa9972acb458ea73f685bc331 100644 (file)
@@ -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 */