diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2008-03-20 14:43:45 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 14:05:42 -0400 |
commit | e3e2aaf7dc0d82a055e084cfd48b9257c0c66b68 (patch) | |
tree | 331f93476f8cabf598a90f6e4eedbd1acda7d388 /include/linux/kgdb.h | |
parent | 4a1b5502d426df09b9ba1cbcc74fd09702a74cd8 (diff) |
kgdb: add documentation
Add in the kgdb documentation for kgdb.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/kgdb.h')
-rw-r--r-- | include/linux/kgdb.h | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index b0985b79b638..9757b1a6d9dc 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -22,31 +22,34 @@ | |||
22 | 22 | ||
23 | struct pt_regs; | 23 | struct pt_regs; |
24 | 24 | ||
25 | /* | 25 | /** |
26 | * kgdb_skipexception - Bail out of KGDB when we've been triggered. | 26 | * kgdb_skipexception - (optional) exit kgdb_handle_exception early |
27 | * @exception: Exception vector number | 27 | * @exception: Exception vector number |
28 | * @regs: Current &struct pt_regs. | 28 | * @regs: Current &struct pt_regs. |
29 | * | 29 | * |
30 | * On some architectures we need to skip a breakpoint exception when | 30 | * On some architectures it is required to skip a breakpoint |
31 | * it occurs after a breakpoint has been removed. | 31 | * exception when it occurs after a breakpoint has been removed. |
32 | * This can be implemented in the architecture specific portion of | ||
33 | * for kgdb. | ||
32 | */ | 34 | */ |
33 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 35 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
34 | 36 | ||
35 | /* | 37 | /** |
36 | * kgdb_post_primary_code - Save error vector/code numbers. | 38 | * kgdb_post_primary_code - (optional) Save error vector/code numbers. |
37 | * @regs: Original pt_regs. | 39 | * @regs: Original pt_regs. |
38 | * @e_vector: Original error vector. | 40 | * @e_vector: Original error vector. |
39 | * @err_code: Original error code. | 41 | * @err_code: Original error code. |
40 | * | 42 | * |
41 | * This is needed on architectures which support SMP and KGDB. | 43 | * This is usually needed on architectures which support SMP and |
42 | * This function is called after all the secondary cpus have been put | 44 | * KGDB. This function is called after all the secondary cpus have |
43 | * to a know spin state and the primary CPU has control over KGDB. | 45 | * been put to a know spin state and the primary CPU has control over |
46 | * KGDB. | ||
44 | */ | 47 | */ |
45 | extern void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, | 48 | extern void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, |
46 | int err_code); | 49 | int err_code); |
47 | 50 | ||
48 | /* | 51 | /** |
49 | * kgdb_disable_hw_debug - Disable hardware debugging while we in kgdb. | 52 | * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook |
50 | * @regs: Current &struct pt_regs. | 53 | * @regs: Current &struct pt_regs. |
51 | * | 54 | * |
52 | * This function will be called if the particular architecture must | 55 | * This function will be called if the particular architecture must |
@@ -59,7 +62,14 @@ struct tasklet_struct; | |||
59 | struct task_struct; | 62 | struct task_struct; |
60 | struct uart_port; | 63 | struct uart_port; |
61 | 64 | ||
62 | /* To enter the debugger explicitly. */ | 65 | /** |
66 | * kgdb_breakpoint - compiled in breakpoint | ||
67 | * | ||
68 | * This will be impelmented a static inline per architecture. This | ||
69 | * function is called by the kgdb core to execute an architecture | ||
70 | * specific trap to cause kgdb to enter the exception processing. | ||
71 | * | ||
72 | */ | ||
63 | void kgdb_breakpoint(void); | 73 | void kgdb_breakpoint(void); |
64 | 74 | ||
65 | extern int kgdb_connected; | 75 | extern int kgdb_connected; |
@@ -102,7 +112,7 @@ struct kgdb_bkpt { | |||
102 | * Functions each KGDB-supporting architecture must provide: | 112 | * Functions each KGDB-supporting architecture must provide: |
103 | */ | 113 | */ |
104 | 114 | ||
105 | /* | 115 | /** |
106 | * kgdb_arch_init - Perform any architecture specific initalization. | 116 | * kgdb_arch_init - Perform any architecture specific initalization. |
107 | * | 117 | * |
108 | * This function will handle the initalization of any architecture | 118 | * This function will handle the initalization of any architecture |
@@ -110,7 +120,7 @@ struct kgdb_bkpt { | |||
110 | */ | 120 | */ |
111 | extern int kgdb_arch_init(void); | 121 | extern int kgdb_arch_init(void); |
112 | 122 | ||
113 | /* | 123 | /** |
114 | * kgdb_arch_exit - Perform any architecture specific uninitalization. | 124 | * kgdb_arch_exit - Perform any architecture specific uninitalization. |
115 | * | 125 | * |
116 | * This function will handle the uninitalization of any architecture | 126 | * This function will handle the uninitalization of any architecture |
@@ -118,7 +128,7 @@ extern int kgdb_arch_init(void); | |||
118 | */ | 128 | */ |
119 | extern void kgdb_arch_exit(void); | 129 | extern void kgdb_arch_exit(void); |
120 | 130 | ||
121 | /* | 131 | /** |
122 | * pt_regs_to_gdb_regs - Convert ptrace regs to GDB regs | 132 | * pt_regs_to_gdb_regs - Convert ptrace regs to GDB regs |
123 | * @gdb_regs: A pointer to hold the registers in the order GDB wants. | 133 | * @gdb_regs: A pointer to hold the registers in the order GDB wants. |
124 | * @regs: The &struct pt_regs of the current process. | 134 | * @regs: The &struct pt_regs of the current process. |
@@ -128,7 +138,7 @@ extern void kgdb_arch_exit(void); | |||
128 | */ | 138 | */ |
129 | extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs); | 139 | extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs); |
130 | 140 | ||
131 | /* | 141 | /** |
132 | * sleeping_thread_to_gdb_regs - Convert ptrace regs to GDB regs | 142 | * sleeping_thread_to_gdb_regs - Convert ptrace regs to GDB regs |
133 | * @gdb_regs: A pointer to hold the registers in the order GDB wants. | 143 | * @gdb_regs: A pointer to hold the registers in the order GDB wants. |
134 | * @p: The &struct task_struct of the desired process. | 144 | * @p: The &struct task_struct of the desired process. |
@@ -143,7 +153,7 @@ extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs); | |||
143 | extern void | 153 | extern void |
144 | sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p); | 154 | sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p); |
145 | 155 | ||
146 | /* | 156 | /** |
147 | * gdb_regs_to_pt_regs - Convert GDB regs to ptrace regs. | 157 | * gdb_regs_to_pt_regs - Convert GDB regs to ptrace regs. |
148 | * @gdb_regs: A pointer to hold the registers we've received from GDB. | 158 | * @gdb_regs: A pointer to hold the registers we've received from GDB. |
149 | * @regs: A pointer to a &struct pt_regs to hold these values in. | 159 | * @regs: A pointer to a &struct pt_regs to hold these values in. |
@@ -153,7 +163,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p); | |||
153 | */ | 163 | */ |
154 | extern void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs); | 164 | extern void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs); |
155 | 165 | ||
156 | /* | 166 | /** |
157 | * kgdb_arch_handle_exception - Handle architecture specific GDB packets. | 167 | * kgdb_arch_handle_exception - Handle architecture specific GDB packets. |
158 | * @vector: The error vector of the exception that happened. | 168 | * @vector: The error vector of the exception that happened. |
159 | * @signo: The signal number of the exception that happened. | 169 | * @signo: The signal number of the exception that happened. |
@@ -175,7 +185,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code, | |||
175 | char *remcom_out_buffer, | 185 | char *remcom_out_buffer, |
176 | struct pt_regs *regs); | 186 | struct pt_regs *regs); |
177 | 187 | ||
178 | /* | 188 | /** |
179 | * kgdb_roundup_cpus - Get other CPUs into a holding pattern | 189 | * kgdb_roundup_cpus - Get other CPUs into a holding pattern |
180 | * @flags: Current IRQ state | 190 | * @flags: Current IRQ state |
181 | * | 191 | * |
@@ -198,7 +208,7 @@ extern int kgdb_validate_break_address(unsigned long addr); | |||
198 | extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr); | 208 | extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr); |
199 | extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle); | 209 | extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle); |
200 | 210 | ||
201 | /* | 211 | /** |
202 | * struct kgdb_arch - Describe architecture specific values. | 212 | * struct kgdb_arch - Describe architecture specific values. |
203 | * @gdb_bpt_instr: The instruction to trigger a breakpoint. | 213 | * @gdb_bpt_instr: The instruction to trigger a breakpoint. |
204 | * @flags: Flags for the breakpoint, currently just %KGDB_HW_BREAKPOINT. | 214 | * @flags: Flags for the breakpoint, currently just %KGDB_HW_BREAKPOINT. |
@@ -227,7 +237,7 @@ struct kgdb_arch { | |||
227 | void (*correct_hw_break)(void); | 237 | void (*correct_hw_break)(void); |
228 | }; | 238 | }; |
229 | 239 | ||
230 | /* | 240 | /** |
231 | * struct kgdb_io - Describe the interface for an I/O driver to talk with KGDB. | 241 | * struct kgdb_io - Describe the interface for an I/O driver to talk with KGDB. |
232 | * @name: Name of the I/O driver. | 242 | * @name: Name of the I/O driver. |
233 | * @read_char: Pointer to a function that will return one char. | 243 | * @read_char: Pointer to a function that will return one char. |