ReactOS 0.4.16-dev-338-g34e76ad
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
37{
48
49typedef struct _PO_HIBER_PERF
50{
65
66typedef struct _PO_MEMORY_IMAGE
67{
91
93{
99
101{
107
109{
110 union
111 {
114 };
116
117typedef struct _POP_HIBER_CONTEXT
118{
158
160{
171
173{
183
185{
194
196{
201
203{
223
224typedef struct _POP_POWER_ACTION
225{
242
244{
248
250{
256
258{
270
272{
276
277//
278// Initialization routines
279//
280CODE_SEG("INIT")
282NTAPI
284 IN ULONG BootPhase
285);
286
287CODE_SEG("INIT")
288VOID
289NTAPI
291 IN PKPRCB Prcb
292);
293
294VOID
295NTAPI
297 VOID
298);
299
300//
301// I/O Routines
302//
303VOID
304NTAPI
306 IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension
307);
308
309VOID
310NTAPI
313);
314
315VOID
316NTAPI
319
320//
321// Power State routines
322//
324NTAPI
327 POWER_ACTION PowerAction
328);
329
330VOID
331NTAPI
334);
335
337NTAPI
341);
342
343//
344// Notifications
345//
346VOID
347NTAPI
349 VOID
350);
351
352//
353// Shutdown routines
354//
355VOID
356NTAPI
358 VOID
359);
360
361VOID
362NTAPI
365);
366
367VOID
368NTAPI
370 IN BOOLEAN ShuttingDown
371);
372
373//
374// Global data inside the Power Manager
375//
382
#define CODE_SEG(...)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
POWER_ACTION
Definition: ntpoapi.h:122
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
VOID NTAPI PoInitializeDeviceObject(IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension)
Definition: povolume.c:361
struct _PO_DEVICE_NOTIFY_ORDER * PPO_DEVICE_NOTIFY_ORDER
struct _POP_SHUTDOWN_BUG_CHECK POP_SHUTDOWN_BUG_CHECK
LIST_ENTRY PopVolumeDevices
Definition: povolume.c:27
struct _POP_DEVICE_POWER_IRP POP_DEVICE_POWER_IRP
VOID NTAPI PopInitShutdownList(VOID)
Definition: poshtdwn.c:35
enum _POP_DEVICE_IDLE_TYPE * PPOP_DEVICE_IDLE_TYPE
struct _POP_SHUTDOWN_BUG_CHECK * PPOP_SHUTDOWN_BUG_CHECK
struct _PO_MEMORY_RANGE_ARRAY_RANGE PO_MEMORY_RANGE_ARRAY_RANGE
VOID NTAPI PopReadShutdownPolicy(VOID)
Definition: poshtdwn.c:303
struct _DEVICE_OBJECT_POWER_EXTENSION DEVICE_OBJECT_POWER_EXTENSION
struct _POP_HIBER_CONTEXT POP_HIBER_CONTEXT
VOID NTAPI PoVolumeDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: povolume.c:81
BOOLEAN NTAPI PoInitSystem(IN ULONG BootPhase)
Definition: power.c:397
struct _PO_MEMORY_RANGE_ARRAY PO_MEMORY_RANGE_ARRAY
struct _POWER_CHANNEL_SUMMARY POWER_CHANNEL_SUMMARY
_POP_POLICY_DEVICE_TYPE
Definition: po.h:37
@ PolicySetPowerStateAPI
Definition: po.h:43
@ PolicyDeviceBattery
Definition: po.h:40
@ PolicyInitiatePowerActionAPI
Definition: po.h:42
@ PolicyDeviceSystemButton
Definition: po.h:38
@ PolicyDeviceMax
Definition: po.h:46
@ PolicyImmediateDozeS4
Definition: po.h:44
@ PolicySystemIdle
Definition: po.h:45
@ PolicyDeviceMemory
Definition: po.h:41
@ PolicyDeviceThermalZone
Definition: po.h:39
struct _POP_POWER_ACTION POP_POWER_ACTION
NTSTATUS NTAPI PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, IN PVOID Context)
Definition: events.c:147
struct _POP_POWER_ACTION * PPOP_POWER_ACTION
struct _PO_MEMORY_IMAGE PO_MEMORY_IMAGE
struct _POP_DEVICE_SYS_STATE POP_DEVICE_SYS_STATE
struct _PO_HIBER_PERF PO_HIBER_PERF
VOID NTAPI PopCleanupPowerState(IN PPOWER_STATE PowerState)
Definition: power.c:164
struct _DEVICE_OBJECT_POWER_EXTENSION * PDEVICE_OBJECT_POWER_EXTENSION
struct _PO_HIBER_PERF * PPO_HIBER_PERF
enum _POP_POLICY_DEVICE_TYPE POP_POLICY_DEVICE_TYPE
enum _POP_DEVICE_IDLE_TYPE POP_DEVICE_IDLE_TYPE
struct _PO_DEVICE_NOTIFY_ORDER PO_DEVICE_NOTIFY_ORDER
SYSTEM_POWER_CAPABILITIES PopCapabilities
Definition: power.c:29
struct _POP_DEVICE_POWER_IRP * PPOP_DEVICE_POWER_IRP
_POP_DEVICE_IDLE_TYPE
Definition: po.h:244
@ DeviceIdleDisk
Definition: po.h:246
@ DeviceIdleNormal
Definition: po.h:245
struct _POWER_CHANNEL_SUMMARY * PPOWER_CHANNEL_SUMMARY
KSPIN_LOCK PopDopeGlobalLock
Definition: povolume.c:28
struct _POP_HIBER_CONTEXT * PPOP_HIBER_CONTEXT
struct _PO_MEMORY_RANGE_ARRAY_LINK PO_MEMORY_RANGE_ARRAY_LINK
NTSTATUS NTAPI PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState, POWER_ACTION PowerAction)
Definition: power.c:332
struct _PO_NOTIFY_ORDER_LEVEL * PPO_NOTIFY_ORDER_LEVEL
VOID NTAPI PopFlushVolumes(IN BOOLEAN ShuttingDown)
Definition: povolume.c:227
struct _POP_DEVICE_SYS_STATE * PPOP_DEVICE_SYS_STATE
struct _PO_MEMORY_RANGE_ARRAY * PPO_MEMORY_RANGE_ARRAY
VOID NTAPI PoNotifySystemTimeSet(VOID)
Definition: events.c:39
struct _POP_SHUTDOWN_WAIT_ENTRY POP_SHUTDOWN_WAIT_ENTRY
struct _PO_NOTIFY_ORDER_LEVEL PO_NOTIFY_ORDER_LEVEL
struct _PO_MEMORY_IMAGE * PPO_MEMORY_IMAGE
struct _POP_SHUTDOWN_WAIT_ENTRY * PPOP_SHUTDOWN_WAIT_ENTRY
KGUARDED_MUTEX PopVolumeLock
Definition: povolume.c:26
VOID NTAPI PoInitializePrcb(IN PKPRCB Prcb)
Definition: power.c:510
VOID NTAPI PoRemoveVolumeDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: povolume.c:103
PDEVICE_NODE PopSystemPowerDeviceNode
Definition: power.c:25
POP_POWER_ACTION PopAction
Definition: power.c:27
VOID NTAPI PopGracefulShutdown(IN PVOID Context)
Definition: poshtdwn.c:232
ULONG PFN_NUMBER
Definition: ke.h:9
LIST_ENTRY NotifyTargetList
Definition: po.h:266
LIST_ENTRY NotifySourceList
Definition: po.h:265
POWER_CHANNEL_SUMMARY PowerChannelSummary
Definition: po.h:267
DEVICE_POWER_STATE State
Definition: po.h:264
PDEVICE_OBJECT DeviceObject
Definition: po.h:262
Definition: typedefs.h:120
PPO_DEVICE_NOTIFY Notify
Definition: po.h:188
SINGLE_LIST_ENTRY Free
Definition: po.h:186
LIST_ENTRY Complete
Definition: po.h:190
LIST_ENTRY Abort
Definition: po.h:191
LIST_ENTRY Pending
Definition: po.h:189
LIST_ENTRY Failed
Definition: po.h:192
POP_DEVICE_POWER_IRP PowerIrpState[20]
Definition: po.h:221
BOOLEAN Waking
Definition: po.h:213
PDEVICE_OBJECT FailedDevice
Definition: po.h:212
BOOLEAN Cancelled
Definition: po.h:214
POP_DEVICE_POWER_IRP Head
Definition: po.h:220
BOOLEAN _WaitAll
Definition: po.h:218
BOOLEAN IgnoreNotImplemented
Definition: po.h:216
BOOLEAN _WaitAny
Definition: po.h:217
UCHAR IrpMinor
Definition: po.h:204
BOOLEAN GetNewDeviceList
Definition: po.h:209
PKEVENT Event
Definition: po.h:206
SYSTEM_POWER_STATE SystemState
Definition: po.h:205
NTSTATUS Status
Definition: po.h:211
PO_DEVICE_NOTIFY_ORDER Order
Definition: po.h:210
LIST_ENTRY PresentIrpQueue
Definition: po.h:219
KSPIN_LOCK SpinLock
Definition: po.h:207
PKTHREAD Thread
Definition: po.h:208
BOOLEAN IgnoreErrors
Definition: po.h:215
PKPROCESSOR_STATE WakeState
Definition: po.h:143
UCHAR HiberFlags
Definition: po.h:124
PKSPIN_LOCK Lock
Definition: po.h:127
PHYSICAL_ADDRESS HiberPte
Definition: po.h:146
ULONG NoRanges
Definition: po.h:144
BOOLEAN ReserveLoaderMemory
Definition: po.h:120
ULONGLONG PagesOut
Definition: po.h:139
PVOID CurrentMcb
Definition: po.h:141
PFN_NUMBER NextPreserve
Definition: po.h:133
NTSTATUS Status
Definition: po.h:147
PPO_MEMORY_IMAGE MemoryImage
Definition: po.h:148
ULONG ClonedRangeCount
Definition: po.h:131
BOOLEAN VerifyOnWake
Definition: po.h:122
PVOID CompressionWorkspace
Definition: po.h:150
PVOID TemporaryHeap
Definition: po.h:155
LIST_ENTRY ClonedRanges
Definition: po.h:130
BOOLEAN Reset
Definition: po.h:123
PMDL LoaderMdl
Definition: po.h:134
PULONG PerformanceStats
Definition: po.h:152
RTL_BITMAP MemoryMap
Definition: po.h:129
PVOID CompressionBlock
Definition: po.h:153
BOOLEAN MapFrozen
Definition: po.h:128
BOOLEAN LinkFile
Definition: po.h:125
BOOLEAN WriteToFile
Definition: po.h:119
PMDL Spares
Definition: po.h:138
PUCHAR NextClone
Definition: po.h:136
ULONG_PTR HiberVa
Definition: po.h:145
PO_HIBER_PERF PerfInfo
Definition: po.h:156
PVOID DmaIO
Definition: po.h:154
BOOLEAN ReserveFreeMemory
Definition: po.h:121
PUCHAR CompressedWriteBuffer
Definition: po.h:151
PLIST_ENTRY NextCloneRange
Definition: po.h:132
PVOID IoPage
Definition: po.h:140
PMDL Clones
Definition: po.h:135
ULONG NoClones
Definition: po.h:137
PVOID DumpStack
Definition: po.h:142
PPO_MEMORY_RANGE_ARRAY TableHead
Definition: po.h:149
HANDLE LinkFileHandle
Definition: po.h:126
ULONGLONG SleepTime
Definition: po.h:240
UCHAR Updates
Definition: po.h:226
SYSTEM_POWER_STATE NextSystemState
Definition: po.h:235
PPOP_SHUTDOWN_BUG_CHECK ShutdownBugCode
Definition: po.h:236
PPOP_DEVICE_SYS_STATE DevState
Definition: po.h:237
ULONG Flags
Definition: po.h:231
SYSTEM_POWER_STATE SystemState
Definition: po.h:234
SYSTEM_POWER_STATE LightestState
Definition: po.h:230
UCHAR IrpMinor
Definition: po.h:233
UCHAR State
Definition: po.h:227
POWER_ACTION Action
Definition: po.h:229
ULONGLONG WakeTime
Definition: po.h:239
BOOLEAN Shutdown
Definition: po.h:228
NTSTATUS Status
Definition: po.h:232
PPOP_HIBER_CONTEXT HiberContext
Definition: po.h:238
ULONG_PTR Parameter1
Definition: po.h:178
ULONG_PTR Parameter4
Definition: po.h:181
HANDLE ProcessId
Definition: po.h:176
HANDLE ThreadHandle
Definition: po.h:174
ULONG_PTR Parameter2
Definition: po.h:179
ULONG_PTR Parameter3
Definition: po.h:180
Definition: po.h:272
struct _POP_SHUTDOWN_WAIT_ENTRY * NextEntry
Definition: po.h:273
PETHREAD Thread
Definition: po.h:274
LIST_ENTRY NotifyList
Definition: po.h:254
ULONG TotalCount
Definition: po.h:252
ULONG DevNodeSequence
Definition: po.h:197
PDEVICE_OBJECT * WarmEjectPdoPointer
Definition: po.h:198
PO_NOTIFY_ORDER_LEVEL OrderLevel[8]
Definition: po.h:199
ULONGLONG StartCount
Definition: po.h:54
ULONG BytesCopied
Definition: po.h:61
ULONG CopyTime
Definition: po.h:57
ULONGLONG InitTicks
Definition: po.h:52
ULONG PagesWritten
Definition: po.h:59
ULONGLONG CopyTicks
Definition: po.h:53
ULONG IoTime
Definition: po.h:56
ULONG InitTime
Definition: po.h:58
ULONGLONG IoTicks
Definition: po.h:51
ULONG PagesProcessed
Definition: po.h:60
ULONG FileRuns
Definition: po.h:63
ULONG ElapsedTime
Definition: po.h:55
ULONG DumpCount
Definition: po.h:62
PFN_NUMBER FirstTablePage
Definition: po.h:87
ULONG Version
Definition: po.h:69
ULONG FreeMapCheck
Definition: po.h:84
UCHAR spare[3]
Definition: po.h:79
ULONG FeatureFlags
Definition: po.h:77
PO_HIBER_PERF PerfInfo
Definition: po.h:89
ULONG PageSize
Definition: po.h:73
PFN_NUMBER LastFilePage
Definition: po.h:88
LARGE_INTEGER SystemTime
Definition: po.h:75
ULONG Signature
Definition: po.h:68
PHYSICAL_ADDRESS HiberPte
Definition: po.h:82
ULONGLONG InterruptTime
Definition: po.h:76
UCHAR HiberFlags
Definition: po.h:78
PFN_NUMBER TotalPages
Definition: po.h:86
ULONG NoFreePages
Definition: po.h:83
ULONG NoHiberPtes
Definition: po.h:80
ULONG CheckSum
Definition: po.h:70
ULONG_PTR HiberVa
Definition: po.h:81
ULONG WakeCheck
Definition: po.h:85
PFN_NUMBER PageSelf
Definition: po.h:72
ULONG ImageType
Definition: po.h:74
ULONG LengthSelf
Definition: po.h:71
PFN_NUMBER EndPage
Definition: po.h:96
PFN_NUMBER StartPage
Definition: po.h:95
PFN_NUMBER PageNo
Definition: po.h:94
PO_MEMORY_RANGE_ARRAY_RANGE Range
Definition: po.h:112
PO_MEMORY_RANGE_ARRAY_LINK Link
Definition: po.h:113
ULONG DeviceCount
Definition: po.h:162
LIST_ENTRY WaitSleep
Definition: po.h:164
LIST_ENTRY ReadyS0
Definition: po.h:168
LIST_ENTRY Pending
Definition: po.h:166
LIST_ENTRY ReadySleep
Definition: po.h:165
LIST_ENTRY Complete
Definition: po.h:167
ULONG ActiveCount
Definition: po.h:163
LIST_ENTRY WaitS0
Definition: po.h:169
KEVENT LevelReady
Definition: po.h:161
Definition: ntbasedef.h:636
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3034
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1206
unsigned char UCHAR
Definition: xmlstorage.h:181