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