]> git.saurik.com Git - apple/xnu.git/blame - iokit/IOKit/IODeviceTreeSupport.h
xnu-344.49.tar.gz
[apple/xnu.git] / iokit / IOKit / IODeviceTreeSupport.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
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
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
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.
1c79356b
A
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
38class IODeviceMemory;
39class IOService;
40
41extern const IORegistryPlane * gIODTPlane;
42
43extern const OSSymbol * gIODTCompatibleKey;
44extern const OSSymbol * gIODTTypeKey;
45extern const OSSymbol * gIODTModelKey;
46
47extern const OSSymbol * gIODTAAPLInterruptsKey;
48extern const OSSymbol * gIODTDefaultInterruptController;
49extern const OSSymbol * gIODTNWInterruptMappingKey;
50
51IORegistryEntry * IODeviceTreeAlloc( void * dtTop );
52
53
54bool IODTMatchNubWithKeys( IORegistryEntry * nub,
55 const char * keys );
56
57bool IODTCompareNubName( const IORegistryEntry * regEntry,
58 OSString * name, OSString ** matchingName );
59
60enum {
61 kIODTRecursive = 0x00000001,
62 kIODTExclusive = 0x00000002,
63};
64
65OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from,
66 IOOptionBits options, const char * keys );
67
68typedef SInt32 (*IODTCompareAddressCellFunc)
69 (UInt32 cellCount, UInt32 left[], UInt32 right[]);
70typedef void (*IODTNVLocationFunc)
71 (IORegistryEntry * entry,
72 UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum );
73
74void IODTSetResolving( IORegistryEntry * regEntry,
75 IODTCompareAddressCellFunc compareFunc,
76 IODTNVLocationFunc locationFunc );
77
78bool IODTResolveAddressCell( IORegistryEntry * regEntry,
79 UInt32 cellsIn[],
80 IOPhysicalAddress * phys, IOPhysicalLength * len );
81
82OSArray * IODTResolveAddressing( IORegistryEntry * regEntry,
83 const char * addressPropertyName,
84 IODeviceMemory * parent );
85
86#pragma options align=mac68k
87
88struct 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
100IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry,
101 IONVRAMDescriptor * hdr );
102
103OSData * IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber );
104
105const OSSymbol * IODTInterruptControllerName(
106 IORegistryEntry * regEntry );
107
108bool IODTMapInterrupts( IORegistryEntry * regEntry );
109
110#ifdef __cplusplus
111extern "C" {
112#endif
113
114IOReturn IONDRVLibrariesInitialize( IOService * provider );
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif /* _IOKIT_IODEVICETREE_H */
121