diff options
author | jhb <jhb@FreeBSD.org> | 2010-07-29 18:44:10 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-07-29 18:44:10 +0000 |
commit | 007376c918adfea0ab81ac43b33dc3f8297b4e6e (patch) | |
tree | ca3924e0572a2a29f202c1fdbe307006a9bf6eed /sys/i386/include/pcpu.h | |
parent | 32773dc6ee3f0d5e900ca06397917b0542c56d12 (diff) | |
download | FreeBSD-src-007376c918adfea0ab81ac43b33dc3f8297b4e6e.zip FreeBSD-src-007376c918adfea0ab81ac43b33dc3f8297b4e6e.tar.gz |
Mark the __curthread() functions as __pure2 and remove the volatile keyword
from the inline assembly. This allows the compiler to cache invocations of
curthread since it's value does not change within a thread context.
Submitted by: zec (i386)
MFC after: 1 week
Diffstat (limited to 'sys/i386/include/pcpu.h')
-rw-r--r-- | sys/i386/include/pcpu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index d80f8e1..8906eda 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()) |