diff options
author | Simon Glass <sjg@chromium.org> | 2020-11-04 09:57:28 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-11-06 09:51:29 +0800 |
commit | a0ed800376b0db57428f9bf6401db36789ff1aa6 (patch) | |
tree | 293f5f54b352f72ec856d4bb328602a3c0fa9dd3 /arch/x86/cpu/i386/interrupt.c | |
parent | 8bcfb7917a61ef8230d85b6efc5a272fd20637ff (diff) | |
download | u-boot-a0ed800376b0db57428f9bf6401db36789ff1aa6.tar.gz |
x86: Show the interrupt pointer with 'irqinfo'
It is useful for this command to show the address of the interrupt table.
Add support for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/i386/interrupt.c')
-rw-r--r-- | arch/x86/cpu/i386/interrupt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/cpu/i386/interrupt.c b/arch/x86/cpu/i386/interrupt.c index c0c4bc95fd..d85f84b29a 100644 --- a/arch/x86/cpu/i386/interrupt.c +++ b/arch/x86/cpu/i386/interrupt.c @@ -180,16 +180,11 @@ struct idt_entry { u16 base_high; } __packed; -struct desc_ptr { - unsigned short size; - unsigned long address; -} __packed; - struct idt_entry idt[256] __aligned(16); -struct desc_ptr idt_ptr; +struct idt_ptr idt_ptr; -static inline void load_idt(const struct desc_ptr *dtr) +static inline void load_idt(const struct idt_ptr *dtr) { asm volatile("cs lidt %0" : : "m" (*dtr)); } @@ -232,6 +227,11 @@ int cpu_init_interrupts(void) return 0; } +void interrupt_read_idt(struct idt_ptr *ptr) +{ + asm volatile("sidt %0" : : "m" (*ptr)); +} + void *x86_get_idt(void) { return &idt_ptr; |