mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
Kernel: Add the NonMaskableInterruptDisabler class
This class will be used later to disable NMIs when we initialize the RTC timer.
This commit is contained in:
parent
07679e347c
commit
9a303cc5a5
2 changed files with 17 additions and 0 deletions
|
@ -39,6 +39,7 @@
|
||||||
#include <Kernel/KSyms.h>
|
#include <Kernel/KSyms.h>
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
#include <Kernel/VM/MemoryManager.h>
|
#include <Kernel/VM/MemoryManager.h>
|
||||||
|
#include <LibBareMetal/IO.h>
|
||||||
#include <LibC/mallocdefs.h>
|
#include <LibC/mallocdefs.h>
|
||||||
|
|
||||||
//#define PAGE_FAULT_DEBUG
|
//#define PAGE_FAULT_DEBUG
|
||||||
|
@ -833,3 +834,13 @@ void __assertion_failed(const char* msg, const char* file, unsigned line, const
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
NonMaskableInterruptDisabler::NonMaskableInterruptDisabler()
|
||||||
|
{
|
||||||
|
IO::out8(0x70, IO::in8(0x70) | 0x80);
|
||||||
|
}
|
||||||
|
|
||||||
|
NonMaskableInterruptDisabler::~NonMaskableInterruptDisabler()
|
||||||
|
{
|
||||||
|
IO::out8(0x70, IO::in8(0x70) & 0x7F);
|
||||||
|
}
|
||||||
|
|
|
@ -369,6 +369,12 @@ private:
|
||||||
u32 m_flags;
|
u32 m_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class NonMaskableInterruptDisabler {
|
||||||
|
public:
|
||||||
|
NonMaskableInterruptDisabler();
|
||||||
|
~NonMaskableInterruptDisabler();
|
||||||
|
};
|
||||||
|
|
||||||
/* Map IRQ0-15 @ ISR 0x50-0x5F */
|
/* Map IRQ0-15 @ ISR 0x50-0x5F */
|
||||||
#define IRQ_VECTOR_BASE 0x50
|
#define IRQ_VECTOR_BASE 0x50
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue