X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6d2010ae8f7a6078e10b361c6962983bab233e0f..7e41aa883dd258f888d0470250eead40a53ef1f5:/iokit/Kernel/IOStartIOKit.cpp diff --git a/iokit/Kernel/IOStartIOKit.cpp b/iokit/Kernel/IOStartIOKit.cpp index 49397d4cb..8177603cc 100644 --- a/iokit/Kernel/IOStartIOKit.cpp +++ b/iokit/Kernel/IOStartIOKit.cpp @@ -42,16 +42,20 @@ #include #include #include +#include #include #include "IOKitKernelInternal.h" +const OSSymbol * gIOProgressBackbufferKey; +OSSet * gIORemoveOnReadProperties; + extern "C" { extern void OSlibkernInit (void); -void iokit_post_constructor_init(void) __attribute__((section("__TEXT, initcode"))); +void iokit_post_constructor_init(void); #include #include @@ -72,25 +76,12 @@ void IOKitInitializeTime( void ) clock_initialize_calendar(); } -void IOKitResetTime( void ) -{ - clock_sec_t secs; - clock_usec_t microsecs; - - clock_initialize_calendar(); - - clock_get_calendar_microtime(&secs, µsecs); - gIOLastWakeTime.tv_sec = secs; - gIOLastWakeTime.tv_usec = microsecs; - - IOService::updateConsoleUsers(NULL, kIOMessageSystemHasPoweredOn); -} - void iokit_post_constructor_init(void) { IORegistryEntry * root; OSObject * obj; + IOCPUInitialize(); root = IORegistryEntry::initialize(); assert( root ); IOService::initialize(); @@ -131,18 +122,23 @@ void StartIOKit( void * p1, void * p2, void * p3, void * p4 ) int debugFlags; if( PE_parse_boot_argn( "io", &debugFlags, sizeof (debugFlags) )) - gIOKitDebug = debugFlags; + gIOKitDebug = debugFlags; +#if DEVELOPMENT || DEBUG + else gIOKitDebug |= kIOWaitQuietPanics; +#endif /* DEVELOPMENT || DEBUG */ if( PE_parse_boot_argn( "iotrace", &debugFlags, sizeof (debugFlags) )) - gIOKitTrace = debugFlags; + gIOKitTrace = debugFlags; - // Compat for boot-args - gIOKitTrace |= (gIOKitDebug & kIOTraceCompatBootArgs); + // Compat for boot-args + gIOKitTrace |= (gIOKitDebug & kIOTraceCompatBootArgs); // Check for the log synchronous bit set in io if (gIOKitDebug & kIOLogSynchronous) debug_mode = true; + if( PE_parse_boot_argn( "pmtimeout", &debugFlags, sizeof (debugFlags) )) + gCanSleepTimeout = debugFlags; // // Have to start IOKit environment before we attempt to start // the C++ runtime environment. At some stage we have to clean up @@ -153,6 +149,11 @@ void StartIOKit( void * p1, void * p2, void * p3, void * p4 ) IOLibInit(); OSlibkernInit(); + gIOProgressBackbufferKey = OSSymbol::withCStringNoCopy(kIOProgressBackbufferKey); + gIORemoveOnReadProperties = OSSet::withObjects((const OSObject **) &gIOProgressBackbufferKey, 1); + + interruptAccountingInit(); + rootNub = new IOPlatformExpertDevice; if( rootNub && rootNub->initWithArgs( p1, p2, p3, p4)) { @@ -194,4 +195,17 @@ IORegistrySetOSBuildVersion(char * build_version) return; } +void +IORecordProgressBackbuffer(void * buffer, size_t size, uint32_t theme) +{ + IORegistryEntry * chosen; + if ((chosen = IORegistryEntry::fromPath(kIODeviceTreePlane ":/chosen"))) + { + chosen->setProperty(kIOProgressBackbufferKey, buffer, size); + chosen->setProperty(kIOProgressColorThemeKey, theme, 32); + + chosen->release(); + } +} + }; /* extern "C" */