1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef _POWER_COMMON_H_
6 #define _POWER_COMMON_H_
10 #include <rte_common.h>
12 #define RTE_POWER_INVALID_FREQ_INDEX (~0)
15 #ifdef RTE_LIBRTE_POWER_DEBUG
16 #define POWER_DEBUG_TRACE(fmt, args...) \
17 RTE_LOG(ERR, POWER, "%s: " fmt, __func__, ## args)
19 #define POWER_DEBUG_TRACE(fmt, args...)
22 /* check if scaling driver matches one we want */
23 int cpufreq_check_scaling_driver(const char *driver);
24 int power_set_governor(unsigned int lcore_id, const char *new_governor,
25 char *orig_governor, size_t orig_governor_len);
26 int open_core_sysfs_file(FILE **f, const char *mode, const char *format, ...)
27 __rte_format_printf(3, 4);
28 int read_core_sysfs_u32(FILE *f, uint32_t *val);
29 int read_core_sysfs_s(FILE *f, char *buf, unsigned int len);
30 int write_core_sysfs_s(FILE *f, const char *str);
32 #endif /* _POWER_COMMON_H_ */