From ae0ac26290af91ddc3b15f83cab43944b067eb29 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 22 Mar 2025 20:34:49 +0100 Subject: kernel(tweak): Tweak scheduler interrupt handler to avoid repeating myself in the code. --- dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'dev/Kernel') diff --git a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index 05326ecb..9eaa24eb 100644 --- a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -58,10 +58,15 @@ EXTERN_C void idt_handle_pf(NeOS::UIntPtr rsp) process.Leak().Crash(); } +namespace NeOS::Detail +{ + constexpr static Int32 kTimeoutCount = 100000UL; +} + /// @brief Handle scheduler interrupt. EXTERN_C void idt_handle_scheduler(NeOS::UIntPtr rsp) { - static NeOS::Int64 try_count_before_brute = 100000UL; + static NeOS::Int64 try_count_before_brute = NeOS::Detail::kTimeoutCount; while (kIsScheduling) { @@ -71,7 +76,7 @@ EXTERN_C void idt_handle_scheduler(NeOS::UIntPtr rsp) break; } - try_count_before_brute = 100000UL; + try_count_before_brute = NeOS::Detail::kTimeoutCount; kIsScheduling = YES; NeOS::UserProcessHelper::StartScheduling(); -- cgit v1.2.3