From 792576b1c5a4da16700f1003b1c3fc1e22cd9e07 Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 18 Mar 2011 16:54:30 +0000 Subject: MN10300: Introduce a general config option for kernel debugger hooks Introduce a general config option for kernel debugger hooks so that both gdbstub and kgdb can use it and add a header file for both debuggers to use. Signed-off-by: David Howells --- arch/mn10300/include/asm/debugger.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 arch/mn10300/include/asm/debugger.h (limited to 'arch/mn10300/include/asm/debugger.h') diff --git a/arch/mn10300/include/asm/debugger.h b/arch/mn10300/include/asm/debugger.h new file mode 100644 index 000000000000..4816f0dc28b5 --- /dev/null +++ b/arch/mn10300/include/asm/debugger.h @@ -0,0 +1,20 @@ +/* Kernel debugger for MN10300 + * + * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ + +#ifndef _ASM_DEBUGGER_H +#define _ASM_DEBUGGER_H + +#if defined(CONFIG_KERNEL_DEBUGGER) + +#else /* CONFIG_KERNEL_DEBUGGER */ + +#endif /* CONFIG_KERNEL_DEBUGGER */ +#endif /* _ASM_DEBUGGER_H */ -- cgit v1.2.3 From 7f386ac3272e057fbf51e5b5712fad1a80e77125 Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 18 Mar 2011 16:54:30 +0000 Subject: MN10300: Create general kernel debugger cache flushing Create general kernel debugger cache flushing for MN10300 and get rid of the old stuff that gdbstub was using. Signed-off-by: David Howells --- arch/mn10300/include/asm/debugger.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'arch/mn10300/include/asm/debugger.h') diff --git a/arch/mn10300/include/asm/debugger.h b/arch/mn10300/include/asm/debugger.h index 4816f0dc28b5..4517f839a999 100644 --- a/arch/mn10300/include/asm/debugger.h +++ b/arch/mn10300/include/asm/debugger.h @@ -14,6 +14,14 @@ #if defined(CONFIG_KERNEL_DEBUGGER) +#ifndef CONFIG_MN10300_DEBUGGER_CACHE_NO_FLUSH +extern void debugger_local_cache_flushinv(void); +extern void debugger_local_cache_flushinv_one(u8 *); +#else +static inline void debugger_local_cache_flushinv(void) {} +static inline void debugger_local_cache_flushinv_one(u8 *addr) {} +#endif + #else /* CONFIG_KERNEL_DEBUGGER */ #endif /* CONFIG_KERNEL_DEBUGGER */ -- cgit v1.2.3 From 67ddb4052daac9d449caf2643ac365d42a04219a Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 18 Mar 2011 16:54:30 +0000 Subject: 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: David Howells --- arch/mn10300/include/asm/debugger.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/mn10300/include/asm/debugger.h') diff --git a/arch/mn10300/include/asm/debugger.h b/arch/mn10300/include/asm/debugger.h index 4517f839a999..e1d3b083696c 100644 --- a/arch/mn10300/include/asm/debugger.h +++ b/arch/mn10300/include/asm/debugger.h @@ -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 */ -- cgit v1.2.3