summaryrefslogtreecommitdiffstats
path: root/patches/cpufrequtils-008
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-05-22 10:27:16 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-05-22 10:27:22 +0200
commit3ff37aa93420689f852db9fd12c113632a405627 (patch)
tree50c57b8894f79c84b4aaa383bf16f9688df6473f /patches/cpufrequtils-008
parent073262f205b8010dcf1179622981b75f8f82c293 (diff)
downloadptxdist-3ff37aa93420689f852db9fd12c113632a405627.tar.gz
ptxdist-3ff37aa93420689f852db9fd12c113632a405627.tar.xz
cpufrequtils: version bump 007 -> 008
Use Debian patches. Libtool is no longer needed so drop the dependency. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/cpufrequtils-008')
-rw-r--r--patches/cpufrequtils-008/0001-Only-x86-has-cpuid-instruction.patch34
-rw-r--r--patches/cpufrequtils-008/0002-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch35
-rw-r--r--patches/cpufrequtils-008/0003-cpufrequtils-sysfs-increase-MAX_LINE_LEN.patch29
-rw-r--r--patches/cpufrequtils-008/0004-aperf-fix-compilation-on-x86-32-with-fPIC.patch46
-rw-r--r--patches/cpufrequtils-008/0005-cpufrequtils-make-NLS-optional.patch91
-rw-r--r--patches/cpufrequtils-008/series8
6 files changed, 243 insertions, 0 deletions
diff --git a/patches/cpufrequtils-008/0001-Only-x86-has-cpuid-instruction.patch b/patches/cpufrequtils-008/0001-Only-x86-has-cpuid-instruction.patch
new file mode 100644
index 000000000..02c459f82
--- /dev/null
+++ b/patches/cpufrequtils-008/0001-Only-x86-has-cpuid-instruction.patch
@@ -0,0 +1,34 @@
+From: Zhang Le <r0bertz@gentoo.org>
+Date: Sun, 18 Jul 2010 02:05:28 +0800
+Subject: [PATCH] Only x86 has cpuid instruction
+
+Signed-off-by: Zhang Le <r0bertz@gentoo.org>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+
+Imported from cpufrequtils_008-1.1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ utils/aperf.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/utils/aperf.c b/utils/aperf.c
+index 627fb1722075..1c64501bec9c 100644
+--- a/utils/aperf.c
++++ b/utils/aperf.c
+@@ -68,11 +68,15 @@ struct avg_perf_cpu_info
+
+ static int cpu_has_effective_freq()
+ {
++#if defined(__i386__) || defined(__x86_64__)
+ /* largest base level */
+ if (cpuid_eax(0) < 6)
+ return 0;
+
+ return cpuid_ecx(6) & 0x1;
++#else
++ return 0;
++#endif
+ }
+
+ /*
diff --git a/patches/cpufrequtils-008/0002-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch b/patches/cpufrequtils-008/0002-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch
new file mode 100644
index 000000000..9bf76d0c7
--- /dev/null
+++ b/patches/cpufrequtils-008/0002-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch
@@ -0,0 +1,35 @@
+From: Frank Arnold <frank.arnold@amd.com>
+Date: Wed, 8 Dec 2010 17:39:14 +0100
+Subject: [PATCH] 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 <frank.arnold@amd.com>
+Reviewed-by: Thomas Renninger <trenn@suse.de>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+
+Imported from cpufrequtils_008-1.1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ utils/aperf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/aperf.c b/utils/aperf.c
+index 1c64501bec9c..6302f5a8efcd 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;
diff --git a/patches/cpufrequtils-008/0003-cpufrequtils-sysfs-increase-MAX_LINE_LEN.patch b/patches/cpufrequtils-008/0003-cpufrequtils-sysfs-increase-MAX_LINE_LEN.patch
new file mode 100644
index 000000000..3feab9fa7
--- /dev/null
+++ b/patches/cpufrequtils-008/0003-cpufrequtils-sysfs-increase-MAX_LINE_LEN.patch
@@ -0,0 +1,29 @@
+From: Roman Vasiyarov <rvasiyarov@gmail.com>
+Date: Mon, 25 Apr 2011 21:34:23 +0400
+Subject: [PATCH] cpufrequtils sysfs: increase MAX_LINE_LEN
+
+larger sysfs data (>255 bytes) was truncated and thus used improperly
+
+Signed-off-by: Roman Vasiyarov <rvasiyarov@gmail.com>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+
+Imported from cpufrequtils_008-1.1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ lib/sysfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/sysfs.c b/lib/sysfs.c
+index 4e0edabc0e1a..24dd56315abd 100644
+--- a/lib/sysfs.c
++++ b/lib/sysfs.c
+@@ -18,7 +18,7 @@
+ #include "cpufreq.h"
+
+ #define PATH_TO_CPU "/sys/devices/system/cpu/"
+-#define MAX_LINE_LEN 255
++#define MAX_LINE_LEN 4096
+ #define SYSFS_PATH_MAX 255
+
+ /* helper function to read file from /sys into given buffer */
diff --git a/patches/cpufrequtils-008/0004-aperf-fix-compilation-on-x86-32-with-fPIC.patch b/patches/cpufrequtils-008/0004-aperf-fix-compilation-on-x86-32-with-fPIC.patch
new file mode 100644
index 000000000..2cb893363
--- /dev/null
+++ b/patches/cpufrequtils-008/0004-aperf-fix-compilation-on-x86-32-with-fPIC.patch
@@ -0,0 +1,46 @@
+From: Matt Turner <mattst88@gmail.com>
+Date: Tue, 26 Jul 2011 19:28:31 -0400
+Subject: [PATCH] aperf: fix compilation on x86-32 with -fPIC
+
+ebx is used to store the GOT pointer when compiled with -fPIC, so it's
+not usable by inline assembly.
+
+https://bugs.gentoo.org/375967
+
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+
+Imported from cpufrequtils_008-1.1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ utils/cpuid.h | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/utils/cpuid.h b/utils/cpuid.h
+index 2bac69aa6afb..53da789ff9aa 100644
+--- a/utils/cpuid.h
++++ b/utils/cpuid.h
+@@ -5,9 +5,21 @@ static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+ {
+ /* ecx is often an input as well as an output. */
+- asm volatile("cpuid"
++ asm volatile(
++#if defined(__i386__) && defined(__PIC__)
++ "push %%ebx\n"
++ "cpuid\n"
++ "movl %%ebx, %1\n"
++ "pop %%ebx\n"
++#else
++ "cpuid\n"
++#endif
+ : "=a" (*eax),
++#if defined(__i386__) && defined(__PIC__)
++ "=r" (*ebx),
++#else
+ "=b" (*ebx),
++#endif
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (*eax), "2" (*ecx));
diff --git a/patches/cpufrequtils-008/0005-cpufrequtils-make-NLS-optional.patch b/patches/cpufrequtils-008/0005-cpufrequtils-make-NLS-optional.patch
new file mode 100644
index 000000000..93c8cb229
--- /dev/null
+++ b/patches/cpufrequtils-008/0005-cpufrequtils-make-NLS-optional.patch
@@ -0,0 +1,91 @@
+From: Sergey Dryabzhinsky <sergey.dryabzhinsky@gmail.com>
+Date: Sat, 13 Aug 2011 23:02:20 -0400
+Subject: [PATCH] cpufrequtils: make NLS optional
+
+https://bugs.gentoo.org/205576
+
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+
+Imported from cpufrequtils_008-1.1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile | 1 +
+ utils/info.c | 10 +++++++++-
+ utils/set.c | 10 +++++++++-
+ 3 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3ef2af762e1f..83963cf30bf5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -140,6 +140,7 @@ endif
+ ifeq ($(strip $(NLS)),true)
+ INSTALL_NLS += install-gmo
+ COMPILE_NLS += update-gmo
++ CPPFLAGS += -DNLS
+ endif
+
+ ifeq ($(strip $(CPUFRQ_BENCH)),true)
+diff --git a/utils/info.c b/utils/info.c
+index 38d906abdc41..155e604f59fb 100644
+--- a/utils/info.c
++++ b/utils/info.c
+@@ -10,7 +10,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <libintl.h>
+ #include <locale.h>
+
+ #include <getopt.h>
+@@ -18,9 +17,18 @@
+ #include "cpufreq.h"
+
+
++#ifdef NLS
++#include <libintl.h>
+ #define _(String) gettext (String)
+ #define gettext_noop(String) String
+ #define N_(String) gettext_noop (String)
++#else
++#define gettext_noop(String) String
++#define _(String) gettext_noop (String)
++#define gettext(String) gettext_noop (String)
++#define N_(String) gettext_noop (String)
++#define textdomain(String)
++#endif
+
+ #define LINE_LEN 10
+
+diff --git a/utils/set.c b/utils/set.c
+index 2ece47e46115..bfca4656088a 100644
+--- a/utils/set.c
++++ b/utils/set.c
+@@ -12,16 +12,24 @@
+ #include <limits.h>
+ #include <string.h>
+ #include <ctype.h>
+-#include <libintl.h>
+ #include <locale.h>
+
+ #include <getopt.h>
+
+ #include "cpufreq.h"
+
++#ifdef NLS
++#include <libintl.h>
+ #define _(String) gettext(String)
+ #define gettext_noop(String) String
+ #define N_(String) gettext_noop(String)
++#else
++#define gettext_noop(String) String
++#define _(String) gettext_noop (String)
++#define gettext(String) gettext_noop (String)
++#define N_(String) gettext_noop (String)
++#define textdomain(String)
++#endif
+
+ #define NORM_FREQ_LEN 32
+
diff --git a/patches/cpufrequtils-008/series b/patches/cpufrequtils-008/series
new file mode 100644
index 000000000..d6fcb0efd
--- /dev/null
+++ b/patches/cpufrequtils-008/series
@@ -0,0 +1,8 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Only-x86-has-cpuid-instruction.patch
+0002-cpufrequtils-aperf-Fix-MSR-read-on-32-bit.patch
+0003-cpufrequtils-sysfs-increase-MAX_LINE_LEN.patch
+0004-aperf-fix-compilation-on-x86-32-with-fPIC.patch
+0005-cpufrequtils-make-NLS-optional.patch
+# 0b44226bbec265cef7765c7bc627caf9 - git-ptx-patches magic