From 57c2251d5cc3c0ee9e734b9ae964096c0f918b91 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 30 Aug 2006 03:31:32 +0000 Subject: [PATCH] o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. --- lib/libthr/arch/ia64/include/pthread_md.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libthr/arch/ia64/include/pthread_md.h b/lib/libthr/arch/ia64/include/pthread_md.h index aee5dd2b1c4c..d64800b326be 100644 --- a/lib/libthr/arch/ia64/include/pthread_md.h +++ b/lib/libthr/arch/ia64/include/pthread_md.h @@ -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); }