Browse Source

Kernel: Disable interrupts while modifying the PIC IMR

Andreas Kling 5 years ago
parent
commit
f692577559
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Kernel/Arch/i386/PIC.cpp

+ 2 - 0
Kernel/Arch/i386/PIC.cpp

@@ -21,6 +21,7 @@ namespace PIC {
 
 
 void disable(u8 irq)
 void disable(u8 irq)
 {
 {
+    InterruptDisabler disabler;
     u8 imr;
     u8 imr;
     if (irq & 8) {
     if (irq & 8) {
         imr = IO::in8(PIC1_CMD);
         imr = IO::in8(PIC1_CMD);
@@ -35,6 +36,7 @@ void disable(u8 irq)
 
 
 void enable(u8 irq)
 void enable(u8 irq)
 {
 {
+    InterruptDisabler disabler;
     u8 imr;
     u8 imr;
     if (irq & 8) {
     if (irq & 8) {
         imr = IO::in8(PIC1_CMD);
         imr = IO::in8(PIC1_CMD);