[kernel] Make IDT per-cpu, not global

Since we modify IST entries while handling interrupts, the IDT cannot be
a global data structure. Allocate new ones for each CPU.
This commit is contained in:
Justin C. Miller
2021-02-19 21:51:25 -08:00
parent 2d6987341c
commit 6a41446185
7 changed files with 28 additions and 19 deletions

View File

@@ -8,6 +8,9 @@ class IDT
public:
IDT();
/// Get the currently running CPU's IDT
static IDT & current();
/// Install this IDT to the current CPU
void install() const;
@@ -35,9 +38,6 @@ public:
/// \arg index Which entry to print, or -1 for all entries
void dump(unsigned index = -1) const;
/// Get the global IDT
static IDT & get();
private:
void set(uint8_t i, void (*handler)(), uint16_t selector, uint8_t flags);