diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-04 07:22:36 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:50 +0200 |
commit | 7ccbdd4d8d3dea7294d2cac38779cceea9745d52 (patch) | |
tree | 3106289a5c5a6e4bf50bc09a548c8408aa29fbad /src/core/hle/kernel/process.h | |
parent | hle: kernel: Refactor IPC interfaces to not use std::shared_ptr. (diff) | |
download | yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.gz yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.bz2 yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.lz yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.xz yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.zst yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.zip |
Diffstat (limited to 'src/core/hle/kernel/process.h')
-rw-r--r-- | src/core/hle/kernel/process.h | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 45eefb90e..df3c7997d 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -13,9 +13,11 @@ #include "common/common_types.h" #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/k_address_arbiter.h" +#include "core/hle/kernel/k_auto_object.h" #include "core/hle/kernel/k_condition_variable.h" #include "core/hle/kernel/k_synchronization_object.h" #include "core/hle/kernel/process_capability.h" +#include "core/hle/kernel/slab_helpers.h" #include "core/hle/result.h" namespace Core { @@ -60,9 +62,11 @@ enum class ProcessStatus { DebugBreak, }; -class Process final : public KSynchronizationObject { +class Process final : public KAutoObjectWithSlabHeapAndContainer<Process, KSynchronizationObject> { + KERNEL_AUTOOBJECT_TRAITS(Process, KSynchronizationObject); + public: - explicit Process(Core::System& system); + explicit Process(KernelCore& kernel); ~Process() override; enum : u64 { @@ -85,8 +89,8 @@ public: static constexpr std::size_t RANDOM_ENTROPY_SIZE = 4; - static std::shared_ptr<Process> Create(Core::System& system, std::string name, - ProcessType type); + static ResultCode Initialize(Process* process, Core::System& system, std::string name, + ProcessType type); std::string GetTypeName() const override { return "Process"; @@ -338,9 +342,21 @@ public: void LoadModule(CodeSet code_set, VAddr base_addr); - bool IsSignaled() const override; + virtual bool IsInitialized() const override { + return is_initialized; + } + + static void PostDestroy([[maybe_unused]] uintptr_t arg) {} + + virtual void Finalize() override { + UNIMPLEMENTED(); + } + + virtual u64 GetId() const override final { + return GetProcessID(); + } - void Finalize() override {} + virtual bool IsSignaled() const override; void PinCurrentThread(); void UnpinCurrentThread(); @@ -462,6 +478,7 @@ private: bool is_signaled{}; bool is_suspended{}; + bool is_initialized{}; std::atomic<s32> num_created_threads{}; std::atomic<u16> num_threads{}; @@ -474,9 +491,6 @@ private: KThread* exception_thread{}; KLightLock state_lock; - - /// System context - Core::System& system; }; } // namespace Kernel |