summaryrefslogtreecommitdiff
path: root/spinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'spinlock.c')
-rw-r--r--spinlock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/spinlock.c b/spinlock.c
index 68cfbe9..e668598 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -23,7 +23,7 @@ initlock(struct spinlock *lk, char *name)
void
acquire(struct spinlock *lk)
{
- pushcli();
+ pushcli(); // disable interrupts to avoid deadlock.
if(holding(lk))
panic("acquire");
@@ -71,7 +71,7 @@ getcallerpcs(void *v, uint pcs[])
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
- if(ebp == 0 || ebp < (uint *) 0x100000 || ebp == (uint*)0xffffffff)
+ if(ebp == 0 || ebp < (uint*)0x100000 || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp