diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-04-02 12:48:03 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-05-20 22:04:19 -0400 |
commit | 53197fc49549240f6c6a963b2713a4cd9517964b (patch) | |
tree | 5a89c338ef8acd188e4aa1503370a4e928c33edd /kernel/debug/debug_core.h | |
parent | c433820971ffa854feda6adc17f5f24201354f11 (diff) |
Separate the gdbstub from the debug core
Split the former kernel/kgdb.c into debug_core.c which contains the
kernel debugger exception logic and to the gdbstub.c which contains
the logic for allowing gdb to talk to the debug core.
This also created a private include file called debug_core.h which
contains all the definitions to glue the debug_core to any other
debugger connections.
CC: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel/debug/debug_core.h')
-rw-r--r-- | kernel/debug/debug_core.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/kernel/debug/debug_core.h b/kernel/debug/debug_core.h new file mode 100644 index 000000000000..db554f9be51d --- /dev/null +++ b/kernel/debug/debug_core.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Created by: Jason Wessel <jason.wessel@windriver.com> | ||
3 | * | ||
4 | * Copyright (c) 2009 Wind River Systems, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef _DEBUG_CORE_H_ | ||
12 | #define _DEBUG_CORE_H_ | ||
13 | /* | ||
14 | * These are the private implementation headers between the kernel | ||
15 | * debugger core and the debugger front end code. | ||
16 | */ | ||
17 | |||
18 | /* kernel debug core data structures */ | ||
19 | struct kgdb_state { | ||
20 | int ex_vector; | ||
21 | int signo; | ||
22 | int err_code; | ||
23 | int cpu; | ||
24 | int pass_exception; | ||
25 | unsigned long thr_query; | ||
26 | unsigned long threadid; | ||
27 | long kgdb_usethreadid; | ||
28 | struct pt_regs *linux_regs; | ||
29 | }; | ||
30 | |||
31 | /* Exception state values */ | ||
32 | #define DCPU_WANT_MASTER 0x1 /* Waiting to become a master kgdb cpu */ | ||
33 | #define DCPU_NEXT_MASTER 0x2 /* Transition from one master cpu to another */ | ||
34 | #define DCPU_IS_SLAVE 0x4 /* Slave cpu enter exception */ | ||
35 | #define DCPU_SSTEP 0x8 /* CPU is single stepping */ | ||
36 | |||
37 | struct debuggerinfo_struct { | ||
38 | void *debuggerinfo; | ||
39 | struct task_struct *task; | ||
40 | int exception_state; | ||
41 | }; | ||
42 | |||
43 | extern struct debuggerinfo_struct kgdb_info[]; | ||
44 | |||
45 | /* kernel debug core break point routines */ | ||
46 | extern int dbg_remove_all_break(void); | ||
47 | extern int dbg_set_sw_break(unsigned long addr); | ||
48 | extern int dbg_remove_sw_break(unsigned long addr); | ||
49 | extern int dbg_activate_sw_breakpoints(void); | ||
50 | |||
51 | /* gdbstub interface functions */ | ||
52 | extern int gdb_serial_stub(struct kgdb_state *ks); | ||
53 | extern void gdbstub_msg_write(const char *s, int len); | ||
54 | |||
55 | #endif /* _DEBUG_CORE_H_ */ | ||