From b548df152b5a53ea8cfcb2d94fbdee07884d8050 Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 11 Jul 2006 17:39:45 +0000 Subject: pre-empt both user and kernel, in clock interrupt usertest.c tests pre-emption kill() --- spinlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spinlock.c') 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 -- cgit v1.2.3