From 72e1ed6d4ca62728eb780c8ce8c4051eb7a6b6ea Mon Sep 17 00:00:00 2001 From: Kim Walisch Date: Fri, 21 Jun 2024 19:10:21 +0200 Subject: [PATCH] Use asm volatile --- src/arch/x86/cpuid.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/arch/x86/cpuid.cpp b/src/arch/x86/cpuid.cpp index cb99734a..0170bf18 100644 --- a/src/arch/x86/cpuid.cpp +++ b/src/arch/x86/cpuid.cpp @@ -44,19 +44,19 @@ void run_cpuid(int eax, int ecx, int* abcd) #if defined(__i386__) && \ defined(__PIC__) // In case of PIC under 32-bit EBX cannot be clobbered - __asm__ ("movl %%ebx, %%edi;" - "cpuid;" - "xchgl %%ebx, %%edi;" - : "+a" (eax), - "=D" (ebx), - "+c" (ecx), - "=d" (edx)); + asm volatile("movl %%ebx, %%edi;" + "cpuid;" + "xchgl %%ebx, %%edi;" + : "+a" (eax), + "=D" (ebx), + "+c" (ecx), + "=d" (edx)); #else - __asm__ ("cpuid" - : "+a" (eax), - "+b" (ebx), - "+c" (ecx), - "=d" (edx)); + asm volatile("cpuid" + : "+a" (eax), + "+b" (ebx), + "+c" (ecx), + "=d" (edx)); #endif abcd[0] = eax; @@ -82,7 +82,7 @@ uint64_t get_xcr0() uint32_t eax; uint32_t edx; - __asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); + asm volatile("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); return eax | (uint64_t(edx) << 32); #endif }