diff options
author | luoqi <luoqi@FreeBSD.org> | 1999-11-15 19:45:19 +0000 |
---|---|---|
committer | luoqi <luoqi@FreeBSD.org> | 1999-11-15 19:45:19 +0000 |
commit | bd6a60007880ff914f79fa8f5054a1f4ddbade1d (patch) | |
tree | 03dc59a61a43488dd94069043399dfe66a091c1e | |
parent | ff78e4a96ed076b9dd3cbd1afa3a5f08fe8fc92d (diff) | |
download | FreeBSD-src-bd6a60007880ff914f79fa8f5054a1f4ddbade1d.zip FreeBSD-src-bd6a60007880ff914f79fa8f5054a1f4ddbade1d.tar.gz |
Segment registers can be read(write) to(from) memory locations as well as
general registers.
-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 9618b25..48ec351 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -437,7 +437,7 @@ static __inline u_int rfs(void) { u_int sel; - __asm __volatile("movl %%fs,%0" : "=r" (sel)); + __asm __volatile("movl %%fs,%0" : "=rm" (sel)); return (sel); } @@ -445,20 +445,20 @@ static __inline u_int rgs(void) { u_int sel; - __asm __volatile("movl %%gs,%0" : "=r" (sel)); + __asm __volatile("movl %%gs,%0" : "=rm" (sel)); return (sel); } static __inline void load_fs(u_int sel) { - __asm __volatile("movl %0,%%fs" : : "r" (sel)); + __asm __volatile("movl %0,%%fs" : : "rm" (sel)); } static __inline void load_gs(u_int sel) { - __asm __volatile("movl %0,%%gs" : : "r" (sel)); + __asm __volatile("movl %0,%%gs" : : "rm" (sel)); } #else /* !__GNUC__ */ diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 9618b25..48ec351 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -437,7 +437,7 @@ static __inline u_int rfs(void) { u_int sel; - __asm __volatile("movl %%fs,%0" : "=r" (sel)); + __asm __volatile("movl %%fs,%0" : "=rm" (sel)); return (sel); } @@ -445,20 +445,20 @@ static __inline u_int rgs(void) { u_int sel; - __asm __volatile("movl %%gs,%0" : "=r" (sel)); + __asm __volatile("movl %%gs,%0" : "=rm" (sel)); return (sel); } static __inline void load_fs(u_int sel) { - __asm __volatile("movl %0,%%fs" : : "r" (sel)); + __asm __volatile("movl %0,%%fs" : : "rm" (sel)); } static __inline void load_gs(u_int sel) { - __asm __volatile("movl %0,%%gs" : : "r" (sel)); + __asm __volatile("movl %0,%%gs" : : "rm" (sel)); } #else /* !__GNUC__ */ |