hv: irq: minor refine about structure idt_64_descriptor

The 'value' field in structure idt_64_descriptor is no one used. We could remove it.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1 2020-04-24 16:06:43 +08:00 committed by wenlingz
parent b514eba9d6
commit 067b439e69
2 changed files with 32 additions and 35 deletions

View File

@ -480,16 +480,16 @@ void init_default_irqs(uint16_t cpu_id)
static inline void fixup_idt(const struct host_idt_descriptor *idtd)
{
uint32_t i;
union idt_64_descriptor *idt_desc = (union idt_64_descriptor *)idtd->idt;
struct idt_64_descriptor *idt_desc = idtd->idt->host_idt_descriptors;
uint32_t entry_hi_32, entry_lo_32;
for (i = 0U; i < HOST_IDT_ENTRIES; i++) {
entry_lo_32 = idt_desc[i].fields.offset_63_32;
entry_hi_32 = idt_desc[i].fields.rsvd;
idt_desc[i].fields.rsvd = 0U;
idt_desc[i].fields.offset_63_32 = entry_hi_32;
idt_desc[i].fields.high32.bits.offset_31_16 = entry_lo_32 >> 16U;
idt_desc[i].fields.low32.bits.offset_15_0 = entry_lo_32 & 0xffffUL;
entry_lo_32 = idt_desc[i].offset_63_32;
entry_hi_32 = idt_desc[i].rsvd;
idt_desc[i].rsvd = 0U;
idt_desc[i].offset_63_32 = entry_hi_32;
idt_desc[i].high32.bits.offset_31_16 = entry_lo_32 >> 16U;
idt_desc[i].low32.bits.offset_15_0 = entry_lo_32 & 0xffffUL;
}
}

View File

@ -19,33 +19,30 @@
/*
* Definition of an 16 byte IDT selector.
*/
union idt_64_descriptor {
uint64_t value;
struct {
union {
uint32_t value;
struct {
uint32_t offset_15_0:16;
uint32_t seg_sel:16;
} bits;
} low32;
union {
uint32_t value;
struct {
uint32_t ist:3;
uint32_t bit_3_clr:1;
uint32_t bit_4_clr:1;
uint32_t bits_5_7_clr:3;
uint32_t type:4;
uint32_t bit_12_clr:1;
uint32_t dpl:2;
uint32_t present:1;
uint32_t offset_31_16:16;
} bits;
} high32;
uint32_t offset_63_32;
uint32_t rsvd;
} fields;
struct idt_64_descriptor {
union {
uint32_t value;
struct {
uint32_t offset_15_0:16;
uint32_t seg_sel:16;
} bits;
} low32;
union {
uint32_t value;
struct {
uint32_t ist:3;
uint32_t bit_3_clr:1;
uint32_t bit_4_clr:1;
uint32_t bits_5_7_clr:3;
uint32_t type:4;
uint32_t bit_12_clr:1;
uint32_t dpl:2;
uint32_t present:1;
uint32_t offset_31_16:16;
} bits;
} high32;
uint32_t offset_63_32;
uint32_t rsvd;
} __aligned(8);
/*****************************************************************************
@ -54,7 +51,7 @@ union idt_64_descriptor {
*
*****************************************************************************/
struct host_idt {
union idt_64_descriptor host_idt_descriptors[HOST_IDT_ENTRIES];
struct idt_64_descriptor host_idt_descriptors[HOST_IDT_ENTRIES];
} __aligned(8);
/*