diff options
Diffstat (limited to 'spinlock.c')
-rw-r--r-- | spinlock.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |