From: Simon Glass Date: Fri, 31 Jul 2015 15:31:32 +0000 (-0600) Subject: x86: Tidy up a few minor issues with interrupts X-Git-Tag: KARO-TXSD-2017-03-15~3982^2~44 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8aba36d89675ff52f57410c8f5c42d37ef2ac8b4;p=karo-tx-uboot.git x86: Tidy up a few minor issues with interrupts Fix a typo, remove an unused field and make sure to use existing #define constants instead of open-coded values. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c index 853c82f5a7..3a9c2d4783 100644 --- a/arch/x86/cpu/interrupts.c +++ b/arch/x86/cpu/interrupts.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -46,7 +47,7 @@ static char *exceptions[] = { "Invalid TSS", "Segment Not Present", "Stack Segment Fault", - "Gerneral Protection", + "General Protection", "Page Fault", "Reserved", "x87 FPU Floating-Point Error", @@ -165,7 +166,6 @@ struct idt_entry { struct desc_ptr { unsigned short size; unsigned long address; - unsigned short segment; } __packed; struct idt_entry idt[256] __aligned(16); @@ -202,14 +202,13 @@ int cpu_init_interrupts(void) for (i = 0; i < 256; i++) { idt[i].access = 0x8e; idt[i].res = 0; - idt[i].selector = 0x10; + idt[i].selector = X86_GDT_ENTRY_32BIT_CS * X86_GDT_ENTRY_SIZE; set_vector(i, irq_entry); irq_entry += irq_entry_size; } - idt_ptr.size = 256 * 8; + idt_ptr.size = 256 * 8 - 1; idt_ptr.address = (unsigned long) idt; - idt_ptr.segment = 0x18; load_idt(&idt_ptr);