diff options
author | rtm <rtm> | 2006-07-01 21:26:01 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-07-01 21:26:01 +0000 |
commit | 8b4e2a08febc8b957b44732dbc7da831479a0005 (patch) | |
tree | 46c3b079ec65f0efbd1f3b603f1b11a3ae09e56d /x86.h | |
parent | f7cea12b38a86e9b37fa5bc635310d3f85e5f8db (diff) | |
download | xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.tar.gz xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.tar.bz2 xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.zip |
swtch saves callee-saved registers
swtch idles on per-CPU stack, not on calling process's stack
fix pipe bugs
usertest.c tests pipes, fork, exit, close
Diffstat (limited to 'x86.h')
-rw-r--r-- | x86.h | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -244,6 +244,30 @@ read_esp(void) return esp; } +static __inline uint32_t +read_esi(void) +{ + uint32_t esi; + __asm __volatile("movl %%esi,%0" : "=r" (esi)); + return esi; +} + +static __inline uint32_t +read_edi(void) +{ + uint32_t edi; + __asm __volatile("movl %%edi,%0" : "=r" (edi)); + return edi; +} + +static __inline uint32_t +read_ebx(void) +{ + uint32_t ebx; + __asm __volatile("movl %%ebx,%0" : "=r" (ebx)); + return ebx; +} + static __inline void cpuid(uint32_t info, uint32_t *eaxp, uint32_t *ebxp, uint32_t *ecxp, uint32_t *edxp) { @@ -280,6 +304,20 @@ read_tsc(void) return tsc; } +// disable interrupts +static __inline void +cli(void) +{ + __asm __volatile("cli"); +} + +// enable interrupts +static __inline void +sti(void) +{ + __asm __volatile("sti"); +} + struct PushRegs { /* registers as pushed by pusha */ uint32_t reg_edi; |