From a61be311da520dd3c6b035161cd6d0d80450b099 Mon Sep 17 00:00:00 2001 From: ppw <583742931@qq.com> Date: Mon, 21 Sep 2020 10:20:48 +0800 Subject: [PATCH] fix the multiple definition of idt & idt_reg remove the definition of idt & idt_reg in 'idt.h', which is included by 2 files and causes multiple definition. Definite the variable idt & idt_reg here to solve the problem. --- 18-interrupts/cpu/idt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/18-interrupts/cpu/idt.c b/18-interrupts/cpu/idt.c index 999d0c9..53ab1ee 100644 --- a/18-interrupts/cpu/idt.c +++ b/18-interrupts/cpu/idt.c @@ -1,6 +1,10 @@ #include "idt.h" #include "../kernel/util.h" +#define IDT_ENTRIES 256 +idt_gate_t idt[IDT_ENTRIES]; +idt_register_t idt_reg; + void set_idt_gate(int n, u32 handler) { idt[n].low_offset = low_16(handler); idt[n].sel = KERNEL_CS;