Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.0 KiB

  1. /*++ BUILD Version: 0000 // Increment this if a change has global effects
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. procpowr.h
  5. Abstract:
  6. This module contains the public (external) header file for the processor
  7. power states required by the PRCB.
  8. Author:
  9. Stephane Plante (splante) 17-Oct-2000
  10. Revision History:
  11. --*/
  12. #ifndef _PROCPOWR_H_
  13. #define _PROCPOWR_H_
  14. //
  15. // Power structure in each processors PRCB
  16. //
  17. struct _PROCESSOR_POWER_STATE; // forward ref
  18. typedef
  19. VOID
  20. (FASTCALL *PPROCESSOR_IDLE_FUNCTION) (
  21. struct _PROCESSOR_POWER_STATE *PState
  22. );
  23. //
  24. // Note: this data structure must contain a number of ULONG such that the
  25. // next structure in the PRCB is aligned on an 16 byte boundary. Currently,
  26. // this means that this structure must have a size that ends on the odd
  27. // eight-byte boundary. In other words, the size of this structure must
  28. // end in 0x8...
  29. //
  30. typedef struct _PROCESSOR_POWER_STATE {
  31. PPROCESSOR_IDLE_FUNCTION IdleFunction;
  32. ULONG Idle0KernelTimeLimit;
  33. ULONG Idle0LastTime;
  34. PVOID IdleHandlers;
  35. PVOID IdleState;
  36. ULONG IdleHandlersCount;
  37. ULONGLONG LastCheck;
  38. PROCESSOR_IDLE_TIMES IdleTimes;
  39. ULONG IdleTime1;
  40. ULONG PromotionCheck;
  41. ULONG IdleTime2;
  42. UCHAR CurrentThrottle; // current throttle setting
  43. UCHAR ThermalThrottleLimit; // max available throttle setting
  44. UCHAR CurrentThrottleIndex;
  45. UCHAR ThermalThrottleIndex;
  46. ULONG PerfSystemTime;
  47. ULONG PerfIdleTime;
  48. // temp for debugging
  49. ULONGLONG DebugDelta;
  50. ULONG DebugCount;
  51. ULONG LastSysTime;
  52. ULONGLONG TotalIdleStateTime[3];
  53. ULONG TotalIdleTransitions[3];
  54. ULONGLONG PreviousC3StateTime;
  55. UCHAR KneeThrottleIndex;
  56. UCHAR ThrottleLimitIndex;
  57. UCHAR PerfStatesCount;
  58. UCHAR ProcessorMinThrottle;
  59. UCHAR ProcessorMaxThrottle;
  60. UCHAR LastBusyPercentage;
  61. UCHAR LastC3Percentage;
  62. UCHAR LastAdjustedBusyPercentage;
  63. ULONG PromotionCount;
  64. ULONG DemotionCount;
  65. ULONG ErrorCount;
  66. ULONG RetryCount;
  67. ULONG Flags;
  68. LARGE_INTEGER PerfCounterFrequency;
  69. ULONG PerfTickCount;
  70. KTIMER PerfTimer;
  71. KDPC PerfDpc;
  72. PPROCESSOR_PERF_STATE PerfStates;
  73. PSET_PROCESSOR_THROTTLE2 PerfSetThrottle;
  74. ULONG Spare1[2];
  75. } PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE;
  76. //
  77. // Processor Power State Flags
  78. //
  79. #define PSTATE_SUPPORTS_THROTTLE 0x01
  80. #define PSTATE_ADAPTIVE_THROTTLE 0x02
  81. #define PSTATE_DEGRADED_THROTTLE 0x04
  82. #define PSTATE_CONSTANT_THROTTLE 0x08
  83. #define PSTATE_NOT_INITIALIZED 0x10
  84. #define PSTATE_DISABLE_THROTTLE_NTAPI 0x20
  85. #define PSTATE_DISABLE_THROTTLE_INRUSH 0x40
  86. //
  87. // Useful masks
  88. //
  89. #define PSTATE_THROTTLE_MASK (PSTATE_ADAPTIVE_THROTTLE | \
  90. PSTATE_DEGRADED_THROTTLE | \
  91. PSTATE_CONSTANT_THROTTLE)
  92. #define PSTATE_CLEAR_MASK (PSTATE_SUPPORTS_THROTTLE | \
  93. PSTATE_THROTTLE_MASK)
  94. #define PSTATE_DISABLE_THROTTLE (PSTATE_DISABLE_THROTTLE_NTAPI | \
  95. PSTATE_DISABLE_THROTTLE_INRUSH)
  96. #endif // _PROCPOWR_H_