ReactOS  0.4.14-dev-293-g2b39b42
po.h
Go to the documentation of this file.
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/internal/po.h
5 * PURPOSE: Internal header for the Power Manager
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8 
9 #include <guiddef.h>
10 #include <poclass.h>
11 
12 //
13 // Define this if you want debugging support
14 //
15 #define _PO_DEBUG_ 0x00
16 
17 //
18 // These define the Debug Masks Supported
19 //
20 #define PO_STATE_DEBUG 0x01
21 
22 //
23 // Debug/Tracing support
24 //
25 #if _PO_DEBUG_
26 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
27 #define POTRACE DbgPrintEx
28 #else
29 #define POTRACE(x, ...) \
30  if (x & PopTraceLevel) DbgPrint(__VA_ARGS__)
31 #endif
32 #else
33 #define POTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
34 #endif
35 
36 typedef struct _PO_HIBER_PERF
37 {
52 
53 typedef struct _PO_MEMORY_IMAGE
54 {
78 
80 {
86 
88 {
94 
95 typedef struct _PO_MEMORY_RANGE_ARRAY
96 {
97  union
98  {
101  };
103 
104 typedef struct _POP_HIBER_CONTEXT
105 {
145 
147 {
158 
160 {
170 
171 typedef struct _POP_DEVICE_POWER_IRP
172 {
181 
183 {
188 
189 typedef struct _POP_DEVICE_SYS_STATE
190 {
210 
211 typedef struct _POP_POWER_ACTION
212 {
229 
231 {
235 
237 {
243 
245 {
257 
259 {
263 
264 //
265 // Initialization routines
266 //
267 INIT_FUNCTION
268 BOOLEAN
269 NTAPI
271  IN ULONG BootPhase
272 );
273 
274 INIT_FUNCTION
275 VOID
276 NTAPI
278  IN PKPRCB Prcb
279 );
280 
281 VOID
282 NTAPI
284  VOID
285 );
286 
287 //
288 // I/O Routines
289 //
290 VOID
291 NTAPI
293  IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension
294 );
295 
296 VOID
297 NTAPI
300 );
301 
302 VOID
303 NTAPI
306 
307 //
308 // Power State routines
309 //
310 NTSTATUS
311 NTAPI
314  POWER_ACTION PowerAction
315 );
316 
317 VOID
318 NTAPI
321 );
322 
323 NTSTATUS
324 NTAPI
328 );
329 
330 //
331 // Notifications
332 //
333 VOID
334 NTAPI
336  VOID
337 );
338 
339 //
340 // Shutdown routines
341 //
342 VOID
343 NTAPI
345  VOID
346 );
347 
348 VOID
349 NTAPI
352 );
353 
354 VOID
355 NTAPI
357  IN BOOLEAN ShuttingDown
358 );
359 
360 //
361 // Global data inside the Power Manager
362 //
369 
struct _PO_HIBER_PERF * PPO_HIBER_PERF
ULONG ClonedRangeCount
Definition: po.h:118
LIST_ENTRY WaitS0
Definition: po.h:156
_POP_DEVICE_IDLE_TYPE
Definition: po.h:230
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1203
SYSTEM_POWER_STATE SystemState
Definition: po.h:221
struct _POP_DEVICE_SYS_STATE * PPOP_DEVICE_SYS_STATE
struct _POP_SHUTDOWN_WAIT_ENTRY * NextEntry
Definition: po.h:260
#define IN
Definition: typedefs.h:38
struct _POP_DEVICE_SYS_STATE POP_DEVICE_SYS_STATE
BOOLEAN WriteToFile
Definition: po.h:106
PO_NOTIFY_ORDER_LEVEL OrderLevel[8]
Definition: po.h:186
struct _POP_SHUTDOWN_WAIT_ENTRY POP_SHUTDOWN_WAIT_ENTRY
PFN_NUMBER PageSelf
Definition: po.h:59
_In_ UCHAR _In_ POWER_STATE PowerState
Definition: pofuncs.h:42
BOOLEAN VerifyOnWake
Definition: po.h:109
PFN_NUMBER EndPage
Definition: po.h:83
LIST_ENTRY WaitSleep
Definition: po.h:151
ULONGLONG InterruptTime
Definition: po.h:63
LIST_ENTRY Abort
Definition: po.h:178
struct _DEVICE_OBJECT_POWER_EXTENSION DEVICE_OBJECT_POWER_EXTENSION
ULONG Signature
Definition: po.h:55
ULONG FeatureFlags
Definition: po.h:64
LIST_ENTRY Pending
Definition: po.h:176
LIST_ENTRY Pending
Definition: po.h:153
PVOID DmaIO
Definition: po.h:141
Definition: ntbasedef.h:635
PUCHAR CompressedWriteBuffer
Definition: po.h:138
BOOLEAN _WaitAny
Definition: po.h:204
PLIST_ENTRY NextCloneRange
Definition: po.h:119
ULONG DumpCount
Definition: po.h:49
ULONG TotalCount
Definition: po.h:239
NTSTATUS Status
Definition: po.h:134
PO_HIBER_PERF PerfInfo
Definition: po.h:76
PKPROCESSOR_STATE WakeState
Definition: po.h:130
PMDL Spares
Definition: po.h:125
ULONG PageSize
Definition: po.h:60
POWER_ACTION Action
Definition: po.h:216
UCHAR IrpMinor
Definition: po.h:220
ULONG PagesProcessed
Definition: po.h:47
unsigned char * PUCHAR
Definition: retypes.h:3
PVOID IoPage
Definition: po.h:127
LONG NTSTATUS
Definition: precomp.h:26
POWER_CHANNEL_SUMMARY PowerChannelSummary
Definition: po.h:254
PVOID TemporaryHeap
Definition: po.h:142
HANDLE LinkFileHandle
Definition: po.h:113
BOOLEAN GetNewDeviceList
Definition: po.h:196
LIST_ENTRY PresentIrpQueue
Definition: po.h:206
ULONGLONG StartCount
Definition: po.h:41
BOOLEAN Reset
Definition: po.h:110
INIT_FUNCTION VOID NTAPI PoInitializePrcb(IN PKPRCB Prcb)
Definition: power.c:396
ULONG Version
Definition: po.h:56
PPO_MEMORY_IMAGE MemoryImage
Definition: po.h:135
struct _PO_MEMORY_RANGE_ARRAY_RANGE PO_MEMORY_RANGE_ARRAY_RANGE
PHYSICAL_ADDRESS HiberPte
Definition: po.h:133
UCHAR Updates
Definition: po.h:213
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
ULONG ActiveCount
Definition: po.h:150
LIST_ENTRY Failed
Definition: po.h:179
ULONGLONG SleepTime
Definition: po.h:227
BOOLEAN LinkFile
Definition: po.h:112
ULONG ElapsedTime
Definition: po.h:42
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
ULONG NoHiberPtes
Definition: po.h:67
PFN_NUMBER PageNo
Definition: po.h:81
SYSTEM_POWER_STATE NextSystemState
Definition: po.h:222
uint32_t ULONG_PTR
Definition: typedefs.h:63
ULONG PagesWritten
Definition: po.h:46
struct _PO_MEMORY_RANGE_ARRAY PO_MEMORY_RANGE_ARRAY
enum _POP_DEVICE_IDLE_TYPE POP_DEVICE_IDLE_TYPE
struct _PO_MEMORY_IMAGE * PPO_MEMORY_IMAGE
NTSTATUS Status
Definition: po.h:219
struct _POP_SHUTDOWN_WAIT_ENTRY * PPOP_SHUTDOWN_WAIT_ENTRY
PMDL LoaderMdl
Definition: po.h:121
LIST_ENTRY PopVolumeDevices
Definition: povolume.c:27
ULONG PFN_NUMBER
Definition: ke.h:8
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PPO_MEMORY_RANGE_ARRAY TableHead
Definition: po.h:136
struct _POP_HIBER_CONTEXT POP_HIBER_CONTEXT
NTSTATUS Status
Definition: po.h:198
UCHAR spare[3]
Definition: po.h:66
LIST_ENTRY ReadyS0
Definition: po.h:155
struct _PO_HIBER_PERF PO_HIBER_PERF
PKSPIN_LOCK Lock
Definition: po.h:114
PFN_NUMBER StartPage
Definition: po.h:82
unsigned char BOOLEAN
VOID NTAPI PopReadShutdownPolicy(VOID)
Definition: poshtdwn.c:315
VOID NTAPI PopInitShutdownList(VOID)
Definition: poshtdwn.c:32
POP_DEVICE_POWER_IRP PowerIrpState[20]
Definition: po.h:208
ULONG_PTR Parameter1
Definition: po.h:165
BOOLEAN ReserveFreeMemory
Definition: po.h:108
HANDLE ProcessId
Definition: po.h:163
PPOP_HIBER_CONTEXT HiberContext
Definition: po.h:225
struct _PO_MEMORY_IMAGE PO_MEMORY_IMAGE
LIST_ENTRY Complete
Definition: po.h:177
enum _POP_DEVICE_IDLE_TYPE * PPOP_DEVICE_IDLE_TYPE
VOID NTAPI PoNotifySystemTimeSet(VOID)
Definition: events.c:39
BOOLEAN Waking
Definition: po.h:200
KGUARDED_MUTEX PopVolumeLock
Definition: povolume.c:26
LIST_ENTRY ClonedRanges
Definition: po.h:117
PDEVICE_OBJECT FailedDevice
Definition: po.h:199
struct _PO_NOTIFY_ORDER_LEVEL PO_NOTIFY_ORDER_LEVEL
PUCHAR NextClone
Definition: po.h:123
LIST_ENTRY NotifySourceList
Definition: po.h:252
struct _PO_DEVICE_NOTIFY_ORDER PO_DEVICE_NOTIFY_ORDER
ULONG Flags
Definition: po.h:218
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
struct _PO_MEMORY_RANGE_ARRAY_LINK PO_MEMORY_RANGE_ARRAY_LINK
PFN_NUMBER NextPreserve
Definition: po.h:120
BOOLEAN IgnoreErrors
Definition: po.h:202
UCHAR HiberFlags
Definition: po.h:111
ULONG ImageType
Definition: po.h:61
ULONG NoRanges
Definition: po.h:131
ULONG_PTR Parameter4
Definition: po.h:168
uint64_t ULONGLONG
Definition: typedefs.h:65
ULONGLONG CopyTicks
Definition: po.h:40
VOID NTAPI PoVolumeDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: povolume.c:83
ULONG_PTR Parameter3
Definition: po.h:167
ULONG DevNodeSequence
Definition: po.h:184
ULONG CheckSum
Definition: po.h:57
PDEVICE_NODE PopSystemPowerDeviceNode
Definition: power.c:25
PVOID CompressionWorkspace
Definition: po.h:137
struct _POP_POWER_ACTION POP_POWER_ACTION
POP_POWER_ACTION PopAction
Definition: power.c:27
HANDLE ThreadHandle
Definition: po.h:161
ULONG_PTR Parameter2
Definition: po.h:166
PDEVICE_OBJECT * WarmEjectPdoPointer
Definition: po.h:185
PFN_NUMBER FirstTablePage
Definition: po.h:74
VOID NTAPI PopCleanupPowerState(IN PPOWER_STATE PowerState)
Definition: power.c:63
unsigned char UCHAR
Definition: xmlstorage.h:181
PVOID DumpStack
Definition: po.h:129
PHYSICAL_ADDRESS HiberPte
Definition: po.h:69
ULONG InitTime
Definition: po.h:45
PO_HIBER_PERF PerfInfo
Definition: po.h:143
POWER_ACTION
Definition: ntpoapi.h:122
BOOLEAN MapFrozen
Definition: po.h:115
UCHAR IrpMinor
Definition: po.h:191
VOID NTAPI PopFlushVolumes(IN BOOLEAN ShuttingDown)
Definition: povolume.c:229
UCHAR State
Definition: po.h:214
Definition: typedefs.h:117
struct _DEVICE_OBJECT_POWER_EXTENSION * PDEVICE_OBJECT_POWER_EXTENSION
LARGE_INTEGER SystemTime
Definition: po.h:62
SYSTEM_POWER_STATE SystemState
Definition: po.h:192
ULONG WakeCheck
Definition: po.h:72
struct _POP_DEVICE_POWER_IRP POP_DEVICE_POWER_IRP
ULONG DeviceCount
Definition: po.h:149
ULONG LengthSelf
Definition: po.h:58
struct _POWER_CHANNEL_SUMMARY POWER_CHANNEL_SUMMARY
ULONG CopyTime
Definition: po.h:44
DEVICE_POWER_STATE State
Definition: po.h:251
BOOLEAN ReserveLoaderMemory
Definition: po.h:107
ULONGLONG IoTicks
Definition: po.h:38
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
KSPIN_LOCK SpinLock
Definition: po.h:194
BOOLEAN _WaitAll
Definition: po.h:205
PVOID CompressionBlock
Definition: po.h:140
ULONGLONG PagesOut
Definition: po.h:126
struct _POP_SHUTDOWN_BUG_CHECK POP_SHUTDOWN_BUG_CHECK
SINGLE_LIST_ENTRY Free
Definition: po.h:173
UCHAR HiberFlags
Definition: po.h:65
LIST_ENTRY ReadySleep
Definition: po.h:152
POP_DEVICE_POWER_IRP Head
Definition: po.h:207
PFN_NUMBER LastFilePage
Definition: po.h:75
VOID NTAPI PopGracefulShutdown(IN PVOID Context)
Definition: poshtdwn.c:244
INIT_FUNCTION BOOLEAN NTAPI PoInitSystem(IN ULONG BootPhase)
Definition: power.c:296
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
struct _POP_SHUTDOWN_BUG_CHECK * PPOP_SHUTDOWN_BUG_CHECK
PDEVICE_OBJECT DeviceObject
Definition: po.h:249
KEVENT LevelReady
Definition: po.h:148
ULONG NoClones
Definition: po.h:124
unsigned int * PULONG
Definition: retypes.h:1
SYSTEM_POWER_STATE LightestState
Definition: po.h:217
struct _PO_NOTIFY_ORDER_LEVEL * PPO_NOTIFY_ORDER_LEVEL
PPO_DEVICE_NOTIFY Notify
Definition: po.h:175
PPOP_SHUTDOWN_BUG_CHECK ShutdownBugCode
Definition: po.h:223
ULONG FileRuns
Definition: po.h:50
PVOID CurrentMcb
Definition: po.h:128
ULONG FreeMapCheck
Definition: po.h:71
struct _POWER_CHANNEL_SUMMARY * PPOWER_CHANNEL_SUMMARY
VOID NTAPI PoRemoveVolumeDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: povolume.c:105
PO_MEMORY_RANGE_ARRAY_RANGE Range
Definition: po.h:99
ULONG_PTR HiberVa
Definition: po.h:68
PMDL Clones
Definition: po.h:122
ULONG IoTime
Definition: po.h:43
PULONG PerformanceStats
Definition: po.h:139
struct _POP_HIBER_CONTEXT * PPOP_HIBER_CONTEXT
Definition: po.h:258
ULONG_PTR HiberVa
Definition: po.h:132
NTSTATUS NTAPI PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, IN PVOID Context)
Definition: events.c:147
#define OUT
Definition: typedefs.h:39
PETHREAD Thread
Definition: po.h:261
ULONGLONG InitTicks
Definition: po.h:39
PKEVENT Event
Definition: po.h:193
PO_DEVICE_NOTIFY_ORDER Order
Definition: po.h:197
unsigned int ULONG
Definition: retypes.h:1
SYSTEM_POWER_CAPABILITIES PopCapabilities
Definition: power.c:29
struct _POP_DEVICE_POWER_IRP * PPOP_DEVICE_POWER_IRP
NTSTATUS NTAPI PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState, POWER_ACTION PowerAction)
Definition: power.c:231
LIST_ENTRY Complete
Definition: po.h:154
LIST_ENTRY NotifyList
Definition: po.h:241
KSPIN_LOCK PopDopeGlobalLock
Definition: povolume.c:28
PKTHREAD Thread
Definition: po.h:195
PPOP_DEVICE_SYS_STATE DevState
Definition: po.h:224
LIST_ENTRY NotifyTargetList
Definition: po.h:253
struct _POP_POWER_ACTION * PPOP_POWER_ACTION
BOOLEAN IgnoreNotImplemented
Definition: po.h:203
BOOLEAN Shutdown
Definition: po.h:215
struct _PO_MEMORY_RANGE_ARRAY * PPO_MEMORY_RANGE_ARRAY
VOID NTAPI PoInitializeDeviceObject(IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension)
Definition: povolume.c:363
PFN_NUMBER TotalPages
Definition: po.h:73
ULONGLONG WakeTime
Definition: po.h:226
PO_MEMORY_RANGE_ARRAY_LINK Link
Definition: po.h:100
ULONG BytesCopied
Definition: po.h:48
RTL_BITMAP MemoryMap
Definition: po.h:116
ULONG NoFreePages
Definition: po.h:70
BOOLEAN Cancelled
Definition: po.h:201
struct _PO_DEVICE_NOTIFY_ORDER * PPO_DEVICE_NOTIFY_ORDER