summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-03-05 04:39:24 +0000
committermarcel <marcel@FreeBSD.org>2003-03-05 04:39:24 +0000
commitd4ee62b07a76bf06911d862a0e2084a2309efa36 (patch)
tree43c9fbba16caef13b08438e9431452fba63c0dde /sys/ia64
parentcf2b37334bdcf41af17a17f34a5d80417cc188d8 (diff)
downloadFreeBSD-src-d4ee62b07a76bf06911d862a0e2084a2309efa36.zip
FreeBSD-src-d4ee62b07a76bf06911d862a0e2084a2309efa36.tar.gz
Fix threaded applications on ia64 that are linked dynamicly. We did
not save (restore) the global pointer (GP) in the jmpbuf in setjmp (longjmp) because it's not needed in general. GP is considered a scratch register at callsites and hence is always restored after a call (when it's possible that the call resolves to a symbol in a different loadmodule; otherwise GP does not have to be saved and restored at all), including calls to setjmp/longjmp. There's just one problem with this now that we use setjmp/longjmp for context switching: A new context must have GP defined properly for the thread's entry point. This means that we need to put GP in the jmpbuf and consequently that we have to restore is in longjmp. This automaticly requires us to save it as well. When setjmp/longjmp isn't used for context switching, this can be reverted again.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/include/setjmp.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ia64/include/setjmp.h b/sys/ia64/include/setjmp.h
index 208e072..6f4fab9 100644
--- a/sys/ia64/include/setjmp.h
+++ b/sys/ia64/include/setjmp.h
@@ -88,10 +88,11 @@
#define J_B5 0x1d0
#define J_SIGMASK 0x1d8
#define J_SIGSET 0x1e0
+#define J_GP 0x1f0
#endif /* __BSD_VISIBLE */
/*
- * We have 16 bytes left for future use, but it's a nice round,
+ * We have 8 bytes left for future use, but it's a nice round,
* but above all large number. Size is in bytes.
*/
#define _JMPBUFSZ 0x200
OpenPOWER on IntegriCloud