summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/cpufunc.h
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-04-19 02:40:39 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-04-19 02:40:39 +0000
commit6223a95348ea93dfdcb9a7f268196bbf9a5e834e (patch)
tree3dc50456ec17153f0e111b7263dec8a799137ff6 /sys/amd64/include/cpufunc.h
parent20e15050d1a812bbce09abe4460de3b893dd773d (diff)
downloadFreeBSD-src-6223a95348ea93dfdcb9a7f268196bbf9a5e834e.zip
FreeBSD-src-6223a95348ea93dfdcb9a7f268196bbf9a5e834e.tar.gz
Don't return garbage in high 16 bits.
Diffstat (limited to 'sys/amd64/include/cpufunc.h')
-rw-r--r--sys/amd64/include/cpufunc.h8
1 files changed, 4 insertions, 4 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);
}
OpenPOWER on IntegriCloud