Skip to content
Snippets Groups Projects
Commit 2715cd35 authored by rsc's avatar rsc
Browse files

and spinlock

parent dca5b5ca
No related branches found
No related tags found
No related merge requests found
...@@ -22,8 +22,10 @@ initlock(struct spinlock *lock, char *name) ...@@ -22,8 +22,10 @@ initlock(struct spinlock *lock, char *name)
void void
getcallerpcs(void *v, uint pcs[]) getcallerpcs(void *v, uint pcs[])
{ {
uint *ebp = (uint*)v - 2; uint *ebp;
int i; int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){ for(i = 0; i < 10; i++){
if(ebp == 0 || ebp == (uint*)0xffffffff) if(ebp == 0 || ebp == (uint*)0xffffffff)
break; break;
...@@ -88,3 +90,4 @@ holding(struct spinlock *lock) ...@@ -88,3 +90,4 @@ holding(struct spinlock *lock)
{ {
return lock->locked && lock->cpu == cpu() + 10; return lock->locked && lock->cpu == cpu() + 10;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment