diff options
author | rsc <rsc> | 2007-08-10 17:17:57 +0000 |
---|---|---|
committer | rsc <rsc> | 2007-08-10 17:17:57 +0000 |
commit | 2715cd35921ee748154ebdce04ed84a1e543338f (patch) | |
tree | 14e51f1a4956aa9fb48d766a378d17a4f276668c | |
parent | dca5b5ca2e3687f27ebf589fe3855966932840d8 (diff) | |
download | xv6-labs-2715cd35921ee748154ebdce04ed84a1e543338f.tar.gz xv6-labs-2715cd35921ee748154ebdce04ed84a1e543338f.tar.bz2 xv6-labs-2715cd35921ee748154ebdce04ed84a1e543338f.zip |
and spinlock
-rw-r--r-- | spinlock.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -22,8 +22,10 @@ initlock(struct spinlock *lock, char *name) void getcallerpcs(void *v, uint pcs[]) { - uint *ebp = (uint*)v - 2; + uint *ebp; int i; + + ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ if(ebp == 0 || ebp == (uint*)0xffffffff) break; @@ -88,3 +90,4 @@ holding(struct spinlock *lock) { return lock->locked && lock->cpu == cpu() + 10; } + |