1 /*++ NDK Version: 0098 2 3 Copyright (c) Alex Ionescu. All rights reserved. 4 5 Header Name: 6 7 potypes.h 8 9 Abstract: 10 11 Type definitions for the Power Subystem 12 13 Author: 14 15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006 16 17 --*/ 18 19 #ifndef _POTYPES_H 20 #define _POTYPES_H 21 22 // 23 // Dependencies 24 // 25 #include <umtypes.h> 26 #ifndef NTOS_MODE_USER 27 #include <ntpoapi.h> 28 #endif 29 30 #ifdef NTOS_MODE_USER 31 // 32 // Information Structures for NtPowerInformation 33 // Copied from ddk\ntpoapi.h 34 // 35 typedef struct _SYSTEM_POWER_INFORMATION 36 { 37 ULONG MaxIdlenessAllowed; 38 ULONG Idleness; 39 ULONG TimeRemaining; 40 UCHAR CoolingMode; 41 } SYSTEM_POWER_INFORMATION, *PSYSTEM_POWER_INFORMATION; 42 #endif 43 44 // 45 // Docking states 46 // 47 typedef enum _SYSTEM_DOCK_STATE 48 { 49 SystemDockStateUnknown, 50 SystemUndocked, 51 SystemDocked 52 } SYSTEM_DOCK_STATE, *PSYSTEM_DOCK_STATE; 53 54 #ifndef NTOS_MODE_USER 55 56 // 57 // Processor Power State Data 58 // 59 struct _PROCESSOR_POWER_STATE; 60 61 typedef 62 VOID 63 (FASTCALL *PPROCESSOR_IDLE_FUNCTION)( 64 struct _PROCESSOR_POWER_STATE *PState); 65 66 typedef struct _PROCESSOR_POWER_STATE 67 { 68 PPROCESSOR_IDLE_FUNCTION IdleFunction; 69 ULONG Idle0KernelTimeLimit; 70 ULONG Idle0LastTime; 71 PVOID IdleHandlers; 72 PVOID IdleState; 73 ULONG IdleHandlersCount; 74 ULONGLONG LastCheck; 75 PROCESSOR_IDLE_TIMES IdleTimes; 76 ULONG IdleTime1; 77 ULONG PromotionCheck; 78 ULONG IdleTime2; 79 UCHAR CurrentThrottle; 80 UCHAR ThermalThrottleLimit; 81 UCHAR CurrentThrottleIndex; 82 UCHAR ThermalThrottleIndex; 83 ULONG LastKernelUserTime; 84 ULONG PerfIdleTime; 85 ULONGLONG DebugDelta; 86 ULONG DebugCount; 87 ULONG LastSysTime; 88 ULONGLONG TotalIdleStateTime[3]; 89 ULONG TotalIdleTransitions[3]; 90 ULONGLONG PreviousC3StateTime; 91 UCHAR KneeThrottleIndex; 92 UCHAR ThrottleLimitIndex; 93 UCHAR PerfStatesCount; 94 UCHAR ProcessorMinThrottle; 95 UCHAR ProcessorMaxThrottle; 96 UCHAR LastBusyPercentage; 97 UCHAR LastC3Percentage; 98 UCHAR LastAdjustedBusyPercentage; 99 ULONG PromotionCount; 100 ULONG DemotionCount; 101 ULONG ErrorCount; 102 ULONG RetryCount; 103 ULONG Flags; 104 LARGE_INTEGER PerfCounterFrequency; 105 ULONG PerfTickCount; 106 KTIMER PerfTimer; 107 KDPC PerfDpc; 108 PROCESSOR_PERF_STATE *PerfStates; 109 PVOID PerfSetThrottle; 110 ULONG LastC3KernelUserTime; 111 ULONG Spare1[1]; 112 } PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE; 113 114 // 115 // Device Notification Structure 116 // 117 typedef struct _PO_DEVICE_NOTIFY 118 { 119 LIST_ENTRY Link; 120 PDEVICE_OBJECT TargetDevice; 121 UCHAR WakeNeeded; 122 UCHAR OrderLevel; 123 PDEVICE_OBJECT DeviceObject; 124 PVOID Node; 125 PUSHORT DeviceName; 126 PUSHORT DriverName; 127 ULONG ChildCount; 128 ULONG ActiveChild; 129 } PO_DEVICE_NOTIFY, *PPO_DEVICE_NOTIFY; 130 131 // 132 // Power IRP Queue 133 // 134 typedef struct _PO_IRP_QUEUE 135 { 136 PIRP CurrentIrp; 137 PIRP PendingIrpList; 138 } PO_IRP_QUEUE, *PPO_IRP_QUEUE; 139 140 // 141 // Power IRP Manager 142 // 143 typedef struct _PO_IRP_MANAGER 144 { 145 PO_IRP_QUEUE DeviceIrpQueue; 146 PO_IRP_QUEUE SystemIrpQueue; 147 } PO_IRP_MANAGER, *PPO_IRP_MANAGER; 148 149 #endif // !NTOS_MODE_USER 150 151 #endif // _POTYPES_H 152