2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
37 #ifndef _IOKIT_IODEVICETREE_H
38 #define _IOKIT_IODEVICETREE_H
40 #include <IOKit/IORegistryEntry.h>
41 #include <libkern/c++/OSData.h>
46 extern const IORegistryPlane
* gIODTPlane
;
48 extern const OSSymbol
* gIODTCompatibleKey
;
49 extern const OSSymbol
* gIODTTypeKey
;
50 extern const OSSymbol
* gIODTModelKey
;
52 extern const OSSymbol
* gIODTAAPLInterruptsKey
;
53 extern const OSSymbol
* gIODTDefaultInterruptController
;
54 extern const OSSymbol
* gIODTNWInterruptMappingKey
;
56 IORegistryEntry
* IODeviceTreeAlloc( void * dtTop
);
59 bool IODTMatchNubWithKeys( IORegistryEntry
* nub
,
62 bool IODTCompareNubName( const IORegistryEntry
* regEntry
,
63 OSString
* name
, OSString
** matchingName
);
66 kIODTRecursive
= 0x00000001,
67 kIODTExclusive
= 0x00000002
70 OSCollectionIterator
* IODTFindMatchingEntries( IORegistryEntry
* from
,
71 IOOptionBits options
, const char * keys
);
73 typedef SInt32 (*IODTCompareAddressCellFunc
)
74 (UInt32 cellCount
, UInt32 left
[], UInt32 right
[]);
75 typedef void (*IODTNVLocationFunc
)
76 (IORegistryEntry
* entry
,
77 UInt8
* busNum
, UInt8
* deviceNum
, UInt8
* functionNum
);
79 void IODTSetResolving( IORegistryEntry
* regEntry
,
80 IODTCompareAddressCellFunc compareFunc
,
81 IODTNVLocationFunc locationFunc
);
83 bool IODTResolveAddressCell( IORegistryEntry
* regEntry
,
85 IOPhysicalAddress
* phys
, IOPhysicalLength
* len
);
87 OSArray
* IODTResolveAddressing( IORegistryEntry
* regEntry
,
88 const char * addressPropertyName
,
89 IODeviceMemory
* parent
);
91 #pragma options align=mac68k
93 struct IONVRAMDescriptor
{
94 unsigned int format
:4;
95 unsigned int marker
:1;
96 unsigned int bridgeCount
:3;
97 unsigned int busNum
:2;
98 unsigned int bridgeDevices
:6 * 5;
99 unsigned int functionNum
:3;
100 unsigned int deviceNum
:5;
103 #pragma options align=reset
105 IOReturn
IODTMakeNVDescriptor( IORegistryEntry
* regEntry
,
106 IONVRAMDescriptor
* hdr
);
108 OSData
* IODTFindSlotName( IORegistryEntry
* regEntry
, UInt32 deviceNumber
);
110 const OSSymbol
* IODTInterruptControllerName(
111 IORegistryEntry
* regEntry
);
113 bool IODTMapInterrupts( IORegistryEntry
* regEntry
);
116 kIODTInterruptShared
= 0x00000001
118 IOReturn
IODTGetInterruptOptions( IORegistryEntry
* regEntry
, int source
, IOOptionBits
* options
);
124 IOReturn
IONDRVLibrariesInitialize( IOService
* provider
);
130 #endif /* _IOKIT_IODEVICETREE_H */