| 1 |
Author: Andreas Beckmann <[email protected]> |
| 2 |
Description: fix cpuid inline assembly |
| 3 |
the old code zeroed the upper half of %rbx |
| 4 |
|
| 5 |
--- a/helper_functions.c |
| 6 |
+++ b/helper_functions.c |
| 7 |
@@ -101,13 +101,7 @@ static inline void cpuid (unsigned int i |
| 8 |
unsigned int *ecx, unsigned int *edx) |
| 9 |
{ |
| 10 |
unsigned int _eax = info, _ebx, _ecx, _edx; |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
+ asm volatile ("cpuid\n\t" : "+a" (_eax), "=b" (_ebx), "=c" (_ecx), "=d" (_edx) : : ); |
| 19 |
if (eax) *eax = _eax; |
| 20 |
if (ebx) *ebx = _ebx; |
| 21 |
if (ecx) *ecx = _ecx; |