From: Andrew Cooper Date: Tue, 16 Jan 2024 11:50:38 +0000 (+0000) Subject: x86/cpuid: Change cpuid() from a macro to a static inline X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=86d0edda34e732f1b000d2adddf4f7884d18e04a;p=people%2Fandrewcoop%2Fxen.git x86/cpuid: Change cpuid() from a macro to a static inline Addresses MISRA Rule 5.5. Introduces others, but lets fix one thing at a time. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h index ff62b080af..b227cdee8e 100644 --- a/xen/arch/x86/include/asm/processor.h +++ b/xen/arch/x86/include/asm/processor.h @@ -126,14 +126,6 @@ static inline int cpu_nr_siblings(unsigned int cpu) return cpu_data[cpu].x86_num_siblings; } -/* - * Generic CPUID function - * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx - * resulting in stale register contents being returned. - */ -#define cpuid(leaf, eax, ebx, ecx, edx) \ - cpuid_count(leaf, 0, eax, ebx, ecx, edx) - /* Some CPUID calls want 'count' to be placed in ecx */ static inline void cpuid_count( unsigned int op, @@ -148,6 +140,21 @@ static inline void cpuid_count( : "0" (op), "c" (count) ); } +/* + * Generic CPUID function + * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx + * resulting in stale register contents being returned. + */ +static inline void cpuid( + unsigned int leaf, + unsigned int *eax, + unsigned int *ebx, + unsigned int *ecx, + unsigned int *edx) +{ + cpuid_count(leaf, 0, eax, ebx, ecx, edx); +} + /* * CPUID functions returning a single datum */