diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-04-19 02:40:39 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-04-19 02:40:39 +0000 |
commit | 6223a95348ea93dfdcb9a7f268196bbf9a5e834e (patch) | |
tree | 3dc50456ec17153f0e111b7263dec8a799137ff6 | |
parent | 20e15050d1a812bbce09abe4460de3b893dd773d (diff) | |
download | FreeBSD-src-6223a95348ea93dfdcb9a7f268196bbf9a5e834e.zip FreeBSD-src-6223a95348ea93dfdcb9a7f268196bbf9a5e834e.tar.gz |
Don't return garbage in high 16 bits.
-rw-r--r-- | sys/amd64/include/cpufunc.h | 8 | ||||
-rw-r--r-- | sys/i386/include/cpufunc.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index c7f9ace..3fe22ac 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -444,16 +444,16 @@ invlpg(u_int addr) static __inline u_int rfs(void) { - u_int sel; - __asm __volatile("movl %%fs,%0" : "=rm" (sel)); + u_short sel; + __asm __volatile("movw %%fs,%0" : "=rm" (sel)); return (sel); } static __inline u_int rgs(void) { - u_int sel; - __asm __volatile("movl %%gs,%0" : "=rm" (sel)); + u_short sel; + __asm __volatile("movw %%gs,%0" : "=rm" (sel)); return (sel); } diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index c7f9ace..3fe22ac 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -444,16 +444,16 @@ invlpg(u_int addr) static __inline u_int rfs(void) { - u_int sel; - __asm __volatile("movl %%fs,%0" : "=rm" (sel)); + u_short sel; + __asm __volatile("movw %%fs,%0" : "=rm" (sel)); return (sel); } static __inline u_int rgs(void) { - u_int sel; - __asm __volatile("movl %%gs,%0" : "=rm" (sel)); + u_short sel; + __asm __volatile("movw %%gs,%0" : "=rm" (sel)); return (sel); } |