Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67ddb405 authored by David Howells's avatar David Howells
Browse files

MN10300: Create generic kernel debugger hooks



Create generic kernel debugger hooks in the MN10300 arch and make gdbstub use
them.  This is a preparation for KGDB support.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 7f386ac3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -401,8 +401,8 @@ comment "[!] NOTE: A lower number/level indicates a higher priority (0 is highes
comment "____Non-maskable interrupt levels____"
comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial"

config GDBSTUB_IRQ_LEVEL
	int "GDBSTUB interrupt priority"
config DEBUGGER_IRQ_LEVEL
	int "DEBUGGER interrupt priority"
	depends on KERNEL_DEBUGGER
	range 0 1 if LINUX_CLI_LEVEL = 2
	range 0 2 if LINUX_CLI_LEVEL = 3
@@ -437,7 +437,7 @@ config LINUX_CLI_LEVEL
	  EPSW.IM from 7.  Any interrupt is permitted for which the level is
	  lower than EPSW.IM.

	  Certain interrupts, such as GDBSTUB and virtual MN10300 on-chip
	  Certain interrupts, such as DEBUGGER and virtual MN10300 on-chip
	  serial DMA interrupts are allowed to interrupt normal disabled
	  sections.

+15 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@

#if defined(CONFIG_KERNEL_DEBUGGER)

extern int debugger_intercept(enum exception_code, int, int, struct pt_regs *);
extern int at_debugger_breakpoint(struct pt_regs *);

#ifndef CONFIG_MN10300_DEBUGGER_CACHE_NO_FLUSH
extern void debugger_local_cache_flushinv(void);
extern void debugger_local_cache_flushinv_one(u8 *);
@@ -24,5 +27,17 @@ static inline void debugger_local_cache_flushinv_one(u8 *addr) {}

#else /* CONFIG_KERNEL_DEBUGGER */

static inline int debugger_intercept(enum exception_code excep,
				     int signo, int si_code,
				     struct pt_regs *regs)
{
	return 0;
}

static inline int at_debugger_breakpoint(struct pt_regs *regs)
{
	return 0;
}

#endif /* CONFIG_KERNEL_DEBUGGER */
#endif /* _ASM_DEBUGGER_H */
+0 −2
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ static inline void clear_using_fpu(struct task_struct *tsk)

extern asmlinkage void fpu_kill_state(struct task_struct *);
extern asmlinkage void fpu_exception(struct pt_regs *, enum exception_code);
extern asmlinkage void fpu_invalid_op(struct pt_regs *, enum exception_code);
extern asmlinkage void fpu_init_state(void);
extern asmlinkage void fpu_save(struct fpu_state_struct *);
extern int fpu_setup_sigcontext(struct fpucontext *buf);
@@ -113,7 +112,6 @@ static inline void flush_fpu(void)

extern asmlinkage
void unexpected_fpu_exception(struct pt_regs *, enum exception_code);
#define fpu_invalid_op unexpected_fpu_exception
#define fpu_exception unexpected_fpu_exception

struct task_struct;
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
/*
 * interrupt control
 * - "disabled": run in IM1/2
 *   - level 0 - GDB stub
 *   - level 0 - kernel debugger
 *   - level 1 - virtual serial DMA (if present)
 *   - level 5 - normal interrupt priority
 *   - level 6 - timer interrupt
+2 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
#define LOCAL_TIMER_IPI		193
#define FLUSH_CACHE_IPI		194
#define CALL_FUNCTION_NMI_IPI	195
#define GDB_NMI_IPI		196
#define DEBUGGER_NMI_IPI	196

#define SMP_BOOT_IRQ		195

@@ -43,6 +43,7 @@
#define LOCAL_TIMER_GxICR_LV	GxICR_LEVEL_4
#define FLUSH_CACHE_GxICR_LV	GxICR_LEVEL_0
#define SMP_BOOT_GxICR_LV	GxICR_LEVEL_0
#define DEBUGGER_GxICR_LV	CONFIG_DEBUGGER_IRQ_LEVEL

#define TIME_OUT_COUNT_BOOT_IPI	100
#define DELAY_TIME_BOOT_IPI	75000
Loading