Root/
Source at commit 1084 created 13 years 1 month ago. By meklort, BiosDisk Read() function working. Write() complete but untested | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
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.␊ |
11 | * ␊ |
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␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
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.␊ |
19 | * ␊ |
20 | * @APPLE_LICENSE_HEADER_END@␊ |
21 | */␊ |
22 | ␊ |
23 | #ifndef _IOKIT_IOACPIPLATFORMDEVICE_H␊ |
24 | #define _IOKIT_IOACPIPLATFORMDEVICE_H␊ |
25 | ␊ |
26 | #include <libkern/c++/OSContainers.h>␊ |
27 | #include <IOKit/IOPlatformExpert.h>␊ |
28 | #include <IOKit/acpi/IOACPITypes.h>␊ |
29 | ␊ |
30 | class IOACPIPlatformExpert;␊ |
31 | ␊ |
32 | class IOACPIPlatformDevice : public IOPlatformDevice␊ |
33 | {␊ |
34 | OSDeclareDefaultStructors( IOACPIPlatformDevice )␊ |
35 | ␊ |
36 | protected:␊ |
37 | void * _deviceHandle;␊ |
38 | UInt32 _deviceType;␊ |
39 | UInt32 _powerFlags;␊ |
40 | UInt32 * _powerStateFlags;␊ |
41 | UInt32 _sleepPowerState;␊ |
42 | IOService * _acpiParent;␊ |
43 | IOACPIPlatformExpert * _platform;␊ |
44 | ␊ |
45 | /*! @struct ExpansionData␊ |
46 | @discussion This structure will be used to expand the capablilties␊ |
47 | of the class in the future.␊ |
48 | */␊ |
49 | struct ExpansionData { };␊ |
50 | ␊ |
51 | /*! @var reserved␊ |
52 | Reserved for future use. (Internal use only)␊ |
53 | */␊ |
54 | ExpansionData * reserved;␊ |
55 | ␊ |
56 | virtual bool initACPIPowerManagement( IOService * powerParent );␊ |
57 | virtual void stopACPIPowerManagement( IOService * powerParent );␊ |
58 | ␊ |
59 | public:␊ |
60 | virtual bool init( IOService * platform,␊ |
61 | void * handle,␊ |
62 | OSDictionary * properties );␊ |
63 | ␊ |
64 | virtual void free( void );␊ |
65 | ␊ |
66 | virtual bool attachToParent( IORegistryEntry * parent,␊ |
67 | const IORegistryPlane * plane );␊ |
68 | ␊ |
69 | virtual void detachFromParent( IORegistryEntry * parent,␊ |
70 | const IORegistryPlane * plane );␊ |
71 | ␊ |
72 | virtual bool getPathComponent( char * path, int * length,␊ |
73 | const IORegistryPlane * plane ) const;␊ |
74 | ␊ |
75 | virtual bool compareName( OSString * name,␊ |
76 | OSString ** matched ) const;␊ |
77 | ␊ |
78 | virtual IOReturn getResources( void );␊ |
79 | ␊ |
80 | virtual void * getDeviceHandle( void ) const;␊ |
81 | ␊ |
82 | virtual UInt32 getDeviceStatus( void ) const;␊ |
83 | ␊ |
84 | enum {␊ |
85 | kTypeDevice = 0,␊ |
86 | kTypeProcessor = 1,␊ |
87 | kTypePowerResource = 2␊ |
88 | };␊ |
89 | ␊ |
90 | virtual UInt32 getDeviceType( void ) const;␊ |
91 | ␊ |
92 | virtual void setDeviceType( UInt32 deviceType );␊ |
93 | ␊ |
94 | // Method (object) evaluation␊ |
95 | ␊ |
96 | virtual IOReturn validateObject( const OSSymbol * objectName );␊ |
97 | ␊ |
98 | virtual IOReturn validateObject( const char * objectName );␊ |
99 | ␊ |
100 | virtual IOReturn evaluateObject( const OSSymbol * objectName,␊ |
101 | OSObject ** result = 0,␊ |
102 | OSObject * params[] = 0,␊ |
103 | IOItemCount paramCount = 0,␊ |
104 | IOOptionBits options = 0 );␊ |
105 | ␊ |
106 | virtual IOReturn evaluateObject( const char * objectName,␊ |
107 | OSObject ** result = 0,␊ |
108 | OSObject * params[] = 0,␊ |
109 | IOItemCount paramCount = 0,␊ |
110 | IOOptionBits options = 0 );␊ |
111 | ␊ |
112 | virtual IOReturn evaluateInteger( const OSSymbol * objectName,␊ |
113 | UInt32 * resultInt32,␊ |
114 | OSObject * params[] = 0,␊ |
115 | IOItemCount paramCount = 0,␊ |
116 | IOOptionBits options = 0 );␊ |
117 | ␊ |
118 | virtual IOReturn evaluateInteger( const char * objectName,␊ |
119 | UInt32 * resultInt32,␊ |
120 | OSObject * params[] = 0,␊ |
121 | IOItemCount paramCount = 0,␊ |
122 | IOOptionBits options = 0 );␊ |
123 | ␊ |
124 | virtual IOReturn evaluateInteger( const OSSymbol * objectName,␊ |
125 | UInt64 * resultInt64,␊ |
126 | OSObject * params[] = 0,␊ |
127 | IOItemCount paramCount = 0,␊ |
128 | IOOptionBits options = 0 );␊ |
129 | ␊ |
130 | virtual IOReturn evaluateInteger( const char * objectName,␊ |
131 | UInt64 * resultInt64,␊ |
132 | OSObject * params[] = 0,␊ |
133 | IOItemCount paramCount = 0,␊ |
134 | IOOptionBits options = 0 );␊ |
135 | ␊ |
136 | // ACPI table access␊ |
137 | ␊ |
138 | virtual const OSData * getACPITableData( const char * tableName,␊ |
139 | UInt32 tableInstance = 0 ) const;␊ |
140 | ␊ |
141 | // Map ACPI event to interrupt event source index␊ |
142 | ␊ |
143 | virtual SInt32 installInterruptForFixedEvent( UInt32 fixedEvent );␊ |
144 | ␊ |
145 | virtual SInt32 installInterruptForGPE( UInt32 gpeNumber,␊ |
146 | void * gpeBlockDevice = 0,␊ |
147 | IOOptionBits options = 0 );␊ |
148 | ␊ |
149 | // ACPI global lock acquire/release␊ |
150 | ␊ |
151 | virtual IOReturn acquireGlobalLock( UInt32 * lockToken,␊ |
152 | const mach_timespec_t * timeout = 0 );␊ |
153 | ␊ |
154 | virtual void releaseGlobalLock( UInt32 lockToken );␊ |
155 | ␊ |
156 | // Address space handler registration␊ |
157 | ␊ |
158 | virtual IOReturn registerAddressSpaceHandler(␊ |
159 | IOACPIAddressSpaceID spaceID,␊ |
160 | IOACPIAddressSpaceHandler handler,␊ |
161 | void * context,␊ |
162 | IOOptionBits options = 0 );␊ |
163 | ␊ |
164 | virtual void unregisterAddressSpaceHandler(␊ |
165 | IOACPIAddressSpaceID spaceID,␊ |
166 | IOACPIAddressSpaceHandler handler,␊ |
167 | IOOptionBits options = 0 );␊ |
168 | ␊ |
169 | // Address space access␊ |
170 | ␊ |
171 | virtual IOReturn readAddressSpace( UInt64 * value,␊ |
172 | IOACPIAddressSpaceID spaceID,␊ |
173 | IOACPIAddress address,␊ |
174 | UInt32 bitWidth,␊ |
175 | UInt32 bitOffset = 0,␊ |
176 | IOOptionBits options = 0 );␊ |
177 | ␊ |
178 | virtual IOReturn writeAddressSpace( UInt64 value,␊ |
179 | IOACPIAddressSpaceID spaceID,␊ |
180 | IOACPIAddress address,␊ |
181 | UInt32 bitWidth,␊ |
182 | UInt32 bitOffset = 0, ␊ |
183 | IOOptionBits options = 0 );␊ |
184 | ␊ |
185 | // Power management␊ |
186 | ␊ |
187 | virtual bool hasSystemWakeCapability( void ) const;␊ |
188 | ␊ |
189 | virtual IOReturn setSystemWakeCapabilityEnable( bool enable );␊ |
190 | ␊ |
191 | virtual bool hasACPIPowerStateSupport( UInt32 powerState ) const;␊ |
192 | ␊ |
193 | virtual IOReturn setACPIPowerManagementEnable(␊ |
194 | bool enable,␊ |
195 | UInt32 powerState = kIOACPIDevicePowerStateD3,␊ |
196 | IOOptionBits options = 0 );␊ |
197 | ␊ |
198 | virtual IOReturn setPowerState( unsigned long powerState,␊ |
199 | IOService * whatDevice );␊ |
200 | ␊ |
201 | // I/O space helpers␊ |
202 | ␊ |
203 | virtual void ioWrite32( UInt16 offset, UInt32 value,␊ |
204 | IOMemoryMap * map = 0 );␊ |
205 | ␊ |
206 | virtual void ioWrite16( UInt16 offset, UInt16 value,␊ |
207 | IOMemoryMap * map = 0 );␊ |
208 | ␊ |
209 | virtual void ioWrite8( UInt16 offset, UInt8 value,␊ |
210 | IOMemoryMap * map = 0 );␊ |
211 | ␊ |
212 | virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 );␊ |
213 | ␊ |
214 | virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 );␊ |
215 | ␊ |
216 | virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 );␊ |
217 | ␊ |
218 | // vtable padding␊ |
219 | ␊ |
220 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 0 );␊ |
221 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 1 );␊ |
222 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 2 );␊ |
223 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 3 );␊ |
224 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 4 );␊ |
225 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 5 );␊ |
226 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 6 );␊ |
227 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 7 );␊ |
228 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 8 );␊ |
229 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 9 );␊ |
230 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 10 );␊ |
231 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 11 );␊ |
232 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 12 );␊ |
233 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 13 );␊ |
234 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 14 );␊ |
235 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 15 );␊ |
236 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 16 );␊ |
237 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 17 );␊ |
238 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 18 );␊ |
239 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 19 );␊ |
240 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 20 );␊ |
241 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 21 );␊ |
242 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 22 );␊ |
243 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 23 );␊ |
244 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 24 );␊ |
245 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 25 );␊ |
246 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 26 );␊ |
247 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 27 );␊ |
248 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 28 );␊ |
249 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 29 );␊ |
250 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 30 );␊ |
251 | OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 31 );␊ |
252 | };␊ |
253 | ␊ |
254 | #endif /* !_IOKIT_IOACPIPLATFORMDEVICE_H */␊ |
255 |