Package: i7z / 0.27.2+git2013.10.12-g5023138-5

fix_cpuid_asm.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Author: Andreas Beckmann <anbe@debian.org>
Description: fix cpuid inline assembly
 the old code zeroed the upper half of %rbx

--- a/helper_functions.c
+++ b/helper_functions.c
@@ -101,13 +101,7 @@ static inline void cpuid (unsigned int i
                           unsigned int *ecx, unsigned int *edx)
 {
     unsigned int _eax = info, _ebx, _ecx, _edx;
-    asm volatile ("mov %%ebx, %%edi;" // save ebx (for PIC)
-                  "cpuid;"
-                  "mov %%ebx, %%esi;" // pass to caller
-                  "mov %%edi, %%ebx;" // restore ebx
-                  :"+a" (_eax), "=S" (_ebx), "=c" (_ecx), "=d" (_edx)
-                  :      /* inputs: eax is handled above */
-                  :"edi" /* clobbers: we hit edi directly */);
+    asm volatile ("cpuid\n\t" : "+a" (_eax), "=b" (_ebx), "=c" (_ecx), "=d" (_edx) : : );
     if (eax) *eax = _eax;
     if (ebx) *ebx = _ebx;
     if (ecx) *ecx = _ecx;