From: Andrew Cooper Date: Thu, 28 Jun 2018 11:00:44 +0000 (+0000) Subject: libx86: Introduce lib/x86/cpuid.h X-Git-Tag: 4.12.0-rc1~932 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0e96f3d52ec200b8f7764164e22d76eef6151f59;p=xen.git libx86: Introduce lib/x86/cpuid.h 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 Signed-off-by: Roger Pau Monné Reviewed-by: Wei Liu Acked-by: Jan Beulich --- diff --git a/tools/include/Makefile b/tools/include/Makefile index 270a34f318..34ca1cb760 100644 --- a/tools/include/Makefile +++ b/tools/include/Makefile @@ -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 $@ diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index c5c3cdc2ae..165bbf86ac 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -33,6 +33,8 @@ enum { }; #include "_xc_cpuid_autogen.h" +#include + #define bitmaskof(idx) (1u << ((idx) & 31)) #define featureword_of(idx) ((idx) >> 5) #define clear_feature(idx, dst) ((dst) &= ~bitmaskof(idx)) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h index c22e7745ad..afad760dbc 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.h +++ b/xen/arch/x86/x86_emulate/x86_emulate.h @@ -23,6 +23,8 @@ #ifndef __X86_EMULATE_H__ #define __X86_EMULATE_H__ +#include + #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; /* diff --git a/xen/include/asm-x86/cpuid.h b/xen/include/asm-x86/cpuid.h index 4113a5edee..12e274662b 100644 --- a/xen/include/asm-x86/cpuid.h +++ b/xen/include/asm-x86/cpuid.h @@ -18,7 +18,9 @@ #ifndef __ASSEMBLY__ #include #include -#include + +#include + #include 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 index 0000000000..cedbec518d --- /dev/null +++ b/xen/include/xen/lib/x86/cpuid.h @@ -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: + */