]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kdp/kdp_internal.h
xnu-792.6.22.tar.gz
[apple/xnu.git] / osfmk / kdp / kdp_internal.h
1 /*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 /*
24 * Internal definitions for kdp module
25 */
26
27 #include <kdp/kdp.h>
28 #include <kdp/kdp_protocol.h>
29
30 typedef struct {
31 unsigned short reply_port;
32 unsigned int conn_seq;
33 boolean_t is_conn;
34 void *saved_state;
35 boolean_t is_halted;
36 unsigned short exception_port;
37 unsigned char exception_seq;
38 boolean_t exception_ack_needed;
39 } kdp_glob_t;
40
41 extern kdp_glob_t kdp;
42
43 extern int kdp_flag;
44 #define KDP_READY 0x1
45 #define KDP_ARP 0x2
46 #define KDP_BP_DIS 0x4
47 #define KDP_GETC_ENA 0x8
48 #define KDP_PANIC_DUMP_ENABLED 0x10
49 #define PANIC_CORE_ON_NMI 0x20
50 #define DBG_POST_CORE 0x40
51 #define PANIC_LOG_DUMP 0x80
52 typedef boolean_t
53 (*kdp_dispatch_t) (
54 kdp_pkt_t *,
55 int *,
56 unsigned short *
57 );
58
59 extern
60 boolean_t
61 kdp_packet(
62 unsigned char *,
63 int *,
64 unsigned short *
65 );
66
67 extern
68 boolean_t
69 kdp_remove_all_breakpoints (void);
70
71 extern
72 void
73 kdp_exception(
74 unsigned char *,
75 int *,
76 unsigned short *,
77 unsigned int,
78 unsigned int,
79 unsigned int
80 );
81
82 extern
83 boolean_t
84 kdp_exception_ack(
85 unsigned char *,
86 int
87 );
88
89 extern
90 void
91 kdp_panic(
92 const char *msg
93 );
94
95 extern
96 void
97 kdp_reboot(
98 void
99 );
100
101 extern
102 void
103 kdp_us_spin(
104 int usec
105 );
106
107 extern
108 int
109 kdp_intr_disbl(
110 void
111 );
112
113 extern
114 void
115 kdp_intr_enbl(
116 int s
117 );
118
119 extern
120 kdp_error_t
121 kdp_machine_read_regs(
122 unsigned int cpu,
123 unsigned int flavor,
124 char *data,
125 int *size
126 );
127
128 extern
129 kdp_error_t
130 kdp_machine_write_regs(
131 unsigned int cpu,
132 unsigned int flavor,
133 char *data,
134 int *size
135 );
136
137 extern
138 void
139 kdp_machine_hostinfo(
140 kdp_hostinfo_t *hostinfo
141 );
142
143 extern
144 void
145 kdp_sync_cache(
146 void
147 );
148
149 unsigned int
150 kdp_ml_get_breakinsn(
151 void
152 );