diff options
author | Robert Morris <[email protected]> | 2019-07-01 14:15:18 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-07-01 14:15:18 -0400 |
commit | 9b99f007434ea3af0c4834a91f19952d5670e16b (patch) | |
tree | 01bc212725572e1df8376500a581ba64d8c0aef4 /kernel | |
parent | 0498bfd15937d64599b8c63948907a8b60e5d6ae (diff) | |
download | xv6-labs-9b99f007434ea3af0c4834a91f19952d5670e16b.tar.gz xv6-labs-9b99f007434ea3af0c4834a91f19952d5670e16b.tar.bz2 xv6-labs-9b99f007434ea3af0c4834a91f19952d5670e16b.zip |
oops, don't hold mycpu() result across intr_off()
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/spinlock.c | 7 |
1 files changed, 3 insertions, 4 deletions
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 |