Extract Dispatcher class from KThread
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in -59m29s
Builds / ExectOS (amd64, debug) (push) Successful in -59m27s
Builds / ExectOS (i686, release) (push) Successful in -59m28s
Builds / ExectOS (i686, debug) (push) Successful in -59m25s

This commit is contained in:
2026-04-29 20:31:34 +02:00
parent f03515b0eb
commit 6cbda52d6b
7 changed files with 59 additions and 23 deletions

30
xtoskrnl/ke/dispatch.cc Normal file
View File

@@ -0,0 +1,30 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ke/dispatch.cc
* DESCRIPTION: Kernel Thread Dispatcher
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtos.hh>
/**
* Exits the dispatcher, switches context to a new thread and lowers runlevel to its original state.
*
* @param OldRunLevel
* Supplies the original runlevel state.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTFASTCALL
VOID
KE::Dispatcher::ExitDispatcher(IN KRUNLEVEL OldRunLevel)
{
UNIMPLEMENTED;
/* Lower runlevel */
RunLevel::LowerRunLevel(OldRunLevel);
}

View File

@@ -16,26 +16,6 @@ KE::KThread::GetInitialThread(VOID)
return &InitialThread;
}
/**
* Exits the dispatcher, switches context to a new thread and lowers runlevel to its original state.
*
* @param OldRunLevel
* Supplies the original runlevel state.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTFASTCALL
VOID
KE::KThread::ExitDispatcher(IN KRUNLEVEL OldRunLevel)
{
UNIMPLEMENTED;
/* Lower runlevel */
RunLevel::LowerRunLevel(OldRunLevel);
}
/**
* Initializes the thread.
*

View File

@@ -43,7 +43,7 @@ KE::Timer::CancelTimer(IN PKTIMER Timer)
/* Release dispatcher lock and process the deferred ready list */
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
KE::KThread::ExitDispatcher(RunLevel);
KE::Dispatcher::ExitDispatcher(RunLevel);
/* Return result */
return Result;
@@ -150,7 +150,7 @@ KE::Timer::QueryTimer(IN PKTIMER Timer)
/* Release dispatcher lock and process the deferred ready list */
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
KE::KThread::ExitDispatcher(RunLevel);
KE::Dispatcher::ExitDispatcher(RunLevel);
/* Return timer's due time */
return DueTime;