kernel: Add support and interface for cpufreq modules
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _CPUFREQ_H
|
||||
#define _CPUFREQ_H
|
||||
|
||||
|
||||
#include <module.h>
|
||||
|
||||
|
||||
#define CPUFREQ_MODULES_PREFIX "power/cpufreq"
|
||||
|
||||
|
||||
const int kCPUPerformanceScaleMax = 1000;
|
||||
|
||||
typedef struct cpufreq_module_info {
|
||||
module_info info;
|
||||
|
||||
status_t (*increase_performance)(int delta, bool allowBoost);
|
||||
status_t (*decrease_performance)(int delta);
|
||||
} cpufreq_module_info;
|
||||
|
||||
|
||||
#endif // _CPUFREQ_H
|
||||
|
||||
@@ -104,6 +104,9 @@ extern inline cpu_ent *get_cpu_struct(void) { return &gCPU[smp_get_current_cpu()
|
||||
status_t cpu_build_topology_tree(void);
|
||||
cpu_topology_node* get_cpu_topology(void);
|
||||
|
||||
status_t increase_cpu_performance(int delta, bool allowBoost);
|
||||
status_t decrease_cpu_performance(int delta);
|
||||
|
||||
void _user_clear_caches(void *address, size_t length, uint32 flags);
|
||||
bool _user_cpu_enabled(int32 cpu);
|
||||
status_t _user_set_cpu_enabled(int32 cpu, bool enabled);
|
||||
|
||||
Reference in New Issue
Block a user