summaryrefslogtreecommitdiff
path: root/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch')
-rw-r--r--sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch b/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch
new file mode 100644
index 000000000000..02e84b725772
--- /dev/null
+++ b/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch
@@ -0,0 +1,17 @@
+make the code work on x86/PIC. this code is only used in the demo,
+and the overhead of always running this is system noise, so don't
+bother bracketing with __i386__/__PIC__ defines.
+
+http://bugs.gentoo.org/456238
+
+--- a/clearcache.c
++++ b/clearcache.c
+@@ -57,7 +57,7 @@ void clearcache(unsigned char *mem, unsigned size)
+ #if defined(__i386__) || defined(__x86_64__)
+ unsigned i, cl, eax, feat;
+ /* get clflush unit and feature */
+- asm("cpuid" : "=a" (eax), "=b" (cl), "=d" (feat) : "0" (1) : "cx");
++ asm("xchg %%ebx, %%esi; cpuid; xchg %%esi, %%ebx;" : "=a" (eax), "=S" (cl), "=d" (feat) : "0" (1) : "cx");
+ if (!(feat & (1 << 19)))
+ fallback_clearcache();
+ cl = ((cl >> 8) & 0xff) * 8;