1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef POWER_MANAGER_H_
6 #define POWER_MANAGER_H_
12 /* Maximum number of CPUS to manage */
13 #define POWER_MGR_MAX_CPUS 64
15 * Initialize power management.
16 * Initializes resources and verifies the number of CPUs on the system.
17 * Wraps librte_power int rte_power_init(unsigned lcore_id);
21 * - Negative on error.
23 int power_manager_init(void);
26 * Exit power management. Must be called prior to exiting the application.
30 * - Negative on error.
32 int power_manager_exit(void);
35 * Scale up the frequency of the cores specified in core_mask.
39 * The uint64_t bit-mask of cores to change frequency.
43 * - Negative on error.
45 int power_manager_scale_mask_up(uint64_t core_mask);
48 * Scale down the frequency of the cores specified in core_mask.
52 * The uint64_t bit-mask of cores to change frequency.
56 * - Negative on error.
58 int power_manager_scale_mask_down(uint64_t core_mask);
61 * Scale to the minimum frequency of the cores specified in core_mask.
65 * The uint64_t bit-mask of cores to change frequency.
69 * - Negative on error.
71 int power_manager_scale_mask_min(uint64_t core_mask);
74 * Scale to the maximum frequency of the cores specified in core_mask.
78 * The uint64_t bit-mask of cores to change frequency.
82 * - Negative on error.
84 int power_manager_scale_mask_max(uint64_t core_mask);
87 * Enable Turbo Boost on the cores specified in core_mask.
91 * The uint64_t bit-mask of cores to change frequency.
95 * - Negative on error.
97 int power_manager_enable_turbo_mask(uint64_t core_mask);
100 * Disable Turbo Boost on the cores specified in core_mask.
104 * The uint64_t bit-mask of cores to change frequency.
108 * - Negative on error.
110 int power_manager_disable_turbo_mask(uint64_t core_mask);
113 * Scale up frequency for the core specified by core_num.
117 * The core number to change frequency
121 * - Negative on error.
123 int power_manager_scale_core_up(unsigned core_num);
126 * Scale down frequency for the core specified by core_num.
130 * The core number to change frequency
134 * - 0 if frequency not changed.
135 * - Negative on error.
137 int power_manager_scale_core_down(unsigned core_num);
140 * Scale to minimum frequency for the core specified by core_num.
144 * The core number to change frequency
148 * - 0 if frequency not changed.
149 * - Negative on error.
151 int power_manager_scale_core_min(unsigned core_num);
154 * Scale to maximum frequency for the core specified by core_num.
158 * The core number to change frequency
162 * - 0 if frequency not changed.
163 * - Negative on error.
165 int power_manager_scale_core_max(unsigned core_num);
168 * Enable Turbo Boost for the core specified by core_num.
172 * The core number to boost
176 * - Negative on error.
178 int power_manager_enable_turbo_core(unsigned int core_num);
181 * Disable Turbo Boost for the core specified by core_num.
185 * The core number to boost
189 * - Negative on error.
191 int power_manager_disable_turbo_core(unsigned int core_num);
194 * Get the current freuency of the core specified by core_num
197 * The core number to get the current frequency
201 * - >0 for current frequency.
203 uint32_t power_manager_get_current_frequency(unsigned core_num);
206 * Scale to medium frequency for the core specified by core_num.
210 * The core number to change frequency
214 * - 0 if frequency not changed.
215 * - Negative on error.
217 int power_manager_scale_core_med(unsigned int core_num);
224 #endif /* POWER_MANAGER_H_ */