2017-12-19 15:49:03 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2010-2014 Intel Corporation
|
2014-11-25 16:18:08 +00:00
|
|
|
*/
|
|
|
|
|
2017-12-12 14:03:25 +00:00
|
|
|
#ifndef _POWER_COMMON_H_
|
|
|
|
#define _POWER_COMMON_H_
|
2014-11-25 16:18:08 +00:00
|
|
|
|
2021-07-08 15:38:23 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include <rte_common.h>
|
|
|
|
|
2014-11-25 16:18:08 +00:00
|
|
|
#define RTE_POWER_INVALID_FREQ_INDEX (~0)
|
|
|
|
|
2021-07-08 15:38:23 +00:00
|
|
|
|
|
|
|
#ifdef RTE_LIBRTE_POWER_DEBUG
|
|
|
|
#define POWER_DEBUG_TRACE(fmt, args...) \
|
|
|
|
RTE_LOG(ERR, POWER, "%s: " fmt, __func__, ## args)
|
|
|
|
#else
|
|
|
|
#define POWER_DEBUG_TRACE(fmt, args...)
|
|
|
|
#endif
|
|
|
|
|
2020-06-19 10:53:54 +00:00
|
|
|
/* check if scaling driver matches one we want */
|
|
|
|
int cpufreq_check_scaling_driver(const char *driver);
|
2021-07-08 15:38:23 +00:00
|
|
|
int power_set_governor(unsigned int lcore_id, const char *new_governor,
|
|
|
|
char *orig_governor, size_t orig_governor_len);
|
|
|
|
int open_core_sysfs_file(FILE **f, const char *mode, const char *format, ...)
|
|
|
|
__rte_format_printf(3, 4);
|
|
|
|
int read_core_sysfs_u32(FILE *f, uint32_t *val);
|
|
|
|
int read_core_sysfs_s(FILE *f, char *buf, unsigned int len);
|
|
|
|
int write_core_sysfs_s(FILE *f, const char *str);
|
2020-06-19 10:53:54 +00:00
|
|
|
|
2017-12-12 14:03:25 +00:00
|
|
|
#endif /* _POWER_COMMON_H_ */
|