]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. | |
7 | * | |
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 | |
13 | * file. | |
14 | * | |
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. | |
22 | * | |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* | |
26 | * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. | |
27 | * | |
28 | * HISTORY | |
29 | * | |
30 | */ | |
31 | ||
32 | #ifndef _IOKIT_IODEVICETREE_H | |
33 | #define _IOKIT_IODEVICETREE_H | |
34 | ||
35 | #include <IOKit/IORegistryEntry.h> | |
36 | #include <libkern/c++/OSData.h> | |
37 | ||
38 | class IODeviceMemory; | |
39 | class IOService; | |
40 | ||
41 | extern const IORegistryPlane * gIODTPlane; | |
42 | ||
43 | extern const OSSymbol * gIODTCompatibleKey; | |
44 | extern const OSSymbol * gIODTTypeKey; | |
45 | extern const OSSymbol * gIODTModelKey; | |
46 | ||
47 | extern const OSSymbol * gIODTAAPLInterruptsKey; | |
48 | extern const OSSymbol * gIODTDefaultInterruptController; | |
49 | extern const OSSymbol * gIODTNWInterruptMappingKey; | |
50 | ||
51 | IORegistryEntry * IODeviceTreeAlloc( void * dtTop ); | |
52 | ||
53 | ||
54 | bool IODTMatchNubWithKeys( IORegistryEntry * nub, | |
55 | const char * keys ); | |
56 | ||
57 | bool IODTCompareNubName( const IORegistryEntry * regEntry, | |
58 | OSString * name, OSString ** matchingName ); | |
59 | ||
60 | enum { | |
61 | kIODTRecursive = 0x00000001, | |
62 | kIODTExclusive = 0x00000002, | |
63 | }; | |
64 | ||
65 | OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from, | |
66 | IOOptionBits options, const char * keys ); | |
67 | ||
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 ); | |
73 | ||
74 | void IODTSetResolving( IORegistryEntry * regEntry, | |
75 | IODTCompareAddressCellFunc compareFunc, | |
76 | IODTNVLocationFunc locationFunc ); | |
77 | ||
78 | bool IODTResolveAddressCell( IORegistryEntry * regEntry, | |
79 | UInt32 cellsIn[], | |
80 | IOPhysicalAddress * phys, IOPhysicalLength * len ); | |
81 | ||
82 | OSArray * IODTResolveAddressing( IORegistryEntry * regEntry, | |
83 | const char * addressPropertyName, | |
84 | IODeviceMemory * parent ); | |
85 | ||
86 | #pragma options align=mac68k | |
87 | ||
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; | |
96 | }; | |
97 | ||
98 | #pragma options align=reset | |
99 | ||
100 | IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry, | |
101 | IONVRAMDescriptor * hdr ); | |
102 | ||
103 | OSData * IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber ); | |
104 | ||
105 | const OSSymbol * IODTInterruptControllerName( | |
106 | IORegistryEntry * regEntry ); | |
107 | ||
108 | bool IODTMapInterrupts( IORegistryEntry * regEntry ); | |
109 | ||
110 | #ifdef __cplusplus | |
111 | extern "C" { | |
112 | #endif | |
113 | ||
114 | IOReturn IONDRVLibrariesInitialize( IOService * provider ); | |
115 | ||
116 | #ifdef __cplusplus | |
117 | } | |
118 | #endif | |
119 | ||
120 | #endif /* _IOKIT_IODEVICETREE_H */ | |
121 |