@@ -8,6 +8,7 @@
#ifndef _ASM_X86_SGX_ARCH_H
#define _ASM_X86_SGX_ARCH_H
+#include <linux/bits.h>
#include <linux/types.h>
#define SGX_CPUID 0x12
@@ -8,31 +8,9 @@
#include <stdint.h>
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
#define __aligned(x) __attribute__((__aligned__(x)))
#define __packed __attribute__((packed))
-/* Derived from asm-generic/bitsperlong.h. */
-#if __x86_64__
-#define BITS_PER_LONG 64
-#else
-#define BITS_PER_LONG 32
-#endif
-#define BITS_PER_LONG_LONG 64
-
-/* Taken from linux/bits.h. */
-#define BIT(nr) (1UL << (nr))
-#define BIT_ULL(nr) (1ULL << (nr))
-#define GENMASK(h, l) \
- (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
-#define GENMASK_ULL(h, l) \
- (((~0ULL) - (1ULL << (l)) + 1) & \
- (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
-
#include "../../../../../arch/x86/kernel/cpu/sgx/arch.h"
#include "../../../../../arch/x86/include/uapi/asm/sgx.h"
Include linux/bits.h for its defitions of BIT() and GENMASK*(). Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kernel/cpu/sgx/arch.h | 1 + tools/testing/selftests/x86/sgx/defines.h | 22 ---------------------- 2 files changed, 1 insertion(+), 22 deletions(-)