aboutsummaryrefslogtreecommitdiffstats
path: root/cputemp2maxfreq.h
diff options
context:
space:
mode:
authorPA4WDH2023-05-20 19:27:47 +0200
committerPA4WDH2023-05-20 19:27:47 +0200
commit48ec55bd19362c5b8f7d06f7678321c3535672f4 (patch)
tree7a8ec313dd0aea97a56697e844aa99cd6c25cf03 /cputemp2maxfreq.h
parentTranslate POC to C code (diff)
downloadcputemp2maxfreq-48ec55bd19362c5b8f7d06f7678321c3535672f4.tar.gz
cputemp2maxfreq-48ec55bd19362c5b8f7d06f7678321c3535672f4.tar.bz2
cputemp2maxfreq-48ec55bd19362c5b8f7d06f7678321c3535672f4.zip
Add validation and fallback to startup
Diffstat (limited to 'cputemp2maxfreq.h')
-rw-r--r--cputemp2maxfreq.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/cputemp2maxfreq.h b/cputemp2maxfreq.h
new file mode 100644
index 0000000..ef33fd5
--- /dev/null
+++ b/cputemp2maxfreq.h
@@ -0,0 +1,17 @@
+struct s_cpudata {
+ long int min_freq; // CPU's minimum frequency
+ long int max_freq; // CPU's maximum frequency
+ long int cur_freq; // CPU's current frequency
+ long int cur_temp; // CPU's current temperature
+ long int scale_max; // Governor's maximum scaling frequency
+};
+
+struct s_config {
+ char *governor; // The governor to use
+ long int max_temp; // The target temperature
+ char *temp_input; // Input file to read the temperature
+ long int freq_step; // Step size to increase/decrease CPU frequency
+ long int fallback_freq; // CPU frquency to set if we fail to protect hardware
+ unsigned int interval; // Time interval to check CPU temperature
+};
+