X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/c18c124eaa464aaaa5549e99e5a70fc9cbb50944..3e170ce000f1506b7b5d2c5c7faec85ceabb573d:/pexpert/i386/pe_init.c diff --git a/pexpert/i386/pe_init.c b/pexpert/i386/pe_init.c index e154c7a78..35d44a25c 100644 --- a/pexpert/i386/pe_init.c +++ b/pexpert/i386/pe_init.c @@ -41,6 +41,10 @@ #include #include +#if CONFIG_CSR +#include +#endif + #include "boot_images.h" /* extern references */ @@ -101,12 +105,6 @@ void PE_init_iokit(void) { enum { kMaxBootVar = 128 }; - typedef struct { - char name[32]; - unsigned long length; - unsigned long value[2]; - } DriversPackageProp; - boolean_t bootClutInitialized = FALSE; boolean_t noroot_rle_Initialized = FALSE; @@ -178,7 +176,7 @@ void PE_init_iokit(void) default_progress_data3x, (unsigned char *) appleClut8); - (void) StartIOKit( PE_state.deviceTreeHead, PE_state.bootArgs, gPEEFIRuntimeServices, NULL); + StartIOKit( PE_state.deviceTreeHead, PE_state.bootArgs, gPEEFIRuntimeServices, NULL); } void PE_init_platform(boolean_t vm_initialized, void * _args) @@ -326,3 +324,21 @@ PE_reboot_on_panic(void) else return FALSE; } + +/* rdar://problem/21244753 */ +uint32_t +PE_i_can_has_debugger(uint32_t *debug_flags) +{ +#if CONFIG_CSR + if (csr_check(CSR_ALLOW_KERNEL_DEBUGGER) != 0 && + csr_check(CSR_ALLOW_APPLE_INTERNAL) != 0) { + if (debug_flags) + *debug_flags = 0; + return FALSE; + } +#endif + if (debug_flags) { + *debug_flags = debug_boot_arg; + } + return TRUE; +}