ia64/xen-unstable

view xen/include/xen/gdbstub.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents 9bf8b152df9f
children
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 /* ... writes in target native byte order as required by gdb spec. */
57 void gdb_send_packet(struct gdb_context *ctx);
58 void gdb_send_reply(const char *buf, struct gdb_context *ctx);
60 /* gdb stub trap handler: entry point */
61 int __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie);
63 /* arch specific routines */
64 u16 gdb_arch_signal_num(
65 struct cpu_user_regs *regs, unsigned long cookie);
66 void gdb_arch_read_reg_array(
67 struct cpu_user_regs *regs, struct gdb_context *ctx);
68 void gdb_arch_write_reg_array(
69 struct cpu_user_regs *regs, const char* buf, struct gdb_context *ctx);
70 void gdb_arch_read_reg(
71 unsigned long regnum, struct cpu_user_regs *regs, struct gdb_context *ctx);
72 void gdb_arch_write_reg(
73 unsigned long regnum, unsigned long val, struct cpu_user_regs *regs,
74 struct gdb_context *ctx);
75 unsigned int gdb_arch_copy_from_user(
76 void *dest, const void *src, unsigned len);
77 unsigned int gdb_arch_copy_to_user(
78 void *dest, const void *src, unsigned len);
79 void gdb_arch_resume(
80 struct cpu_user_regs *regs, unsigned long addr,
81 unsigned long type, struct gdb_context *ctx);
82 void gdb_arch_print_state(struct cpu_user_regs *regs);
83 void gdb_arch_enter(struct cpu_user_regs *regs);
84 void gdb_arch_exit(struct cpu_user_regs *regs);
86 #define GDB_CONTINUE 0
87 #define GDB_STEP 1
89 #define SIGILL 4
90 #define SIGTRAP 5
91 #define SIGBUS 7
92 #define SIGFPE 8
93 #define SIGSEGV 11
94 #define SIGALRM 14
95 #define SIGTERM 15
97 void initialise_gdb(void);
99 #else
101 #define initialise_gdb() ((void)0)
103 #endif
105 #endif /* __XEN_GDBSTUB_H__ */
107 /*
108 * Local variables:
109 * mode: C
110 * c-set-style: "BSD"
111 * c-basic-offset: 4
112 * tab-width: 4
113 * End:
114 */