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.
This commit is contained in:
ppw 2020-09-21 10:20:48 +08:00 committed by GitHub
parent 7aff64740e
commit a61be311da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;