Thread support in 0.10 on OpenBSD

Simon J. Gerraty sjg at
Tue Mar 31 20:02:19 PST 1998

Tank writes:

>>>>>> "Tim" == Tim Wilkinson <tim at> writes:

>    Tim> a problem with the setjmp/longjmp threading system.  You need
>    Tim> to know where the stack pointer is stored in the structure

>I see that the full size of the setjmp buffer is (long)10 in
>OpenBSD-i386 but have not been able to find the area in soure where
>the offset to the stack ptr is...  Any ideas on where in a source tree
>(BSD) this is usually located?

Have a look at /usr/src/lib/libc/arch/i386/gen/setjmp.S or
sigsetjmp.S depending on what is being used. (That's on NetBSD).
On NetBSD/i386 offset 2 is the stack ptr (esp) as far as I can tell.

I know there is a patch for this in the pkgsrc/lang/kaffe for 0.9.2
which used to die a horrible death on NetBSD (after consumming the stack :-)
The patch (just found it) was (for 0.9.2):

--- config/i386/netbsd1/md.h    1998/02/03 14:29:01     1.1
+++ config/i386/netbsd1/md.h    1998/02/03 14:30:48
@@ -16,6 +16,12 @@
 #include "i386/common.h"
 #include "i386/threads.h"
+ * Redefine stack pointer offset.
+ */
+#undef SP_OFFSET
+#define        SP_OFFSET       2
 #if defined(TRANSLATOR)
 #include "jit-md.h"

More information about the kaffe mailing list