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