summaryrefslogtreecommitdiff
path: root/tools/power/cpupower/utils/helpers/sysfs.h
blob: d28f11fedbdaa0231d2047770fbaffd771c803d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef __CPUPOWER_HELPERS_SYSFS_H__
#define __CPUPOWER_HELPERS_SYSFS_H__

#define PATH_TO_CPU "/sys/devices/system/cpu/"
#define MAX_LINE_LEN 255
#define SYSFS_PATH_MAX 255

extern unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen);

extern unsigned int sysfs_idlestate_file_exists(unsigned int cpu,
						unsigned int idlestate,
						const char *fname);

extern int sysfs_is_cpu_online(unsigned int cpu);

extern int sysfs_is_idlestate_disabled(unsigned int cpu,
				       unsigned int idlestate);
extern int sysfs_idlestate_disable(unsigned int cpu, unsigned int idlestate,
				   unsigned int disable);
extern unsigned long sysfs_get_idlestate_latency(unsigned int cpu,
						unsigned int idlestate);
extern unsigned long sysfs_get_idlestate_usage(unsigned int cpu,
					unsigned int idlestate);
extern unsigned long long sysfs_get_idlestate_time(unsigned int cpu,
						unsigned int idlestate);
extern char *sysfs_get_idlestate_name(unsigned int cpu,
				unsigned int idlestate);
extern char *sysfs_get_idlestate_desc(unsigned int cpu,
				unsigned int idlestate);
extern unsigned int sysfs_get_idlestate_count(unsigned int cpu);

extern char *sysfs_get_cpuidle_governor(void);
extern char *sysfs_get_cpuidle_driver(void);

extern int sysfs_get_sched(const char *smt_mc);
extern int sysfs_set_sched(const char *smt_mc, int val);

#endif /* __CPUPOWER_HELPERS_SYSFS_H__ */
e, by moving some of the FDT manipulation to after the invocation of ExitBootServices(). Given that the stub's libfdt implementation uses the ordinary, accelerated string functions, which rely on hardware handling of unaligned accesses, manipulating the FDT with the MMU off may result in alignment faults. So fix the situation by moving the update_fdt_memmap() call into the callback function invoked by efi_exit_boot_services() right before it calls the ExitBootServices() UEFI service (which is arguably a better place for it anyway) Note that disabling the MMU in ExitBootServices() is not compliant with the UEFI spec, and carries great risk due to the fact that switching from cached to uncached memory accesses halfway through compiler generated code (i.e., involving a stack) can never be done in a way that is architecturally safe. Fixes: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Riku Voipio <riku.voipio@linaro.org> Cc: <stable@vger.kernel.org> Cc: mark.rutland@arm.com Cc: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk Cc: leif.lindholm@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/batman-adv/sysfs.c')