summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Sources
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-19 11:08:35 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-19 11:11:32 +0200
commit849af3db3b0d0c1edd3d32359be21785e3465bf2 (patch)
tree6f7a9266a9972da7cf8418fe2a41b2e95154e9e1 /dev/ZKA/Sources
parent933d1ef6721903895b15c45917a0fc705763fbf5 (diff)
[IMP]
+ Add the thread header block, which contains informations about a list of threads inside a process. + Add WINDOW structure to keep track of Windows as well. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Sources')
-rw-r--r--dev/ZKA/Sources/MP.cxx18
-rw-r--r--dev/ZKA/Sources/ProcessScheduler.cxx4
-rw-r--r--dev/ZKA/Sources/ThreadScheduler.cxx29
3 files changed, 39 insertions, 12 deletions
diff --git a/dev/ZKA/Sources/MP.cxx b/dev/ZKA/Sources/MP.cxx
index bf35f51e..da92a8c6 100644
--- a/dev/ZKA/Sources/MP.cxx
+++ b/dev/ZKA/Sources/MP.cxx
@@ -84,17 +84,17 @@ namespace Kernel
/// @retval false stack is invalid, previous code is running.
Bool HardwareThread::Switch(HAL::StackFramePtr stack)
{
- if (!rt_check_stack(stack))
+ /// provide 'nullptr' to free the stack frame.
+ if (stack == nullptr)
{
- /// provide 'nullptr' to free the stack frame.
- if (stack == nullptr)
- {
- delete fStack;
- fStack = nullptr;
+ delete fStack;
+ fStack = nullptr;
- return true;
- }
+ return true;
+ }
+ if (!rt_check_stack(stack))
+ {
return false;
}
@@ -125,7 +125,7 @@ namespace Kernel
StringView strCoreName(512);
strCoreName += "\\Class\\Smp\\MPClass";
- cSMPCoreName.GetKey() = strCoreName;
+ cSMPCoreName.GetKey() = strCoreName;
cSMPCoreName.GetValue() = (UIntPtr)this;
kcout << "newoskrnl: initializing " << strCoreName.CData() << endl;
diff --git a/dev/ZKA/Sources/ProcessScheduler.cxx b/dev/ZKA/Sources/ProcessScheduler.cxx
index a979c413..0066d70b 100644
--- a/dev/ZKA/Sources/ProcessScheduler.cxx
+++ b/dev/ZKA/Sources/ProcessScheduler.cxx
@@ -210,8 +210,8 @@ namespace Kernel
}
/// @brief Add process to list.
- /// @param process
- /// @return
+ /// @param process the process *Ref* class.
+ /// @return the process index inside the team.
SizeT ProcessScheduler::Add(Ref<PROCESS_HEADER_BLOCK>& process)
{
if (!process.Leak().Image)
diff --git a/dev/ZKA/Sources/ThreadScheduler.cxx b/dev/ZKA/Sources/ThreadScheduler.cxx
index fb822a68..a6dfd2b9 100644
--- a/dev/ZKA/Sources/ThreadScheduler.cxx
+++ b/dev/ZKA/Sources/ThreadScheduler.cxx
@@ -5,4 +5,31 @@
------------------------------------------- */
#include <KernelKit/ProcessScheduler.hxx>
-#include <KernelKit/MP.hxx> \ No newline at end of file
+#include <KernelKit/MP.hxx>
+
+namespace Kernel::Detail
+{
+ /// \brief Process thread information.
+ struct THREAD_HEADER_BLOCK final
+ {
+ STATIC constexpr SizeT cMaxLen = 256;
+
+ // Status
+ Char fName[cMaxLen] = { "THREAD #0 (PROCESS 0)" };
+
+ ProcessStatus fThreadStatus;
+
+ // Information
+ Int64 fThreadID;
+
+ // Code buffers.
+ UIntPtr fCode;
+ UIntPtr fStack;
+ UIntPtr fBSS;
+ UIntPtr fProcessheader;
+
+ // GX buffers.
+ UIntPtr fTGB;
+ UIntPtr fTGBSize;
+ };
+}