diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index a55627fc1df5..c4b0c440c7df 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -216,12 +216,12 @@ extern struct pcpu *pcpup; #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -static __inline struct thread * +static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm __volatile("movq %%gs:0,%0" : "=r" (td)); + __asm("movq %%gs:0,%0" : "=r" (td)); return (td); } #define curthread (__curthread()) diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index d80f8e16ac2c..8906eda38cda 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -223,12 +223,12 @@ extern struct pcpu *pcpup; #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -static __inline struct thread * +static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm __volatile("movl %%fs:0,%0" : "=r" (td)); + __asm("movl %%fs:0,%0" : "=r" (td)); return (td); } #define curthread (__curthread()) diff --git a/sys/ia64/include/pcpu.h b/sys/ia64/include/pcpu.h index 3c6e6a762af5..58403aad5871 100644 --- a/sys/ia64/include/pcpu.h +++ b/sys/ia64/include/pcpu.h @@ -70,12 +70,12 @@ struct pcpu; register struct pcpu *pcpup __asm__("r13"); -static __inline struct thread * +static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm __volatile("ld8.acq %0=[r13]" : "=r"(td)); + __asm("ld8.acq %0=[r13]" : "=r"(td)); return (td); } #define curthread (__curthread())