summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Sources
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-29 14:51:58 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-29 14:51:58 +0200
commit60902ec5fc462128d264f63f279c7fc362a72e1d (patch)
tree92ec898fb28e0be2fef65094392c3575af721cc2 /Kernel/Sources
parent30411936809d66538ca279a5b5d20865c54afd5c (diff)
[IMP] Replace SMP manager with Multi Processing manager.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/Sources')
-rw-r--r--Kernel/Sources/MPManager.cxx (renamed from Kernel/Sources/SMPManager.cxx)28
-rw-r--r--Kernel/Sources/ProcessScheduler.cxx20
2 files changed, 24 insertions, 24 deletions
diff --git a/Kernel/Sources/SMPManager.cxx b/Kernel/Sources/MPManager.cxx
index 155a1f86..d8faa983 100644
--- a/Kernel/Sources/SMPManager.cxx
+++ b/Kernel/Sources/MPManager.cxx
@@ -6,12 +6,12 @@
#include <ArchKit/ArchKit.hpp>
#include <KernelKit/ProcessScheduler.hxx>
-#include <KernelKit/SMPManager.hpp>
+#include <KernelKit/MPManager.hpp>
#include <CFKit/Property.hpp>
///! BUGS: 0
-///! @file SMPManager.cxx
+///! @file MPManager.cxx
///! @brief This file handles multi processing in Kernel.
///! @brief Multi processing is needed for multi-tasking operations.
@@ -120,7 +120,7 @@ namespace Kernel
//! @brief Constructor and destructor
///! @brief Default constructor.
- SMPManager::SMPManager()
+ MPManager::MPManager()
{
StringView strCoreName(512);
strCoreName += "\\Properties\\Smp\\SchedulerClass";
@@ -132,28 +132,28 @@ namespace Kernel
}
///! @brief Default destructor.
- SMPManager::~SMPManager() = default;
+ MPManager::~MPManager() = default;
/// @brief Shared singleton function
- Ref<SMPManager> SMPManager::The()
+ Ref<MPManager> MPManager::The()
{
- static SMPManager manager;
+ static MPManager manager;
return {manager};
}
/// @brief Get Stack Frame of Core
- HAL::StackFramePtr SMPManager::Leak() noexcept
+ HAL::StackFramePtr MPManager::Leak() noexcept
{
if (fThreadList[fCurrentThread].Leak() &&
ProcessHelper::TheCurrentPID() ==
- fThreadList[fCurrentThread].Leak().Leak()->fPID)
+ fThreadList[fCurrentThread].Leak().Leak()->fSourcePID)
return fThreadList[fCurrentThread].Leak().Leak()->fStack;
return nullptr;
}
/// @brief Finds and switch to a free core.
- bool SMPManager::Switch(HAL::StackFramePtr stack)
+ bool MPManager::Switch(HAL::StackFramePtr stack)
{
if (stack == nullptr)
return false;
@@ -188,7 +188,7 @@ namespace Kernel
fThreadList[idx].Leak().Leak()->Switch(fThreadList[idx].Leak().Leak()->fStack);
- fThreadList[idx].Leak().Leak()->fPID = ProcessHelper::TheCurrentPID();
+ fThreadList[idx].Leak().Leak()->fSourcePID = ProcessHelper::TheCurrentPID();
fThreadList[idx].Leak().Leak()->Busy(false);
@@ -203,7 +203,7 @@ namespace Kernel
* @param idx the index
* @return the reference to the hardware thread.
*/
- Ref<HardwareThread*> SMPManager::operator[](const SizeT& idx)
+ Ref<HardwareThread*> MPManager::operator[](const SizeT& idx)
{
if (idx == 0)
{
@@ -233,7 +233,7 @@ namespace Kernel
* Check if thread pool isn't empty.
* @return
*/
- SMPManager::operator bool() noexcept
+ MPManager::operator bool() noexcept
{
return !fThreadList.Empty();
}
@@ -242,14 +242,14 @@ namespace Kernel
* Reverse operator bool
* @return
*/
- bool SMPManager::operator!() noexcept
+ bool MPManager::operator!() noexcept
{
return fThreadList.Empty();
}
/// @brief Returns the amount of core present.
/// @return the number of cores.
- SizeT SMPManager::Count() noexcept
+ SizeT MPManager::Count() noexcept
{
return fThreadList.Count();
}
diff --git a/Kernel/Sources/ProcessScheduler.cxx b/Kernel/Sources/ProcessScheduler.cxx
index b5be1dd2..cccd8979 100644
--- a/Kernel/Sources/ProcessScheduler.cxx
+++ b/Kernel/Sources/ProcessScheduler.cxx
@@ -10,7 +10,7 @@
/***********************************************************************************/
#include <KernelKit/ProcessScheduler.hxx>
-#include <KernelKit/SMPManager.hpp>
+#include <KernelKit/MPManager.hpp>
#include <KernelKit/Heap.hxx>
#include <NewKit/String.hpp>
#include <KernelKit/LPC.hxx>
@@ -382,29 +382,29 @@ namespace Kernel
if (!the_stack || new_pid < 0)
return false;
- for (SizeT index = 0UL; index < SMPManager::The().Leak().Count(); ++index)
+ for (SizeT index = 0UL; index < MPManager::The().Leak().Count(); ++index)
{
- if (SMPManager::The().Leak()[index].Leak()->Kind() == kInvalidHart)
+ if (MPManager::The().Leak()[index].Leak()->Kind() == kInvalidHart)
continue;
- if (SMPManager::The().Leak()[index].Leak()->StackFrame() == the_stack)
+ if (MPManager::The().Leak()[index].Leak()->StackFrame() == the_stack)
{
- SMPManager::The().Leak()[index].Leak()->Busy(false);
+ MPManager::The().Leak()[index].Leak()->Busy(false);
continue;
}
- if (SMPManager::The().Leak()[index].Leak()->IsBusy())
+ if (MPManager::The().Leak()[index].Leak()->IsBusy())
continue;
- if (SMPManager::The().Leak()[index].Leak()->Kind() !=
+ if (MPManager::The().Leak()[index].Leak()->Kind() !=
ThreadKind::kHartBoot &&
- SMPManager::The().Leak()[index].Leak()->Kind() !=
+ MPManager::The().Leak()[index].Leak()->Kind() !=
ThreadKind::kHartSystemReserved)
{
- SMPManager::The().Leak()[index].Leak()->Busy(true);
+ MPManager::The().Leak()[index].Leak()->Busy(true);
ProcessHelper::TheCurrentPID() = new_pid;
- return SMPManager::The().Leak()[index].Leak()->Switch(the_stack);
+ return MPManager::The().Leak()[index].Leak()->Switch(the_stack);
}
}