From 038219772e3b4d13e9642f9d0db00ee7f144af43 Mon Sep 17 00:00:00 2001 From: karina Date: Sun, 3 May 2026 12:28:30 +0400 Subject: [PATCH] fix(scheduler): yield fixed and dont panic --- Kernel/Source/Arch/Exceptions.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Kernel/Source/Arch/Exceptions.c b/Kernel/Source/Arch/Exceptions.c index 70f3a1e..1c4228f 100644 --- a/Kernel/Source/Arch/Exceptions.c +++ b/Kernel/Source/Arch/Exceptions.c @@ -1,9 +1,20 @@ #include #include #include +#include Address ExceptionsHandler(ExceptionsContext* frame, ExceptionsType type) { if (type == ExceptionsIRQEl1h || type == ExceptionsIRQEl064) return GICDispatch(frame, type); + if (type == ExceptionsSyncEl1h || type == ExceptionsSyncEl064) { + UInt32 esr = frame->esr_el1; + UInt32 class = (esr >> 26) & 0x3F; + UInt32 syndrome = esr & 0x1FFFFFF; + + if (class == 0x11 || class == 0x15) { + if (syndrome == kOSSchedulerExceptionNumber) { + return SchedulerNext((Address)frame); + } + } + } OSPanicException(frame); } -