diff options
author | marius <marius@FreeBSD.org> | 2011-06-18 11:07:09 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-06-18 11:07:09 +0000 |
commit | 44781533ff6a37d1a1adef814b3f7c92f282a3dd (patch) | |
tree | 09c667a3840dcc7f44fe437d41a37446177d26f9 /lib/libthr/arch/sparc64/include | |
parent | 784b15655084691642334c13097cf2ecf023679d (diff) | |
download | FreeBSD-src-44781533ff6a37d1a1adef814b3f7c92f282a3dd.zip FreeBSD-src-44781533ff6a37d1a1adef814b3f7c92f282a3dd.tar.gz |
Merge from r161730:
o Set TP using inline assembly to avoid dead code elimination.
o Eliminate _tcb.
Merge from r161840:
Stylize: avoid using a global register variable.
Merge from r157461:
Simplify _get_curthread() and _tcb_ctor because libc and rtld now
already allocate thread pointer space in tls block for initial thread.
Merge from r177853:
Replace function _umtx_op with _umtx_op_err, the later function directly
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.
MFC after: 1 week
Diffstat (limited to 'lib/libthr/arch/sparc64/include')
-rw-r--r-- | lib/libthr/arch/sparc64/include/pthread_md.h | 23 |
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_ */ |