1 /* Generated by ./xlat/gen.sh from ./xlat/kvm_cpuid_flags.in; do not edit. */ 2 3 #include "gcc_compat.h" 4 #include "static_assert.h" 5 6 #ifndef BIT 7 # define BIT(nr_) (1UL << (nr_)) 8 #endif 9 #if defined(KVM_CPUID_FLAG_SIGNIFCANT_INDEX) || (defined(HAVE_DECL_KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && HAVE_DECL_KVM_CPUID_FLAG_SIGNIFCANT_INDEX) 10 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 11 static_assert((KVM_CPUID_FLAG_SIGNIFCANT_INDEX) == ((1 << 0)), "KVM_CPUID_FLAG_SIGNIFCANT_INDEX != (1 << 0)"); 12 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 13 #else 14 # define KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0) 15 #endif 16 #if defined(KVM_CPUID_FLAG_STATEFUL_FUNC) || (defined(HAVE_DECL_KVM_CPUID_FLAG_STATEFUL_FUNC) && HAVE_DECL_KVM_CPUID_FLAG_STATEFUL_FUNC) 17 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 18 static_assert((KVM_CPUID_FLAG_STATEFUL_FUNC) == ((1 << 1)), "KVM_CPUID_FLAG_STATEFUL_FUNC != (1 << 1)"); 19 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 20 #else 21 # define KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1) 22 #endif 23 #if defined(KVM_CPUID_FLAG_STATE_READ_NEXT) || (defined(HAVE_DECL_KVM_CPUID_FLAG_STATE_READ_NEXT) && HAVE_DECL_KVM_CPUID_FLAG_STATE_READ_NEXT) 24 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 25 static_assert((KVM_CPUID_FLAG_STATE_READ_NEXT) == ((1 << 2)), "KVM_CPUID_FLAG_STATE_READ_NEXT != (1 << 2)"); 26 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 27 #else 28 # define KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2) 29 #endif 30 31 #ifndef XLAT_MACROS_ONLY 32 33 # ifdef IN_MPERS 34 35 # error static const struct xlat kvm_cpuid_flags in mpers mode 36 37 # else 38 39 static 40 const struct xlat kvm_cpuid_flags[] = { 41 #ifndef BIT 42 /* 43 * Workaround a bug in kernel headers fixed by linux commit v4.7-rc1~32^2~42. 44 */ 45 # define BIT(nr_) (1UL << (nr_)) 46 #endif 47 48 XLAT(KVM_CPUID_FLAG_SIGNIFCANT_INDEX), 49 XLAT(KVM_CPUID_FLAG_STATEFUL_FUNC), 50 XLAT(KVM_CPUID_FLAG_STATE_READ_NEXT), 51 XLAT_END 52 }; 53 54 # endif /* !IN_MPERS */ 55 56 #endif /* !XLAT_MACROS_ONLY */ 57