|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * The contents of this file constitute Original Code as defined in and ! 7: * are subject to the Apple Public Source License Version 1.1 (the ! 8: * "License"). You may not use this file except in compliance with the ! 9: * License. Please obtain a copy of the License at ! 10: * http://www.apple.com/publicsource and read it before using this file. ! 11: * ! 12: * This Original Code and all software distributed under the License are ! 13: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 14: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 15: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 16: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 17: * License for the specific language governing rights and limitations ! 18: * under the License. ! 19: * ! 20: * @APPLE_LICENSE_HEADER_END@ ! 21: */ ! 22: /* ! 23: * Copyright (c) 1998,1999 Apple Computer, Inc. All rights reserved. ! 24: * ! 25: * HISTORY ! 26: * ! 27: */ ! 28: ! 29: #include <IOKit/IORegistryEntry.h> ! 30: #include <IOKit/IODeviceTreeSupport.h> ! 31: #include <IOKit/IOCatalogue.h> ! 32: #include <IOKit/IOUserClient.h> ! 33: #include <IOKit/IOMemoryDescriptor.h> ! 34: #include <IOKit/IOPlatformExpert.h> ! 35: #include <IOKit/IOLib.h> ! 36: #include <IOKit/IOKitKeys.h> ! 37: #include <IOKit/IOKitDebug.h> ! 38: #include <IOKit/network/IONetworkController.h> ! 39: ! 40: #include <IOKit/assert.h> ! 41: ! 42: extern "C" { ! 43: ! 44: extern void OSlibkernInit (void); ! 45: extern void IOLibInit(void); ! 46: ! 47: #include <kern/clock.h> ! 48: ! 49: ! 50: void IOKitResetTime( void ) ! 51: { ! 52: mach_timespec_t t; ! 53: ! 54: t.tv_sec = 30; ! 55: t.tv_nsec = 0; ! 56: IOService::waitForService( ! 57: IOService::resourceMatching("IORTC"), &t ); ! 58: #ifndef i386 ! 59: IOService::waitForService( ! 60: IOService::resourceMatching("IONVRAM"), &t ); ! 61: #endif ! 62: ! 63: clock_initialize_calendar(); ! 64: } ! 65: ! 66: ! 67: void StartIOKit( void * p1, void * p2, void * p3, void * p4 ) ! 68: { ! 69: IOPlatformExpertDevice * rootNub; ! 70: int debugFlags; ! 71: IORegistryEntry * root; ! 72: OSObject * obj; ! 73: ! 74: IOLog( iokit_version ); ! 75: ! 76: if( PE_parse_boot_arg( "io", &debugFlags )) ! 77: gIOKitDebug = debugFlags; ! 78: ! 79: // ! 80: // Have to start IOKit environment before we attempt to start ! 81: // the C++ runtime environment. At some stage we have to clean up ! 82: // the initialisation path so that OS C++ can initialise independantly ! 83: // of iokit basic service initialisation, or better we have IOLib stuff ! 84: // initialise as basic OS services. ! 85: // ! 86: IOLibInit(); ! 87: OSlibkernInit(); ! 88: ! 89: IOLog("_cppInit done\n"); ! 90: ! 91: root = IORegistryEntry::initialize(); ! 92: assert( root ); ! 93: IOService::initialize(); ! 94: IOCatalogue::initialize(); ! 95: IOUserClient::initialize(); ! 96: IOMemoryDescriptor::initialize(); ! 97: IONetworkController::initialize(); ! 98: ! 99: obj = OSString::withCString( iokit_version ); ! 100: assert( obj ); ! 101: if( obj ) { ! 102: root->setProperty( kIOKitBuildVersionKey, obj ); ! 103: obj->release(); ! 104: } ! 105: obj = IOKitDiagnostics::diagnostics(); ! 106: if( obj ) { ! 107: root->setProperty( kIOKitDiagnosticsKey, obj ); ! 108: obj->release(); ! 109: } ! 110: ! 111: #ifdef i386 ! 112: // pretend there's no device-tree for intel ! 113: p1 = 0; ! 114: #endif ! 115: ! 116: rootNub = new IOPlatformExpertDevice; ! 117: ! 118: if( rootNub && rootNub->initWithArgs( p1, p2, p3, p4)) { ! 119: rootNub->attach( 0 ); ! 120: rootNub->registerService(); ! 121: } ! 122: } ! 123: ! 124: }; /* extern "C" */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.