Segment registers can be read(write) to(from) memory locations as well as

general registers.
This commit is contained in:
Luoqi Chen 1999-11-15 19:45:19 +00:00
parent a02d4a1bb5
commit e870e9b278
2 changed files with 8 additions and 8 deletions

View File

@ -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__ */

View File

@ -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__ */