diff options
author | rsc <rsc> | 2006-07-16 15:38:13 +0000 |
---|---|---|
committer | rsc <rsc> | 2006-07-16 15:38:13 +0000 |
commit | 679a977cb2d4df42ce1f144593716aeb855d7a92 (patch) | |
tree | 62c881253f6567a9298a7b98f571b268aae34c86 /spinlock.c | |
parent | f3d290220f072a7053b9a368bf7c42e8e2945c7e (diff) | |
download | xv6-labs-679a977cb2d4df42ce1f144593716aeb855d7a92.tar.gz xv6-labs-679a977cb2d4df42ce1f144593716aeb855d7a92.tar.bz2 xv6-labs-679a977cb2d4df42ce1f144593716aeb855d7a92.zip |
remove acquire1 and release1
Diffstat (limited to 'spinlock.c')
-rw-r--r-- | spinlock.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -10,7 +10,7 @@ // because cprintf uses them itself. #define cprintf dont_use_cprintf -extern int use_console_lock; +extern int bootstrap; int getcallerpc(void *v) @@ -19,7 +19,7 @@ getcallerpc(void *v) } void -acquire1(struct spinlock * lock, struct proc *cp) +acquire(struct spinlock * lock) { if(cpus[cpu()].nlock++ == 0) cli(); @@ -30,23 +30,11 @@ acquire1(struct spinlock * lock, struct proc *cp) } void -release1(struct spinlock * lock, struct proc *cp) +release(struct spinlock * lock) { cpuid(0, 0, 0, 0, 0); // memory barrier lock->locked = 0; - if(--cpus[cpu()].nlock == 0) + if(--cpus[cpu()].nlock == 0 && !bootstrap) sti(); } -void -acquire(struct spinlock *lock) -{ - acquire1(lock, curproc[cpu()]); -} - -void -release(struct spinlock *lock) -{ - release1(lock, curproc[cpu()]); -} - |