diff options
author | rtm <rtm> | 2006-07-11 17:39:45 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-07-11 17:39:45 +0000 |
commit | b548df152b5a53ea8cfcb2d94fbdee07884d8050 (patch) | |
tree | b1eec270a0892fad7a256ae809ebedbbcfaeb720 /spinlock.c | |
parent | 5ce9751cab960e3b226eb0720e781e793a0be4ed (diff) | |
download | xv6-labs-b548df152b5a53ea8cfcb2d94fbdee07884d8050.tar.gz xv6-labs-b548df152b5a53ea8cfcb2d94fbdee07884d8050.tar.bz2 xv6-labs-b548df152b5a53ea8cfcb2d94fbdee07884d8050.zip |
pre-empt both user and kernel, in clock interrupt
usertest.c tests pre-emption
kill()
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 |