1*1b191cb5SApple OSS Distributions /* 2*1b191cb5SApple OSS Distributions * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3*1b191cb5SApple OSS Distributions * 4*1b191cb5SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5*1b191cb5SApple OSS Distributions * 6*1b191cb5SApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code 7*1b191cb5SApple OSS Distributions * as defined in and that are subject to the Apple Public Source License 8*1b191cb5SApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in 9*1b191cb5SApple OSS Distributions * compliance with the License. The rights granted to you under the License 10*1b191cb5SApple OSS Distributions * may not be used to create, or enable the creation or redistribution of, 11*1b191cb5SApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to 12*1b191cb5SApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any 13*1b191cb5SApple OSS Distributions * terms of an Apple operating system software license agreement. 14*1b191cb5SApple OSS Distributions * 15*1b191cb5SApple OSS Distributions * Please obtain a copy of the License at 16*1b191cb5SApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file. 17*1b191cb5SApple OSS Distributions * 18*1b191cb5SApple OSS Distributions * The Original Code and all software distributed under the License are 19*1b191cb5SApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20*1b191cb5SApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21*1b191cb5SApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22*1b191cb5SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23*1b191cb5SApple OSS Distributions * Please see the License for the specific language governing rights and 24*1b191cb5SApple OSS Distributions * limitations under the License. 25*1b191cb5SApple OSS Distributions * 26*1b191cb5SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27*1b191cb5SApple OSS Distributions */ 28*1b191cb5SApple OSS Distributions 29*1b191cb5SApple OSS Distributions #ifndef _KDP_PROTOCOL_H_ 30*1b191cb5SApple OSS Distributions #define _KDP_PROTOCOL_H_ 31*1b191cb5SApple OSS Distributions 32*1b191cb5SApple OSS Distributions /* 33*1b191cb5SApple OSS Distributions * Definition of remote debugger protocol. 34*1b191cb5SApple OSS Distributions */ 35*1b191cb5SApple OSS Distributions 36*1b191cb5SApple OSS Distributions 37*1b191cb5SApple OSS Distributions #ifdef MACH_KERNEL_PRIVATE 38*1b191cb5SApple OSS Distributions #include <mach/vm_prot.h> 39*1b191cb5SApple OSS Distributions #include <mach/boolean.h> 40*1b191cb5SApple OSS Distributions #include <stdint.h> 41*1b191cb5SApple OSS Distributions #endif 42*1b191cb5SApple OSS Distributions 43*1b191cb5SApple OSS Distributions #ifdef KDP_PROXY_PACK_SUPPORT 44*1b191cb5SApple OSS Distributions #pragma pack(1) 45*1b191cb5SApple OSS Distributions #define KDP_PACKED 46*1b191cb5SApple OSS Distributions #else 47*1b191cb5SApple OSS Distributions #define KDP_PACKED __attribute__((packed)) 48*1b191cb5SApple OSS Distributions #endif 49*1b191cb5SApple OSS Distributions 50*1b191cb5SApple OSS Distributions /* 51*1b191cb5SApple OSS Distributions * Retransmit parameters 52*1b191cb5SApple OSS Distributions */ 53*1b191cb5SApple OSS Distributions #if DDEBUG_DEBUG || DEBUG_DEBUG 54*1b191cb5SApple OSS Distributions #define KDP_REXMIT_SECS 20 /* rexmit if no ack in 3 secs */ 55*1b191cb5SApple OSS Distributions #else /* DDEBUG_DEBUG || DEBUG_DEBUG */ 56*1b191cb5SApple OSS Distributions #define KDP_REXMIT_SECS 3 /* rexmit if no ack in 3 secs */ 57*1b191cb5SApple OSS Distributions #endif /* DDEBUG_DEBUG || DEBUG_DEBUG */ 58*1b191cb5SApple OSS Distributions #define KDP_REXMIT_TRIES 8 /* xmit 8 times, then give up */ 59*1b191cb5SApple OSS Distributions 60*1b191cb5SApple OSS Distributions 61*1b191cb5SApple OSS Distributions /* 62*1b191cb5SApple OSS Distributions * (NMI) Attention Max Wait Time 63*1b191cb5SApple OSS Distributions * Remote will resume unless KDP requests is received within this 64*1b191cb5SApple OSS Distributions * many seconds after an attention (nmi) packet is sent. 65*1b191cb5SApple OSS Distributions */ 66*1b191cb5SApple OSS Distributions #define KDP_MAX_ATTN_WAIT 30 /* wait max of 30 seconds */ 67*1b191cb5SApple OSS Distributions 68*1b191cb5SApple OSS Distributions /* 69*1b191cb5SApple OSS Distributions * Well-known UDP port, debugger side. 70*1b191cb5SApple OSS Distributions * FIXME: This is what the 68K guys use, but beats me how they chose it... 71*1b191cb5SApple OSS Distributions */ 72*1b191cb5SApple OSS Distributions #define KDP_REMOTE_PORT 41139 /* pick one and register it */ 73*1b191cb5SApple OSS Distributions 74*1b191cb5SApple OSS Distributions /* 75*1b191cb5SApple OSS Distributions * UDP ports, KDB side. 5 port numbers are reserved for each port (request 76*1b191cb5SApple OSS Distributions * and exception). This allows multiple KDBs to run on one host. 77*1b191cb5SApple OSS Distributions */ 78*1b191cb5SApple OSS Distributions #define UDP_HOST_COMM_BASE 41140 79*1b191cb5SApple OSS Distributions #define UDP_HOST_EXCEP_BASE 41145 80*1b191cb5SApple OSS Distributions #define NUM_UDP_HOST_PORTS 5 81*1b191cb5SApple OSS Distributions 82*1b191cb5SApple OSS Distributions /* 83*1b191cb5SApple OSS Distributions * Requests 84*1b191cb5SApple OSS Distributions */ 85*1b191cb5SApple OSS Distributions typedef enum { 86*1b191cb5SApple OSS Distributions /* connection oriented requests */ 87*1b191cb5SApple OSS Distributions KDP_CONNECT, KDP_DISCONNECT, 88*1b191cb5SApple OSS Distributions 89*1b191cb5SApple OSS Distributions /* obtaining client info */ 90*1b191cb5SApple OSS Distributions KDP_HOSTINFO, KDP_VERSION, KDP_MAXBYTES, 91*1b191cb5SApple OSS Distributions 92*1b191cb5SApple OSS Distributions /* memory access */ 93*1b191cb5SApple OSS Distributions KDP_READMEM, KDP_WRITEMEM, 94*1b191cb5SApple OSS Distributions 95*1b191cb5SApple OSS Distributions /* register access */ 96*1b191cb5SApple OSS Distributions KDP_READREGS, KDP_WRITEREGS, 97*1b191cb5SApple OSS Distributions 98*1b191cb5SApple OSS Distributions /* executable image info */ 99*1b191cb5SApple OSS Distributions KDP_LOAD, KDP_IMAGEPATH, 100*1b191cb5SApple OSS Distributions 101*1b191cb5SApple OSS Distributions /* execution control */ 102*1b191cb5SApple OSS Distributions KDP_SUSPEND, KDP_RESUMECPUS, 103*1b191cb5SApple OSS Distributions 104*1b191cb5SApple OSS Distributions /* exception and termination notification, NOT true requests */ 105*1b191cb5SApple OSS Distributions KDP_EXCEPTION, KDP_TERMINATION, 106*1b191cb5SApple OSS Distributions 107*1b191cb5SApple OSS Distributions /* breakpoint control */ 108*1b191cb5SApple OSS Distributions KDP_BREAKPOINT_SET, KDP_BREAKPOINT_REMOVE, 109*1b191cb5SApple OSS Distributions 110*1b191cb5SApple OSS Distributions /* vm regions */ 111*1b191cb5SApple OSS Distributions KDP_REGIONS, 112*1b191cb5SApple OSS Distributions 113*1b191cb5SApple OSS Distributions /* reattach to a connected host */ 114*1b191cb5SApple OSS Distributions KDP_REATTACH, 115*1b191cb5SApple OSS Distributions 116*1b191cb5SApple OSS Distributions /* remote reboot request */ 117*1b191cb5SApple OSS Distributions KDP_HOSTREBOOT, 118*1b191cb5SApple OSS Distributions 119*1b191cb5SApple OSS Distributions /* memory access (64-bit wide addresses). Version 11 protocol */ 120*1b191cb5SApple OSS Distributions KDP_READMEM64, KDP_WRITEMEM64, 121*1b191cb5SApple OSS Distributions 122*1b191cb5SApple OSS Distributions /* breakpoint control (64-bit wide addresses). Version 11 protocol */ 123*1b191cb5SApple OSS Distributions KDP_BREAKPOINT64_SET, KDP_BREAKPOINT64_REMOVE, 124*1b191cb5SApple OSS Distributions 125*1b191cb5SApple OSS Distributions /* kernel version string, like "xnu-1234.5~6". Version 11 protocol */ 126*1b191cb5SApple OSS Distributions KDP_KERNELVERSION, 127*1b191cb5SApple OSS Distributions 128*1b191cb5SApple OSS Distributions /* physical memory access (64-bit wide addresses). Version 12 protocol */ 129*1b191cb5SApple OSS Distributions KDP_READPHYSMEM64, KDP_WRITEPHYSMEM64, 130*1b191cb5SApple OSS Distributions 131*1b191cb5SApple OSS Distributions /* ioport access (8-, 16-, and 32-bit) */ 132*1b191cb5SApple OSS Distributions KDP_READIOPORT, KDP_WRITEIOPORT, 133*1b191cb5SApple OSS Distributions 134*1b191cb5SApple OSS Distributions /* msr access (64-bit) */ 135*1b191cb5SApple OSS Distributions KDP_READMSR64, KDP_WRITEMSR64, 136*1b191cb5SApple OSS Distributions 137*1b191cb5SApple OSS Distributions /* get/dump panic/corefile info */ 138*1b191cb5SApple OSS Distributions KDP_DUMPINFO, 139*1b191cb5SApple OSS Distributions 140*1b191cb5SApple OSS Distributions /* keep this last */ 141*1b191cb5SApple OSS Distributions KDP_INVALID_REQUEST 142*1b191cb5SApple OSS Distributions } kdp_req_t; 143*1b191cb5SApple OSS Distributions 144*1b191cb5SApple OSS Distributions typedef enum { 145*1b191cb5SApple OSS Distributions KDP_DUMPINFO_GETINFO = 0x00000000, 146*1b191cb5SApple OSS Distributions KDP_DUMPINFO_SETINFO = 0x00000001, 147*1b191cb5SApple OSS Distributions KDP_DUMPINFO_CORE = 0x00000102, 148*1b191cb5SApple OSS Distributions KDP_DUMPINFO_PANICLOG = 0x00000103, 149*1b191cb5SApple OSS Distributions KDP_DUMPINFO_SYSTEMLOG = 0x00000104, 150*1b191cb5SApple OSS Distributions KDP_DUMPINFO_DISABLE = 0x00000105, 151*1b191cb5SApple OSS Distributions KDP_DUMPINFO_MASK = 0x00000FFF, 152*1b191cb5SApple OSS Distributions KDP_DUMPINFO_DUMP = 0x00000100, 153*1b191cb5SApple OSS Distributions 154*1b191cb5SApple OSS Distributions KDP_DUMPINFO_REBOOT = 0x10000000, 155*1b191cb5SApple OSS Distributions KDP_DUMPINFO_NORESUME = 0x20000000, 156*1b191cb5SApple OSS Distributions KDP_DUMPINFO_RESUME = 0x00000000, /* default behaviour */ 157*1b191cb5SApple OSS Distributions KDP_DUMPINFO_NOINTR = 0x40000000, /* don't interrupt */ 158*1b191cb5SApple OSS Distributions KDP_DUMPINFO_INTR = 0x00000000, /* default behaviour */ 159*1b191cb5SApple OSS Distributions } kdp_dumpinfo_t; 160*1b191cb5SApple OSS Distributions 161*1b191cb5SApple OSS Distributions /* 162*1b191cb5SApple OSS Distributions * Common KDP packet header 163*1b191cb5SApple OSS Distributions * NOTE: kgmacros has a non-symboled version of kdp_hdr_t so that some basic information. 164*1b191cb5SApple OSS Distributions * can be gathered from a kernel without any symbols. changes to this structure 165*1b191cb5SApple OSS Distributions * need to be reflected in kgmacros as well. 166*1b191cb5SApple OSS Distributions */ 167*1b191cb5SApple OSS Distributions typedef struct { 168*1b191cb5SApple OSS Distributions kdp_req_t request:7; /* kdp_req_t, request type */ 169*1b191cb5SApple OSS Distributions unsigned is_reply:1; /* 0 => request, 1 => reply */ 170*1b191cb5SApple OSS Distributions unsigned seq:8; /* sequence number within session */ 171*1b191cb5SApple OSS Distributions unsigned len:16; /* length of entire pkt including hdr */ 172*1b191cb5SApple OSS Distributions unsigned key; /* session key */ 173*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_hdr_t; 174*1b191cb5SApple OSS Distributions 175*1b191cb5SApple OSS Distributions /* 176*1b191cb5SApple OSS Distributions * KDP errors 177*1b191cb5SApple OSS Distributions */ 178*1b191cb5SApple OSS Distributions typedef enum { 179*1b191cb5SApple OSS Distributions KDPERR_NO_ERROR = 0, 180*1b191cb5SApple OSS Distributions KDPERR_ALREADY_CONNECTED, 181*1b191cb5SApple OSS Distributions KDPERR_BAD_NBYTES, 182*1b191cb5SApple OSS Distributions KDPERR_BADFLAVOR, /* bad flavor in w/r regs */ 183*1b191cb5SApple OSS Distributions KDPERR_BAD_ACCESS, /* memory reference failure */ 184*1b191cb5SApple OSS Distributions 185*1b191cb5SApple OSS Distributions KDPERR_MAX_BREAKPOINTS = 100, 186*1b191cb5SApple OSS Distributions KDPERR_BREAKPOINT_NOT_FOUND = 101, 187*1b191cb5SApple OSS Distributions KDPERR_BREAKPOINT_ALREADY_SET = 102 188*1b191cb5SApple OSS Distributions } kdp_error_t; 189*1b191cb5SApple OSS Distributions 190*1b191cb5SApple OSS Distributions #if defined(__x86_64__) 191*1b191cb5SApple OSS Distributions #define KDPERR_ACCESS(_req, _ret) \ 192*1b191cb5SApple OSS Distributions (((_req) == (uint32_t)(_ret)) ? KDPERR_NO_ERROR : KDPERR_BAD_ACCESS) 193*1b191cb5SApple OSS Distributions #else 194*1b191cb5SApple OSS Distributions #define KDPERR_ACCESS(req, cnt) (KDPERR_NO_ERROR) 195*1b191cb5SApple OSS Distributions #endif /* x86_64 */ 196*1b191cb5SApple OSS Distributions 197*1b191cb5SApple OSS Distributions 198*1b191cb5SApple OSS Distributions /* 199*1b191cb5SApple OSS Distributions * KDP requests and reply packet formats 200*1b191cb5SApple OSS Distributions */ 201*1b191cb5SApple OSS Distributions 202*1b191cb5SApple OSS Distributions /* 203*1b191cb5SApple OSS Distributions * KDP_CONNECT 204*1b191cb5SApple OSS Distributions */ 205*1b191cb5SApple OSS Distributions typedef struct { /* KDP_CONNECT request */ 206*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 207*1b191cb5SApple OSS Distributions uint16_t req_reply_port; /* udp port which to send replies */ 208*1b191cb5SApple OSS Distributions uint16_t exc_note_port; /* udp port which to send exc notes */ 209*1b191cb5SApple OSS Distributions char greeting[0]; /* "greetings", nul-terminated */ 210*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_connect_req_t; 211*1b191cb5SApple OSS Distributions 212*1b191cb5SApple OSS Distributions typedef struct { /* KDP_CONNECT reply */ 213*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 214*1b191cb5SApple OSS Distributions kdp_error_t error; 215*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_connect_reply_t; 216*1b191cb5SApple OSS Distributions 217*1b191cb5SApple OSS Distributions /* 218*1b191cb5SApple OSS Distributions * KDP_DISCONNECT 219*1b191cb5SApple OSS Distributions */ 220*1b191cb5SApple OSS Distributions typedef struct { /* KDP_DISCONNECT request */ 221*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 222*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_disconnect_req_t; 223*1b191cb5SApple OSS Distributions 224*1b191cb5SApple OSS Distributions typedef struct { /* KDP_DISCONNECT reply */ 225*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 226*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_disconnect_reply_t; 227*1b191cb5SApple OSS Distributions 228*1b191cb5SApple OSS Distributions /* 229*1b191cb5SApple OSS Distributions * KDP_REATTACH 230*1b191cb5SApple OSS Distributions */ 231*1b191cb5SApple OSS Distributions typedef struct { 232*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 233*1b191cb5SApple OSS Distributions uint16_t req_reply_port; /* udp port which to send replies */ 234*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_reattach_req_t; 235*1b191cb5SApple OSS Distributions 236*1b191cb5SApple OSS Distributions /* 237*1b191cb5SApple OSS Distributions * KDP_HOSTINFO 238*1b191cb5SApple OSS Distributions */ 239*1b191cb5SApple OSS Distributions typedef struct { /* KDP_HOSTINFO request */ 240*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 241*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_hostinfo_req_t; 242*1b191cb5SApple OSS Distributions 243*1b191cb5SApple OSS Distributions typedef struct { 244*1b191cb5SApple OSS Distributions uint32_t cpus_mask; /* bit is 1 if cpu present */ 245*1b191cb5SApple OSS Distributions uint32_t cpu_type; 246*1b191cb5SApple OSS Distributions uint32_t cpu_subtype; 247*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_hostinfo_t; 248*1b191cb5SApple OSS Distributions 249*1b191cb5SApple OSS Distributions typedef struct { /* KDP_HOSTINFO reply */ 250*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 251*1b191cb5SApple OSS Distributions kdp_hostinfo_t hostinfo; 252*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_hostinfo_reply_t; 253*1b191cb5SApple OSS Distributions 254*1b191cb5SApple OSS Distributions /* 255*1b191cb5SApple OSS Distributions * KDP_VERSION 256*1b191cb5SApple OSS Distributions */ 257*1b191cb5SApple OSS Distributions typedef struct { /* KDP_VERSION request */ 258*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 259*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_version_req_t; 260*1b191cb5SApple OSS Distributions 261*1b191cb5SApple OSS Distributions #define KDP_FEATURE_BP 0x1 /* local breakpoint support */ 262*1b191cb5SApple OSS Distributions 263*1b191cb5SApple OSS Distributions typedef struct { /* KDP_VERSION reply */ 264*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 265*1b191cb5SApple OSS Distributions uint32_t version; 266*1b191cb5SApple OSS Distributions uint32_t feature; 267*1b191cb5SApple OSS Distributions uint32_t pad0; 268*1b191cb5SApple OSS Distributions uint32_t pad1; 269*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_version_reply_t; 270*1b191cb5SApple OSS Distributions 271*1b191cb5SApple OSS Distributions #define VM_PROT_VOLATILE ((vm_prot_t) 0x08) /* not cacheable */ 272*1b191cb5SApple OSS Distributions #define VM_PROT_SPARSE ((vm_prot_t) 0x10) /* sparse addr space */ 273*1b191cb5SApple OSS Distributions 274*1b191cb5SApple OSS Distributions /* 275*1b191cb5SApple OSS Distributions * KDP_REGIONS 276*1b191cb5SApple OSS Distributions */ 277*1b191cb5SApple OSS Distributions typedef struct { /* KDP_REGIONS request */ 278*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 279*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_regions_req_t; 280*1b191cb5SApple OSS Distributions 281*1b191cb5SApple OSS Distributions typedef struct { 282*1b191cb5SApple OSS Distributions uint32_t address; 283*1b191cb5SApple OSS Distributions uint32_t nbytes; 284*1b191cb5SApple OSS Distributions uint32_t protection; /* vm_prot_t */ 285*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_region_t; 286*1b191cb5SApple OSS Distributions 287*1b191cb5SApple OSS Distributions typedef struct { /* KDP_REGIONS reply */ 288*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 289*1b191cb5SApple OSS Distributions uint32_t nregions; 290*1b191cb5SApple OSS Distributions kdp_region_t regions[0]; 291*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_regions_reply_t; 292*1b191cb5SApple OSS Distributions 293*1b191cb5SApple OSS Distributions /* 294*1b191cb5SApple OSS Distributions * KDP_MAXBYTES 295*1b191cb5SApple OSS Distributions */ 296*1b191cb5SApple OSS Distributions typedef struct { /* KDP_MAXBYTES request */ 297*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 298*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_maxbytes_req_t; 299*1b191cb5SApple OSS Distributions 300*1b191cb5SApple OSS Distributions typedef struct { /* KDP_MAXBYTES reply */ 301*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 302*1b191cb5SApple OSS Distributions uint32_t max_bytes; 303*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_maxbytes_reply_t; 304*1b191cb5SApple OSS Distributions 305*1b191cb5SApple OSS Distributions /* 306*1b191cb5SApple OSS Distributions * KDP_READMEM 307*1b191cb5SApple OSS Distributions */ 308*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READMEM request */ 309*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 310*1b191cb5SApple OSS Distributions uint32_t address; 311*1b191cb5SApple OSS Distributions uint32_t nbytes; 312*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readmem_req_t; 313*1b191cb5SApple OSS Distributions 314*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READMEM reply */ 315*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 316*1b191cb5SApple OSS Distributions kdp_error_t error; 317*1b191cb5SApple OSS Distributions char data[0]; 318*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readmem_reply_t; 319*1b191cb5SApple OSS Distributions 320*1b191cb5SApple OSS Distributions /* 321*1b191cb5SApple OSS Distributions * KDP_READMEM64 322*1b191cb5SApple OSS Distributions */ 323*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READMEM64 request */ 324*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 325*1b191cb5SApple OSS Distributions uint64_t address; 326*1b191cb5SApple OSS Distributions uint32_t nbytes; 327*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readmem64_req_t; 328*1b191cb5SApple OSS Distributions 329*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READMEM64 reply */ 330*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 331*1b191cb5SApple OSS Distributions kdp_error_t error; 332*1b191cb5SApple OSS Distributions char data[0]; 333*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readmem64_reply_t; 334*1b191cb5SApple OSS Distributions 335*1b191cb5SApple OSS Distributions /* 336*1b191cb5SApple OSS Distributions * KDP_READPHYSMEM64 337*1b191cb5SApple OSS Distributions */ 338*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READPHYSMEM64 request */ 339*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 340*1b191cb5SApple OSS Distributions uint64_t address; 341*1b191cb5SApple OSS Distributions uint32_t nbytes; 342*1b191cb5SApple OSS Distributions uint16_t lcpu; 343*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readphysmem64_req_t; 344*1b191cb5SApple OSS Distributions 345*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READPHYSMEM64 reply */ 346*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 347*1b191cb5SApple OSS Distributions kdp_error_t error; 348*1b191cb5SApple OSS Distributions char data[0]; 349*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readphysmem64_reply_t; 350*1b191cb5SApple OSS Distributions 351*1b191cb5SApple OSS Distributions /* 352*1b191cb5SApple OSS Distributions * KDP_WRITEMEM 353*1b191cb5SApple OSS Distributions */ 354*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEMEM request */ 355*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 356*1b191cb5SApple OSS Distributions uint32_t address; 357*1b191cb5SApple OSS Distributions uint32_t nbytes; 358*1b191cb5SApple OSS Distributions char data[0]; 359*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writemem_req_t; 360*1b191cb5SApple OSS Distributions 361*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEMEM reply */ 362*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 363*1b191cb5SApple OSS Distributions kdp_error_t error; 364*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writemem_reply_t; 365*1b191cb5SApple OSS Distributions 366*1b191cb5SApple OSS Distributions /* 367*1b191cb5SApple OSS Distributions * KDP_WRITEMEM64 368*1b191cb5SApple OSS Distributions */ 369*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEMEM64 request */ 370*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 371*1b191cb5SApple OSS Distributions uint64_t address; 372*1b191cb5SApple OSS Distributions uint32_t nbytes; 373*1b191cb5SApple OSS Distributions char data[0]; 374*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writemem64_req_t; 375*1b191cb5SApple OSS Distributions 376*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEMEM64 reply */ 377*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 378*1b191cb5SApple OSS Distributions kdp_error_t error; 379*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writemem64_reply_t; 380*1b191cb5SApple OSS Distributions 381*1b191cb5SApple OSS Distributions /* 382*1b191cb5SApple OSS Distributions * KDP_WRITEPHYSMEM64 383*1b191cb5SApple OSS Distributions */ 384*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEPHYSMEM64 request */ 385*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 386*1b191cb5SApple OSS Distributions uint64_t address; 387*1b191cb5SApple OSS Distributions uint32_t nbytes; 388*1b191cb5SApple OSS Distributions uint16_t lcpu; 389*1b191cb5SApple OSS Distributions char data[0]; 390*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writephysmem64_req_t; 391*1b191cb5SApple OSS Distributions 392*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEPHYSMEM64 reply */ 393*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 394*1b191cb5SApple OSS Distributions kdp_error_t error; 395*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writephysmem64_reply_t; 396*1b191cb5SApple OSS Distributions 397*1b191cb5SApple OSS Distributions /* 398*1b191cb5SApple OSS Distributions * KDP_WRITEIOPORT 399*1b191cb5SApple OSS Distributions */ 400*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEIOPORT request */ 401*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 402*1b191cb5SApple OSS Distributions uint16_t lcpu; 403*1b191cb5SApple OSS Distributions uint16_t address; 404*1b191cb5SApple OSS Distributions uint16_t nbytes; 405*1b191cb5SApple OSS Distributions char data[0]; 406*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writeioport_req_t; 407*1b191cb5SApple OSS Distributions 408*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEIOPORT reply */ 409*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 410*1b191cb5SApple OSS Distributions kdp_error_t error; 411*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writeioport_reply_t; 412*1b191cb5SApple OSS Distributions 413*1b191cb5SApple OSS Distributions /* 414*1b191cb5SApple OSS Distributions * KDP_READIOPORT 415*1b191cb5SApple OSS Distributions */ 416*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READIOPORT request */ 417*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 418*1b191cb5SApple OSS Distributions uint16_t lcpu; 419*1b191cb5SApple OSS Distributions uint16_t address; 420*1b191cb5SApple OSS Distributions uint16_t nbytes; 421*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readioport_req_t; 422*1b191cb5SApple OSS Distributions 423*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READIOPORT reply */ 424*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 425*1b191cb5SApple OSS Distributions kdp_error_t error; 426*1b191cb5SApple OSS Distributions char data[0]; 427*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readioport_reply_t; 428*1b191cb5SApple OSS Distributions 429*1b191cb5SApple OSS Distributions 430*1b191cb5SApple OSS Distributions /* 431*1b191cb5SApple OSS Distributions * KDP_WRITEMSR64 432*1b191cb5SApple OSS Distributions */ 433*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEMSR64 request */ 434*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 435*1b191cb5SApple OSS Distributions uint32_t address; 436*1b191cb5SApple OSS Distributions uint16_t lcpu; 437*1b191cb5SApple OSS Distributions char data[0]; 438*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writemsr64_req_t; 439*1b191cb5SApple OSS Distributions 440*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEMSR64 reply */ 441*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 442*1b191cb5SApple OSS Distributions kdp_error_t error; 443*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writemsr64_reply_t; 444*1b191cb5SApple OSS Distributions 445*1b191cb5SApple OSS Distributions /* 446*1b191cb5SApple OSS Distributions * KDP_READMSR64 447*1b191cb5SApple OSS Distributions */ 448*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READMSR64 request */ 449*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 450*1b191cb5SApple OSS Distributions uint32_t address; 451*1b191cb5SApple OSS Distributions uint16_t lcpu; 452*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readmsr64_req_t; 453*1b191cb5SApple OSS Distributions 454*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READMSR64 reply */ 455*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 456*1b191cb5SApple OSS Distributions kdp_error_t error; 457*1b191cb5SApple OSS Distributions char data[0]; 458*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readmsr64_reply_t; 459*1b191cb5SApple OSS Distributions 460*1b191cb5SApple OSS Distributions 461*1b191cb5SApple OSS Distributions /* 462*1b191cb5SApple OSS Distributions * KDP_READREGS 463*1b191cb5SApple OSS Distributions */ 464*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READREGS request */ 465*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 466*1b191cb5SApple OSS Distributions uint32_t cpu; 467*1b191cb5SApple OSS Distributions uint32_t flavor; 468*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readregs_req_t; 469*1b191cb5SApple OSS Distributions 470*1b191cb5SApple OSS Distributions typedef struct { /* KDP_READREGS reply */ 471*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 472*1b191cb5SApple OSS Distributions kdp_error_t error; /* could be KDPERR_BADFLAVOR */ 473*1b191cb5SApple OSS Distributions char data[0]; 474*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_readregs_reply_t; 475*1b191cb5SApple OSS Distributions 476*1b191cb5SApple OSS Distributions /* 477*1b191cb5SApple OSS Distributions * KDP_WRITEREGS 478*1b191cb5SApple OSS Distributions */ 479*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEREGS request */ 480*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 481*1b191cb5SApple OSS Distributions uint32_t cpu; 482*1b191cb5SApple OSS Distributions uint32_t flavor; 483*1b191cb5SApple OSS Distributions char data[0]; 484*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writeregs_req_t; 485*1b191cb5SApple OSS Distributions 486*1b191cb5SApple OSS Distributions typedef struct { /* KDP_WRITEREGS reply */ 487*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 488*1b191cb5SApple OSS Distributions kdp_error_t error; 489*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_writeregs_reply_t; 490*1b191cb5SApple OSS Distributions 491*1b191cb5SApple OSS Distributions /* 492*1b191cb5SApple OSS Distributions * KDP_LOAD 493*1b191cb5SApple OSS Distributions */ 494*1b191cb5SApple OSS Distributions typedef struct { /* KDP_LOAD request */ 495*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 496*1b191cb5SApple OSS Distributions char file_args[0]; 497*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_load_req_t; 498*1b191cb5SApple OSS Distributions 499*1b191cb5SApple OSS Distributions typedef struct { /* KDP_LOAD reply */ 500*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 501*1b191cb5SApple OSS Distributions kdp_error_t error; 502*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_load_reply_t; 503*1b191cb5SApple OSS Distributions 504*1b191cb5SApple OSS Distributions /* 505*1b191cb5SApple OSS Distributions * KDP_IMAGEPATH 506*1b191cb5SApple OSS Distributions */ 507*1b191cb5SApple OSS Distributions typedef struct { /* KDP_IMAGEPATH request */ 508*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 509*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_imagepath_req_t; 510*1b191cb5SApple OSS Distributions 511*1b191cb5SApple OSS Distributions typedef struct { /* KDP_IMAGEPATH reply */ 512*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 513*1b191cb5SApple OSS Distributions char path[0]; 514*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_imagepath_reply_t; 515*1b191cb5SApple OSS Distributions 516*1b191cb5SApple OSS Distributions /* 517*1b191cb5SApple OSS Distributions * KDP_SUSPEND 518*1b191cb5SApple OSS Distributions */ 519*1b191cb5SApple OSS Distributions typedef struct { /* KDP_SUSPEND request */ 520*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 521*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_suspend_req_t; 522*1b191cb5SApple OSS Distributions 523*1b191cb5SApple OSS Distributions typedef struct { /* KDP_SUSPEND reply */ 524*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 525*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_suspend_reply_t; 526*1b191cb5SApple OSS Distributions 527*1b191cb5SApple OSS Distributions /* 528*1b191cb5SApple OSS Distributions * KDP_RESUMECPUS 529*1b191cb5SApple OSS Distributions */ 530*1b191cb5SApple OSS Distributions typedef struct { /* KDP_RESUMECPUS request */ 531*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 532*1b191cb5SApple OSS Distributions uint32_t cpu_mask; 533*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_resumecpus_req_t; 534*1b191cb5SApple OSS Distributions 535*1b191cb5SApple OSS Distributions typedef struct { /* KDP_RESUMECPUS reply */ 536*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 537*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_resumecpus_reply_t; 538*1b191cb5SApple OSS Distributions 539*1b191cb5SApple OSS Distributions /* 540*1b191cb5SApple OSS Distributions * KDP_BREAKPOINT_SET and KDP_BREAKPOINT_REMOVE 541*1b191cb5SApple OSS Distributions */ 542*1b191cb5SApple OSS Distributions 543*1b191cb5SApple OSS Distributions typedef struct { 544*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 545*1b191cb5SApple OSS Distributions uint32_t address; 546*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_breakpoint_req_t; 547*1b191cb5SApple OSS Distributions 548*1b191cb5SApple OSS Distributions typedef struct { 549*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 550*1b191cb5SApple OSS Distributions kdp_error_t error; 551*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_breakpoint_reply_t; 552*1b191cb5SApple OSS Distributions 553*1b191cb5SApple OSS Distributions /* 554*1b191cb5SApple OSS Distributions * KDP_BREAKPOINT64_SET and KDP_BREAKPOINT64_REMOVE 555*1b191cb5SApple OSS Distributions */ 556*1b191cb5SApple OSS Distributions 557*1b191cb5SApple OSS Distributions typedef struct { 558*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 559*1b191cb5SApple OSS Distributions uint64_t address; 560*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_breakpoint64_req_t; 561*1b191cb5SApple OSS Distributions 562*1b191cb5SApple OSS Distributions typedef struct { 563*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 564*1b191cb5SApple OSS Distributions kdp_error_t error; 565*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_breakpoint64_reply_t; 566*1b191cb5SApple OSS Distributions 567*1b191cb5SApple OSS Distributions /* 568*1b191cb5SApple OSS Distributions * Exception notifications 569*1b191cb5SApple OSS Distributions * (Exception notifications are not requests, and in fact travel from 570*1b191cb5SApple OSS Distributions * the remote debugger to the gdb agent KDB.) 571*1b191cb5SApple OSS Distributions */ 572*1b191cb5SApple OSS Distributions typedef struct { /* exc. info for one cpu */ 573*1b191cb5SApple OSS Distributions uint32_t cpu; 574*1b191cb5SApple OSS Distributions /* 575*1b191cb5SApple OSS Distributions * Following info is defined as 576*1b191cb5SApple OSS Distributions * per <mach/exception.h> 577*1b191cb5SApple OSS Distributions */ 578*1b191cb5SApple OSS Distributions uint32_t exception; 579*1b191cb5SApple OSS Distributions uint32_t code; 580*1b191cb5SApple OSS Distributions uint32_t subcode; 581*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_exc_info_t; 582*1b191cb5SApple OSS Distributions 583*1b191cb5SApple OSS Distributions typedef struct { /* KDP_EXCEPTION notification */ 584*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 585*1b191cb5SApple OSS Distributions uint32_t n_exc_info; 586*1b191cb5SApple OSS Distributions kdp_exc_info_t exc_info[0]; 587*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_exception_t; 588*1b191cb5SApple OSS Distributions 589*1b191cb5SApple OSS Distributions typedef struct { /* KDP_EXCEPTION acknowledgement */ 590*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 591*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_exception_ack_t; 592*1b191cb5SApple OSS Distributions 593*1b191cb5SApple OSS Distributions /* 594*1b191cb5SApple OSS Distributions * KDP_KERNELVERSION 595*1b191cb5SApple OSS Distributions */ 596*1b191cb5SApple OSS Distributions typedef struct { /* KDP_KERNELVERSION request */ 597*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 598*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_kernelversion_req_t; 599*1b191cb5SApple OSS Distributions 600*1b191cb5SApple OSS Distributions typedef struct { /* KDP_KERNELVERSION reply */ 601*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 602*1b191cb5SApple OSS Distributions char version[0]; 603*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_kernelversion_reply_t; 604*1b191cb5SApple OSS Distributions 605*1b191cb5SApple OSS Distributions 606*1b191cb5SApple OSS Distributions /* 607*1b191cb5SApple OSS Distributions * Child termination messages 608*1b191cb5SApple OSS Distributions */ 609*1b191cb5SApple OSS Distributions typedef enum { 610*1b191cb5SApple OSS Distributions KDP_FAULT = 0, /* child took fault (internal use) */ 611*1b191cb5SApple OSS Distributions KDP_EXIT, /* child exited */ 612*1b191cb5SApple OSS Distributions KDP_POWEROFF, /* child power-off */ 613*1b191cb5SApple OSS Distributions KDP_REBOOT, /* child reboot */ 614*1b191cb5SApple OSS Distributions KDP_COMMAND_MODE /* child exit to mon command_mode */ 615*1b191cb5SApple OSS Distributions } kdp_termination_code_t; 616*1b191cb5SApple OSS Distributions 617*1b191cb5SApple OSS Distributions typedef struct { /* KDP_TERMINATION notification */ 618*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 619*1b191cb5SApple OSS Distributions uint32_t term_code; /* kdp_termination_code_t */ 620*1b191cb5SApple OSS Distributions uint32_t exit_code; 621*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_termination_t; 622*1b191cb5SApple OSS Distributions 623*1b191cb5SApple OSS Distributions typedef struct { 624*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 625*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_termination_ack_t; 626*1b191cb5SApple OSS Distributions 627*1b191cb5SApple OSS Distributions /* 628*1b191cb5SApple OSS Distributions * KDP_DUMPINFO 629*1b191cb5SApple OSS Distributions */ 630*1b191cb5SApple OSS Distributions typedef struct { /* KDP_DUMPINFO request */ 631*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 632*1b191cb5SApple OSS Distributions char name[50]; 633*1b191cb5SApple OSS Distributions char destip[16]; 634*1b191cb5SApple OSS Distributions char routerip[16]; 635*1b191cb5SApple OSS Distributions uint32_t port; 636*1b191cb5SApple OSS Distributions kdp_dumpinfo_t type; 637*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_dumpinfo_req_t; 638*1b191cb5SApple OSS Distributions 639*1b191cb5SApple OSS Distributions typedef struct { /* KDP_DUMPINFO reply */ 640*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 641*1b191cb5SApple OSS Distributions char name[50]; 642*1b191cb5SApple OSS Distributions char destip[16]; 643*1b191cb5SApple OSS Distributions char routerip[16]; 644*1b191cb5SApple OSS Distributions uint32_t port; 645*1b191cb5SApple OSS Distributions kdp_dumpinfo_t type; 646*1b191cb5SApple OSS Distributions } KDP_PACKED kdp_dumpinfo_reply_t; 647*1b191cb5SApple OSS Distributions 648*1b191cb5SApple OSS Distributions 649*1b191cb5SApple OSS Distributions typedef union { 650*1b191cb5SApple OSS Distributions kdp_hdr_t hdr; 651*1b191cb5SApple OSS Distributions kdp_connect_req_t connect_req; 652*1b191cb5SApple OSS Distributions kdp_connect_reply_t connect_reply; 653*1b191cb5SApple OSS Distributions kdp_disconnect_req_t disconnect_req; 654*1b191cb5SApple OSS Distributions kdp_disconnect_reply_t disconnect_reply; 655*1b191cb5SApple OSS Distributions kdp_hostinfo_req_t hostinfo_req; 656*1b191cb5SApple OSS Distributions kdp_hostinfo_reply_t hostinfo_reply; 657*1b191cb5SApple OSS Distributions kdp_version_req_t version_req; 658*1b191cb5SApple OSS Distributions kdp_version_reply_t version_reply; 659*1b191cb5SApple OSS Distributions kdp_maxbytes_req_t maxbytes_req; 660*1b191cb5SApple OSS Distributions kdp_maxbytes_reply_t maxbytes_reply; 661*1b191cb5SApple OSS Distributions kdp_readmem_req_t readmem_req; 662*1b191cb5SApple OSS Distributions kdp_readmem_reply_t readmem_reply; 663*1b191cb5SApple OSS Distributions kdp_readmem64_req_t readmem64_req; 664*1b191cb5SApple OSS Distributions kdp_readmem64_reply_t readmem64_reply; 665*1b191cb5SApple OSS Distributions kdp_readphysmem64_req_t readphysmem64_req; 666*1b191cb5SApple OSS Distributions kdp_readphysmem64_reply_t readphysmem64_reply; 667*1b191cb5SApple OSS Distributions kdp_writemem_req_t writemem_req; 668*1b191cb5SApple OSS Distributions kdp_writemem_reply_t writemem_reply; 669*1b191cb5SApple OSS Distributions kdp_writemem64_req_t writemem64_req; 670*1b191cb5SApple OSS Distributions kdp_writemem64_reply_t writemem64_reply; 671*1b191cb5SApple OSS Distributions kdp_writephysmem64_req_t writephysmem64_req; 672*1b191cb5SApple OSS Distributions kdp_writephysmem64_reply_t writephysmem64_reply; 673*1b191cb5SApple OSS Distributions kdp_readregs_req_t readregs_req; 674*1b191cb5SApple OSS Distributions kdp_readregs_reply_t readregs_reply; 675*1b191cb5SApple OSS Distributions kdp_writeregs_req_t writeregs_req; 676*1b191cb5SApple OSS Distributions kdp_writeregs_reply_t writeregs_reply; 677*1b191cb5SApple OSS Distributions kdp_load_req_t load_req; 678*1b191cb5SApple OSS Distributions kdp_load_reply_t load_reply; 679*1b191cb5SApple OSS Distributions kdp_imagepath_req_t imagepath_req; 680*1b191cb5SApple OSS Distributions kdp_imagepath_reply_t imagepath_reply; 681*1b191cb5SApple OSS Distributions kdp_suspend_req_t suspend_req; 682*1b191cb5SApple OSS Distributions kdp_suspend_reply_t suspend_reply; 683*1b191cb5SApple OSS Distributions kdp_resumecpus_req_t resumecpus_req; 684*1b191cb5SApple OSS Distributions kdp_resumecpus_reply_t resumecpus_reply; 685*1b191cb5SApple OSS Distributions kdp_exception_t exception; 686*1b191cb5SApple OSS Distributions kdp_exception_ack_t exception_ack; 687*1b191cb5SApple OSS Distributions kdp_termination_t termination; 688*1b191cb5SApple OSS Distributions kdp_termination_ack_t termination_ack; 689*1b191cb5SApple OSS Distributions kdp_breakpoint_req_t breakpoint_req; 690*1b191cb5SApple OSS Distributions kdp_breakpoint_reply_t breakpoint_reply; 691*1b191cb5SApple OSS Distributions kdp_breakpoint64_req_t breakpoint64_req; 692*1b191cb5SApple OSS Distributions kdp_breakpoint64_reply_t breakpoint64_reply; 693*1b191cb5SApple OSS Distributions kdp_reattach_req_t reattach_req; 694*1b191cb5SApple OSS Distributions kdp_regions_req_t regions_req; 695*1b191cb5SApple OSS Distributions kdp_regions_reply_t regions_reply; 696*1b191cb5SApple OSS Distributions kdp_kernelversion_req_t kernelversion_req; 697*1b191cb5SApple OSS Distributions kdp_kernelversion_reply_t kernelversion_reply; 698*1b191cb5SApple OSS Distributions kdp_readioport_req_t readioport_req; 699*1b191cb5SApple OSS Distributions kdp_readioport_reply_t readioport_reply; 700*1b191cb5SApple OSS Distributions kdp_writeioport_req_t writeioport_req; 701*1b191cb5SApple OSS Distributions kdp_writeioport_reply_t writeioport_reply; 702*1b191cb5SApple OSS Distributions kdp_readmsr64_req_t readmsr64_req; 703*1b191cb5SApple OSS Distributions kdp_readmsr64_reply_t readmsr64_reply; 704*1b191cb5SApple OSS Distributions kdp_writemsr64_req_t writemsr64_req; 705*1b191cb5SApple OSS Distributions kdp_writemsr64_reply_t writemsr64_reply; 706*1b191cb5SApple OSS Distributions kdp_dumpinfo_req_t dumpinfo_req; 707*1b191cb5SApple OSS Distributions kdp_dumpinfo_reply_t dumpinfo_reply; 708*1b191cb5SApple OSS Distributions } kdp_pkt_t; 709*1b191cb5SApple OSS Distributions 710*1b191cb5SApple OSS Distributions #define MAX_KDP_PKT_SIZE 1200 /* max packet size */ 711*1b191cb5SApple OSS Distributions #define MAX_KDP_DATA_SIZE 1024 /* max r/w data per packet */ 712*1b191cb5SApple OSS Distributions 713*1b191cb5SApple OSS Distributions /* 714*1b191cb5SApple OSS Distributions * Support relatively small request/responses here. 715*1b191cb5SApple OSS Distributions * If kgmacros needs to make a larger request, increase 716*1b191cb5SApple OSS Distributions * this buffer size 717*1b191cb5SApple OSS Distributions */ 718*1b191cb5SApple OSS Distributions #define KDP_MANUAL_PACKET_SIZE 128 719*1b191cb5SApple OSS Distributions struct kdp_manual_pkt { 720*1b191cb5SApple OSS Distributions unsigned char data[KDP_MANUAL_PACKET_SIZE]; 721*1b191cb5SApple OSS Distributions unsigned int len; 722*1b191cb5SApple OSS Distributions boolean_t input; 723*1b191cb5SApple OSS Distributions } KDP_PACKED; 724*1b191cb5SApple OSS Distributions 725*1b191cb5SApple OSS Distributions #ifdef KDP_PROXY_PACK_SUPPORT 726*1b191cb5SApple OSS Distributions #pragma pack() 727*1b191cb5SApple OSS Distributions #endif 728*1b191cb5SApple OSS Distributions 729*1b191cb5SApple OSS Distributions #endif // _KDP_PROTOCOL_H_ 730