From 650fee520f526d9cd5ffa75735bd94d5140dd247 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 20 Jul 2024 08:43:16 +0200 Subject: [IMP] See below. - Revoke OTA flag for now inside bootloader (newosldr #4) - Rework Comm as SCI (System Call Interface) (newoskrnl #3) - Rework and fix some parts of the scheduler (newoskrnl #2) - Return from thread when region is zero (newosldr #1) - Separate allocation functions and c++ runtime from each other. (DDK #5) - Rename kHartStandard to kStandard (newoskrnl #6) Signed-off-by: Amlal --- Kernel/KernelKit/ProcessHeap.hxx | 2 +- Kernel/KernelKit/ProcessScheduler.hxx | 24 ++++++++++++++---------- Kernel/KernelKit/RLE.hxx | 3 +++ 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'Kernel/KernelKit') diff --git a/Kernel/KernelKit/ProcessHeap.hxx b/Kernel/KernelKit/ProcessHeap.hxx index 677aa835..d2ec4035 100644 --- a/Kernel/KernelKit/ProcessHeap.hxx +++ b/Kernel/KernelKit/ProcessHeap.hxx @@ -15,7 +15,7 @@ /// @version 5/11/23 /// @file ProcessHeap.hxx -/// @brief memory heap for user processes. +/// @brief Heap for user processes. #define kUserHeapMaxSz (4096) #define kUserHeapMag (0xFAF0FEF0) diff --git a/Kernel/KernelKit/ProcessScheduler.hxx b/Kernel/KernelKit/ProcessScheduler.hxx index cbce2ec2..3f6e7828 100644 --- a/Kernel/KernelKit/ProcessScheduler.hxx +++ b/Kernel/KernelKit/ProcessScheduler.hxx @@ -13,7 +13,7 @@ #include #include -#define kSchedMinMicroTime (AffinityKind::kHartStandard) +#define kSchedMinMicroTime (AffinityKind::kStandard) #define kSchedInvalidPID (-1) #define kSchedProcessLimitPerTeam (16U) @@ -58,7 +58,7 @@ namespace Kernel kInvalid = 300, kVeryHigh = 250, kHigh = 200, - kHartStandard = 150, + kStandard = 150, kLowUsage = 100, kVeryLowUsage = 50, }; @@ -167,7 +167,7 @@ namespace Kernel kKindCount, }; - ProcessTime PTime; + ProcessTime PTime{0}; PID ProcessId{kSchedInvalidPID}; Int32 Kind{kAppKind}; @@ -178,25 +178,29 @@ namespace Kernel return Status != ProcessStatus::kDead; } - //! @brief Crash the app, exits with code ~0. + ///! @brief Crashes the app, exits with code ~0. Void Crash(); - //! @brief Exits app. + ///! @brief Exits the app. Void Exit(Int32 exitCode = 0); - //! @brief TLS Allocate + ///! @brief TLS allocate. + ///! @param sz size of new ptr. VoidPtr New(const SizeT& sz); - //! @brief TLS Free. + ///! @brief TLS free. + ///! @param ptr the pointer to free. + ///! @param sz the size of it. Boolean Delete(VoidPtr ptr, const SizeT& sz); - //! @brief Wakes up threads. + ///! @brief Wakes up threads. Void Wake(const bool wakeup = false); // ProcessHeader getters. public: - //! @brief ProcessHeader name getter, example: "C RunTime" - const Char* GetName() noexcept; + ///! @brief Get the process's name + ///! @example 'C Runtime Library' + const Char* GetProcessName() noexcept; //! @brief return local error code of process. //! @return Int32 local error code. diff --git a/Kernel/KernelKit/RLE.hxx b/Kernel/KernelKit/RLE.hxx index e43d2462..9256c23b 100644 --- a/Kernel/KernelKit/RLE.hxx +++ b/Kernel/KernelKit/RLE.hxx @@ -9,4 +9,7 @@ #include +EXTERN_C void rle_compress(void* data, long sz, void* out, long out_sz); +EXTERN_C void rle_decompress(void* data, long sz, void* out, long out_sz); + #endif // !ifndef __KERNELKIT_RLE_HXX__ -- cgit v1.2.3