Avoid use of register variables. Clang 3.5 treats this as undefined behavior,
and bad things happen. MFC after: 1 week
This commit is contained in:
parent
8c29a9824b
commit
85eda151ff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276734
@ -29,7 +29,6 @@
|
||||
void
|
||||
_set_tp(void *tpval)
|
||||
{
|
||||
register void *tp __asm__("r2");
|
||||
|
||||
__asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7008));
|
||||
__asm __volatile("mr 2,%0" :: "r"((char*)tpval + 0x7008));
|
||||
}
|
||||
|
@ -29,7 +29,6 @@
|
||||
void
|
||||
_set_tp(void *tpval)
|
||||
{
|
||||
register void *tp __asm__("r13");
|
||||
|
||||
__asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7010));
|
||||
__asm __volatile("mr 13,%0" :: "r"((char*)tpval + 0x7010));
|
||||
}
|
||||
|
@ -62,22 +62,22 @@ static __inline void
|
||||
_tcb_set(struct tcb *tcb)
|
||||
{
|
||||
#ifdef __powerpc64__
|
||||
register uint8_t *_tp __asm__("%r13");
|
||||
#else
|
||||
register uint8_t *_tp __asm__("%r2");
|
||||
#endif
|
||||
|
||||
__asm __volatile("mr %0,%1" : "=r"(_tp) :
|
||||
__asm __volatile("mr 13,%0" ::
|
||||
"r"((uint8_t *)tcb + TP_OFFSET));
|
||||
#else
|
||||
__asm __volatile("mr 2,%0" ::
|
||||
"r"((uint8_t *)tcb + TP_OFFSET));
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline struct tcb *
|
||||
_tcb_get(void)
|
||||
{
|
||||
register uint8_t *_tp;
|
||||
#ifdef __powerpc64__
|
||||
register uint8_t *_tp __asm__("%r13");
|
||||
__asm __volatile("mr %0,13" : "=r"(_tp));
|
||||
#else
|
||||
register uint8_t *_tp __asm__("%r2");
|
||||
__asm __volatile("mr %0,2" : "=r"(_tp));
|
||||
#endif
|
||||
|
||||
return ((struct tcb *)(_tp - TP_OFFSET));
|
||||
|
Loading…
Reference in New Issue
Block a user