+#endif /* KERNEL_PRIVATE */
+
+#if XNU_KERNEL_PRIVATE
+
+boolean_t oslog_is_safe(void);
+boolean_t debug_mode_active(void);
+boolean_t stackshot_active(void);
+void panic_stackshot_reset_state(void);
+
+/*
+ * @function stack_snapshot_from_kernel
+ *
+ * @abstract Stackshot function for kernel consumers who have their own buffer.
+ *
+ * @param pid the PID to be traced or -1 for the whole system
+ * @param buf a pointer to the buffer where the stackshot should be written
+ * @param size the size of the buffer
+ * @param flags flags to be passed to the stackshot
+ * @param delta_since_timestamp start time for delta period
+ * @bytes_traced a pointer to be filled with the length of the stackshot
+ *
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+kern_return_t
+stack_snapshot_from_kernel(int pid, void *buf, uint32_t size, uint32_t flags,
+ uint64_t delta_since_timestamp, unsigned *bytes_traced);
+#ifdef __cplusplus
+}
+#endif
+
+#if !CONFIG_EMBEDDED
+extern char debug_buf[];
+extern boolean_t coprocessor_paniclog_flush;
+extern boolean_t extended_debug_log_enabled;;
+#endif /* !CONFIG_EMBEDDED */
+
+extern char *debug_buf_base;
+
+extern char kernel_uuid_string[];
+extern char panic_disk_error_description[];
+extern size_t panic_disk_error_description_size;
+
+extern unsigned char *kernel_uuid;
+extern unsigned int debug_boot_arg;
+#if DEVELOPMENT || DEBUG
+extern boolean_t debug_boot_arg_inited;
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern boolean_t doprnt_hide_pointers;
+
+#ifdef __cplusplus
+}
+#endif
+
+extern unsigned int halt_in_debugger; /* pending halt in debugger after boot */
+extern unsigned int current_debugger;
+#define NO_CUR_DB 0x0
+#define KDP_CUR_DB 0x1
+
+extern unsigned int active_debugger;
+extern unsigned int kernel_debugger_entry_count;
+
+extern unsigned int panicDebugging;
+extern unsigned int kdebug_serial;
+
+extern const char *debugger_panic_str;
+
+extern char *debug_buf_ptr;
+extern unsigned int debug_buf_size;
+
+extern void debug_log_init(void);
+extern void debug_putc(char);
+
+extern void panic_init(void);
+
+#if defined (__x86_64__)
+extern void extended_debug_log_init(void);
+
+int packA(char *inbuf, uint32_t length, uint32_t buflen);
+void unpackA(char *inbuf, uint32_t length);
+
+#if DEVELOPMENT || DEBUG
+#define PANIC_STACKSHOT_BUFSIZE (1024 * 1024)
+
+extern uintptr_t panic_stackshot_buf;
+extern size_t panic_stackshot_len;
+#endif /* DEVELOPMENT || DEBUG */
+#endif /* defined (__x86_64__) */
+
+void SavePanicInfo(const char *message, uint64_t panic_options);
+void paniclog_flush(void);
+void panic_display_system_configuration(boolean_t launchd_exit);
+void panic_display_zprint(void);
+void panic_display_kernel_aslr(void);
+void panic_display_hibb(void);
+void panic_display_model_name(void);
+void panic_display_kernel_uuid(void);
+#if CONFIG_ZLEAKS
+void panic_display_ztrace(void);
+#endif /* CONFIG_ZLEAKS */
+#if CONFIG_ECC_LOGGING
+void panic_display_ecc_errors(void);
+#endif /* CONFIG_ECC_LOGGING */
+
+/*
+ * @var not_in_kdp
+ *
+ * @abstract True if we're in normal kernel operation, False if we're in a
+ * single-core debugger context.
+ */
+extern unsigned int not_in_kdp;
+
+#define DEBUGGER_NO_CPU -1
+
+typedef enum {
+ DBOP_NONE,
+ DBOP_STACKSHOT,
+ DBOP_RESET_PGO_COUNTERS,
+ DBOP_PANIC,
+ DBOP_DEBUGGER,
+ DBOP_BREAKPOINT,
+} debugger_op;
+
+kern_return_t DebuggerTrapWithState(debugger_op db_op, const char *db_message, const char *db_panic_str, va_list *db_panic_args,
+ uint64_t db_panic_options, boolean_t db_proceed_on_sync_failure, unsigned long db_panic_caller);
+void handle_debugger_trap(unsigned int exception, unsigned int code, unsigned int subcode, void *state);
+
+void DebuggerWithContext(unsigned int reason, void *ctx, const char *message, uint64_t debugger_options_mask);
+
+#if DEBUG || DEVELOPMENT
+/* leak pointer scan definitions */
+
+enum
+{
+ kInstanceFlagAddress = 0x01UL,
+ kInstanceFlagReferenced = 0x02UL,
+ kInstanceFlags = 0x03UL
+};
+
+#define INSTANCE_GET(x) ((x) & ~kInstanceFlags)
+#define INSTANCE_PUT(x) ((x) ^ ~kInstanceFlags)
+
+typedef void (*leak_site_proc)(void * refCon, uint32_t siteCount, uint32_t zoneSize,
+ uintptr_t * backtrace, uint32_t btCount);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern kern_return_t
+zone_leaks(const char * zoneName, uint32_t nameLen, leak_site_proc proc, void * refCon);
+
+extern void
+zone_leaks_scan(uintptr_t * instances, uint32_t count, uint32_t zoneSize, uint32_t * found);
+
+#ifdef __cplusplus
+}
+#endif
+
+extern boolean_t
+kdp_is_in_zone(void *addr, const char *zone_name);
+
+#endif /* DEBUG || DEVELOPMENT */
+#endif /* XNU_KERNEL_PRIVATE */