summaryrefslogtreecommitdiff
path: root/spinlock.c
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-06 19:08:14 +0000
committerrsc <rsc>2006-09-06 19:08:14 +0000
commit0cfc7290e8307b66ade6d5eb736c89cc4062c302 (patch)
tree592ad149f605717dfa0162d75da0af050a9c53e4 /spinlock.c
parentdb8fb62e4d599f4e08a3b6420e42b2445e8d7fe3 (diff)
downloadxv6-labs-0cfc7290e8307b66ade6d5eb736c89cc4062c302.tar.gz
xv6-labs-0cfc7290e8307b66ade6d5eb736c89cc4062c302.tar.bz2
xv6-labs-0cfc7290e8307b66ade6d5eb736c89cc4062c302.zip
wrap long lines
Diffstat (limited to 'spinlock.c')
-rw-r--r--spinlock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/spinlock.c b/spinlock.c
index e728460..1e68ae4 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -21,10 +21,13 @@ getcallerpcs(void *v, uint pcs[])
{
uint *ebp = (uint*)v - 2;
int i;
- for(i = 0; i < 10 && ebp && ebp != (uint*)0xffffffff; ebp = (uint*)*ebp, i++){
- pcs[i] = *(ebp + 1);
+ for(i = 0; i < 10; i++){
+ if(ebp == 0 || ebp == (uint*)0xffffffff)
+ break;
+ pcs[i] = ebp[1]; // saved %eip
+ ebp = (uint*)ebp[0]; // saved %ebp
}
- for( ; i < 10; i++)
+ for(; i < 10; i++)
pcs[i] = 0;
}