mirror of
https://github.com/DrHo1y/orangepi-build.git
synced 2026-11-23 18:42:46 +07:00
First Commit
This commit is contained in:
29
external/packages/extras-buildpkgs/htop/debian/patches/fix-cpufreq-meter-on-biglittle.patch
vendored
Normal file
29
external/packages/extras-buildpkgs/htop/debian/patches/fix-cpufreq-meter-on-biglittle.patch
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
diff --git a/CpuFreqMeter.c b/CpuFreqMeter.c
|
||||
index a2f39eb..5436156 100644
|
||||
--- a/CpuFreqMeter.c
|
||||
+++ b/CpuFreqMeter.c
|
||||
@@ -47,9 +47,7 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
|
||||
xSnprintf(buf_b, ln, "%4d MHz", Freq);
|
||||
}
|
||||
|
||||
- cpu--;
|
||||
- if (cpu < 0)
|
||||
- cpu = 0;
|
||||
+ cpu = 0;
|
||||
Freq = Platform_getCpuFreq(this, cpu);
|
||||
if (Freq > 1000) {
|
||||
Freq /= 1000;
|
||||
diff --git a/linux/Platform.c b/linux/Platform.c
|
||||
index e87089c..cd95463 100644
|
||||
--- a/linux/Platform.c
|
||||
+++ b/linux/Platform.c
|
||||
@@ -320,8 +320,7 @@ int Platform_getCpuFreq(Meter* this, int cpu) {
|
||||
}
|
||||
} else {
|
||||
// sleep_ms(30);
|
||||
- // xSnprintf(szbuf, sizeof(szbuf), "/sys/devices/system/cpu/cpufreq/policy%d/cpuinfo_cur_freq", cpu);
|
||||
- xSnprintf(szbuf, sizeof(szbuf), "%s", "/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq");
|
||||
+ xSnprintf(szbuf, sizeof(szbuf), "/sys/devices/system/cpu/cpufreq/policy%d/cpuinfo_cur_freq", cpu);
|
||||
}
|
||||
fd = fopen(szbuf, "r");
|
||||
if (fd) {
|
||||
Reference in New Issue
Block a user