diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 557a86c..5a44a46 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c @@ -87,13 +87,12 @@ holding(struct spinlock *lk) void push_off(void) { - struct cpu *c = mycpu(); int old = intr_get(); intr_off(); - if(c->noff == 0) - c->intena = old; - c->noff += 1; + if(mycpu()->noff == 0) + mycpu()->intena = old; + mycpu()->noff += 1; } void