]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/cpuid: Change cpuid() from a macro to a static inline
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 16 Jan 2024 11:50:38 +0000 (11:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Jan 2024 20:59:06 +0000 (20:59 +0000)
Addresses MISRA Rule 5.5.  Introduces others, but lets fix one thing at a
time.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/include/asm/processor.h

index ff62b080afbf223533eac36c78c78b1efaa363a6..b227cdee8ef3b251ea66429b25ad4ff82751e439 100644 (file)
@@ -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
  */