]> git.saurik.com Git - apple/xnu.git/blame - iokit/IOKit/IODeviceTreeSupport.h
xnu-792.6.22.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 *
e5568f75
A
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.
1c79356b 11 *
e5568f75
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
e5568f75
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
24 *
25 * HISTORY
26 *
27 */
28
29#ifndef _IOKIT_IODEVICETREE_H
30#define _IOKIT_IODEVICETREE_H
31
32#include <IOKit/IORegistryEntry.h>
33#include <libkern/c++/OSData.h>
34
35class IODeviceMemory;
36class IOService;
37
38extern const IORegistryPlane * gIODTPlane;
39
40extern const OSSymbol * gIODTCompatibleKey;
41extern const OSSymbol * gIODTTypeKey;
42extern const OSSymbol * gIODTModelKey;
43
44extern const OSSymbol * gIODTAAPLInterruptsKey;
45extern const OSSymbol * gIODTDefaultInterruptController;
46extern const OSSymbol * gIODTNWInterruptMappingKey;
47
48IORegistryEntry * IODeviceTreeAlloc( void * dtTop );
49
50
51bool IODTMatchNubWithKeys( IORegistryEntry * nub,
52 const char * keys );
53
54bool IODTCompareNubName( const IORegistryEntry * regEntry,
55 OSString * name, OSString ** matchingName );
56
57enum {
58 kIODTRecursive = 0x00000001,
55e303ae 59 kIODTExclusive = 0x00000002
1c79356b
A
60};
61
62OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from,
63 IOOptionBits options, const char * keys );
64
65typedef SInt32 (*IODTCompareAddressCellFunc)
66 (UInt32 cellCount, UInt32 left[], UInt32 right[]);
67typedef void (*IODTNVLocationFunc)
68 (IORegistryEntry * entry,
69 UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum );
70
71void IODTSetResolving( IORegistryEntry * regEntry,
72 IODTCompareAddressCellFunc compareFunc,
73 IODTNVLocationFunc locationFunc );
74
75bool IODTResolveAddressCell( IORegistryEntry * regEntry,
76 UInt32 cellsIn[],
77 IOPhysicalAddress * phys, IOPhysicalLength * len );
78
79OSArray * IODTResolveAddressing( IORegistryEntry * regEntry,
80 const char * addressPropertyName,
81 IODeviceMemory * parent );
82
83#pragma options align=mac68k
84
85struct 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;
93};
94
95#pragma options align=reset
96
97IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry,
98 IONVRAMDescriptor * hdr );
99
100OSData * IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber );
101
102const OSSymbol * IODTInterruptControllerName(
103 IORegistryEntry * regEntry );
104
105bool IODTMapInterrupts( IORegistryEntry * regEntry );
106
91447636
A
107enum {
108 kIODTInterruptShared = 0x00000001
109};
110IOReturn IODTGetInterruptOptions( IORegistryEntry * regEntry, int source, IOOptionBits * options );
111
1c79356b
A
112#ifdef __cplusplus
113extern "C" {
114#endif
115
116IOReturn IONDRVLibrariesInitialize( IOService * provider );
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif /* _IOKIT_IODEVICETREE_H */
123