]> xenbits.xensource.com Git - xen.git/commitdiff
libx86: Introduce lib/x86/cpuid.h
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 28 Jun 2018 11:00:44 +0000 (11:00 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Jul 2018 18:31:31 +0000 (19:31 +0100)
Begin to untangle the header dependency tangle by moving definition of
struct cpuid_leaf out of x86_emulate.h into the new cpuid.h.

Additionally, plumb the header through to libxc.  This is technically a
redundant include at this point, but it helps build-test the later changes,
and will be used eventually.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
tools/include/Makefile
tools/libxc/xc_cpuid_x86.c
xen/arch/x86/x86_emulate/x86_emulate.h
xen/include/asm-x86/cpuid.h
xen/include/xen/lib/x86/cpuid.h [new file with mode: 0644]

index 270a34f3185b9df6d05c549c42a8ac91b64428d0..34ca1cb76057351319dcaafa3fd70cfb4e14d726 100644 (file)
@@ -23,6 +23,8 @@ xen/.dir:
        ln -sf $(XEN_ROOT)/xen/include/acpi acpi
 ifeq ($(CONFIG_X86),y)
        ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
+       mkdir -p xen/lib
+       ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86 xen/lib/x86
 endif
        touch $@
 
index c5c3cdc2aec20edef7b633281467276f36f55d36..165bbf86acd12d5a8b537643c3d7df889a7b3d88 100644 (file)
@@ -33,6 +33,8 @@ enum {
 };
 #include "_xc_cpuid_autogen.h"
 
+#include <xen/lib/x86/cpuid.h>
+
 #define bitmaskof(idx)      (1u << ((idx) & 31))
 #define featureword_of(idx) ((idx) >> 5)
 #define clear_feature(idx, dst) ((dst) &= ~bitmaskof(idx))
index c22e7745ad6f1292bbf2db0719f89e267a7e261e..afad760dbcb60ebb2923d3b4970055a27e6027a8 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef __X86_EMULATE_H__
 #define __X86_EMULATE_H__
 
+#include <xen/lib/x86/cpuid.h>
+
 #define MAX_INST_LEN 15
 
 #if defined(__i386__)
@@ -172,11 +174,6 @@ enum x86_emulate_fpu_type {
     X86EMUL_FPU_none
 };
 
-struct cpuid_leaf
-{
-    uint32_t a, b, c, d;
-};
-
 struct x86_emulate_state;
 
 /*
index 4113a5edeea3952e47aebb1d2eda0c2ee42a993d..12e274662b2d0b839d826383d2f4e0c9ac5ff824 100644 (file)
@@ -18,7 +18,9 @@
 #ifndef __ASSEMBLY__
 #include <xen/types.h>
 #include <xen/kernel.h>
-#include <asm/x86_emulate.h>
+
+#include <xen/lib/x86/cpuid.h>
+
 #include <public/sysctl.h>
 
 extern const uint32_t known_features[FSCAPINTS];
diff --git a/xen/include/xen/lib/x86/cpuid.h b/xen/include/xen/lib/x86/cpuid.h
new file mode 100644 (file)
index 0000000..cedbec5
--- /dev/null
@@ -0,0 +1,20 @@
+/* Common data structures and functions consumed by hypervisor and toolstack */
+#ifndef XEN_LIB_X86_CPUID_H
+#define XEN_LIB_X86_CPUID_H
+
+struct cpuid_leaf
+{
+    uint32_t a, b, c, d;
+};
+
+#endif /* !XEN_LIB_X86_CPUID_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */