]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
2d21ac55 A |
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 License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
8f6c56a5 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
8f6c56a5 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* | |
29 | * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. | |
30 | * | |
31 | * HISTORY | |
32 | * | |
33 | */ | |
34 | ||
35 | #ifndef _IOKIT_IODEVICETREE_H | |
36 | #define _IOKIT_IODEVICETREE_H | |
37 | ||
38 | #include <IOKit/IORegistryEntry.h> | |
39 | #include <libkern/c++/OSData.h> | |
40 | ||
41 | class IODeviceMemory; | |
42 | class IOService; | |
43 | ||
44 | extern const IORegistryPlane * gIODTPlane; | |
45 | ||
2d21ac55 A |
46 | extern const OSSymbol * gIODTPHandleKey; |
47 | ||
1c79356b A |
48 | extern const OSSymbol * gIODTCompatibleKey; |
49 | extern const OSSymbol * gIODTTypeKey; | |
50 | extern const OSSymbol * gIODTModelKey; | |
3e170ce0 | 51 | extern const OSSymbol * gIODTTargetTypeKey; |
1c79356b A |
52 | |
53 | extern const OSSymbol * gIODTAAPLInterruptsKey; | |
54 | extern const OSSymbol * gIODTDefaultInterruptController; | |
55 | extern const OSSymbol * gIODTNWInterruptMappingKey; | |
56 | ||
57 | IORegistryEntry * IODeviceTreeAlloc( void * dtTop ); | |
58 | ||
59 | ||
60 | bool IODTMatchNubWithKeys( IORegistryEntry * nub, | |
61 | const char * keys ); | |
62 | ||
63 | bool IODTCompareNubName( const IORegistryEntry * regEntry, | |
64 | OSString * name, OSString ** matchingName ); | |
65 | ||
66 | enum { | |
67 | kIODTRecursive = 0x00000001, | |
55e303ae | 68 | kIODTExclusive = 0x00000002 |
1c79356b A |
69 | }; |
70 | ||
71 | OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from, | |
72 | IOOptionBits options, const char * keys ); | |
73 | ||
74 | typedef SInt32 (*IODTCompareAddressCellFunc) | |
75 | (UInt32 cellCount, UInt32 left[], UInt32 right[]); | |
316670eb | 76 | |
1c79356b A |
77 | typedef void (*IODTNVLocationFunc) |
78 | (IORegistryEntry * entry, | |
79 | UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum ); | |
80 | ||
81 | void IODTSetResolving( IORegistryEntry * regEntry, | |
82 | IODTCompareAddressCellFunc compareFunc, | |
83 | IODTNVLocationFunc locationFunc ); | |
84 | ||
39236c6e A |
85 | void IODTGetCellCounts( IORegistryEntry * regEntry, |
86 | UInt32 * sizeCount, UInt32 * addressCount); | |
87 | ||
1c79356b A |
88 | bool IODTResolveAddressCell( IORegistryEntry * regEntry, |
89 | UInt32 cellsIn[], | |
90 | IOPhysicalAddress * phys, IOPhysicalLength * len ); | |
91 | ||
92 | OSArray * IODTResolveAddressing( IORegistryEntry * regEntry, | |
93 | const char * addressPropertyName, | |
94 | IODeviceMemory * parent ); | |
95 | ||
1c79356b A |
96 | struct IONVRAMDescriptor { |
97 | unsigned int format:4; | |
98 | unsigned int marker:1; | |
99 | unsigned int bridgeCount:3; | |
100 | unsigned int busNum:2; | |
101 | unsigned int bridgeDevices:6 * 5; | |
102 | unsigned int functionNum:3; | |
103 | unsigned int deviceNum:5; | |
b0d623f7 | 104 | } __attribute__((aligned(2), packed)); |
1c79356b A |
105 | |
106 | IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry, | |
107 | IONVRAMDescriptor * hdr ); | |
108 | ||
109 | OSData * IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber ); | |
110 | ||
111 | const OSSymbol * IODTInterruptControllerName( | |
112 | IORegistryEntry * regEntry ); | |
113 | ||
114 | bool IODTMapInterrupts( IORegistryEntry * regEntry ); | |
115 | ||
91447636 A |
116 | enum { |
117 | kIODTInterruptShared = 0x00000001 | |
118 | }; | |
119 | IOReturn IODTGetInterruptOptions( IORegistryEntry * regEntry, int source, IOOptionBits * options ); | |
120 | ||
1c79356b A |
121 | #ifdef __cplusplus |
122 | extern "C" { | |
123 | #endif | |
124 | ||
125 | IOReturn IONDRVLibrariesInitialize( IOService * provider ); | |
126 | ||
127 | #ifdef __cplusplus | |
128 | } | |
129 | #endif | |
130 | ||
131 | #endif /* _IOKIT_IODEVICETREE_H */ | |
132 |