diff options
author | bunnei <bunneidev@gmail.com> | 2022-09-06 02:47:00 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-10-19 04:13:34 +0200 |
commit | 25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad (patch) | |
tree | 1007ca27eaa8cb9f76c0359903d11432e17c44d8 /src/core/hle/kernel/k_process.cpp | |
parent | core: hle: kernel: svc_types: Add SystemThreadPriorityHighest and ProcessState. (diff) | |
download | yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.tar yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.tar.gz yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.tar.bz2 yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.tar.lz yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.tar.xz yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.tar.zst yuzu-25dcaf1ecaeb3998a2cb8b03a7aa8a02402e0bad.zip |
Diffstat (limited to 'src/core/hle/kernel/k_process.cpp')
-rw-r--r-- | src/core/hle/kernel/k_process.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index d3e99665f..1d3157a9f 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp @@ -72,7 +72,7 @@ Result KProcess::Initialize(KProcess* process, Core::System& system, std::string process->name = std::move(process_name); process->resource_limit = res_limit; - process->status = ProcessStatus::Created; + process->state = State::Created; process->program_id = 0; process->process_id = type == ProcessType::KernelInternal ? kernel.CreateNewKernelProcessID() : kernel.CreateNewUserProcessID(); @@ -289,7 +289,7 @@ Result KProcess::Reset() { KScopedSchedulerLock sl{kernel}; // Validate that we're in a state that we can reset. - R_UNLESS(status != ProcessStatus::Exited, ResultInvalidState); + R_UNLESS(state != State::Terminated, ResultInvalidState); R_UNLESS(is_signaled, ResultInvalidState); // Clear signaled. @@ -304,8 +304,8 @@ Result KProcess::SetActivity(ProcessActivity activity) { KScopedSchedulerLock sl{kernel}; // Validate our state. - R_UNLESS(status != ProcessStatus::Exiting, ResultInvalidState); - R_UNLESS(status != ProcessStatus::Exited, ResultInvalidState); + R_UNLESS(state != State::Terminating, ResultInvalidState); + R_UNLESS(state != State::Terminated, ResultInvalidState); // Either pause or resume. if (activity == ProcessActivity::Paused) { @@ -411,13 +411,13 @@ void KProcess::Run(s32 main_thread_priority, u64 stack_size) { const std::size_t heap_capacity{memory_usage_capacity - (main_thread_stack_size + image_size)}; ASSERT(!page_table->SetMaxHeapSize(heap_capacity).IsError()); - ChangeStatus(ProcessStatus::Running); + ChangeState(State::Running); SetupMainThread(kernel.System(), *this, main_thread_priority, main_thread_stack_top); } void KProcess::PrepareForTermination() { - ChangeStatus(ProcessStatus::Exiting); + ChangeState(State::Terminating); const auto stop_threads = [this](const std::vector<KThread*>& in_thread_list) { for (auto* thread : in_thread_list) { @@ -445,7 +445,7 @@ void KProcess::PrepareForTermination() { main_thread_stack_size + image_size); } - ChangeStatus(ProcessStatus::Exited); + ChangeState(State::Terminated); } void KProcess::Finalize() { @@ -652,12 +652,12 @@ KProcess::KProcess(KernelCore& kernel_) KProcess::~KProcess() = default; -void KProcess::ChangeStatus(ProcessStatus new_status) { - if (status == new_status) { +void KProcess::ChangeState(State new_state) { + if (state == new_state) { return; } - status = new_status; + state = new_state; is_signaled = true; NotifyAvailable(); } |