summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-31 16:40:11 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-31 16:42:42 +0200
commit63dc1384bcbf8caf4ca53c715628db2c36b0b096 (patch)
tree2937e78fc2f0e729052660bdd1c74fdacf57d0ec /Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
parent59e0caa55e97f1a998904f404e5fedac3b2b0ec6 (diff)
[IMP] SEE BELOW.
- Support for shared libraries inside a process. - SMP improvements, add the PROCESS_CONTROL_BLOCK, to handle task switching. - Add MUST_PASS in HardwareTimer class. - Add rtl.internal.inl for SCM internal implementation. Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx')
-rw-r--r--Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx b/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
index 2f82da6b..a79d1881 100644
--- a/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
+++ b/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
@@ -166,7 +166,6 @@ namespace Kernel::HAL
{
while (Yes)
{
-
}
}
@@ -176,9 +175,17 @@ namespace Kernel::HAL
hal_switch_context(stackFrame);
}
+ constexpr auto cMaxPCBBlocks = 64;
+
+ struct PROCESS_CONTROL_BLOCK final
+ {
+ ProcessHeader* f_Header;
+ HAL::StackFramePtr f_StackFrame;
+ } fBlocks[cMaxPCBBlocks] = {0};
+
STATIC Void hal_switch_context(HAL::StackFramePtr stackFrame)
{
- Semaphore sem;
+ STATIC Semaphore sem;
constexpr auto cSeconds = 1U;
@@ -187,6 +194,9 @@ namespace Kernel::HAL
cFramePtr = stackFrame;
+ fBlocks[ProcessScheduler::The().Leak().TheCurrent().Leak().ProcessId % cMaxPCBBlocks].f_Header = &ProcessScheduler::The().Leak().TheCurrent().Leak();
+ fBlocks[ProcessScheduler::The().Leak().TheCurrent().Leak().ProcessId % cMaxPCBBlocks].f_StackFrame = stackFrame;
+
sem.Unlock();
}