From b489aec3e1b7705a3e7a38e21622ca9785d96b4c Mon Sep 17 00:00:00 2001 From: Shiqing Gao Date: Tue, 22 Jan 2019 14:09:18 +0800 Subject: [PATCH] hv: idt: separate the MACRO definition For binutils <= 2.26: 'U' suffix for unsigned constant is not accepted by binutils assembler. This patch separates the MACRO definition for ASSEMBLER and non-ASSEMBLER code in idt.h Tracked-On: #2200 Signed-off-by: Shiqing Gao --- hypervisor/include/arch/x86/idt.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hypervisor/include/arch/x86/idt.h b/hypervisor/include/arch/x86/idt.h index f417e881d..76e4c63f8 100644 --- a/hypervisor/include/arch/x86/idt.h +++ b/hypervisor/include/arch/x86/idt.h @@ -11,16 +11,10 @@ * IDT is defined in assembly so we handle exceptions as early as possible. */ -/* Interrupt Descriptor Table (LDT) selectors are 16 bytes on x86-64 instead of - * 8 bytes. - */ -#define X64_IDT_DESC_SIZE (0x10U) +#ifndef ASSEMBLER + /* Number of the HOST IDT entries */ #define HOST_IDT_ENTRIES (0x100U) -/* Size of the IDT */ -#define HOST_IDT_SIZE (HOST_IDT_ENTRIES * X64_IDT_DESC_SIZE) - -#ifndef ASSEMBLER /* * Definition of an 16 byte IDT selector. @@ -74,6 +68,15 @@ struct host_idt_descriptor { extern struct host_idt HOST_IDT; extern struct host_idt_descriptor HOST_IDTR; +#else /* ASSEMBLER */ + +/* Interrupt Descriptor Table (LDT) selectors are 16 bytes on x86-64 instead of 8 bytes. */ +#define X64_IDT_DESC_SIZE (0x10) +/* Number of the HOST IDT entries */ +#define HOST_IDT_ENTRIES (0x100) +/* Size of the IDT */ +#define HOST_IDT_SIZE (HOST_IDT_ENTRIES * X64_IDT_DESC_SIZE) + #endif /* end #ifndef ASSEMBLER */ #endif /* IDT_H */