]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kdp/kdp_internal.h
xnu-2782.1.97.tar.gz
[apple/xnu.git] / osfmk / kdp / kdp_internal.h
index 968a388878decbc86dbeb1aee59565c2d51f6c83..f73d345821a6c239774d0e26e343ae5681e94168 100644 (file)
 
 #include <kdp/kdp.h>
 #include <kdp/kdp_protocol.h>
+#include <mach/vm_types.h>
+#include <libsa/types.h>
 
 typedef struct {
-    unsigned short             reply_port;
+    void                       *saved_state;
+    thread_t                   kdp_thread;
+    int                                kdp_cpu;
+    uint32_t                    session_key;
     unsigned int               conn_seq;
+    unsigned short             reply_port;
+    unsigned short             exception_port;
     boolean_t                  is_conn;
-    void                       *saved_state;
     boolean_t                  is_halted;
-    unsigned short             exception_port;
     unsigned char              exception_seq;
     boolean_t                  exception_ack_needed;
 } kdp_glob_t;
@@ -47,6 +52,7 @@ typedef struct {
 extern kdp_glob_t      kdp;
 
 extern volatile int    kdp_flag;
+extern int            noresume_on_disconnect;
 
 #define KDP_READY       0x1
 #define KDP_ARP         0x2
@@ -56,6 +62,8 @@ extern volatile int   kdp_flag;
 #define PANIC_CORE_ON_NMI 0x20 
 #define DBG_POST_CORE     0x40
 #define PANIC_LOG_DUMP    0x80
+#define REBOOT_POST_CORE  0x100
+#define SYSTEM_LOG_DUMP   0x200
 typedef boolean_t
 (*kdp_dispatch_t) (
     kdp_pkt_t *,
@@ -101,7 +109,7 @@ kdp_panic(
 
 extern
 void
-kdp_reboot(
+kdp_machine_reboot(
     void
 );
 
@@ -153,7 +161,46 @@ kdp_sync_cache(
     void
 );
 
-unsigned int
-kdp_ml_get_breakinsn(
-    void
+/* Return a byte array that can be byte-copied to a memory address
+ * to trap into the debugger. Must be 4 bytes or less in the current
+ * implementation
+ */
+#define MAX_BREAKINSN_BYTES 4
+
+void
+kdp_machine_get_breakinsn(
+                                                 uint8_t *bytes,
+                                                 uint32_t *size
 );
+
+extern void
+kdp_ml_enter_debugger(
+       void
+);
+
+mach_vm_size_t
+kdp_machine_vm_read( mach_vm_address_t, caddr_t, mach_vm_size_t);
+
+mach_vm_size_t
+kdp_machine_vm_write( caddr_t, mach_vm_address_t, mach_vm_size_t);
+
+mach_vm_size_t
+kdp_machine_phys_read(kdp_readphysmem64_req_t *rq, caddr_t /* data */,
+                      uint16_t /* lcpu */);
+
+mach_vm_size_t
+kdp_machine_phys_write(kdp_writephysmem64_req_t *rq, caddr_t /* data */,
+                       uint16_t /* lcpu */);
+
+int
+kdp_machine_ioport_read(kdp_readioport_req_t *, caddr_t /* data */, uint16_t /* lcpu */);
+
+int
+kdp_machine_ioport_write(kdp_writeioport_req_t *, caddr_t /* data */, uint16_t /* lcpu */);
+
+int
+kdp_machine_msr64_read(kdp_readmsr64_req_t *, caddr_t /* data */, uint16_t /* lcpu */);
+
+int
+kdp_machine_msr64_write(kdp_writemsr64_req_t *, caddr_t /* data */, uint16_t /* lcpu */);
+