Linux Audio

Check our new training course

Loading...
 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 */
19struct 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	atomic_t		*send_ready;
30};
31
32/* Exception state values */
33#define DCPU_WANT_MASTER 0x1 /* Waiting to become a master kgdb cpu */
34#define DCPU_NEXT_MASTER 0x2 /* Transition from one master cpu to another */
35#define DCPU_IS_SLAVE    0x4 /* Slave cpu enter exception */
36#define DCPU_WANT_BT     0x8 /* Slave cpu should backtrace then clear flag */
37
38struct debuggerinfo_struct {
39	void			*debuggerinfo;
40	struct task_struct	*task;
41	int			exception_state;
42	int			ret_state;
43	int			irq_depth;
44	int			enter_kgdb;
45	bool			rounding_up;
46};
47
48extern struct debuggerinfo_struct kgdb_info[];
49
50/* kernel debug core break point routines */
51extern int dbg_remove_all_break(void);
52extern int dbg_set_sw_break(unsigned long addr);
53extern int dbg_remove_sw_break(unsigned long addr);
54extern int dbg_activate_sw_breakpoints(void);
55extern int dbg_deactivate_sw_breakpoints(void);
56
57/* polled character access to i/o module */
58extern int dbg_io_get_char(void);
59
60/* stub return value for switching between the gdbstub and kdb */
61#define DBG_PASS_EVENT -12345
62/* Switch from one cpu to another */
63#define DBG_SWITCH_CPU_EVENT -123456
64extern int dbg_switch_cpu;
65
66/* gdbstub interface functions */
67extern int gdb_serial_stub(struct kgdb_state *ks);
68extern void gdbstub_msg_write(const char *s, int len);
69
70/* gdbstub functions used for kdb <-> gdbstub transition */
71extern int gdbstub_state(struct kgdb_state *ks, char *cmd);
72extern int dbg_kdb_mode;
73
74#ifdef CONFIG_KGDB_KDB
75extern int kdb_stub(struct kgdb_state *ks);
76extern int kdb_parse(const char *cmdstr);
77extern int kdb_common_init_state(struct kgdb_state *ks);
78extern int kdb_common_deinit_state(void);
79extern void kdb_dump_stack_on_cpu(int cpu);
80#else /* ! CONFIG_KGDB_KDB */
81static inline int kdb_stub(struct kgdb_state *ks)
82{
83	return DBG_PASS_EVENT;
84}
85#endif /* CONFIG_KGDB_KDB */
86
87#endif /* _DEBUG_CORE_H_ */
 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 */
19struct 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
37struct debuggerinfo_struct {
38	void			*debuggerinfo;
39	struct task_struct	*task;
40	int			exception_state;
41	int			ret_state;
42	int			irq_depth;
43	int			enter_kgdb;
 
44};
45
46extern struct debuggerinfo_struct kgdb_info[];
47
48/* kernel debug core break point routines */
49extern int dbg_remove_all_break(void);
50extern int dbg_set_sw_break(unsigned long addr);
51extern int dbg_remove_sw_break(unsigned long addr);
52extern int dbg_activate_sw_breakpoints(void);
53extern int dbg_deactivate_sw_breakpoints(void);
54
55/* polled character access to i/o module */
56extern int dbg_io_get_char(void);
57
58/* stub return value for switching between the gdbstub and kdb */
59#define DBG_PASS_EVENT -12345
60/* Switch from one cpu to another */
61#define DBG_SWITCH_CPU_EVENT -123456
62extern int dbg_switch_cpu;
63
64/* gdbstub interface functions */
65extern int gdb_serial_stub(struct kgdb_state *ks);
66extern void gdbstub_msg_write(const char *s, int len);
67
68/* gdbstub functions used for kdb <-> gdbstub transition */
69extern int gdbstub_state(struct kgdb_state *ks, char *cmd);
70extern int dbg_kdb_mode;
71
72#ifdef CONFIG_KGDB_KDB
73extern int kdb_stub(struct kgdb_state *ks);
74extern int kdb_parse(const char *cmdstr);
 
 
 
75#else /* ! CONFIG_KGDB_KDB */
76static inline int kdb_stub(struct kgdb_state *ks)
77{
78	return DBG_PASS_EVENT;
79}
80#endif /* CONFIG_KGDB_KDB */
81
82#endif /* _DEBUG_CORE_H_ */