2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
29 #ifndef _IOKIT_IODEVICETREE_H
30 #define _IOKIT_IODEVICETREE_H
32 #include <IOKit/IORegistryEntry.h>
33 #include <libkern/c++/OSData.h>
38 extern const IORegistryPlane
* gIODTPlane
;
40 extern const OSSymbol
* gIODTCompatibleKey
;
41 extern const OSSymbol
* gIODTTypeKey
;
42 extern const OSSymbol
* gIODTModelKey
;
44 extern const OSSymbol
* gIODTAAPLInterruptsKey
;
45 extern const OSSymbol
* gIODTDefaultInterruptController
;
46 extern const OSSymbol
* gIODTNWInterruptMappingKey
;
48 IORegistryEntry
* IODeviceTreeAlloc( void * dtTop
);
51 bool IODTMatchNubWithKeys( IORegistryEntry
* nub
,
54 bool IODTCompareNubName( const IORegistryEntry
* regEntry
,
55 OSString
* name
, OSString
** matchingName
);
58 kIODTRecursive
= 0x00000001,
59 kIODTExclusive
= 0x00000002,
62 OSCollectionIterator
* IODTFindMatchingEntries( IORegistryEntry
* from
,
63 IOOptionBits options
, const char * keys
);
65 typedef SInt32 (*IODTCompareAddressCellFunc
)
66 (UInt32 cellCount
, UInt32 left
[], UInt32 right
[]);
67 typedef void (*IODTNVLocationFunc
)
68 (IORegistryEntry
* entry
,
69 UInt8
* busNum
, UInt8
* deviceNum
, UInt8
* functionNum
);
71 void IODTSetResolving( IORegistryEntry
* regEntry
,
72 IODTCompareAddressCellFunc compareFunc
,
73 IODTNVLocationFunc locationFunc
);
75 bool IODTResolveAddressCell( IORegistryEntry
* regEntry
,
77 IOPhysicalAddress
* phys
, IOPhysicalLength
* len
);
79 OSArray
* IODTResolveAddressing( IORegistryEntry
* regEntry
,
80 const char * addressPropertyName
,
81 IODeviceMemory
* parent
);
83 #pragma options align=mac68k
85 struct IONVRAMDescriptor
{
86 unsigned int format
:4;
87 unsigned int marker
:1;
88 unsigned int bridgeCount
:3;
89 unsigned int busNum
:2;
90 unsigned int bridgeDevices
:6 * 5;
91 unsigned int functionNum
:3;
92 unsigned int deviceNum
:5;
95 #pragma options align=reset
97 IOReturn
IODTMakeNVDescriptor( IORegistryEntry
* regEntry
,
98 IONVRAMDescriptor
* hdr
);
100 OSData
* IODTFindSlotName( IORegistryEntry
* regEntry
, UInt32 deviceNumber
);
102 const OSSymbol
* IODTInterruptControllerName(
103 IORegistryEntry
* regEntry
);
105 bool IODTMapInterrupts( IORegistryEntry
* regEntry
);
111 IOReturn
IONDRVLibrariesInitialize( IOService
* provider
);
117 #endif /* _IOKIT_IODEVICETREE_H */