Index: sys/sparc64/include/pcpu.h =================================================================== --- sys/sparc64/include/pcpu.h (revision 262582) +++ sys/sparc64/include/pcpu.h (working copy) @@ -70,9 +70,28 @@ extern void *dpcpu0; struct pcb; struct pcpu; -register struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); -register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + __asm("mov %" __XSTRING(PCB_REG) ", %0" : "=r" (pcb)); + + return (pcb); +} +#define curpcb (__curpcb()) + +static __inline __pure2 struct pcpu * +__pcpu(void) +{ + struct pcpu *pcpu; + + __asm("mov %" __XSTRING(PCPU_REG) ", %0" : "=r" (pcpu)); + + return (pcpu); +} +#define pcpup (__pcpu()) + #define PCPU_GET(member) (pcpup->pc_ ## member) static __inline __pure2 struct thread *