Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / liboil / x86_64-cpuid.patch
blobd86dd79c3bcb83c3181b2fbf99d96792dc2e282c
1 From 705916007fba0a845229a02dc6474cb523eff150 Mon Sep 17 00:00:00 2001
2 From: David Schleef <ds@schleef.org>
3 Date: Tue, 20 Jul 2010 21:05:26 +0000
4 Subject: x86: Fix cpuid function on x86-64
6 Fixes: #28956.
7 ---
8 diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c
9 index e7a1978..ef4d3f2 100644
10 --- a/liboil/liboilcpu-x86.c
11 +++ b/liboil/liboilcpu-x86.c
12 @@ -162,13 +162,10 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
13 static void
14 get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
16 + *a = op;
17 __asm__ (
18 - " pushq %%rbx\n"
19 " cpuid\n"
20 - " mov %%ebx, %%esi\n"
21 - " popq %%rbx\n"
22 - : "=a" (*a), "=S" (*b), "=c" (*c), "=d" (*d)
23 - : "0" (op));
24 + : "+a" (*a), "=b" (*b), "=c" (*c), "=d" (*d));
26 #endif
28 @@ -185,7 +182,7 @@ oil_cpu_detect_cpuid (void)
30 uint32_t eax, ebx, ecx, edx;
31 uint32_t level;
32 - char vendor[13] = { 0 };
33 + char vendor[13+4] = { 0 };
34 int ret;
36 oil_fault_check_enable ();
38 cgit v0.9.0.2-2-gbebe