diff --git a/xtoskrnl/includes/ke/krnlinit.hh b/xtoskrnl/includes/ke/krnlinit.hh index 351890f..0984ff0 100644 --- a/xtoskrnl/includes/ke/krnlinit.hh +++ b/xtoskrnl/includes/ke/krnlinit.hh @@ -24,6 +24,7 @@ namespace KE private: STATIC XTAPI VOID BootstrapKernel(VOID); + STATIC XTAPI VOID InitializeInterruptHandlers(VOID); STATIC XTAPI VOID InitializeKernel(VOID); }; } diff --git a/xtoskrnl/ke/amd64/krnlinit.cc b/xtoskrnl/ke/amd64/krnlinit.cc index d2d7438..e71e4e7 100644 --- a/xtoskrnl/ke/amd64/krnlinit.cc +++ b/xtoskrnl/ke/amd64/krnlinit.cc @@ -51,6 +51,9 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo /* Initialize per-CPU spin lock queues */ KE::SpinLock::InitializeLockQueues(); + /* Initialize interrupt handlers */ + InitializeInterruptHandlers(); + /* Lower to APC runlevel */ KE::RunLevel::LowerRunLevel(APC_LEVEL); @@ -96,6 +99,9 @@ KE::KernelInit::BootstrapKernel(VOID) KE::SpinLock::InitializeAllLocks(); KE::SpinLock::InitializeLockQueues(); + /* Initialize interrupt handlers */ + InitializeInterruptHandlers(); + /* Lower to APC runlevel */ KE::RunLevel::LowerRunLevel(APC_LEVEL); @@ -123,6 +129,22 @@ KE::KernelInit::BootstrapKernel(VOID) KE::Crash::HaltSystem(); } +/** + * Initializes and registers the core system interrupt handlers. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTAPI +VOID +KE::KernelInit::InitializeInterruptHandlers(VOID) +{ + /* Register interrupt handlers */ + HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_DPC, KE::Dispatcher::HandleDispatchInterrupt); + HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_IPI, KE::Ipi::HandleIpiInterrupt); +} + /** * This routine initializes XT kernel. * diff --git a/xtoskrnl/ke/i686/krnlinit.cc b/xtoskrnl/ke/i686/krnlinit.cc index 6cc5887..1e1aa19 100644 --- a/xtoskrnl/ke/i686/krnlinit.cc +++ b/xtoskrnl/ke/i686/krnlinit.cc @@ -51,6 +51,9 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo /* Initialize per-CPU spin lock queues */ KE::SpinLock::InitializeLockQueues(); + /* Initialize interrupt handlers */ + InitializeInterruptHandlers(); + /* Lower to APC runlevel */ KE::RunLevel::LowerRunLevel(APC_LEVEL); @@ -96,6 +99,9 @@ KE::KernelInit::BootstrapKernel(VOID) KE::SpinLock::InitializeAllLocks(); KE::SpinLock::InitializeLockQueues(); + /* Initialize interrupt handlers */ + InitializeInterruptHandlers(); + /* Lower to APC runlevel */ KE::RunLevel::LowerRunLevel(APC_LEVEL); @@ -123,6 +129,22 @@ KE::KernelInit::BootstrapKernel(VOID) KE::Crash::HaltSystem(); } +/** + * Initializes and registers the core system interrupt handlers. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTAPI +VOID +KE::KernelInit::InitializeInterruptHandlers(VOID) +{ + /* Register interrupt handlers */ + HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_DPC, KE::Dispatcher::HandleDispatchInterrupt); + HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_IPI, KE::Ipi::HandleIpiInterrupt); +} + /** * This routine initializes XT kernel. *