Commit e71ff89c authored by Madhavan Srinivasan's avatar Madhavan Srinivasan Committed by Michael Ellerman

powerpc/xmon: Cleanup to use is_kernel_addr macro

Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 4eb43875
...@@ -1403,7 +1403,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, ...@@ -1403,7 +1403,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
struct pt_regs regs; struct pt_regs regs;
while (max_to_print--) { while (max_to_print--) {
if (sp < PAGE_OFFSET) { if (!is_kernel_addr(sp)) {
if (sp != 0) if (sp != 0)
printf("SP (%lx) is in userspace\n", sp); printf("SP (%lx) is in userspace\n", sp);
break; break;
...@@ -1431,12 +1431,12 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, ...@@ -1431,12 +1431,12 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
mread(newsp + LRSAVE_OFFSET, &nextip, mread(newsp + LRSAVE_OFFSET, &nextip,
sizeof(unsigned long)); sizeof(unsigned long));
if (lr == ip) { if (lr == ip) {
if (lr < PAGE_OFFSET if (!is_kernel_addr(lr)
|| (fnstart <= lr && lr < fnend)) || (fnstart <= lr && lr < fnend))
printip = 0; printip = 0;
} else if (lr == nextip) { } else if (lr == nextip) {
printip = 0; printip = 0;
} else if (lr >= PAGE_OFFSET } else if (is_kernel_addr(lr)
&& !(fnstart <= lr && lr < fnend)) { && !(fnstart <= lr && lr < fnend)) {
printf("[link register ] "); printf("[link register ] ");
xmon_print_symbol(lr, " ", "\n"); xmon_print_symbol(lr, " ", "\n");
...@@ -1496,7 +1496,7 @@ static void print_bug_trap(struct pt_regs *regs) ...@@ -1496,7 +1496,7 @@ static void print_bug_trap(struct pt_regs *regs)
if (regs->msr & MSR_PR) if (regs->msr & MSR_PR)
return; /* not in kernel */ return; /* not in kernel */
addr = regs->nip; /* address of trap instruction */ addr = regs->nip; /* address of trap instruction */
if (addr < PAGE_OFFSET) if (!is_kernel_addr(addr))
return; return;
bug = find_bug(regs->nip); bug = find_bug(regs->nip);
if (bug == NULL) if (bug == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment