diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:07:50 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:07:50 -0400 |
| commit | 3dab04e6978e358ad2307bca563fabd6c5d2c58b (patch) | |
| tree | 893e9bc5041e7f722722fe13a3b145396f2554d8 | |
| parent | 6d1e9a42e7176bbce9348274784b2e5f69223936 (diff) | |
| parent | 5a4b65ab506398ba5a35c37e06edddd387cc0add (diff) | |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-mn10300
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-mn10300:
MN10300: gcc 4.6 vs am33 inline assembly
MN10300: Deprecate gdbstub
MN10300: Allow KGDB to use the MN10300 serial ports
MN10300: Emulate single stepping in KGDB on MN10300
MN10300: Generalise kernel debugger kernel halt, reboot or power off hook
KGDB: Notify GDB of machine halt, reboot or power off
MN10300: Use KGDB
MN10300: Create generic kernel debugger hooks
MN10300: Create general kernel debugger cache flushing
MN10300: Introduce a general config option for kernel debugger hooks
MN10300: The icache invalidate functions should disable the icache first
MN10300: gdbstub: Restrict single-stepping to non-preemptable non-SMP configs
39 files changed, 1924 insertions, 502 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 10971be43061..d8ab97a73db2 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
| @@ -3,6 +3,8 @@ config MN10300 | |||
| 3 | select HAVE_OPROFILE | 3 | select HAVE_OPROFILE |
| 4 | select HAVE_GENERIC_HARDIRQS | 4 | select HAVE_GENERIC_HARDIRQS |
| 5 | select GENERIC_HARDIRQS_NO_DEPRECATED | 5 | select GENERIC_HARDIRQS_NO_DEPRECATED |
| 6 | select HAVE_ARCH_TRACEHOOK | ||
| 7 | select HAVE_ARCH_KGDB | ||
| 6 | 8 | ||
| 7 | config AM33_2 | 9 | config AM33_2 |
| 8 | def_bool n | 10 | def_bool n |
| @@ -401,9 +403,9 @@ comment "[!] NOTE: A lower number/level indicates a higher priority (0 is highes | |||
| 401 | comment "____Non-maskable interrupt levels____" | 403 | comment "____Non-maskable interrupt levels____" |
| 402 | comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial" | 404 | comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial" |
| 403 | 405 | ||
| 404 | config GDBSTUB_IRQ_LEVEL | 406 | config DEBUGGER_IRQ_LEVEL |
| 405 | int "GDBSTUB interrupt priority" | 407 | int "DEBUGGER interrupt priority" |
| 406 | depends on GDBSTUB | 408 | depends on KERNEL_DEBUGGER |
| 407 | range 0 1 if LINUX_CLI_LEVEL = 2 | 409 | range 0 1 if LINUX_CLI_LEVEL = 2 |
| 408 | range 0 2 if LINUX_CLI_LEVEL = 3 | 410 | range 0 2 if LINUX_CLI_LEVEL = 3 |
| 409 | range 0 3 if LINUX_CLI_LEVEL = 4 | 411 | range 0 3 if LINUX_CLI_LEVEL = 4 |
| @@ -437,7 +439,7 @@ config LINUX_CLI_LEVEL | |||
| 437 | EPSW.IM from 7. Any interrupt is permitted for which the level is | 439 | EPSW.IM from 7. Any interrupt is permitted for which the level is |
| 438 | lower than EPSW.IM. | 440 | lower than EPSW.IM. |
| 439 | 441 | ||
| 440 | Certain interrupts, such as GDBSTUB and virtual MN10300 on-chip | 442 | Certain interrupts, such as DEBUGGER and virtual MN10300 on-chip |
| 441 | serial DMA interrupts are allowed to interrupt normal disabled | 443 | serial DMA interrupts are allowed to interrupt normal disabled |
| 442 | sections. | 444 | sections. |
| 443 | 445 | ||
diff --git a/arch/mn10300/Kconfig.debug b/arch/mn10300/Kconfig.debug index ce83c74b3fd7..bdbfd444a9ff 100644 --- a/arch/mn10300/Kconfig.debug +++ b/arch/mn10300/Kconfig.debug | |||
| @@ -36,7 +36,7 @@ config KPROBES | |||
| 36 | 36 | ||
| 37 | config GDBSTUB | 37 | config GDBSTUB |
| 38 | bool "Remote GDB kernel debugging" | 38 | bool "Remote GDB kernel debugging" |
| 39 | depends on DEBUG_KERNEL | 39 | depends on DEBUG_KERNEL && DEPRECATED |
| 40 | select DEBUG_INFO | 40 | select DEBUG_INFO |
| 41 | select FRAME_POINTER | 41 | select FRAME_POINTER |
| 42 | help | 42 | help |
| @@ -46,6 +46,9 @@ config GDBSTUB | |||
| 46 | RAM to avoid excessive linking time. This is only useful for kernel | 46 | RAM to avoid excessive linking time. This is only useful for kernel |
| 47 | hackers. If unsure, say N. | 47 | hackers. If unsure, say N. |
| 48 | 48 | ||
| 49 | This is deprecated in favour of KGDB and will be removed in a later | ||
| 50 | version. | ||
| 51 | |||
| 49 | config GDBSTUB_IMMEDIATE | 52 | config GDBSTUB_IMMEDIATE |
| 50 | bool "Break into GDB stub immediately" | 53 | bool "Break into GDB stub immediately" |
| 51 | depends on GDBSTUB | 54 | depends on GDBSTUB |
| @@ -54,6 +57,14 @@ config GDBSTUB_IMMEDIATE | |||
| 54 | possible, leaving the program counter at the beginning of | 57 | possible, leaving the program counter at the beginning of |
| 55 | start_kernel() in init/main.c. | 58 | start_kernel() in init/main.c. |
| 56 | 59 | ||
| 60 | config GDBSTUB_ALLOW_SINGLE_STEP | ||
| 61 | bool "Allow software single-stepping in GDB stub" | ||
| 62 | depends on GDBSTUB && !SMP && !PREEMPT | ||
| 63 | help | ||
| 64 | Allow GDB stub to perform software single-stepping through the | ||
| 65 | kernel. This doesn't work very well on SMP or preemptible kernels as | ||
| 66 | it uses temporary breakpoints to emulate single-stepping. | ||
| 67 | |||
| 57 | config GDB_CONSOLE | 68 | config GDB_CONSOLE |
| 58 | bool "Console output to GDB" | 69 | bool "Console output to GDB" |
| 59 | depends on GDBSTUB | 70 | depends on GDBSTUB |
| @@ -142,3 +153,7 @@ config GDBSTUB_ON_TTYSx | |||
| 142 | default y | 153 | default y |
| 143 | 154 | ||
| 144 | endmenu | 155 | endmenu |
| 156 | |||
| 157 | config KERNEL_DEBUGGER | ||
| 158 | def_bool y | ||
| 159 | depends on GDBSTUB || KGDB | ||
diff --git a/arch/mn10300/include/asm/debugger.h b/arch/mn10300/include/asm/debugger.h new file mode 100644 index 000000000000..e1d3b083696c --- /dev/null +++ b/arch/mn10300/include/asm/debugger.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* Kernel debugger for MN10300 | ||
| 2 | * | ||
| 3 | * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public Licence | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the Licence, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _ASM_DEBUGGER_H | ||
| 13 | #define _ASM_DEBUGGER_H | ||
| 14 | |||
| 15 | #if defined(CONFIG_KERNEL_DEBUGGER) | ||
| 16 | |||
| 17 | extern int debugger_intercept(enum exception_code, int, int, struct pt_regs *); | ||
| 18 | extern int at_debugger_breakpoint(struct pt_regs *); | ||
| 19 | |||
| 20 | #ifndef CONFIG_MN10300_DEBUGGER_CACHE_NO_FLUSH | ||
| 21 | extern void debugger_local_cache_flushinv(void); | ||
| 22 | extern void debugger_local_cache_flushinv_one(u8 *); | ||
| 23 | #else | ||
| 24 | static inline void debugger_local_cache_flushinv(void) {} | ||
| 25 | static inline void debugger_local_cache_flushinv_one(u8 *addr) {} | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #else /* CONFIG_KERNEL_DEBUGGER */ | ||
| 29 | |||
| 30 | static inline int debugger_intercept(enum exception_code excep, | ||
| 31 | int signo, int si_code, | ||
| 32 | struct pt_regs *regs) | ||
| 33 | { | ||
| 34 | return 0; | ||
| 35 | } | ||
| 36 | |||
| 37 | static inline int a | ||
