diff options
Diffstat (limited to 'Private/KernelKit')
| -rw-r--r-- | Private/KernelKit/FileManager.hpp | 10 | ||||
| -rw-r--r-- | Private/KernelKit/ThreadLocalStorage.hxx | 20 |
2 files changed, 26 insertions, 4 deletions
diff --git a/Private/KernelKit/FileManager.hpp b/Private/KernelKit/FileManager.hpp index 52dfb267..311527f9 100644 --- a/Private/KernelKit/FileManager.hpp +++ b/Private/KernelKit/FileManager.hpp @@ -77,10 +77,13 @@ namespace hCore }; + /** + * @brief Child of IFilesystemManager, takes care of managing NewFS disks. + */ class NewFilesystemManager final : public IFilesystemManager { public: - NewFilesystemManager(); + explicit NewFilesystemManager(); ~NewFilesystemManager() override; public: @@ -113,6 +116,11 @@ namespace hCore }; + /** + * Usable FileStream + * @tparam Encoding file encoding (char, wchar_t...) + * @tparam FSClass Filesystem contract who takes care of it. + */ template <typename Encoding = char, typename FSClass = NewFilesystemManager> class FileStream final { diff --git a/Private/KernelKit/ThreadLocalStorage.hxx b/Private/KernelKit/ThreadLocalStorage.hxx index 518adb32..8b3f2c9b 100644 --- a/Private/KernelKit/ThreadLocalStorage.hxx +++ b/Private/KernelKit/ThreadLocalStorage.hxx @@ -27,11 +27,25 @@ bool hcore_tls_delete_ptr(T* ptr); template <typename T, typename... Args> T* hcore_tls_new_class(Args&&... args); -//! @brief Cookie Sanity check. -hCore::Boolean hcore_tls_check(hCore::VoidPtr ptr); - typedef char rt_cookie_type[3]; +/// @brief Thread Information Block for Local Storage. +/// Located in GS on AMD64, Virtual Address 0x10000 (64x0, 32x0, ARM64) +struct ThreadInformationBlock final +{ + hCore::Char Name[255]; // Module Name + hCore::UIntPtr StartCode; // Start Address + hCore::UIntPtr StartData; // Allocation Heap + hCore::UIntPtr StartStack; // Stack Pointer. + hCore::Int32 Arch; // Architecture and/or platform. + rt_cookie_type Cookie; // Not shown in public header, this is the way we tell something went wrong. +}; + +//! @brief Cookie Sanity check. +hCore::Boolean hcore_tls_check(ThreadInformationBlock* ptr); + #include "ThreadLocalStorage.inl" +// last rev 1/27/24 + #endif /* ifndef _KERNELKIT_TLS_HPP */ |
