summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2012-03-06 03:27:58 +0000
committergonzo <gonzo@FreeBSD.org>2012-03-06 03:27:58 +0000
commit7d20e4f65e1a5975b1f51dec4c1dd14f924e50e9 (patch)
tree7425c7e6ee42dfd1f457540804a0c88cc902427f /lib/libthr
parentf348ee84f4c3f04d015cb8fc440e7d72cf4ef541 (diff)
downloadFreeBSD-src-7d20e4f65e1a5975b1f51dec4c1dd14f924e50e9.zip
FreeBSD-src-7d20e4f65e1a5975b1f51dec4c1dd14f924e50e9.tar.gz
- Switch to saving non-offseted pointer to TLS block in order too keep things simple
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/arch/mips/include/pthread_md.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libthr/arch/mips/include/pthread_md.h b/lib/libthr/arch/mips/include/pthread_md.h
index f7c286a..19c9f38 100644
--- a/lib/libthr/arch/mips/include/pthread_md.h
+++ b/lib/libthr/arch/mips/include/pthread_md.h
@@ -35,15 +35,11 @@
#include <sys/types.h>
#include <machine/sysarch.h>
+#include <machine/tls.h>
#include <stddef.h>
#define CPU_SPINWAIT
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
-#ifdef __mips_n64
-#define TP_OFFSET 0x7010
-#else
-#define TP_OFFSET 0x7008
-#endif
/*
* Variant I tcb. The structure layout is fixed, don't blindly
@@ -65,7 +61,7 @@ static __inline void
_tcb_set(struct tcb *tcb)
{
- sysarch(MIPS_SET_TLS, ((uint8_t*)tcb + TP_OFFSET));
+ sysarch(MIPS_SET_TLS, tcb);
}
/*
@@ -74,10 +70,10 @@ _tcb_set(struct tcb *tcb)
static __inline struct tcb *
_tcb_get(void)
{
- uint8_t *tcb;
+ struct tcb *tcb;
sysarch(MIPS_GET_TLS, &tcb);
- return ((struct tcb *)(tcb - TP_OFFSET));
+ return tcb;
}
extern struct pthread *_thr_initial;
OpenPOWER on IntegriCloud