[kaffe] CVS kaffe (guilhem): NetBSD 1.6 fix

Kaffe CVS cvs-commits at kaffe.org
Mon Jul 11 07:29:01 PDT 2005


PatchSet 6721 
Date: 2005/07/11 14:23:51
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
NetBSD 1.6 fix

Members: 
	ChangeLog:1.4245->1.4246 
	config/i386/netbsd1/jit-md.h:1.3->1.4 
	config/i386/netbsd1/md.h:1.12->1.13 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4245 kaffe/ChangeLog:1.4246
--- kaffe/ChangeLog:1.4245	Sun Jul 10 13:49:27 2005
+++ kaffe/ChangeLog	Mon Jul 11 14:23:51 2005
@@ -1,3 +1,9 @@
+2005-07-11  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* config/i386/netbsd1/md.h,
+	config/i386/netbsd1/jit-md.h: Use old sigcontext if ucontext.h is not 
+	available.
+
 2005-07-10  Guilhem Lavaux  <guilhem at kaffe.org>
 
 	* configure.ac: Check for sys/ucontext.h
Index: kaffe/config/i386/netbsd1/jit-md.h
diff -u kaffe/config/i386/netbsd1/jit-md.h:1.3 kaffe/config/i386/netbsd1/jit-md.h:1.4
--- kaffe/config/i386/netbsd1/jit-md.h:1.3	Mon Jul  4 00:53:16 2005
+++ kaffe/config/i386/netbsd1/jit-md.h	Mon Jul 11 14:23:53 2005
@@ -25,9 +25,15 @@
 #define	EXCEPTIONPROTO SIGNAL_ARGS(sig, ctx)
 
 /* Get the first exception frame from a signal handler */
+#if defined(HAVE_SYS_UCONTEXT_H)
 #define	EXCEPTIONFRAME(f, c)						\
         (f).retbp = _UC_MACHINE_SP(((ucontext_t *)(c)));                \
 	(f).retpc = _UC_MACHINE_PC(((ucontext_t *)(c)))
+#else
+#define EXCEPTIONFRAME(f, c)						\
+	(f).retbp = (c)->sc_ebp;					\
+	(f).retpc = (c)->sc_eip + 1;
+#endif
 
 
 #endif
Index: kaffe/config/i386/netbsd1/md.h
diff -u kaffe/config/i386/netbsd1/md.h:1.12 kaffe/config/i386/netbsd1/md.h:1.13
--- kaffe/config/i386/netbsd1/md.h:1.12	Sun Jul 10 13:49:34 2005
+++ kaffe/config/i386/netbsd1/md.h	Mon Jul 11 14:23:53 2005
@@ -32,9 +32,14 @@
 #endif
 
 
+/*
+ * Redefine stack pointer offset.
+ */
+#undef SP_OFFSET
+#define SP_OFFSET 2
+
 #if defined(HAVE_SYS_UCONTEXT_H)
 #include <sys/ucontext.h>
-#endif
 
 /* older netbsd's could have this macro missing, so we provide it */
 #ifdef _UC_MACHINE_SP
@@ -44,20 +49,23 @@
 #define _UC_MACHINE_PC(uc)      ((uc)->uc_mcontext.__gregs[_REG_EIP])
 #endif
 
-
-/*
- * Redefine stack pointer offset.
- */
-#undef SP_OFFSET
-#define SP_OFFSET 2
-
 #define SIGCONTEXT ucontext_t
 
 #define SIGNAL_ARGS(sig, sc) int sig, siginfo_t *__si, void *sc
 #define SIGNAL_CONTEXT_POINTER(scp) SIGCONTEXT *scp
-#define GET_SIGNAL_CONTEXT_POINTER(sc) (sc)
 #define SIGNAL_PC(scp) _UC_MACHINE_PC(((SIGCONTEXT *)(scp)))
 #define STACK_POINTER(scp) _UC_MACHINE_SP(((SIGCONTEXT *)(scp)))
+#define GET_SIGNAL_CONTEXT_POINTER(sc) (sc)
+
+#else
+
+#define SIGNAL_ARGS(sig, sc) int sig, int __code, struct sigcontext *sc
+#define SIGNAL_CONTEXT_POINTER(scp) struct sigcontext *scp
+#define GET_SIGNAL_CONTEXT_POINTER(sc) (sc)
+#define SIGNAL_PC(scp) (scp)->sc_pc
+#define STACK_POINTER(scp) (scp)->sc_sp
+
+#endif
 
 #if defined(TRANSLATOR)
 #include "jit-md.h"




More information about the kaffe mailing list