Commit 5c6cce95 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Fix compile with CONFIG_DEBUG_KERNEL disabled, from David Altobelli

parent d8cc89ec
...@@ -494,8 +494,10 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -494,8 +494,10 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
while (atomic_read(&data.started) != cpus) { while (atomic_read(&data.started) != cpus) {
HMT_low(); HMT_low();
if (--timeout == 0) { if (--timeout == 0) {
#ifdef CONFIG_DEBUG_KERNEL
if (debugger) if (debugger)
debugger(0); debugger(0);
#endif
printk("smp_call_function on cpu %d: other cpus not " printk("smp_call_function on cpu %d: other cpus not "
"responding (%d)\n", smp_processor_id(), "responding (%d)\n", smp_processor_id(),
atomic_read(&data.started)); atomic_read(&data.started));
...@@ -508,8 +510,10 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -508,8 +510,10 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
while (atomic_read(&data.finished) != cpus) { while (atomic_read(&data.finished) != cpus) {
HMT_low(); HMT_low();
if (--timeout == 0) { if (--timeout == 0) {
#ifdef CONFIG_DEBUG_KERNEL
if (debugger) if (debugger)
debugger(0); debugger(0);
#endif
printk("smp_call_function on cpu %d: other " printk("smp_call_function on cpu %d: other "
"cpus not finishing (%d/%d)\n", "cpus not finishing (%d/%d)\n",
smp_processor_id(), smp_processor_id(),
......
...@@ -81,8 +81,10 @@ static void ...@@ -81,8 +81,10 @@ static void
_exception(int signr, siginfo_t *info, struct pt_regs *regs) _exception(int signr, siginfo_t *info, struct pt_regs *regs)
{ {
if (!user_mode(regs)) { if (!user_mode(regs)) {
#ifdef CONFIG_DEBUG_KERNEL
if (debugger) if (debugger)
debugger(regs); debugger(regs);
#endif
die("Exception in kernel mode\n", regs, signr); die("Exception in kernel mode\n", regs, signr);
} }
...@@ -133,8 +135,10 @@ SystemResetException(struct pt_regs *regs) ...@@ -133,8 +135,10 @@ SystemResetException(struct pt_regs *regs)
FWNMI_release_errinfo(); FWNMI_release_errinfo();
} }
#ifdef CONFIG_DEBUG_KERNEL
if (debugger) if (debugger)
debugger(regs); debugger(regs);
#endif
#ifdef PANIC_ON_ERROR #ifdef PANIC_ON_ERROR
panic("System Reset"); panic("System Reset");
...@@ -174,13 +178,14 @@ MachineCheckException(struct pt_regs *regs) ...@@ -174,13 +178,14 @@ MachineCheckException(struct pt_regs *regs)
return; return;
} }
#ifdef CONFIG_DEBUG_KERNEL
if (debugger_fault_handler) { if (debugger_fault_handler) {
debugger_fault_handler(regs); debugger_fault_handler(regs);
return; return;
} }
if (debugger) if (debugger)
debugger(regs); debugger(regs);
#endif
console_verbose(); console_verbose();
spin_lock_irq(&die_lock); spin_lock_irq(&die_lock);
bust_spinlocks(1); bust_spinlocks(1);
...@@ -223,9 +228,10 @@ InstructionBreakpointException(struct pt_regs *regs) ...@@ -223,9 +228,10 @@ InstructionBreakpointException(struct pt_regs *regs)
{ {
siginfo_t info; siginfo_t info;
#ifdef CONFIG_DEBUG_KERNEL
if (debugger_iabr_match && debugger_iabr_match(regs)) if (debugger_iabr_match && debugger_iabr_match(regs))
return; return;
#endif
info.si_signo = SIGTRAP; info.si_signo = SIGTRAP;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TRAP_BRKPT; info.si_code = TRAP_BRKPT;
...@@ -292,9 +298,10 @@ ProgramCheckException(struct pt_regs *regs) ...@@ -292,9 +298,10 @@ ProgramCheckException(struct pt_regs *regs)
} else if (regs->msr & 0x20000) { } else if (regs->msr & 0x20000) {
/* trap exception */ /* trap exception */
#ifdef CONFIG_DEBUG_KERNEL
if (debugger_bpt && debugger_bpt(regs)) if (debugger_bpt && debugger_bpt(regs))
return; return;
#endif
info.si_signo = SIGTRAP; info.si_signo = SIGTRAP;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TRAP_BRKPT; info.si_code = TRAP_BRKPT;
...@@ -318,9 +325,10 @@ SingleStepException(struct pt_regs *regs) ...@@ -318,9 +325,10 @@ SingleStepException(struct pt_regs *regs)
regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */
#ifdef CONFIG_DEBUG_KERNEL
if (debugger_sstep && debugger_sstep(regs)) if (debugger_sstep && debugger_sstep(regs))
return; return;
#endif
info.si_signo = SIGTRAP; info.si_signo = SIGTRAP;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TRAP_TRACE; info.si_code = TRAP_TRACE;
......
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