summaryrefslogtreecommitdiff
path: root/spinlock.c
diff options
context:
space:
mode:
authorrsc <rsc>2009-05-31 00:28:45 +0000
committerrsc <rsc>2009-05-31 00:28:45 +0000
commit19333efb9eb634f17bea41d0cec8ee28c595cce8 (patch)
tree97350b8c0c4a4c0f61d76516f067b32298af37c7 /spinlock.c
parent0c7f483838c48db05e7ea44232a55135d7c262a0 (diff)
downloadxv6-labs-19333efb9eb634f17bea41d0cec8ee28c595cce8.tar.gz
xv6-labs-19333efb9eb634f17bea41d0cec8ee28c595cce8.tar.bz2
xv6-labs-19333efb9eb634f17bea41d0cec8ee28c595cce8.zip
Some proc cleanup, moving some of copyproc into allocproc.
Also, an experiment: use "thread-local" storage for c and cp instead of the #define macro for curproc[cpu()].
Diffstat (limited to 'spinlock.c')
-rw-r--r--spinlock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/spinlock.c b/spinlock.c
index 3784b24..d6e952d 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -102,8 +102,8 @@ pushcli(void)
eflags = readeflags();
cli();
- if(cpus[cpu()].ncli++ == 0)
- cpus[cpu()].intena = eflags & FL_IF;
+ if(c->ncli++ == 0)
+ c->intena = eflags & FL_IF;
}
void
@@ -111,9 +111,9 @@ popcli(void)
{
if(readeflags()&FL_IF)
panic("popcli - interruptible");
- if(--cpus[cpu()].ncli < 0)
+ if(--c->ncli < 0)
panic("popcli");
- if(cpus[cpu()].ncli == 0 && cpus[cpu()].intena)
+ if(c->ncli == 0 && c->intena)
sti();
}