[kaffe] CVS kaffe (robilad): small fix for jthreads on i386-linux

Kaffe CVS cvs-commits at kaffe.org
Sun Dec 30 17:51:45 PST 2007


PatchSet 7626 
Date: 2007/12/31 01:50:40
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
small fix for jthreads on i386-linux

2007-12-30  Dalibor Topic  <robilad at kaffe.org>

        * config/i386/linux/md.h (SP_OFFSET): Set to 3 to fix crashes with jthreads
        caused by bad SP_OFFSET. Still crashes for me later, though.

Members: 
	ChangeLog:1.5124->1.5125 
	config/i386/linux/md.h:INITIAL->1.17 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5124 kaffe/ChangeLog:1.5125
--- kaffe/ChangeLog:1.5124	Mon Dec 31 01:45:16 2007
+++ kaffe/ChangeLog	Mon Dec 31 01:50:40 2007
@@ -1,5 +1,10 @@
 2007-12-30  Dalibor Topic  <robilad at kaffe.org>
 
+	* config/i386/linux/md.h (SP_OFFSET): Set to 3 to fix crashes with jthreads 
+	caused by bad SP_OFFSET. Still crashes for me later, though.
+
+2007-12-30  Dalibor Topic  <robilad at kaffe.org>
+
 	* configure.ac: Downgrade error when not building with gcc to warning.
 
 2007-12-29  Dalibor Topic  <robilad at kaffe.org>
===================================================================
Checking out kaffe/config/i386/linux/md.h
RCS:  /home/cvs/kaffe/kaffe/config/i386/linux/md.h,v
VERS: 1.17
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/i386/linux/md.h	Mon Dec 31 01:51:44 2007
@@ -0,0 +1,97 @@
+/*
+ * i386/linux/md.h
+ * Linux i386 configuration information.
+ *
+ * Copyright (c) 1996, 1997
+ *	Transvirtual Technologies, Inc.  All rights reserved.
+ *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
+ * See the file "license.terms" for information on usage and redistribution 
+ * of this file. 
+ */
+
+#ifndef __ki386_linux_md_h
+#define __ki386_linux_md_h
+
+#include "i386/common.h"
+#include "i386/threads.h"
+
+/*
+ * Redefine stack pointer offset.
+ */
+#undef SP_OFFSET
+#define SP_OFFSET 3
+
+/**/
+/* Extra exception handling information. */
+/**/
+#if defined(HAVE_FEATURES_H)
+#include <features.h>
+#endif
+#if defined(HAVE_ASM_SIGNAL_H) && !defined(__GLIBC__)
+#include <asm/signal.h>
+#endif
+#if defined(HAVE_SIGNAL_H)
+#include <signal.h>
+#endif
+#if defined(HAVE_ASM_SIGCONTEXT_H) && !defined(__GLIBC__)
+#include <asm/sigcontext.h>
+#endif
+#if defined(HAVE_SIGCONTEXT_H)
+#include <sigcontext.h>
+#endif
+#if defined(HAVE_SYS_RESOURCE_H)
+#include <sys/resource.h>
+#endif
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+/*
+ * newer Linux kernel actually implement SA_SIGINFO.
+ * But we don't need it, so let's turn it off
+ */
+#if defined(SA_SIGINFO)
+#undef SA_SIGINFO
+#endif
+
+/* Linux requires a little initialisation */
+extern void init_md(void);
+#define	INIT_MD()	init_md()
+
+/* Function prototype for signal handlers */
+#if defined(HAVE_STRUCT_SIGCONTEXT_STRUCT) && !defined(__GLIBC__)
+/* Linux < 2.1.1 */
+#define	SIGNAL_ARGS(sig, sc)						\
+	int sig, struct sigcontext_struct sc
+#define SIGNAL_CONTEXT_POINTER(scp) struct sigcontext_struct * scp
+
+#elif defined(HAVE_STRUCT_SIGCONTEXT) || defined(__GLIBC__)
+/* Linux >= 2.1.1  or Linux 2.0.x with glibc2 */
+#define	SIGNAL_ARGS(sig, sc)						\
+	int sig, struct sigcontext sc
+#define SIGNAL_CONTEXT_POINTER(scp) struct sigcontext * scp
+#else
+#error Do not know how to define SIGNAL_ARGS
+#endif
+
+#include "sigcontextinfo.h"
+
+#define GET_SIGNAL_CONTEXT_POINTER(sc) (&sc)
+#define SIGNAL_PC(scp) (GET_PC((*scp)))
+#define STACK_POINTER(scp) (GET_STACK((*scp)))
+
+#include "kaffe-unix-stack.h"
+
+#if defined(__GLIBC__)
+#define KAFFEMD_STACKEND
+extern void *mdGetStackEnd(void);
+#endif
+
+#if defined(TRANSLATOR)
+#include "jit-md.h"
+#endif
+
+#endif




More information about the kaffe mailing list