/* * Originally written by Glenn Engel, Lake Stevens Instrument Division * * Contributed by HP Systems * * Modified for Linux/MIPS (and MIPS in general) by Andreas Busse * Send complaints, suggestions etc. to <andy@waldorf-gmbh.de> * * Copyright (C) 1995 Andreas Busse * * Copyright (C) 2003 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net * * Copyright (C) 2004-2005 MontaVista Software Inc. * Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com * * Copyright (C) 2007-2008 Wind River Systems, Inc. * Author/Maintainer: Jason Wessel, jason.wessel@windriver.com * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied.
*/
for (ht = hard_trap_info; ht->tt && ht->signo; ht++) if (ht->tt == tt) return ht->signo;
return SIGHUP; /* default for things we don't know about */
}
/* * Similar to regs_to_gdb_regs() except that process is sleeping and so * we may not be able to get all the info.
*/ void sleeping_thread_to_gdb_regs(unsignedlong *gdb_regs, struct task_struct *p)
{ int reg; #if (KGDB_GDB_REG_SIZE == 32)
u32 *ptr = (u32 *)gdb_regs; #else
u64 *ptr = (u64 *)gdb_regs; #endif
/* * BadVAddr, Cause * Ideally these would come from the last exception frame up the stack * but that requires unwinding, otherwise we can't know much for sure.
*/
*(ptr++) = 0;
*(ptr++) = 0;
/* * PC * use return address (RA), i.e. the moment after return from resume()
*/
*(ptr++) = p->thread.reg31;
}
/* * Calls linux_debug_hook before the kernel dies. If KGDB is enabled, * then try to fall into the debugger
*/ staticint kgdb_mips_notify(struct notifier_block *self, unsignedlong cmd, void *ptr)
{ struct die_args *args = (struct die_args *)ptr; struct pt_regs *regs = args->regs; int trap = (regs->cp0_cause & 0x7c) >> 2;
#ifdef CONFIG_KPROBES /* * Return immediately if the kprobes fault notifier has set * DIE_PAGE_FAULT.
*/ if (cmd == DIE_PAGE_FAULT) return NOTIFY_DONE; #endif/* CONFIG_KPROBES */
/* Userspace events, ignore. */ if (user_mode(regs)) return NOTIFY_DONE;
if (atomic_read(&kgdb_active) != -1)
kgdb_nmicallback(smp_processor_id(), regs);
if (kgdb_handle_exception(trap, compute_signal(trap), cmd, regs)) return NOTIFY_DONE;
if (atomic_read(&kgdb_setting_breakpoint)) if ((trap == 9) && (regs->cp0_epc == (unsignedlong)breakinst))
regs->cp0_epc += 4;
/* In SMP mode, __flush_cache_all does IPI */
local_irq_enable();
__flush_cache_all();
return NOTIFY_STOP;
}
#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP int kgdb_ll_trap(int cmd, constchar *str, struct pt_regs *regs, long err, int trap, int sig)
{ struct die_args args = {
.regs = regs,
.str = str,
.err = err,
.trapnr = trap,
.signr = sig,
};
if (!kgdb_io_module_registered) return NOTIFY_DONE;
int kgdb_arch_init(void)
{
register_die_notifier(&kgdb_notifier);
return 0;
}
/* * kgdb_arch_exit - Perform any architecture specific uninitalization. * * This function will handle the uninitalization of any architecture * specific callbacks, for dynamic registration and unregistration.
*/ void kgdb_arch_exit(void)
{
unregister_die_notifier(&kgdb_notifier);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-04-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.