PatchSet 4910 
Date: 2004/07/08 13:48:14
Author: gb
Branch: HEAD
Tag: (none) 
Log:
Use ucontext_t rather than sigcontext for x86_64 signal handlers.

Members: 
        ChangeLog:1.2476->1.2477 
        config/x86_64/linux/md.h:1.2->1.3 
        config/x86_64/linux/sigcontextinfo.h:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2476 kaffe/ChangeLog:1.2477
--- kaffe/ChangeLog:1.2476      Thu Jul  8 10:41:39 2004
+++ kaffe/ChangeLog     Thu Jul  8 13:48:14 2004
@@ -1,5 +1,13 @@
 2004-07-08  Gwenole Beauchesne  <[EMAIL PROTECTED]>
 
+       * config/x86_64//linux/md.h (SIGNAL_ARGS, SIGNAL_CONTEXT_POINTER):
+       Kernel sends an (ucontext_t *) to the signal handler.
+       * config/x86_64/linux/sigcontextinfo.h
+       (REG_RIP, REG_RBP, REG_RSP): Define.
+       (GET_PC, GET_FRAME, GET_STACK): Use uc_mcontext.gregs[].
+
+2004-07-08  Gwenole Beauchesne  <[EMAIL PROTECTED]>
+
        * kaffe/kaffevm/systems/unix-jthreads/signal.c
        (detectStackBoundaries): Fix initialization of guessPointer on
        64-bit platforms.
Index: kaffe/config/x86_64/linux/md.h
diff -u kaffe/config/x86_64/linux/md.h:1.2 kaffe/config/x86_64/linux/md.h:1.3
--- kaffe/config/x86_64/linux/md.h:1.2  Mon Jun  7 19:14:25 2004
+++ kaffe/config/x86_64/linux/md.h      Thu Jul  8 13:48:16 2004
@@ -28,8 +28,8 @@
 
 #include "sigcontextinfo.h"
 
-#define SIGNAL_ARGS(sig, scp)           int sig, siginfo_t *sip, struct sigcontext 
*scp
-#define SIGNAL_CONTEXT_POINTER(scp)     struct sigcontext *scp
+#define SIGNAL_ARGS(sig, scp)           int sig, siginfo_t *sip, ucontext_t *scp
+#define SIGNAL_CONTEXT_POINTER(scp)     ucontext_t *scp
 #define GET_SIGNAL_CONTEXT_POINTER(sc)  (sc)
 #define SIGNAL_PC(scp)                  (GET_PC((*scp)))
 #define STACK_POINTER(scp)             (GET_STACK((*scp)))
Index: kaffe/config/x86_64/linux/sigcontextinfo.h
diff -u kaffe/config/x86_64/linux/sigcontextinfo.h:1.2 
kaffe/config/x86_64/linux/sigcontextinfo.h:1.3
--- kaffe/config/x86_64/linux/sigcontextinfo.h:1.2      Tue Jul  6 20:48:34 2004
+++ kaffe/config/x86_64/linux/sigcontextinfo.h  Thu Jul  8 13:48:16 2004
@@ -16,6 +16,22 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define GET_PC(ctx)    ((void *) (ctx).rip)
-#define GET_FRAME(ctx) ((void *) (ctx).rbp)
-#define GET_STACK(ctx) ((void *) (ctx).rsp)
+#include <sys/ucontext.h>
+#include <stddef.h>
+
+/* Indices are defined if _GNU_SOURCE is set prior to include <sys/ucontext.h> */
+#define REG_INDEX(NAME)        (offsetof(struct sigcontext, NAME) / sizeof(greg_t))
+
+#ifndef REG_RIP
+#define REG_RIP                REG_INDEX(rip) /* 16 */
+#endif
+#ifndef REG_RBP
+#define REG_RBP                REG_INDEX(rbp) /* 10 */
+#endif
+#ifndef REG_RSP
+#define REG_RSP                REG_INDEX(rsp) /* 15 */
+#endif
+
+#define GET_PC(ctx)    ((void *) (ctx).uc_mcontext.gregs[REG_RIP])
+#define GET_FRAME(ctx) ((void *) (ctx).uc_mcontext.gregs[REG_RBP])
+#define GET_STACK(ctx) ((void *) (ctx).uc_mcontext.gregs[REG_RSP])

_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to