From 862c741a3ccc0936ce80840bad3937dec6a52c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 2 Dec 2014 09:52:11 +0000 Subject: main/cpufrequtils: apply upstream commits to fix arm build and also the other issues we were already patching for. --- ...cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 main/cpufrequtils/0003-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch (limited to 'main/cpufrequtils/0003-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch') diff --git a/main/cpufrequtils/0003-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch b/main/cpufrequtils/0003-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch new file mode 100644 index 000000000..308e73a5b --- /dev/null +++ b/main/cpufrequtils/0003-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch @@ -0,0 +1,35 @@ +From d4490efed068a552e8b67d52a0726458a224c9a0 Mon Sep 17 00:00:00 2001 +From: Frank Arnold +Date: Wed, 8 Dec 2010 17:39:14 +0100 +Subject: [PATCH 3/8] cpufrequtils aperf: Fix MSR read on 32-bit + +The cpufreq-aperf command does not work on 32-bit systems. The reason +for that is a wrong count argument passed to the read() call. Instead +of the buffer size, the size of the pointer to the buffer is used. On +64-bit systems this just happened to work, because we need to read an +8 byte value and a pointer has a size of 8 bytes on 64-bit. On 32-bit +systems only 4 bytes are read, which then triggers the error path. + +Signed-off-by: Frank Arnold +Reviewed-by: Thomas Renninger +Signed-off-by: Dominik Brodowski +--- + utils/aperf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/aperf.c b/utils/aperf.c +index 1c64501..6302f5a 100644 +--- a/utils/aperf.c ++++ b/utils/aperf.c +@@ -100,7 +100,7 @@ static int read_msr(int cpu, unsigned int idx, unsigned long long *val) + return -1; + if (lseek(fd, idx, SEEK_CUR) == -1) + goto err; +- if (read(fd, val, sizeof val) != sizeof *val) ++ if (read(fd, val, sizeof *val) != sizeof *val) + goto err; + close(fd); + return 0; +-- +1.7.10 + -- cgit v1.2.3