Loading...
iokit/Kernel/IOStartIOKit.cpp xnu-517.7.21 xnu-792.25.20
--- xnu/xnu-517.7.21/iokit/Kernel/IOStartIOKit.cpp
+++ xnu/xnu-792.25.20/iokit/Kernel/IOStartIOKit.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -27,6 +27,7 @@
  */
 
 #include <libkern/c++/OSUnserialize.h>
+#include <libkern/version.h>
 #include <IOKit/IORegistryEntry.h>
 #include <IOKit/IODeviceTreeSupport.h>
 #include <IOKit/IOCatalogue.h>
@@ -36,13 +37,16 @@
 #include <IOKit/IOLib.h>
 #include <IOKit/IOKitKeys.h>
 #include <IOKit/IOKitDebug.h>
+#include <IOKit/pwr_mgt/IOPMinformeeList.h>
 
 #include <IOKit/assert.h>
+
+#include "IOKitKernelInternal.h"
 
 extern "C" {
 
 extern void OSlibkernInit (void);
-extern void IOLibInit(void);
+extern void ml_hpet_cfg(uint32_t, uint32_t);
 
 #include <kern/clock.h>
 
@@ -57,6 +61,7 @@
 #ifndef i386
 	IOService::waitForService(
 		IOService::resourceMatching("IONVRAM"), &t );
+
 #endif
 
     clock_initialize_calendar();
@@ -76,8 +81,6 @@
     OSDictionary *              fakeKmods;  // must release
     OSCollectionIterator *      kmodIter;   // must release
     OSString *                  kmodName;   // don't release
-
-    IOLog( iokit_version );
 
     if( PE_parse_boot_arg( "io", &debugFlags ))
 	gIOKitDebug = debugFlags;
@@ -126,8 +129,13 @@
                 "an invalid version.\n",
                 kmodName->getCStringNoCopy());
         }
-        if (KERN_SUCCESS != kmod_create_fake(kmodName->getCStringNoCopy(),
-                kmodVersion->getCStringNoCopy())) {
+
+	// empty version strings get replaced with current kernel version
+	const char *vers = (strlen(kmodVersion->getCStringNoCopy())
+				 ? kmodVersion->getCStringNoCopy()
+				 : osrelease);
+
+        if (KERN_SUCCESS != kmod_create_fake(kmodName->getCStringNoCopy(), vers)) {
             panic("Failure declaring in-kernel kmod \"%s\".\n",
                 kmodName->getCStringNoCopy());
         }
@@ -145,7 +153,10 @@
     IOUserClient::initialize();
     IOMemoryDescriptor::initialize();
 
-    obj = OSString::withCString( iokit_version );
+    // Initializes IOPMinformeeList class-wide shared lock
+    IOPMinformeeList::getSharedRecursiveLock();
+
+    obj = OSString::withCString( version );
     assert( obj );
     if( obj ) {
         root->setProperty( kIOKitBuildVersionKey, obj );