diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-06-28 08:26:19 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-06-28 08:26:19 +0200 |
| commit | c142fe6fda7d09e929c9706b444cdc13ed5e72f3 (patch) | |
| tree | f42890096937271233da33d9c201043fb9960634 /Kernel/KernelKit | |
| parent | e32c206fe1d17eb96339b280c7f061e7201bd15b (diff) | |
IMP: Feature Pack #1
- Process scheduler.
- System calls.
- ACPI support.
- Driver kit.
- Filesystem support.
- Program loader.
- newstd/herror APIs.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/KernelKit')
| -rw-r--r-- | Kernel/KernelKit/ProcessScheduler.hxx | 17 | ||||
| -rw-r--r-- | Kernel/KernelKit/SMPManager.hpp | 6 | ||||
| -rw-r--r-- | Kernel/KernelKit/Semaphore.hpp | 5 |
3 files changed, 16 insertions, 12 deletions
diff --git a/Kernel/KernelKit/ProcessScheduler.hxx b/Kernel/KernelKit/ProcessScheduler.hxx index 98008d69..11555b1d 100644 --- a/Kernel/KernelKit/ProcessScheduler.hxx +++ b/Kernel/KernelKit/ProcessScheduler.hxx @@ -141,7 +141,8 @@ namespace NewOS NEWOS_COPY_DEFAULT(ProcessHeader) public: - void SetEntrypoint(UIntPtr& imageStart) noexcept; + void SetEntrypoint(UIntPtr& imageStart) noexcept; + const Int32& GetExitCode() noexcept; public: Char Name[kProcessLen] = {"Process"}; @@ -179,30 +180,32 @@ namespace NewOS } //! @brief Crash the app, exits with code ~0. - void Crash(); + Void Crash(); //! @brief Exits app. - void Exit(Int32 exitCode = 0); + Void Exit(Int32 exitCode = 0); //! @brief TLS Allocate - VoidPtr New(const SizeT& sz); + VoidPtr New(const SizeT& sz); //! @brief TLS Free. - Boolean Delete(VoidPtr ptr, const SizeT& sz); + Boolean Delete(VoidPtr ptr, const SizeT& sz); //! @brief Wakes up threads. - void Wake(const bool wakeup = false); + Void Wake(const bool wakeup = false); // ProcessHeader getters. public: //! @brief ProcessHeader name getter, example: "C RunTime" - const Char* GetName(); + const Char* GetName(); const ProcessSelector& GetSelector(); const ProcessStatus& GetStatus(); const AffinityKind& GetAffinity(); private: + Int32 fLastExitCode{0}; + friend ProcessScheduler; friend ProcessHelper; }; diff --git a/Kernel/KernelKit/SMPManager.hpp b/Kernel/KernelKit/SMPManager.hpp index 1840dd20..9f4166ad 100644 --- a/Kernel/KernelKit/SMPManager.hpp +++ b/Kernel/KernelKit/SMPManager.hpp @@ -4,8 +4,8 @@ ------------------------------------------- */ -#ifndef __SMP_MANAGER__ -#define __SMP_MANAGER__ +#ifndef __INC_SMP_MANAGER_HPP__ +#define __INC_SMP_MANAGER_HPP__ #include <ArchKit/ArchKit.hpp> #include <CompilerKit/CompilerKit.hxx> @@ -126,4 +126,4 @@ namespace NewOS Void rt_hang_thread(HAL::StackFramePtr stack); } // namespace NewOS -#endif // !__SMP_MANAGER__ +#endif // !__INC_SMP_MANAGER_HPP__ diff --git a/Kernel/KernelKit/Semaphore.hpp b/Kernel/KernelKit/Semaphore.hpp index 7850804d..83d711ed 100644 --- a/Kernel/KernelKit/Semaphore.hpp +++ b/Kernel/KernelKit/Semaphore.hpp @@ -7,6 +7,7 @@ #pragma once #include <NewKit/Defines.hpp> +#include <KernelKit/Timer.hpp> #include <CompilerKit/CompilerKit.hxx> namespace NewOS @@ -27,11 +28,11 @@ namespace NewOS bool Unlock() noexcept; public: - void Sync() noexcept; + void WaitForProcess() noexcept; public: bool Lock(ProcessHeader* process); - bool LockOrWait(ProcessHeader* process, const Int64& seconds); + bool LockOrWait(ProcessHeader* process, HardwareTimerInterface* timer); public: NEWOS_COPY_DEFAULT(Semaphore); |
