From 3807c1f20b5f7dca7ec7ca4bbe38bc5904e980ff Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 27 Sep 2007 20:09:40 +0000 Subject: rename splhi/spllo to pushcli/popcli --- spinlock.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'spinlock.c') diff --git a/spinlock.c b/spinlock.c index 61ae093..bf02292 100644 --- a/spinlock.c +++ b/spinlock.c @@ -25,7 +25,7 @@ initlock(struct spinlock *lock, char *name) void acquire(struct spinlock *lock) { - splhi(); + pushcli(); if(holding(lock)) panic("acquire"); @@ -59,7 +59,7 @@ release(struct spinlock *lock) cpuid(0, 0, 0, 0, 0); // memory barrier (see Ch 7, IA-32 manual vol 3) lock->locked = 0; - spllo(); + popcli(); } // Record the current call stack in pcs[] by following the %ebp chain. @@ -93,20 +93,20 @@ holding(struct spinlock *lock) // Better names? Better functions? void -splhi(void) +pushcli(void) { cli(); - cpus[cpu()].nsplhi++; + cpus[cpu()].ncli++; } void -spllo(void) +popcli(void) { if(read_eflags()&FL_IF) - panic("spllo - interruptible"); - if(--cpus[cpu()].nsplhi < 0) - panic("spllo"); - if(cpus[cpu()].nsplhi == 0) + panic("popcli - interruptible"); + if(--cpus[cpu()].ncli < 0) + panic("popcli"); + if(cpus[cpu()].ncli == 0) sti(); } -- cgit v1.2.3