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