2 * PROJECT: ReactOS ACPI bus driver
3 * FILE: acpi/ospm/include/acpisys.h
4 * PURPOSE: ACPI bus driver definitions
7 extern UNICODE_STRING ProcessorHardwareIds
;
8 extern LPWSTR ProcessorNameString
;
10 typedef enum _DEVICE_PNP_STATE
{
12 NotStarted
= 0, // Not started yet
13 Started
, // Device has received the START_DEVICE IRP
14 StopPending
, // Device has received the QUERY_STOP IRP
15 Stopped
, // Device has received the STOP_DEVICE IRP
16 UnKnown
// Unknown state
21 // A common header for the device extensions of the PDOs and FDO
24 typedef struct _COMMON_DEVICE_DATA
28 DEVICE_PNP_STATE DevicePnPState
;
29 DEVICE_PNP_STATE PreviousPnPState
;
30 SYSTEM_POWER_STATE SystemPowerState
;
31 DEVICE_POWER_STATE DevicePowerState
;
32 } COMMON_DEVICE_DATA
, *PCOMMON_DEVICE_DATA
;
34 typedef struct _PDO_DEVICE_DATA
36 COMMON_DEVICE_DATA Common
;
37 ACPI_HANDLE AcpiHandle
;
38 // A back pointer to the bus
39 PDEVICE_OBJECT ParentFdo
;
40 // An array of (zero terminated wide character strings).
41 // The array itself also null terminated
43 // Link point to hold all the PDOs for a single bus together
45 ULONG InterfaceRefCount
;
46 UNICODE_STRING InterfaceName
;
48 } PDO_DEVICE_DATA
, *PPDO_DEVICE_DATA
;
51 // The device extension of the bus itself. From whence the PDO's are born.
54 typedef struct _FDO_DEVICE_DATA
56 COMMON_DEVICE_DATA Common
;
57 PDEVICE_OBJECT UnderlyingPDO
;
59 // The underlying bus PDO and the actual device object to which our
61 PDEVICE_OBJECT NextLowerDriver
;
63 // List of PDOs created so far
64 LIST_ENTRY ListOfPDOs
;
66 // The PDOs currently enumerated.
69 // A synchronization for access to the device extension.
72 } FDO_DEVICE_DATA
, *PFDO_DEVICE_DATA
;
74 #define FDO_FROM_PDO(pdoData) \
75 ((PFDO_DEVICE_DATA) (pdoData)->ParentFdo->DeviceExtension)
77 #define INITIALIZE_PNP_STATE(_Data_) \
78 (_Data_).DevicePnPState = NotStarted;\
79 (_Data_).PreviousPnPState = NotStarted;
81 #define SET_NEW_PNP_STATE(_Data_, _state_) \
82 (_Data_).PreviousPnPState = (_Data_).DevicePnPState;\
83 (_Data_).DevicePnPState = (_state_);
85 #define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
86 (_Data_).DevicePnPState = (_Data_).PreviousPnPState;\
92 PFDO_DEVICE_DATA DeviceExtension
);
96 Bus_PDO_EvalMethod(PPDO_DEVICE_DATA DeviceData
,
102 PDEVICE_OBJECT DeviceObject
,
108 PDRIVER_OBJECT DriverObject
112 PnPMinorFunctionString (
119 PDRIVER_OBJECT DriverObject
,
120 PDEVICE_OBJECT PhysicalDeviceObject
124 Bus_SendIrpSynchronously (
125 PDEVICE_OBJECT DeviceObject
,
132 PDEVICE_OBJECT DeviceObject
,
138 Bus_CompletionRoutine(
139 PDEVICE_OBJECT DeviceObject
,
147 PFDO_DEVICE_DATA FdoData
153 PFDO_DEVICE_DATA FdoData
158 PDEVICE_OBJECT Device
,
159 PPDO_DEVICE_DATA PdoData
165 PDEVICE_OBJECT DeviceObject
,
167 PIO_STACK_LOCATION IrpStack
,
168 PFDO_DEVICE_DATA DeviceData
174 PFDO_DEVICE_DATA FdoData
,
179 BUS_QUERY_ID_TYPE Type
183 DbgDeviceRelationString(
184 DEVICE_RELATION_TYPE Type
189 PFDO_DEVICE_DATA FdoData
,
195 PPDO_DEVICE_DATA PdoData
,
202 PDEVICE_OBJECT DeviceObject
,
207 PowerMinorFunctionString (
212 DbgSystemPowerString(
213 SYSTEM_POWER_STATE Type
217 DbgDevicePowerString(
218 DEVICE_POWER_STATE Type
223 PDEVICE_OBJECT DeviceObject
,
225 PIO_STACK_LOCATION IrpStack
,
226 PPDO_DEVICE_DATA DeviceData
230 Bus_PDO_QueryDeviceCaps(
231 PPDO_DEVICE_DATA DeviceData
,
235 Bus_PDO_QueryDeviceId(
236 PPDO_DEVICE_DATA DeviceData
,
241 Bus_PDO_QueryDeviceText(
242 PPDO_DEVICE_DATA DeviceData
,
246 Bus_PDO_QueryResources(
247 PPDO_DEVICE_DATA DeviceData
,
251 Bus_PDO_QueryResourceRequirements(
252 PPDO_DEVICE_DATA DeviceData
,
256 Bus_PDO_QueryDeviceRelations(
257 PPDO_DEVICE_DATA DeviceData
,
261 Bus_PDO_QueryBusInformation(
262 PPDO_DEVICE_DATA DeviceData
,
266 Bus_GetDeviceCapabilities(
267 PDEVICE_OBJECT DeviceObject
,
268 PDEVICE_CAPABILITIES DeviceCapabilities
272 Bus_PDO_QueryInterface(
273 PPDO_DEVICE_DATA DeviceData
,
277 Bus_GetCrispinessLevel(
282 Bus_SetCrispinessLevel(
287 Bus_IsSafetyLockEnabled(
291 Bus_InterfaceReference (
295 Bus_InterfaceDereference (