ReactOS 0.4.15-dev-5672-gf73ac17
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
36typedef struct _PO_HIBER_PERF
37{
52
53typedef struct _PO_MEMORY_IMAGE
54{
78
80{
86
88{
94
96{
97 union
98 {
101 };
103
104typedef struct _POP_HIBER_CONTEXT
105{
145
147{
158
160{
170
172{
181
183{
188
190{
210
211typedef struct _POP_POWER_ACTION
212{
229
231{
235
237{
243
245{
257
259{
263
264//
265// Initialization routines
266//
267CODE_SEG("INIT")
269NTAPI
271 IN ULONG BootPhase
272);
273
274CODE_SEG("INIT")
275VOID
276NTAPI
278 IN PKPRCB Prcb
279);
280
281VOID
282NTAPI
284 VOID
285);
286
287//
288// I/O Routines
289//
290VOID
291NTAPI
293 IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension
294);
295
296VOID
297NTAPI
300);
301
302VOID
303NTAPI
306
307//
308// Power State routines
309//
311NTAPI
314 POWER_ACTION PowerAction
315);
316
317VOID
318NTAPI
321);
322
324NTAPI
328);
329
330//
331// Notifications
332//
333VOID
334NTAPI
336 VOID
337);
338
339//
340// Shutdown routines
341//
342VOID
343NTAPI
345 VOID
346);
347
348VOID
349NTAPI
352);
353
354VOID
355NTAPI
357 IN BOOLEAN ShuttingDown
358);
359
360//
361// Global data inside the Power Manager
362//
369
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
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
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:318
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
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_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:231
@ DeviceIdleDisk
Definition: po.h:233
@ DeviceIdleNormal
Definition: po.h:232
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:498
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:247
ULONG PFN_NUMBER
Definition: ke.h:9
LIST_ENTRY NotifyTargetList
Definition: po.h:253
LIST_ENTRY NotifySourceList
Definition: po.h:252
POWER_CHANNEL_SUMMARY PowerChannelSummary
Definition: po.h:254
DEVICE_POWER_STATE State
Definition: po.h:251
PDEVICE_OBJECT DeviceObject
Definition: po.h:249
Definition: typedefs.h:120
PPO_DEVICE_NOTIFY Notify
Definition: po.h:175
SINGLE_LIST_ENTRY Free
Definition: po.h:173
LIST_ENTRY Complete
Definition: po.h:177
LIST_ENTRY Abort
Definition: po.h:178
LIST_ENTRY Pending
Definition: po.h:176
LIST_ENTRY Failed
Definition: po.h:179
POP_DEVICE_POWER_IRP PowerIrpState[20]
Definition: po.h:208
BOOLEAN Waking
Definition: po.h:200
PDEVICE_OBJECT FailedDevice
Definition: po.h:199
BOOLEAN Cancelled
Definition: po.h:201
POP_DEVICE_POWER_IRP Head
Definition: po.h:207
BOOLEAN _WaitAll
Definition: po.h:205
BOOLEAN IgnoreNotImplemented
Definition: po.h:203
BOOLEAN _WaitAny
Definition: po.h:204
UCHAR IrpMinor
Definition: po.h:191
BOOLEAN GetNewDeviceList
Definition: po.h:196
PKEVENT Event
Definition: po.h:193
SYSTEM_POWER_STATE SystemState
Definition: po.h:192
NTSTATUS Status
Definition: po.h:198
PO_DEVICE_NOTIFY_ORDER Order
Definition: po.h:197
LIST_ENTRY PresentIrpQueue
Definition: po.h:206
KSPIN_LOCK SpinLock
Definition: po.h:194
PKTHREAD Thread
Definition: po.h:195
BOOLEAN IgnoreErrors
Definition: po.h:202
PKPROCESSOR_STATE WakeState
Definition: po.h:130
UCHAR HiberFlags
Definition: po.h:111
PKSPIN_LOCK Lock
Definition: po.h:114
PHYSICAL_ADDRESS HiberPte
Definition: po.h:133
ULONG NoRanges
Definition: po.h:131
BOOLEAN ReserveLoaderMemory
Definition: po.h:107
ULONGLONG PagesOut
Definition: po.h:126
PVOID CurrentMcb
Definition: po.h:128
PFN_NUMBER NextPreserve
Definition: po.h:120
NTSTATUS Status
Definition: po.h:134
PPO_MEMORY_IMAGE MemoryImage
Definition: po.h:135
ULONG ClonedRangeCount
Definition: po.h:118
BOOLEAN VerifyOnWake
Definition: po.h:109
PVOID CompressionWorkspace
Definition: po.h:137
PVOID TemporaryHeap
Definition: po.h:142
LIST_ENTRY ClonedRanges
Definition: po.h:117
BOOLEAN Reset
Definition: po.h:110
PMDL LoaderMdl
Definition: po.h:121
PULONG PerformanceStats
Definition: po.h:139
RTL_BITMAP MemoryMap
Definition: po.h:116
PVOID CompressionBlock
Definition: po.h:140
BOOLEAN MapFrozen
Definition: po.h:115
BOOLEAN LinkFile
Definition: po.h:112
BOOLEAN WriteToFile
Definition: po.h:106
PMDL Spares
Definition: po.h:125
PUCHAR NextClone
Definition: po.h:123
ULONG_PTR HiberVa
Definition: po.h:132
PO_HIBER_PERF PerfInfo
Definition: po.h:143
PVOID DmaIO
Definition: po.h:141
BOOLEAN ReserveFreeMemory
Definition: po.h:108
PUCHAR CompressedWriteBuffer
Definition: po.h:138
PLIST_ENTRY NextCloneRange
Definition: po.h:119
PVOID IoPage
Definition: po.h:127
PMDL Clones
Definition: po.h:122
ULONG NoClones
Definition: po.h:124
PVOID DumpStack
Definition: po.h:129
PPO_MEMORY_RANGE_ARRAY TableHead
Definition: po.h:136
HANDLE LinkFileHandle
Definition: po.h:113
ULONGLONG SleepTime
Definition: po.h:227
UCHAR Updates
Definition: po.h:213
SYSTEM_POWER_STATE NextSystemState
Definition: po.h:222
PPOP_SHUTDOWN_BUG_CHECK ShutdownBugCode
Definition: po.h:223
PPOP_DEVICE_SYS_STATE DevState
Definition: po.h:224
ULONG Flags
Definition: po.h:218
SYSTEM_POWER_STATE SystemState
Definition: po.h:221
SYSTEM_POWER_STATE LightestState
Definition: po.h:217
UCHAR IrpMinor
Definition: po.h:220
UCHAR State
Definition: po.h:214
POWER_ACTION Action
Definition: po.h:216
ULONGLONG WakeTime
Definition: po.h:226
BOOLEAN Shutdown
Definition: po.h:215
NTSTATUS Status
Definition: po.h:219
PPOP_HIBER_CONTEXT HiberContext
Definition: po.h:225
ULONG_PTR Parameter1
Definition: po.h:165
ULONG_PTR Parameter4
Definition: po.h:168
HANDLE ProcessId
Definition: po.h:163
HANDLE ThreadHandle
Definition: po.h:161
ULONG_PTR Parameter2
Definition: po.h:166
ULONG_PTR Parameter3
Definition: po.h:167
Definition: po.h:259
struct _POP_SHUTDOWN_WAIT_ENTRY * NextEntry
Definition: po.h:260
PETHREAD Thread
Definition: po.h:261
LIST_ENTRY NotifyList
Definition: po.h:241
ULONG TotalCount
Definition: po.h:239
ULONG DevNodeSequence
Definition: po.h:184
PDEVICE_OBJECT * WarmEjectPdoPointer
Definition: po.h:185
PO_NOTIFY_ORDER_LEVEL OrderLevel[8]
Definition: po.h:186
ULONGLONG StartCount
Definition: po.h:41
ULONG BytesCopied
Definition: po.h:48
ULONG CopyTime
Definition: po.h:44
ULONGLONG InitTicks
Definition: po.h:39
ULONG PagesWritten
Definition: po.h:46
ULONGLONG CopyTicks
Definition: po.h:40
ULONG IoTime
Definition: po.h:43
ULONG InitTime
Definition: po.h:45
ULONGLONG IoTicks
Definition: po.h:38
ULONG PagesProcessed
Definition: po.h:47
ULONG FileRuns
Definition: po.h:50
ULONG ElapsedTime
Definition: po.h:42
ULONG DumpCount
Definition: po.h:49
PFN_NUMBER FirstTablePage
Definition: po.h:74
ULONG Version
Definition: po.h:56
ULONG FreeMapCheck
Definition: po.h:71
UCHAR spare[3]
Definition: po.h:66
ULONG FeatureFlags
Definition: po.h:64
PO_HIBER_PERF PerfInfo
Definition: po.h:76
ULONG PageSize
Definition: po.h:60
PFN_NUMBER LastFilePage
Definition: po.h:75
LARGE_INTEGER SystemTime
Definition: po.h:62
ULONG Signature
Definition: po.h:55
PHYSICAL_ADDRESS HiberPte
Definition: po.h:69
ULONGLONG InterruptTime
Definition: po.h:63
UCHAR HiberFlags
Definition: po.h:65
PFN_NUMBER TotalPages
Definition: po.h:73
ULONG NoFreePages
Definition: po.h:70
ULONG NoHiberPtes
Definition: po.h:67
ULONG CheckSum
Definition: po.h:57
ULONG_PTR HiberVa
Definition: po.h:68
ULONG WakeCheck
Definition: po.h:72
PFN_NUMBER PageSelf
Definition: po.h:59
ULONG ImageType
Definition: po.h:61
ULONG LengthSelf
Definition: po.h:58
PFN_NUMBER EndPage
Definition: po.h:83
PFN_NUMBER StartPage
Definition: po.h:82
PFN_NUMBER PageNo
Definition: po.h:81
PO_MEMORY_RANGE_ARRAY_RANGE Range
Definition: po.h:99
PO_MEMORY_RANGE_ARRAY_LINK Link
Definition: po.h:100
ULONG DeviceCount
Definition: po.h:149
LIST_ENTRY WaitSleep
Definition: po.h:151
LIST_ENTRY ReadyS0
Definition: po.h:155
LIST_ENTRY Pending
Definition: po.h:153
LIST_ENTRY ReadySleep
Definition: po.h:152
LIST_ENTRY Complete
Definition: po.h:154
ULONG ActiveCount
Definition: po.h:150
LIST_ENTRY WaitS0
Definition: po.h:156
KEVENT LevelReady
Definition: po.h:148
Definition: ntbasedef.h:628
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