Loading...
iokit/Kernel/IOStartIOKit.cpp xnu-1504.15.3 xnu-2782.1.97
--- xnu/xnu-1504.15.3/iokit/Kernel/IOStartIOKit.cpp
+++ xnu/xnu-2782.1.97/iokit/Kernel/IOStartIOKit.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998-2011 Apple Inc. All rights reserved.
+ * Copyright (c) 1998-2010 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -38,17 +38,24 @@
 #include <IOKit/IOLib.h>
 #include <IOKit/IOKitKeys.h>
 #include <IOKit/IOKitDebug.h>
+#include <IOKit/pwr_mgt/RootDomain.h>
 #include <IOKit/pwr_mgt/IOPMinformeeList.h>
+#include <IOKit/IOStatisticsPrivate.h>
+#include <IOKit/IOKitKeysPrivate.h>
+#include <IOKit/IOInterruptAccountingPrivate.h>
 
 #include <IOKit/assert.h>
 
 #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 <kern/clock.h>
 #include <sys/time.h>
@@ -61,7 +68,7 @@
 	t.tv_nsec = 0;
 	IOService::waitForService(
 		IOService::resourceMatching("IORTC"), &t );
-#ifdef ppc
+#if defined(__i386__) || defined(__x86_64__)
 	IOService::waitForService(
 		IOService::resourceMatching("IONVRAM"), &t );
 #endif
@@ -79,6 +86,8 @@
     clock_get_calendar_microtime(&secs, &microsecs);
     gIOLastWakeTime.tv_sec  = secs;
     gIOLastWakeTime.tv_usec = microsecs;
+
+    IOService::updateConsoleUsers(NULL, kIOMessageSystemHasPoweredOn);
 }
 
 void iokit_post_constructor_init(void)
@@ -90,8 +99,11 @@
     assert( root );
     IOService::initialize();
     IOCatalogue::initialize();
+    IOStatistics::initialize();
+    OSKext::initialize();
     IOUserClient::initialize();
     IOMemoryDescriptor::initialize();
+    IORootParent::initialize();
 
     // Initializes IOPMinformeeList class-wide shared lock
     IOPMinformeeList::getSharedRecursiveLock();
@@ -107,7 +119,6 @@
         root->setProperty( kIOKitDiagnosticsKey, obj );
 	obj->release();
     }
-
 }
 
 // From <osfmk/kern/debug.c>
@@ -122,24 +133,20 @@
 {
     IOPlatformExpertDevice *	rootNub;
     int				debugFlags;
-	uint32_t		intThreshold;
 
     if( PE_parse_boot_argn( "io", &debugFlags, sizeof (debugFlags) ))
-	gIOKitDebug = debugFlags;
-
+		gIOKitDebug = debugFlags;
+	
     if( PE_parse_boot_argn( "iotrace", &debugFlags, sizeof (debugFlags) ))
 		gIOKitTrace = debugFlags;
 	
 	// Compat for boot-args
 	gIOKitTrace |= (gIOKitDebug & kIOTraceCompatBootArgs);
-
-    if( PE_parse_boot_argn( "iointthreshold", &intThreshold, sizeof (intThreshold) ))
-		gIOInterruptThresholdNS = intThreshold * 1000;
 	
     // Check for the log synchronous bit set in io
     if (gIOKitDebug & kIOLogSynchronous)
         debug_mode = true;
-	
+
     //
     // Have to start IOKit environment before we attempt to start
     // the C++ runtime environment.  At some stage we have to clean up
@@ -150,6 +157,11 @@
     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)) {
@@ -191,4 +203,17 @@
     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" */