ia64/xen-unstable

view xen/include/xen/gdbstub.h @ 15264:20ccb03e738d

gdbstub: Bit-field boolean must be unsigned.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jun 04 14:25:03 2007 +0100 (2007-06-04)
parents 19b126974c1f
children 514d450ad729
line source
1 /*
2 * Copyright (C) 2005 Hollis Blanchard <hollisb@us.ibm.com>, IBM Corporation
3 * Copyright (C) 2006 Isaku Yamahata <yamahata at valinux co jp>
4 * VA Linux Systems Japan. K.K.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
21 #ifndef __XEN_GDBSTUB_H__
22 #define __XEN_GDBSTUB_H__
24 #include <asm/atomic.h>
25 #include <asm/page.h>
27 #ifdef CRASH_DEBUG
29 /* value <-> char (de)serialzers for arch specific gdb backends */
30 char hex2char(unsigned long x);
31 int char2hex(unsigned char c);
32 char str2hex(const char *str);
33 unsigned long str2ulong(const char *str, unsigned long bytes);
35 struct gdb_context {
36 int serhnd; /* handle on our serial line */
37 int console_steal_id; /* handle on stolen console */
38 bool_t currently_attached;
39 atomic_t running;
40 unsigned long connected;
41 u8 signum;
43 char in_buf[PAGE_SIZE];
44 unsigned long in_bytes;
46 char out_buf[PAGE_SIZE];
47 unsigned long out_offset;
48 u8 out_csum;
49 };
51 /* interface to arch specific routines */
52 void gdb_write_to_packet(
53 const char *buf, int count, struct gdb_context *ctx);
54 void gdb_write_to_packet_hex(
55 unsigned long x, int int_size, struct gdb_context *ctx);
56 void gdb_send_packet(struct gdb_context *ctx);
57 void gdb_send_reply(const char *buf, struct gdb_context *ctx);
59 /* gdb stub trap handler: entry point */
60 int __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie);
62 /* arch specific routines */
63 u16 gdb_arch_signal_num(
64 struct cpu_user_regs *regs, unsigned long cookie);
65 void gdb_arch_read_reg_array(
66 struct cpu_user_regs *regs, struct gdb_context *ctx);
67 void gdb_arch_write_reg_array(
68 struct cpu_user_regs *regs, const char* buf, struct gdb_context *ctx);
69 void gdb_arch_read_reg(
70 unsigned long regnum, struct cpu_user_regs *regs, struct gdb_context *ctx);
71 unsigned int gdb_arch_copy_from_user(
72 void *dest, const void *src, unsigned len);
73 unsigned int gdb_arch_copy_to_user(
74 void *dest, const void *src, unsigned len);
75 void gdb_arch_resume(
76 struct cpu_user_regs *regs, unsigned long addr,
77 unsigned long type, struct gdb_context *ctx);
78 void gdb_arch_print_state(struct cpu_user_regs *regs);
79 void gdb_arch_enter(struct cpu_user_regs *regs);
80 void gdb_arch_exit(struct cpu_user_regs *regs);
82 #define GDB_CONTINUE 0
83 #define GDB_STEP 1
85 #define SIGILL 4
86 #define SIGTRAP 5
87 #define SIGBUS 7
88 #define SIGFPE 8
89 #define SIGSEGV 11
90 #define SIGALRM 14
91 #define SIGTERM 15
93 void initialise_gdb(void);
95 #else
97 #define initialise_gdb() ((void)0)
99 #endif
101 #endif /* __XEN_GDBSTUB_H__ */
103 /*
104 * Local variables:
105 * mode: C
106 * c-set-style: "BSD"
107 * c-basic-offset: 4
108 * tab-width: 4
109 * End:
110 */