diff options
Diffstat (limited to 'arch/mips/kernel/kgdb.c')
-rw-r--r-- | arch/mips/kernel/kgdb.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c index 50c9bb880667..9b78ff6e9b84 100644 --- a/arch/mips/kernel/kgdb.c +++ b/arch/mips/kernel/kgdb.c | |||
@@ -180,6 +180,11 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) | |||
180 | *(ptr++) = regs->cp0_epc; | 180 | *(ptr++) = regs->cp0_epc; |
181 | } | 181 | } |
182 | 182 | ||
183 | void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc) | ||
184 | { | ||
185 | regs->cp0_epc = pc; | ||
186 | } | ||
187 | |||
183 | /* | 188 | /* |
184 | * Calls linux_debug_hook before the kernel dies. If KGDB is enabled, | 189 | * Calls linux_debug_hook before the kernel dies. If KGDB is enabled, |
185 | * then try to fall into the debugger | 190 | * then try to fall into the debugger |
@@ -198,7 +203,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, | |||
198 | if (atomic_read(&kgdb_active) != -1) | 203 | if (atomic_read(&kgdb_active) != -1) |
199 | kgdb_nmicallback(smp_processor_id(), regs); | 204 | kgdb_nmicallback(smp_processor_id(), regs); |
200 | 205 | ||
201 | if (kgdb_handle_exception(trap, compute_signal(trap), 0, regs)) | 206 | if (kgdb_handle_exception(trap, compute_signal(trap), cmd, regs)) |
202 | return NOTIFY_DONE; | 207 | return NOTIFY_DONE; |
203 | 208 | ||
204 | if (atomic_read(&kgdb_setting_breakpoint)) | 209 | if (atomic_read(&kgdb_setting_breakpoint)) |
@@ -212,6 +217,26 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, | |||
212 | return NOTIFY_STOP; | 217 | return NOTIFY_STOP; |
213 | } | 218 | } |
214 | 219 | ||
220 | #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP | ||
221 | int kgdb_ll_trap(int cmd, const char *str, | ||
222 | struct pt_regs *regs, long err, int trap, int sig) | ||
223 | { | ||
224 | struct die_args args = { | ||
225 | .regs = regs, | ||
226 | .str = str, | ||
227 | .err = err, | ||
228 | .trapnr = trap, | ||
229 | .signr = sig, | ||
230 | |||
231 | }; | ||
232 | |||
233 | if (!kgdb_io_module_registered) | ||
234 | return NOTIFY_DONE; | ||
235 | |||
236 | return kgdb_mips_notify(NULL, cmd, &args); | ||
237 | } | ||
238 | #endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */ | ||
239 | |||
215 | static struct notifier_block kgdb_notifier = { | 240 | static struct notifier_block kgdb_notifier = { |
216 | .notifier_call = kgdb_mips_notify, | 241 | .notifier_call = kgdb_mips_notify, |
217 | }; | 242 | }; |