o Set TP using inline assembly to avoid dead code elimination.

o  Eliminate _tcb.
This commit is contained in:
Marcel Moolenaar 2006-08-30 03:31:32 +00:00
parent f3cec68877
commit 57c2251d5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161730

View File

@ -44,8 +44,6 @@ struct tcb {
register struct tcb *_tp __asm("%r13");
#define _tcb _tp
/*
* The tcb constructors.
*/
@ -56,13 +54,13 @@ void _tcb_dtor(struct tcb *);
static __inline void
_tcb_set(struct tcb *tcb)
{
_tp = tcb;
__asm __volatile("mov r13 = %0;;" :: "r"(tcb));
}
static __inline struct tcb *
_tcb_get(void)
{
return (_tcb);
return (_tp);
}
extern struct pthread *_thr_initial;
@ -71,7 +69,7 @@ static __inline struct pthread *
_get_curthread(void)
{
if (_thr_initial)
return (_tcb->tcb_thread);
return (_tp->tcb_thread);
return (NULL);
}