and spinlock

This commit is contained in:
rsc 2007-08-10 17:17:57 +00:00
parent dca5b5ca2e
commit 2715cd3592

View file

@ -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;
}