summaryrefslogtreecommitdiffstats
path: root/lib/libthr/arch/sparc64/include/pthread_md.h
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2011-06-28 06:26:03 +0000
committergrehan <grehan@FreeBSD.org>2011-06-28 06:26:03 +0000
commit2c6741be0f59191f2283eb268e4f7690399d578a (patch)
treeb139c8c6dcca4fa284815daade405b75886ee360 /lib/libthr/arch/sparc64/include/pthread_md.h
parent3c35264f695e0a1f8a04dbcca1c93bb5159b2274 (diff)
parent19ae02bba572390c7299166228d31e54003e094a (diff)
downloadFreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.zip
FreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.tar.gz
IFC @ r222830
Diffstat (limited to 'lib/libthr/arch/sparc64/include/pthread_md.h')
-rw-r--r--lib/libthr/arch/sparc64/include/pthread_md.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/lib/libthr/arch/sparc64/include/pthread_md.h b/lib/libthr/arch/sparc64/include/pthread_md.h
index 7909291..7ee9654 100644
--- a/lib/libthr/arch/sparc64/include/pthread_md.h
+++ b/lib/libthr/arch/sparc64/include/pthread_md.h
@@ -50,10 +50,6 @@ struct tcb {
void *tcb_spare[1];
};
-register struct tcb *_tp __asm("%g7");
-
-#define _tcb (_tp)
-
/*
* The tcb constructors.
*/
@@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *);
static __inline void
_tcb_set(struct tcb *tcb)
{
- _tp = tcb;
+
+ __asm __volatile("mov %0, %%g7" : : "r" (tcb));
}
-/*
- * Get the current tcb.
- */
static __inline struct tcb *
_tcb_get(void)
{
- return (_tcb);
-}
+ register struct tcb *tp __asm("%g7");
-extern struct pthread *_thr_initial;
+ return (tp);
+}
static __inline struct pthread *
_get_curthread(void)
{
- if (_thr_initial)
- return (_tcb->tcb_thread);
- return (NULL);
+
+ return (_tcb_get()->tcb_thread);
}
+#define HAS__UMTX_OP_ERR 1
+
#endif /* _PTHREAD_MD_H_ */
OpenPOWER on IntegriCloud