From f28c870192c6f9f07051f2defd4fe5db5cfec0d3 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 22 Nov 2023 19:24:14 +0100 Subject: [PATCH] Implement KeHaltSystem() routine --- xtoskrnl/includes/ke.h | 4 ++++ xtoskrnl/ke/krnlinit.c | 7 +------ xtoskrnl/ke/panic.c | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/xtoskrnl/includes/ke.h b/xtoskrnl/includes/ke.h index 76a8484..1bbdbeb 100644 --- a/xtoskrnl/includes/ke.h +++ b/xtoskrnl/includes/ke.h @@ -17,6 +17,10 @@ XTAPI VOID KeClearEvent(IN PKEVENT Event); +XTAPI +VOID +KeHaltSystem(); + XTAPI VOID KeInitializeEvent(OUT PKEVENT Event, diff --git a/xtoskrnl/ke/krnlinit.c b/xtoskrnl/ke/krnlinit.c index bb29c22..75bf633 100644 --- a/xtoskrnl/ke/krnlinit.c +++ b/xtoskrnl/ke/krnlinit.c @@ -32,12 +32,7 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters) KeInitializationBlock->ProtocolVersion != BOOT_PROTOCOL_VERSION) { /* Kernel and boot loader version mismatch */ - for(;;) - { - /* Halt system */ - ArClearInterruptFlag(); - ArHalt(); - } + KeHaltSystem(); } /* Check if debugging enabled and if boot loader provided routine for debug printing */ diff --git a/xtoskrnl/ke/panic.c b/xtoskrnl/ke/panic.c index cca6f62..d9cbd0b 100644 --- a/xtoskrnl/ke/panic.c +++ b/xtoskrnl/ke/panic.c @@ -9,6 +9,27 @@ #include +/** + * Halts the system. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTAPI +VOID +KeHaltSystem() +{ + /* Enter infinite loop */ + for(;;) + { + /* Halt system */ + ArClearInterruptFlag(); + ArHalt(); + } + +} + /** * Crashes the system upon detecting a fatal error in which either it is unable to recover or continue to run system. *