From e870e9b278b9348d1987d6837bc97529d6f67cfd Mon Sep 17 00:00:00 2001 From: Luoqi Chen Date: Mon, 15 Nov 1999 19:45:19 +0000 Subject: [PATCH] Segment registers can be read(write) to(from) memory locations as well as general registers. --- sys/amd64/include/cpufunc.h | 8 ++++---- 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 9618b252019..48ec3518fc8 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 9618b252019..48ec3518fc8 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__ */