[MIPS] kgdb: add arch support for the kernel's kgdb core

The new kgdb architecture specific handler registers and unregisters
dynamically for exceptions depending on when you configure a kgdb I/O
driver.

Aside from initializing the exceptions earlier in the boot process,
kgdb should have no impact on a device when it is compiled in so long
as an I/O module is not configured for use.

There have been quite a number of contributors during the existence of
this patch (see arch/mips/kernel/kgdb.c).  Most recently Jason
re-wrote the mips kgdb logic to use the die notification handlers.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Jason Wessel
2008-07-29 15:58:53 -05:00
committed by Ralf Baechle
parent 8d60a903d9
commit 8854700115
7 changed files with 376 additions and 1 deletions
+13 -1
View File
@@ -1 +1,13 @@
#include <asm-generic/kdebug.h>
#ifndef _ASM_MIPS_KDEBUG_H
#define _ASM_MIPS_KDEBUG_H
#include <linux/notifier.h>
enum die_val {
DIE_OOPS = 1,
DIE_FP,
DIE_TRAP,
DIE_RI,
};
#endif /* _ASM_MIPS_KDEBUG_H */
+44
View File
@@ -0,0 +1,44 @@
#ifndef __ASM_KGDB_H_
#define __ASM_KGDB_H_
#ifdef __KERNEL__
#include <asm/sgidefs.h>
#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
(_MIPS_ISA == _MIPS_ISA_MIPS32)
#define KGDB_GDB_REG_SIZE 32
#elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
(_MIPS_ISA == _MIPS_ISA_MIPS64)
#ifdef CONFIG_32BIT
#define KGDB_GDB_REG_SIZE 32
#else /* CONFIG_CPU_32BIT */
#define KGDB_GDB_REG_SIZE 64
#endif
#else
#error "Need to set KGDB_GDB_REG_SIZE for MIPS ISA"
#endif /* _MIPS_ISA */
#define BUFMAX 2048
#if (KGDB_GDB_REG_SIZE == 32)
#define NUMREGBYTES (90*sizeof(u32))
#define NUMCRITREGBYTES (12*sizeof(u32))
#else
#define NUMREGBYTES (90*sizeof(u64))
#define NUMCRITREGBYTES (12*sizeof(u64))
#endif
#define BREAK_INSTR_SIZE 4
#define CACHE_FLUSH_IS_SAFE 0
extern void arch_kgdb_breakpoint(void);
extern int kgdb_early_setup;
extern void *saved_vectors[32];
extern void handle_exception(struct pt_regs *regs);
extern void breakinst(void);
#endif /* __KERNEL__ */
#endif /* __ASM_KGDB_H_ */