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