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 Original line 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 "____Non-maskable interrupt levels____"
comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial"
comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial"


config GDBSTUB_IRQ_LEVEL
config DEBUGGER_IRQ_LEVEL
	int "GDBSTUB interrupt priority"
	int "DEBUGGER interrupt priority"
	depends on KERNEL_DEBUGGER
	depends on KERNEL_DEBUGGER
	range 0 1 if LINUX_CLI_LEVEL = 2
	range 0 1 if LINUX_CLI_LEVEL = 2
	range 0 2 if LINUX_CLI_LEVEL = 3
	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
	  EPSW.IM from 7.  Any interrupt is permitted for which the level is
	  lower than EPSW.IM.
	  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
	  serial DMA interrupts are allowed to interrupt normal disabled
	  sections.
	  sections.


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


#if defined(CONFIG_KERNEL_DEBUGGER)
#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
#ifndef CONFIG_MN10300_DEBUGGER_CACHE_NO_FLUSH
extern void debugger_local_cache_flushinv(void);
extern void debugger_local_cache_flushinv(void);
extern void debugger_local_cache_flushinv_one(u8 *);
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 */
#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 /* CONFIG_KERNEL_DEBUGGER */
#endif /* _ASM_DEBUGGER_H */
#endif /* _ASM_DEBUGGER_H */
+0 −2
Original line number Original line 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_kill_state(struct task_struct *);
extern asmlinkage void fpu_exception(struct pt_regs *, enum exception_code);
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_init_state(void);
extern asmlinkage void fpu_save(struct fpu_state_struct *);
extern asmlinkage void fpu_save(struct fpu_state_struct *);
extern int fpu_setup_sigcontext(struct fpucontext *buf);
extern int fpu_setup_sigcontext(struct fpucontext *buf);
@@ -113,7 +112,6 @@ static inline void flush_fpu(void)


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


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


#define SMP_BOOT_IRQ		195
#define SMP_BOOT_IRQ		195


@@ -43,6 +43,7 @@
#define LOCAL_TIMER_GxICR_LV	GxICR_LEVEL_4
#define LOCAL_TIMER_GxICR_LV	GxICR_LEVEL_4
#define FLUSH_CACHE_GxICR_LV	GxICR_LEVEL_0
#define FLUSH_CACHE_GxICR_LV	GxICR_LEVEL_0
#define SMP_BOOT_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 TIME_OUT_COUNT_BOOT_IPI	100
#define DELAY_TIME_BOOT_IPI	75000
#define DELAY_TIME_BOOT_IPI	75000
Loading