Follow xv6 code style. Also fixes indexing for these functions
This commit is contained in:
parent
37ee75f42e
commit
92639b6ba9
1 changed files with 12 additions and 6 deletions
18
x86.h
18
x86.h
|
@ -132,7 +132,8 @@ sti(void)
|
|||
asm volatile("sti");
|
||||
}
|
||||
|
||||
static inline void nop_pause(void)
|
||||
static inline void
|
||||
nop_pause(void)
|
||||
{
|
||||
asm volatile("pause" : :);
|
||||
}
|
||||
|
@ -151,31 +152,36 @@ xchg(volatile uint *addr, uint newval)
|
|||
return result;
|
||||
}
|
||||
|
||||
static inline void lcr0(uint val)
|
||||
static inline void
|
||||
lcr0(uint val)
|
||||
{
|
||||
asm volatile("movl %0,%%cr0" : : "r" (val));
|
||||
}
|
||||
|
||||
static inline uint rcr0(void)
|
||||
static inline uint
|
||||
rcr0(void)
|
||||
{
|
||||
uint val;
|
||||
asm volatile("movl %%cr0,%0" : "=r" (val));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline uint rcr2(void)
|
||||
static inline uint
|
||||
rcr2(void)
|
||||
{
|
||||
uint val;
|
||||
asm volatile("movl %%cr2,%0" : "=r" (val));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void lcr3(uint val)
|
||||
static inline void
|
||||
lcr3(uint val)
|
||||
{
|
||||
asm volatile("movl %0,%%cr3" : : "r" (val));
|
||||
}
|
||||
|
||||
static inline uint rcr3(void)
|
||||
static inline uint
|
||||
rcr3(void)
|
||||
{
|
||||
uint val;
|
||||
asm volatile("movl %%cr3,%0" : "=r" (val));
|
||||
|
|
Loading…
Reference in a new issue