Extract Dispatcher class from KThread
All checks were successful
All checks were successful
This commit is contained in:
@@ -41,6 +41,7 @@ list(APPEND XTOSKRNL_SOURCE
|
|||||||
${XTOSKRNL_SOURCE_DIR}/ke/bootinfo.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/bootinfo.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/crash.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/crash.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/data.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/data.cc
|
||||||
|
${XTOSKRNL_SOURCE_DIR}/ke/dispatch.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/dpc.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/dpc.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/event.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/event.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/exports.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/exports.cc
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <ke/apc.hh>
|
#include <ke/apc.hh>
|
||||||
#include <ke/bootinfo.hh>
|
#include <ke/bootinfo.hh>
|
||||||
#include <ke/crash.hh>
|
#include <ke/crash.hh>
|
||||||
|
#include <ke/dispatch.hh>
|
||||||
#include <ke/dpc.hh>
|
#include <ke/dpc.hh>
|
||||||
#include <ke/event.hh>
|
#include <ke/event.hh>
|
||||||
#include <ke/guard.hh>
|
#include <ke/guard.hh>
|
||||||
|
|||||||
25
xtoskrnl/includes/ke/dispatch.hh
Normal file
25
xtoskrnl/includes/ke/dispatch.hh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtoskrnl/includes/ke/dispatch.hh
|
||||||
|
* DESCRIPTION: Kernel Thread Dispatcher
|
||||||
|
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __XTOSKRNL_KE_DISPATCH_HH
|
||||||
|
#define __XTOSKRNL_KE_DISPATCH_HH
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
/* Kernel Library */
|
||||||
|
namespace KE
|
||||||
|
{
|
||||||
|
class Dispatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
STATIC XTFASTCALL VOID ExitDispatcher(IN KRUNLEVEL OldRunLevel);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __XTOSKRNL_KE_DISPATCH_HH */
|
||||||
@@ -21,7 +21,6 @@ namespace KE
|
|||||||
STATIC ETHREAD InitialThread;
|
STATIC ETHREAD InitialThread;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
STATIC XTFASTCALL VOID ExitDispatcher(IN KRUNLEVEL OldRunLevel);
|
|
||||||
STATIC XTAPI PETHREAD GetInitialThread(VOID);
|
STATIC XTAPI PETHREAD GetInitialThread(VOID);
|
||||||
STATIC XTAPI XTSTATUS InitializeThread(IN PKPROCESS Process,
|
STATIC XTAPI XTSTATUS InitializeThread(IN PKPROCESS Process,
|
||||||
IN OUT PKTHREAD Thread,
|
IN OUT PKTHREAD Thread,
|
||||||
|
|||||||
30
xtoskrnl/ke/dispatch.cc
Normal file
30
xtoskrnl/ke/dispatch.cc
Normal 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);
|
||||||
|
}
|
||||||
@@ -16,26 +16,6 @@ KE::KThread::GetInitialThread(VOID)
|
|||||||
return &InitialThread;
|
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.
|
* Initializes the thread.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ KE::Timer::CancelTimer(IN PKTIMER Timer)
|
|||||||
|
|
||||||
/* Release dispatcher lock and process the deferred ready list */
|
/* Release dispatcher lock and process the deferred ready list */
|
||||||
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
||||||
KE::KThread::ExitDispatcher(RunLevel);
|
KE::Dispatcher::ExitDispatcher(RunLevel);
|
||||||
|
|
||||||
/* Return result */
|
/* Return result */
|
||||||
return Result;
|
return Result;
|
||||||
@@ -150,7 +150,7 @@ KE::Timer::QueryTimer(IN PKTIMER Timer)
|
|||||||
|
|
||||||
/* Release dispatcher lock and process the deferred ready list */
|
/* Release dispatcher lock and process the deferred ready list */
|
||||||
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
||||||
KE::KThread::ExitDispatcher(RunLevel);
|
KE::Dispatcher::ExitDispatcher(RunLevel);
|
||||||
|
|
||||||
/* Return timer's due time */
|
/* Return timer's due time */
|
||||||
return DueTime;
|
return DueTime;
|
||||||
|
|||||||
Reference in New Issue
Block a user