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 ProcessorIdString
;
9 extern LPWSTR ProcessorNameString
;
11 typedef enum _DEVICE_PNP_STATE
{
13 NotStarted
= 0, // Not started yet
14 Started
, // Device has received the START_DEVICE IRP
15 StopPending
, // Device has received the QUERY_STOP IRP
16 Stopped
, // Device has received the STOP_DEVICE IRP
17 RemovalPending
, // Device has received the QUERY_REMOVE IRP
18 UnKnown
// Unknown state
23 // A common header for the device extensions of the PDOs and FDO
26 typedef struct _COMMON_DEVICE_DATA
30 DEVICE_PNP_STATE DevicePnPState
;
31 DEVICE_PNP_STATE PreviousPnPState
;
32 SYSTEM_POWER_STATE SystemPowerState
;
33 DEVICE_POWER_STATE DevicePowerState
;
34 } COMMON_DEVICE_DATA
, *PCOMMON_DEVICE_DATA
;
36 typedef struct _PDO_DEVICE_DATA
38 COMMON_DEVICE_DATA Common
;
39 ACPI_HANDLE AcpiHandle
;
40 // A back pointer to the bus
41 PDEVICE_OBJECT ParentFdo
;
42 // An array of (zero terminated wide character strings).
43 // The array itself also null terminated
45 // Link point to hold all the PDOs for a single bus together
47 ULONG InterfaceRefCount
;
48 UNICODE_STRING InterfaceName
;
50 } PDO_DEVICE_DATA
, *PPDO_DEVICE_DATA
;
53 // The device extension of the bus itself. From whence the PDO's are born.
56 typedef struct _FDO_DEVICE_DATA
58 COMMON_DEVICE_DATA Common
;
59 PDEVICE_OBJECT UnderlyingPDO
;
61 // The underlying bus PDO and the actual device object to which our
63 PDEVICE_OBJECT NextLowerDriver
;
65 // List of PDOs created so far
66 LIST_ENTRY ListOfPDOs
;
68 // The PDOs currently enumerated.
71 // A synchronization for access to the device extension.
74 } FDO_DEVICE_DATA
, *PFDO_DEVICE_DATA
;
76 #define FDO_FROM_PDO(pdoData) \
77 ((PFDO_DEVICE_DATA) (pdoData)->ParentFdo->DeviceExtension)
79 #define INITIALIZE_PNP_STATE(_Data_) \
80 (_Data_).DevicePnPState = NotStarted;\
81 (_Data_).PreviousPnPState = NotStarted;
83 #define SET_NEW_PNP_STATE(_Data_, _state_) \
84 (_Data_).PreviousPnPState = (_Data_).DevicePnPState;\
85 (_Data_).DevicePnPState = (_state_);
87 #define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
88 (_Data_).DevicePnPState = (_Data_).PreviousPnPState;\
94 PFDO_DEVICE_DATA DeviceExtension
);
98 Bus_PDO_EvalMethod(PPDO_DEVICE_DATA DeviceData
,
104 PDEVICE_OBJECT DeviceObject
,
110 PDRIVER_OBJECT DriverObject
114 PnPMinorFunctionString (
121 PDRIVER_OBJECT DriverObject
,
122 PDEVICE_OBJECT PhysicalDeviceObject
126 Bus_SendIrpSynchronously (
127 PDEVICE_OBJECT DeviceObject
,
134 PDEVICE_OBJECT DeviceObject
,
140 Bus_CompletionRoutine(
141 PDEVICE_OBJECT DeviceObject
,
149 PFDO_DEVICE_DATA FdoData
155 PFDO_DEVICE_DATA FdoData
160 PDEVICE_OBJECT Device
,
161 PPDO_DEVICE_DATA PdoData
167 PDEVICE_OBJECT DeviceObject
,
169 PIO_STACK_LOCATION IrpStack
,
170 PFDO_DEVICE_DATA DeviceData
176 PFDO_DEVICE_DATA FdoData
,
181 BUS_QUERY_ID_TYPE Type
185 DbgDeviceRelationString(
186 DEVICE_RELATION_TYPE Type
191 PFDO_DEVICE_DATA FdoData
,
197 PPDO_DEVICE_DATA PdoData
,
204 PDEVICE_OBJECT DeviceObject
,
209 PowerMinorFunctionString (
214 DbgSystemPowerString(
215 SYSTEM_POWER_STATE Type
219 DbgDevicePowerString(
220 DEVICE_POWER_STATE Type
225 PDEVICE_OBJECT DeviceObject
,
227 PIO_STACK_LOCATION IrpStack
,
228 PPDO_DEVICE_DATA DeviceData
232 Bus_PDO_QueryDeviceCaps(
233 PPDO_DEVICE_DATA DeviceData
,
237 Bus_PDO_QueryDeviceId(
238 PPDO_DEVICE_DATA DeviceData
,
243 Bus_PDO_QueryDeviceText(
244 PPDO_DEVICE_DATA DeviceData
,
248 Bus_PDO_QueryResources(
249 PPDO_DEVICE_DATA DeviceData
,
253 Bus_PDO_QueryResourceRequirements(
254 PPDO_DEVICE_DATA DeviceData
,
258 Bus_PDO_QueryDeviceRelations(
259 PPDO_DEVICE_DATA DeviceData
,
263 Bus_PDO_QueryBusInformation(
264 PPDO_DEVICE_DATA DeviceData
,
268 Bus_GetDeviceCapabilities(
269 PDEVICE_OBJECT DeviceObject
,
270 PDEVICE_CAPABILITIES DeviceCapabilities
274 Bus_PDO_QueryInterface(
275 PPDO_DEVICE_DATA DeviceData
,
279 Bus_GetCrispinessLevel(
284 Bus_SetCrispinessLevel(
289 Bus_IsSafetyLockEnabled(
293 Bus_InterfaceReference (
297 Bus_InterfaceDereference (