power.h 964 B

12345678910111213141516171819202122232425262728
  1. /* Intel Nehalem/Westmere P-state and deep C-state management. */
  2. #ifndef POWER_H
  3. #define POWER_H
  4. #define POWER_CPUFREQ_AUTO 0
  5. #define POWER_CPUFREQ_MIN 1
  6. #define POWER_CPUFREQ_MAX 2
  7. #define POWER_CPUFREQ_FIXED 3
  8. #define POWER_CPUFREQ_OFF 4
  9. /* Probe the CPU and MSRs, enable SpeedStep/C1E/C6 and start at the maximum
  10. * non-turbo ratio. Called once on the BSP before idle_init(); logs to COM1
  11. * and is a no-op on CPUs outside the Nehalem/Westmere allowlist. */
  12. void power_init(void);
  13. /* Once per scheduler tick with the CPU's idle flag and the tick length. */
  14. void power_tick(int idle, unsigned int ms);
  15. /* Deep C-state hint for idle.c's automatic mode: -1 = use HLT, otherwise
  16. * the MWAIT hint (0x20 C6; 0x01 C1E on an AP whose local timer stops). */
  17. int power_idle_hint(void);
  18. /* `power` / `cpufreq` command support (terminal.c). */
  19. void power_print(void);
  20. int power_cpufreq_command(const char *arg);
  21. const char *power_cpufreq_name(void);
  22. #endif