and spinlock
This commit is contained in:
parent
dca5b5ca2e
commit
2715cd3592
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
return lock->locked && lock->cpu == cpu() + 10;
|
return lock->locked && lock->cpu == cpu() + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue