2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
32 #ifndef _IOKIT_IODEVICETREE_H
33 #define _IOKIT_IODEVICETREE_H
35 #include <IOKit/IORegistryEntry.h>
36 #include <libkern/c++/OSData.h>
41 extern const IORegistryPlane
* gIODTPlane
;
43 extern const OSSymbol
* gIODTCompatibleKey
;
44 extern const OSSymbol
* gIODTTypeKey
;
45 extern const OSSymbol
* gIODTModelKey
;
47 extern const OSSymbol
* gIODTAAPLInterruptsKey
;
48 extern const OSSymbol
* gIODTDefaultInterruptController
;
49 extern const OSSymbol
* gIODTNWInterruptMappingKey
;
51 IORegistryEntry
* IODeviceTreeAlloc( void * dtTop
);
54 bool IODTMatchNubWithKeys( IORegistryEntry
* nub
,
57 bool IODTCompareNubName( const IORegistryEntry
* regEntry
,
58 OSString
* name
, OSString
** matchingName
);
61 kIODTRecursive
= 0x00000001,
62 kIODTExclusive
= 0x00000002,
65 OSCollectionIterator
* IODTFindMatchingEntries( IORegistryEntry
* from
,
66 IOOptionBits options
, const char * keys
);
68 typedef SInt32 (*IODTCompareAddressCellFunc
)
69 (UInt32 cellCount
, UInt32 left
[], UInt32 right
[]);
70 typedef void (*IODTNVLocationFunc
)
71 (IORegistryEntry
* entry
,
72 UInt8
* busNum
, UInt8
* deviceNum
, UInt8
* functionNum
);
74 void IODTSetResolving( IORegistryEntry
* regEntry
,
75 IODTCompareAddressCellFunc compareFunc
,
76 IODTNVLocationFunc locationFunc
);
78 bool IODTResolveAddressCell( IORegistryEntry
* regEntry
,
80 IOPhysicalAddress
* phys
, IOPhysicalLength
* len
);
82 OSArray
* IODTResolveAddressing( IORegistryEntry
* regEntry
,
83 const char * addressPropertyName
,
84 IODeviceMemory
* parent
);
86 #pragma options align=mac68k
88 struct IONVRAMDescriptor
{
89 unsigned int format
:4;
90 unsigned int marker
:1;
91 unsigned int bridgeCount
:3;
92 unsigned int busNum
:2;
93 unsigned int bridgeDevices
:6 * 5;
94 unsigned int functionNum
:3;
95 unsigned int deviceNum
:5;
98 #pragma options align=reset
100 IOReturn
IODTMakeNVDescriptor( IORegistryEntry
* regEntry
,
101 IONVRAMDescriptor
* hdr
);
103 OSData
* IODTFindSlotName( IORegistryEntry
* regEntry
, UInt32 deviceNumber
);
105 const OSSymbol
* IODTInterruptControllerName(
106 IORegistryEntry
* regEntry
);
108 bool IODTMapInterrupts( IORegistryEntry
* regEntry
);
114 IOReturn
IONDRVLibrariesInitialize( IOService
* provider
);
120 #endif /* _IOKIT_IODEVICETREE_H */