We don't use lesp/lebp and using them at all from C would be fraught with peril. Keep resp/rebp, but fix their code style.

This commit is contained in:
Austin Clements 2010-08-31 17:07:54 -04:00
parent 7914ab7214
commit 29c054df81

30
x86.h
View file

@ -96,24 +96,16 @@ loadgs(ushort v)
asm volatile("movw %0, %%gs" : : "r" (v)); asm volatile("movw %0, %%gs" : : "r" (v));
} }
static inline void lebp(uint val) static inline uint
{ rebp(void)
asm volatile("movl %0,%%ebp" : : "r" (val));
}
static inline uint rebp(void)
{ {
uint val; uint val;
asm volatile("movl %%ebp,%0" : "=r" (val)); asm volatile("movl %%ebp,%0" : "=r" (val));
return val; return val;
} }
static inline void lesp(uint val) static inline uint
{ resp(void)
asm volatile("movl %0,%%esp" : : "r" (val));
}
static inline uint resp(void)
{ {
uint val; uint val;
asm volatile("movl %%esp,%0" : "=r" (val)); asm volatile("movl %%esp,%0" : "=r" (val));
@ -132,13 +124,6 @@ sti(void)
asm volatile("sti"); asm volatile("sti");
} }
static inline void
nop_pause(void)
{
asm volatile("pause" : :);
}
//PAGEBREAK!
static inline uint static inline uint
xchg(volatile uint *addr, uint newval) xchg(volatile uint *addr, uint newval)
{ {
@ -152,6 +137,13 @@ xchg(volatile uint *addr, uint newval)
return result; return result;
} }
static inline void
nop_pause(void)
{
asm volatile("pause" : :);
}
//PAGEBREAK!
static inline void static inline void
lcr0(uint val) lcr0(uint val)
{ {