- && gIODTPHandles && gIODTPHandleMap
- && gIODTInterruptCellKey
- );
-
- freeDT = (kSuccess == DTLookupEntry( 0, "/chosen/memory-map", &mapEntry ))
- && (kSuccess == DTGetProperty( mapEntry,
- "DeviceTree", (void **) &dtMap, &propSize ))
- && ((2 * sizeof( vm_offset_t)) == propSize);
-
- parent = MakeReferenceTable( (DTEntry)dtTop, freeDT );
-
- stack = OSArray::withObjects( (const OSObject **) &parent, 1, 10 );
- DTCreateEntryIterator( (DTEntry)dtTop, &iter );
-
- do {
- parent = (IORegistryEntry *)stack->getObject( stack->getCount() - 1);
- //parent->release();
- stack->removeObject( stack->getCount() - 1);
-
- while( kSuccess == DTIterateEntries( iter, &dtChild) ) {
-
- child = MakeReferenceTable( dtChild, freeDT );
- child->attachToParent( parent, gIODTPlane);
-
- AddPHandle( child );
-
- if( kSuccess == DTEnterEntry( iter, dtChild)) {
- stack->setObject( parent);
- parent = child;
- }
- // only registry holds retain
- child->release();
- }
-
- } while( stack->getCount()
- && (kSuccess == DTExitEntry( iter, &dtChild)));
-
- stack->release();
- DTDisposeEntryIterator( iter);
-
- // parent is now root of the created tree
-
- // make root name first compatible entry (purely cosmetic)
- if( (prop = (OSData *) parent->getProperty( gIODTCompatibleKey))) {
- parent->setName( parent->getName(), gIODTPlane );
- parent->setName( (const char *) prop->getBytesNoCopy() );
- }
-
- // attach tree to meta root
- parent->attachToParent( IORegistryEntry::getRegistryRoot(), gIODTPlane);
- parent->release();
-
- if( freeDT ) {
- // free original device tree
- DTInit(0);
- IODTFreeLoaderInfo( "DeviceTree",
- (void *)dtMap[0], round_page_32(dtMap[1]) );
- }
-
- // adjust tree
-
- gIODTSharedInterrupts = OSDictionary::withCapacity(4);
- allInts = OSDictionary::withCapacity(4);
- intMap = false;
- regIter = IORegistryIterator::iterateOver( gIODTPlane,
- kIORegistryIterateRecursively );
- assert( regIter && allInts && gIODTSharedInterrupts );
- if( regIter && allInts && gIODTSharedInterrupts ) {
- while( (child = regIter->getNextObject())) {
- IODTMapInterruptsSharing( child, allInts );
- if( !intMap && child->getProperty( gIODTInterruptParentKey))
- intMap = true;
-
- // Look for a "driver,AAPL,MacOSX,PowerPC" property.
- if( (obj = child->getProperty( "driver,AAPL,MacOSX,PowerPC"))) {
- gIOCatalogue->addExtensionsFromArchive((OSData *)obj);
- child->removeProperty( "driver,AAPL,MacOSX,PowerPC");
- }
-
- // some gross pruning
- child->removeProperty( "lanLib,AAPL,MacOS,PowerPC");
-
- if( (obj = child->getProperty( "driver,AAPL,MacOS,PowerPC"))) {
-
- if( (0 == (prop = (OSData *)child->getProperty( gIODTTypeKey )))
- || (strcmp( "display", (char *) prop->getBytesNoCopy())) ) {
- child->removeProperty( "driver,AAPL,MacOS,PowerPC");
- }
- }
- }
- regIter->release();
- }
+ && gIODTPHandles && gIODTPHandleMap && gIODTResolvers && gIODTResolversLock
+ && gIODTInterruptCellKey
+ );
+
+ freeDT = (kSuccess == DTLookupEntry( NULL, "/chosen/memory-map", &mapEntry ))
+ && (kSuccess == DTGetProperty( mapEntry,
+ "DeviceTree", (void **) &dtMap, &propSize ))
+ && ((2 * sizeof(uint32_t)) == propSize);
+
+ parent = MakeReferenceTable((DTEntry)dtTop, freeDT );
+
+ stack = OSArray::withObjects((const OSObject **) &parent, 1, 10 );
+ DTInitEntryIterator((DTEntry)dtTop, &iter );
+
+ do {
+ parent = (IORegistryEntry *)stack->getObject( stack->getCount() - 1);
+ //parent->release();
+ stack->removeObject( stack->getCount() - 1);
+
+ while (kSuccess == DTIterateEntries( &iter, &dtChild)) {
+ child = MakeReferenceTable( dtChild, freeDT );
+ child->attachToParent( parent, gIODTPlane);
+
+ AddPHandle( child );
+
+ if (kSuccess == DTEnterEntry( &iter, dtChild)) {
+ stack->setObject( parent);
+ parent = child;
+ }
+ // only registry holds retain
+ child->release();
+ }
+ } while (stack->getCount()
+ && (kSuccess == DTExitEntry( &iter, &dtChild)));
+
+ stack->release();
+ assert(kSuccess != DTExitEntry(&iter, &dtChild));
+
+ // parent is now root of the created tree
+
+ // make root name first compatible entry (purely cosmetic)
+ if ((prop = (OSData *) parent->getProperty( gIODTCompatibleKey))) {
+ parent->setName( parent->getName(), gIODTPlane );
+ parent->setName((const char *) prop->getBytesNoCopy());
+ }
+
+ // attach tree to meta root
+ parent->attachToParent( IORegistryEntry::getRegistryRoot(), gIODTPlane);
+ parent->release();
+
+ if (freeDT) {
+ // free original device tree
+ DTInit(NULL);
+ IODTFreeLoaderInfo( "DeviceTree",
+ (void *)dtMap[0], (int) round_page(dtMap[1]));
+ }
+
+ // adjust tree
+
+ gIODTSharedInterrupts = OSDictionary::withCapacity(4);
+ allInts = OSDictionary::withCapacity(4);
+ intMap = false;
+ regIter = IORegistryIterator::iterateOver( gIODTPlane,
+ kIORegistryIterateRecursively );
+ assert( regIter && allInts && gIODTSharedInterrupts );
+ if (regIter && allInts && gIODTSharedInterrupts) {
+ while ((child = regIter->getNextObject())) {
+ IODTMapInterruptsSharing( child, allInts );
+ if (!intMap && child->getProperty( gIODTInterruptParentKey)) {
+ intMap = true;
+ }
+ if (!strcmp("sep", child->getName())
+ || !strcmp("aop", child->getName())
+ || !strcmp("disp0", child->getName())) {
+ uint32_t aotFlags = 1;
+ child->setProperty("aot-power", &aotFlags, sizeof(aotFlags));
+ }
+ }
+ regIter->release();
+ }