summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-11 13:08:32 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-11 13:11:29 +0100
commitdef46ab40f8feffa167ab9c6e893dd6157cd57a2 (patch)
treec433545caf4f30e83f81c3a69eb84f387c2326e6 /src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc
parent8168d385ecc7ec1ae618996dffc45bb861502ebc (diff)
chore: refactor: codebase improvements and more usage of Ref<>.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc')
-rw-r--r--src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc
index 3745fe3c..ae36746e 100644
--- a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc
+++ b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc
@@ -9,16 +9,16 @@
#include <KernelKit/UserMgr.h>
#include <NeKit/KString.h>
#include <SignalKit/Signals.h>
+#include <NeKit/Atom.h>
EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip);
-
EXTERN_C Kernel::UIntPtr kApicBaseAddress;
-STATIC BOOL kIsRunning = NO;
+static bool kIsRunning = NO;
/// @brief Notify APIC and PIC that we're done with the interrupt.
/// @note
-STATIC void hal_idt_send_eoi(UInt8 vector) {
+static void hal_idt_send_eoi(UInt8 vector) {
((volatile UInt32*) kApicBaseAddress)[0xB0 / 4] = 0;
if (vector >= kPICCommand && vector <= 0x2F) {
@@ -32,7 +32,7 @@ STATIC void hal_idt_send_eoi(UInt8 vector) {
/// @brief Handle GPF fault.
/// @param rsp
EXTERN_C Kernel::Void idt_handle_gpf(Kernel::UIntPtr rsp) {
- auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
+ auto process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
process.Leak().Crash();
hal_idt_send_eoi(13);
@@ -45,7 +45,7 @@ EXTERN_C Kernel::Void idt_handle_gpf(Kernel::UIntPtr rsp) {
/// @brief Handle page fault.
/// @param rsp
EXTERN_C void idt_handle_pf(Kernel::UIntPtr rsp) {
- auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
+ auto process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
process.Leak().Crash();
hal_idt_send_eoi(14);
@@ -73,7 +73,7 @@ EXTERN_C void idt_handle_scheduler(Kernel::UIntPtr rsp) {
/// @brief Handle math fault.
/// @param rsp
EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp) {
- auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
+ auto process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
process.Leak().Crash();
hal_idt_send_eoi(8);
@@ -87,7 +87,7 @@ EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp) {
/// @brief Handle any generic fault.
/// @param rsp
EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp) {
- auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
+ auto process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
process.Leak().Crash();
hal_idt_send_eoi(30);
@@ -103,7 +103,7 @@ EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp) {
}
EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip) {
- auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
+ auto process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
hal_idt_send_eoi(3);
@@ -118,7 +118,7 @@ EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip) {
/// @brief Handle #UD fault.
/// @param rsp
EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp) {
- auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
+ auto process = Kernel::UserProcessScheduler::The().TheCurrentProcess();
process.Leak().Crash();
hal_idt_send_eoi(6);