summaryrefslogtreecommitdiffhomepage
path: root/Private/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-19 10:05:31 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-19 10:05:31 +0100
commitbaf2afd8cd672dcb9c13d956dfdd73b61dfee558 (patch)
tree0734d2fe6d480e9805121e1c7d5e42f20bf4e8f4 /Private/KernelKit
parent98347089c7e4e2b306d25a0db77e00aa2ea50882 (diff)
unstable, secret: See below.
System.Core: - Add RunTime init function. - Add ReadMe.md Kernel: - Improve TLS code, use Encoder class instead of casting directly. - Refactor process team to include processscheduler.hpp instead. ObjectKit: - Rename Object.hxx to ObjectKit.hxx Builtins/AHCI: - Rename API.hxx to Interface.hxx Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/KernelKit')
-rw-r--r--Private/KernelKit/ProcessScheduler.hpp1
-rw-r--r--Private/KernelKit/ProcessTeam.hpp9
-rw-r--r--Private/KernelKit/SMPManager.hpp10
-rw-r--r--Private/KernelKit/ThreadLocalStorage.hxx15
4 files changed, 9 insertions, 26 deletions
diff --git a/Private/KernelKit/ProcessScheduler.hpp b/Private/KernelKit/ProcessScheduler.hpp
index 733c7c65..fa59be4b 100644
--- a/Private/KernelKit/ProcessScheduler.hpp
+++ b/Private/KernelKit/ProcessScheduler.hpp
@@ -9,7 +9,6 @@
#include <ArchKit/ArchKit.hpp>
#include <KernelKit/FileManager.hpp>
-#include <KernelKit/ProcessTeam.hpp>
#include <KernelKit/PermissionSelector.hxx>
#include <NewKit/LockDelegate.hpp>
#include <NewKit/MutableArray.hpp>
diff --git a/Private/KernelKit/ProcessTeam.hpp b/Private/KernelKit/ProcessTeam.hpp
deleted file mode 100644
index 9538bbae..00000000
--- a/Private/KernelKit/ProcessTeam.hpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#pragma once
-
-#include <KernelKit/ProcessScheduler.hpp>
diff --git a/Private/KernelKit/SMPManager.hpp b/Private/KernelKit/SMPManager.hpp
index 49406f1b..c207be82 100644
--- a/Private/KernelKit/SMPManager.hpp
+++ b/Private/KernelKit/SMPManager.hpp
@@ -4,8 +4,8 @@
------------------------------------------- */
-#ifndef _INC_SMP_MANAGER_HPP
-#define _INC_SMP_MANAGER_HPP
+#ifndef __SMP_MANAGER__
+#define __SMP_MANAGER__
#include <ArchKit/ArchKit.hpp>
#include <CompilerKit/CompilerKit.hxx>
@@ -112,11 +112,11 @@ class SMPManager final {
/// @brief wakes up thread.
/// wakes up thread from hang.
-void rt_wakeup_thread(HAL::StackFrame* stack);
+Void rt_wakeup_thread(HAL::StackFramePtr stack);
/// @brief makes thread sleep.
/// hooks and hangs thread to prevent code from executing.
-void rt_hang_thread(HAL::StackFrame* stack);
+Void rt_hang_thread(HAL::StackFramePtr stack);
} // namespace HCore
-#endif // !_INC_SMP_MANAGER_HPP
+#endif // !__SMP_MANAGER__
diff --git a/Private/KernelKit/ThreadLocalStorage.hxx b/Private/KernelKit/ThreadLocalStorage.hxx
index 2fab5026..c6be2c2b 100644
--- a/Private/KernelKit/ThreadLocalStorage.hxx
+++ b/Private/KernelKit/ThreadLocalStorage.hxx
@@ -26,28 +26,21 @@ T *tls_new_class(Args &&...args);
#define kTLSCookieLen 3
-typedef HCore::Char* rt_cookie_type;
-
-#define kTIBNameLen 256
-
/// @brief Thread Information Block for Local Storage.
/// Located in GS on AMD64, Virtual Address 0x10000 (64x0, 32x0, ARM64)
-struct ThreadInformationBlock final {
- HCore::Char Name[kTIBNameLen]; // Module Name
+struct PACKED ThreadInformationBlock final {
+ HCore::Char Cookie[kTLSCookieLen];
HCore::UIntPtr StartCode; // Start Address
HCore::UIntPtr StartData; // Allocation Heap
HCore::UIntPtr StartStack; // Stack Pointer.
- HCore::Int32 Arch; // Architecture and/or platform.
- HCore::Int32 ID; // Thread execution ID.
- rt_cookie_type Cookie; // Not shown in public header, location of the cookie header is store here, this is the way we tell
- // something went wrong.
+ HCore::Int32 ThreadID; // Thread execution ID.
};
/// @brief TLS install TIB
EXTERN_C void rt_install_tib(ThreadInformationBlock *pTib, HCore::VoidPtr pPib);
///! @brief Cookie Sanity check.
-HCore::Boolean tls_check_tib(ThreadInformationBlock *ptr);
+HCore::Boolean tls_check_tib(ThreadInformationBlock* ptr);
/// @brief TLS check system call
EXTERN_C HCore::Void tls_check_syscall_impl(HCore::HAL::StackFramePtr stackPtr) noexcept;