Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153740
b: refs/heads/master
c: c894ed6
h: refs/heads/master
v: v3
  • Loading branch information
Catalin Marinas authored and Russell King committed Jun 19, 2009
1 parent 1fb5655 commit 2653b59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7436127ce9042f95a10bb5423f726fd63a61934d
refs/heads/master: c894ed6956f126d60d888e8efc5fb3a595ba89ae
19 changes: 9 additions & 10 deletions trunk/arch/arm/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
ctrl->vrs[14] = *vsp++;
ctrl->vrs[SP] = (unsigned long)vsp;
} else if (insn == 0xb0) {
ctrl->vrs[PC] = ctrl->vrs[LR];
if (ctrl->vrs[PC] == 0)
ctrl->vrs[PC] = ctrl->vrs[LR];
/* no further processing */
ctrl->entries = 0;
} else if (insn == 0xb1) {
Expand Down Expand Up @@ -309,18 +310,20 @@ int unwind_frame(struct stackframe *frame)
}

while (ctrl.entries > 0) {
int urc;

if (ctrl.vrs[SP] < low || ctrl.vrs[SP] >= high)
return -URC_FAILURE;
urc = unwind_exec_insn(&ctrl);
int urc = unwind_exec_insn(&ctrl);
if (urc < 0)
return urc;
if (ctrl.vrs[SP] < low || ctrl.vrs[SP] >= high)
return -URC_FAILURE;
}

if (ctrl.vrs[PC] == 0)
ctrl.vrs[PC] = ctrl.vrs[LR];

/* check for infinite loop */
if (frame->pc == ctrl.vrs[PC])
return -URC_FAILURE;

frame->fp = ctrl.vrs[FP];
frame->sp = ctrl.vrs[SP];
frame->lr = ctrl.vrs[LR];
Expand All @@ -332,7 +335,6 @@ int unwind_frame(struct stackframe *frame)
void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
{
struct stackframe frame;
unsigned long high, low;
register unsigned long current_sp asm ("sp");

pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk);
Expand Down Expand Up @@ -362,9 +364,6 @@ void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
frame.pc = thread_saved_pc(tsk);
}

low = frame.sp & ~(THREAD_SIZE - 1);
high = low + THREAD_SIZE;

while (1) {
int urc;
unsigned long where = frame.pc;
Expand Down

0 comments on commit 2653b59

Please sign in to comment.