[kernel] Make grabbing an IST stack atomic
In the beginning of the interrupt handler, we had previously checked if the current handler had grabbed an IST stack from the IDT/TSS. If it was, it saved this value and set it to 0 in the IDT, then restored it at the end. Now this is an atomic action. This is unlikely to make a difference unless the interrupt handler is itself interrupted by an exception before being able to swap the IDT value, but such a situation is now impossible.
This commit is contained in:
@@ -75,8 +75,6 @@ isr_handler(cpu_state *regs)
|
||||
// this stack
|
||||
IDT &idt = IDT::current();
|
||||
uint8_t old_ist = idt.get_ist(vector);
|
||||
if (old_ist)
|
||||
idt.set_ist(vector, 0);
|
||||
|
||||
char message[200];
|
||||
|
||||
@@ -165,7 +163,7 @@ isr_handler(cpu_state *regs)
|
||||
|
||||
// Return the IST for this vector to what it was
|
||||
if (old_ist)
|
||||
idt.set_ist(vector, old_ist);
|
||||
idt.return_ist(vector, old_ist);
|
||||
*reinterpret_cast<uint32_t *>(apic_eoi_addr) = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user