From 397b03fd02a851abc70e750daf340966914e4239 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sat, 29 Jun 2024 23:52:17 +0200 Subject: New err_ kernel API (with err_bug_check) Signed-off-by: Amlal EL Mahrouss --- Kernel/Sources/HError.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Kernel/Sources/HError.cxx') diff --git a/Kernel/Sources/HError.cxx b/Kernel/Sources/HError.cxx index d38f2e07..39915f65 100644 --- a/Kernel/Sources/HError.cxx +++ b/Kernel/Sources/HError.cxx @@ -5,15 +5,28 @@ ------------------------------------------- */ #include +#include namespace NewOS { - /// @brief Doea a system wide bug check. + STATIC Bool cRaise = false; + + /// @brief Does a system wide bug check. /// @param void no params. /// @return if error-free: true, otherwise false. Boolean err_bug_check(void) noexcept { - /// TODO: + if (cRaise) + { + ke_stop(RUNTIME_CHECK_BAD_BEHAVIOR); + } + return false; } + + Void err_bug_check_raise(void) noexcept + { + if (!cRaise) + cRaise = true; + } } // namespace NewOS -- cgit v1.2.3