17fe2f639SDominik Brodowski #ifndef __CPUPOWER_HELPERS_SYSFS_H__ 27fe2f639SDominik Brodowski #define __CPUPOWER_HELPERS_SYSFS_H__ 37fe2f639SDominik Brodowski 47fe2f639SDominik Brodowski #define PATH_TO_CPU "/sys/devices/system/cpu/" 57fe2f639SDominik Brodowski #define MAX_LINE_LEN 255 67fe2f639SDominik Brodowski #define SYSFS_PATH_MAX 255 77fe2f639SDominik Brodowski 87fe2f639SDominik Brodowski extern unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen); 97fe2f639SDominik Brodowski 100924c369SThomas Renninger extern unsigned int sysfs_idlestate_file_exists(unsigned int cpu, 110924c369SThomas Renninger unsigned int idlestate, 120924c369SThomas Renninger const char *fname); 130924c369SThomas Renninger 147c74d2bcSThomas Renninger extern int sysfs_is_cpu_online(unsigned int cpu); 157c74d2bcSThomas Renninger 160924c369SThomas Renninger extern int sysfs_is_idlestate_disabled(unsigned int cpu, 170924c369SThomas Renninger unsigned int idlestate); 180924c369SThomas Renninger extern int sysfs_idlestate_disable(unsigned int cpu, unsigned int idlestate, 190924c369SThomas Renninger unsigned int disable); 202cd005caSDominik Brodowski extern unsigned long sysfs_get_idlestate_latency(unsigned int cpu, 212cd005caSDominik Brodowski unsigned int idlestate); 222cd005caSDominik Brodowski extern unsigned long sysfs_get_idlestate_usage(unsigned int cpu, 232cd005caSDominik Brodowski unsigned int idlestate); 242cd005caSDominik Brodowski extern unsigned long long sysfs_get_idlestate_time(unsigned int cpu, 252cd005caSDominik Brodowski unsigned int idlestate); 262cd005caSDominik Brodowski extern char *sysfs_get_idlestate_name(unsigned int cpu, 272cd005caSDominik Brodowski unsigned int idlestate); 282cd005caSDominik Brodowski extern char *sysfs_get_idlestate_desc(unsigned int cpu, 292cd005caSDominik Brodowski unsigned int idlestate); 30f605181aSThomas Renninger extern unsigned int sysfs_get_idlestate_count(unsigned int cpu); 317fe2f639SDominik Brodowski 327fe2f639SDominik Brodowski extern char *sysfs_get_cpuidle_governor(void); 337fe2f639SDominik Brodowski extern char *sysfs_get_cpuidle_driver(void); 347fe2f639SDominik Brodowski 357fe2f639SDominik Brodowski extern int sysfs_get_sched(const char *smt_mc); 367fe2f639SDominik Brodowski extern int sysfs_set_sched(const char *smt_mc, int val); 377fe2f639SDominik Brodowski 387fe2f639SDominik Brodowski #endif /* __CPUPOWER_HELPERS_SYSFS_H__ */ 39