summaryrefslogtreecommitdiff
path: root/spinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'spinlock.c')
-rw-r--r--spinlock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/spinlock.c b/spinlock.c
index 4020186..9ee65f6 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -69,17 +69,17 @@ release(struct spinlock *lk)
// Record the current call stack in pcs[] by following the %ebp chain.
void
-getcallerpcs(void *v, uint pcs[])
+getcallerpcs(void *v, uint64 pcs[])
{
- uint *ebp;
+ uint64 *ebp;
int i;
- ebp = (uint*)v - 2;
+ asm volatile("mov %%rbp, %0" : "=r" (ebp));
for(i = 0; i < 10; i++){
- if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
+ if(ebp == 0 || ebp < (uint64*)KERNBASE || ebp == (uint64*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
- ebp = (uint*)ebp[0]; // saved %ebp
+ ebp = (uint64*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
pcs[i] = 0;