- while( (child = regIter->getNextObject())) {
- IODTMapInterrupts( child );
- 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();
+ while( (child = regIter->getNextObject())) {
+ IODTMapInterrupts( child );
+ 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();
- while( kSuccess == DTIterateProperties( dtIter, &name)) {
-
- if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize ))
- continue;
-
- if( copy) {
- nameKey = OSSymbol::withCString(name);
- data = OSData::withBytes(prop, propSize);
- } else {
- nameKey = OSSymbol::withCStringNoCopy(name);
- data = OSData::withBytesNoCopy(prop, propSize);
- }
- assert( nameKey && data );
-
- propTable->setObject( nameKey, data);
- data->release();
- nameKey->release();
-
- if( nameKey == gIODTNameKey ) {
- if( copy)
- sym = OSSymbol::withCString( (const char *) prop);
- else
- sym = OSSymbol::withCStringNoCopy( (const char *) prop);
- regEntry->setName( sym );
- sym->release();
- } else if( nameKey == gIODTUnitKey ) {
- // all OF strings are null terminated... except this one
- if( propSize >= (int) sizeof( location))
- propSize = sizeof( location) - 1;
- strncpy( location, (const char *) prop, propSize );
- location[ propSize ] = 0;
- regEntry->setLocation( location );
- propTable->removeObject( gIODTUnitKey );
- noLocation = false;
-
- } else if( noLocation && (0 == strcmp( name, "reg"))) {
- // default location - override later
- sprintf( location, "%lX", *((UInt32 *) prop) );
- regEntry->setLocation( location );
- }
- }
- DTDisposePropertyIterator( dtIter);
+ while( kSuccess == DTIterateProperties( dtIter, &name)) {
+
+ if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize ))
+ continue;
+
+ if( copy) {
+ nameKey = OSSymbol::withCString(name);
+ data = OSData::withBytes(prop, propSize);
+ } else {
+ nameKey = OSSymbol::withCStringNoCopy(name);
+ data = OSData::withBytesNoCopy(prop, propSize);
+ }
+ assert( nameKey && data );
+
+ propTable->setObject( nameKey, data);
+ data->release();
+ nameKey->release();
+
+ if( nameKey == gIODTNameKey ) {
+ if( copy)
+ sym = OSSymbol::withCString( (const char *) prop);
+ else
+ sym = OSSymbol::withCStringNoCopy( (const char *) prop);
+ regEntry->setName( sym );
+ sym->release();
+
+ } else if( nameKey == gIODTUnitKey ) {
+ // all OF strings are null terminated... except this one
+ if( propSize >= (int) sizeof( location))
+ propSize = sizeof( location) - 1;
+ strncpy( location, (const char *) prop, propSize );
+ location[ propSize ] = 0;
+ regEntry->setLocation( location );
+ propTable->removeObject( gIODTUnitKey );
+ noLocation = false;
+
+ } else if( noLocation && (0 == strcmp( name, "reg"))) {
+ // default location - override later
+ sprintf( location, "%lX", *((UInt32 *) prop) );
+ regEntry->setLocation( location );
+ }
+ }
+ DTDisposePropertyIterator( dtIter);
- && (data = OSDynamicCast( OSData, regEntry->getProperty( gIODTPHandleKey )))) {
- // a possible interrupt-parent
- gIODTPHandles->setObject( data );
- gIODTPHandleMap->setObject( regEntry );
+ && (data = OSDynamicCast( OSData, regEntry->getProperty( gIODTPHandleKey )))) {
+ // a possible interrupt-parent
+ gIODTPHandles->setObject( data );
+ gIODTPHandleMap->setObject( regEntry );
- kprintf ("IODTMapOneInterrupt: current regEntry name %s\n", regEntry->getName());
- kprintf ("acells - icells: ");
- for (i = 0; i < acells; i++) kprintf ("0x%08X ", addrCmp[i]);
- kprintf ("- ");
- for (i = 0; i < icells; i++) kprintf ("0x%08X ", intSpec[i]);
- kprintf ("\n");
+ kprintf ("IODTMapOneInterrupt: current regEntry name %s\n", regEntry->getName());
+ kprintf ("acells - icells: ");
+ for (i = 0; i < acells; i++) kprintf ("0x%08X ", addrCmp[i]);
+ kprintf ("- ");
+ for (i = 0; i < icells; i++) kprintf ("0x%08X ", intSpec[i]);
+ kprintf ("\n");
// interrupt-map
map = (UInt32 *) data->getBytesNoCopy();
endMap = map + (data->getLength() / sizeof(UInt32));
data = OSDynamicCast( OSData, regEntry->getProperty( "interrupt-map-mask" ));
if( data && (data->getLength() >= ((acells + icells) * sizeof( UInt32))))
maskCmp = (UInt32 *) data->getBytesNoCopy();
// interrupt-map
map = (UInt32 *) data->getBytesNoCopy();
endMap = map + (data->getLength() / sizeof(UInt32));
data = OSDynamicCast( OSData, regEntry->getProperty( "interrupt-map-mask" ));
if( data && (data->getLength() >= ((acells + icells) * sizeof( UInt32))))
maskCmp = (UInt32 *) data->getBytesNoCopy();
- if (maskCmp) {
- kprintf (" maskCmp: ");
- for (i = 0; i < acells + icells; i++) {
- if (i == acells)
- kprintf ("- ");
- kprintf ("0x%08X ", maskCmp[i]);
- }
- kprintf ("\n");
- kprintf (" masked: ");
- for (i = 0; i < acells + icells; i++) {
- if (i == acells)
- kprintf ("- ");
- kprintf ("0x%08X ", ((i < acells) ? addrCmp[i] : intSpec[i-acells]) & maskCmp[i]);
- }
- kprintf ("\n");
- } else
- kprintf ("no maskCmp\n");
+ if (maskCmp) {
+ kprintf (" maskCmp: ");
+ for (i = 0; i < acells + icells; i++) {
+ if (i == acells)
+ kprintf ("- ");
+ kprintf ("0x%08X ", maskCmp[i]);
+ }
+ kprintf ("\n");
+ kprintf (" masked: ");
+ for (i = 0; i < acells + icells; i++) {
+ if (i == acells)
+ kprintf ("- ");
+ kprintf ("0x%08X ", ((i < acells) ? addrCmp[i] : intSpec[i-acells]) & maskCmp[i]);
+ }
+ kprintf ("\n");
+ } else
+ kprintf ("no maskCmp\n");
- if( IODTResolveAddressCell( parentEntry, reg, &phys, &len )) {
- range = 0;
- if( parent)
- range = IODeviceMemory::withSubRange( parent,
- phys - parent->getPhysicalAddress(), len );
- if( 0 == range)
- range = IODeviceMemory::withRange( phys, len );
- if( range)
- array->setObject( range );
- }
- reg += cells;
+ if( IODTResolveAddressCell( parentEntry, reg, &phys, &len )) {
+ range = 0;
+ if( parent)
+ range = IODeviceMemory::withSubRange( parent,
+ phys - parent->getPhysicalAddress(), len );
+ if( 0 == range)
+ range = IODeviceMemory::withRange( phys, len );
+ if( range)
+ array->setObject( range );
+ }
+ reg += cells;