summaryrefslogtreecommitdiff
path: root/spinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'spinlock.c')
-rw-r--r--spinlock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/spinlock.c b/spinlock.c
index 8d40258..d73faff 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -20,7 +20,7 @@ acquire_spinlock(uint32_t* lock)
// on a real machine there would be a memory barrier here
if(DEBUG) cprintf("cpu%d: acquiring at %x\n", cpu_id, getcallerpc(&lock));
- write_eflags(read_eflags() & ~FL_IF);
+ cli();
if (*lock == cpu_id)
panic("recursive lock");
@@ -37,7 +37,7 @@ release_spinlock(uint32_t* lock)
panic("release_spinlock: releasing a lock that i don't own\n");
*lock = LOCK_FREE;
// on a real machine there would be a memory barrier here
- write_eflags(read_eflags() | FL_IF);
+ sti();
}
void