1/*
2 * Copyright (c) 2000 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 * Private functions for kdp.c
31 */
32extern char kdp_kernelversion_string[];
33
34static boolean_t
35kdp_unknown(
36    kdp_pkt_t *,
37    int *,
38    unsigned short *
39);
40
41static boolean_t
42kdp_connect(
43    kdp_pkt_t *,
44    int *,
45    unsigned short *
46);
47
48static boolean_t
49kdp_disconnect(
50    kdp_pkt_t *,
51    int *,
52    unsigned short *
53);
54
55static boolean_t
56kdp_reattach(
57    kdp_pkt_t *,
58    int *,
59    unsigned short *
60);
61
62static boolean_t
63kdp_hostinfo(
64    kdp_pkt_t *,
65    int *,
66    unsigned short *
67);
68
69static boolean_t
70kdp_suspend(
71    kdp_pkt_t *,
72    int *,
73    unsigned short *
74);
75
76static boolean_t
77kdp_readregs(
78    kdp_pkt_t *,
79    int *,
80    unsigned short *
81);
82
83static boolean_t
84kdp_writeregs(
85    kdp_pkt_t *,
86    int *,
87    unsigned short *
88);
89
90static boolean_t
91kdp_version(
92    kdp_pkt_t *,
93    int *,
94    unsigned short *
95);
96
97static boolean_t
98kdp_kernelversion(
99				  kdp_pkt_t		*,
100				  int			*,
101				  unsigned short	*
102);
103
104static boolean_t
105kdp_regions(
106    kdp_pkt_t *,
107    int *,
108    unsigned short *
109);
110
111static boolean_t
112kdp_maxbytes(
113    kdp_pkt_t *,
114    int *,
115    unsigned short *
116);
117
118static boolean_t
119kdp_readmem(
120    kdp_pkt_t *,
121    int *,
122    unsigned short *
123);
124
125static boolean_t
126kdp_readmem64(
127			kdp_pkt_t *,
128			int *,
129			unsigned short *
130);
131
132static boolean_t
133kdp_readphysmem64(
134			kdp_pkt_t *,
135			int *,
136			unsigned short *
137);
138
139static boolean_t
140kdp_writemem(
141    kdp_pkt_t *,
142    int *,
143    unsigned short *
144);
145
146static boolean_t
147kdp_writemem64(
148			 kdp_pkt_t *,
149			 int *,
150			 unsigned short *
151);
152
153static boolean_t
154kdp_writephysmem64(
155			 kdp_pkt_t *,
156			 int *,
157			 unsigned short *
158);
159
160static boolean_t
161kdp_resumecpus(
162    kdp_pkt_t *,
163    int *,
164    unsigned short *
165);
166
167static boolean_t
168kdp_breakpoint_set(
169    kdp_pkt_t *,
170    int	*,
171    unsigned short *t
172);
173
174static boolean_t
175kdp_breakpoint64_set(
176				   kdp_pkt_t *,
177				   int	*,
178				   unsigned short *t
179);
180
181
182static boolean_t
183kdp_breakpoint_remove(
184    kdp_pkt_t *,
185    int	*,
186    unsigned short *
187);
188
189static boolean_t
190kdp_breakpoint64_remove(
191					  kdp_pkt_t *,
192					  int	*,
193					  unsigned short *
194);
195
196
197static boolean_t
198kdp_reboot(
199					  kdp_pkt_t *,
200					  int	*,
201					  unsigned short *
202);
203
204static boolean_t
205kdp_readioport(kdp_pkt_t *, int *, unsigned short *);
206
207static boolean_t
208kdp_writeioport(kdp_pkt_t *, int *, unsigned short *);
209
210static boolean_t
211kdp_readmsr64(kdp_pkt_t *, int *, unsigned short *);
212
213static boolean_t
214kdp_writemsr64(kdp_pkt_t *, int *, unsigned short *);
215
216static boolean_t
217kdp_dumpinfo(kdp_pkt_t *, int *, unsigned short *);
218