X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/43866e378188c25dd1e2208016ab3cbeb086ae6c..ff6e181ae92fc6f1e89841290f461d1f2f9badd9:/iokit/Drivers/platform/drvAppleMacIO/AppleMacIO.cpp?ds=sidebyside diff --git a/iokit/Drivers/platform/drvAppleMacIO/AppleMacIO.cpp b/iokit/Drivers/platform/drvAppleMacIO/AppleMacIO.cpp index 5242a6fd6..974bf94fa 100644 --- a/iokit/Drivers/platform/drvAppleMacIO/AppleMacIO.cpp +++ b/iokit/Drivers/platform/drvAppleMacIO/AppleMacIO.cpp @@ -3,8 +3,6 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. - * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -267,19 +265,30 @@ OSMetaClassDefineReservedUnused(AppleMacIODevice, 3); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ bool AppleMacIODevice::compareName( OSString * name, - OSString ** matched = 0 ) const + OSString ** matched ) const { - return( ((AppleMacIO *)getProvider())-> - compareNubName( this, name, matched )); + return (IODTCompareNubName(this, name, matched) || + IORegistryEntry::compareName(name, matched)); } IOService * AppleMacIODevice::matchLocation( IOService * /* client */ ) { - return( this ); + return this; } IOReturn AppleMacIODevice::getResources( void ) { - return( ((AppleMacIO *)getProvider())->getNubResources( this )); + IOService *macIO = this; + + if (getDeviceMemory() != 0) return kIOReturnSuccess; + + while (macIO && ((macIO = macIO->getProvider()) != 0)) + if (strcmp("mac-io", macIO->getName()) == 0) break; + + if (macIO == 0) return kIOReturnError; + + IODTResolveAddressing(this, "reg", macIO->getDeviceMemoryWithIndex(0)); + + return kIOReturnSuccess; }