aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/os/process.h
diff options
context:
space:
mode:
authoryuzubot <[email protected]>2024-03-04 13:02:54 +0000
committeryuzubot <[email protected]>2024-03-04 13:02:54 +0000
commit537296095ab24eddcb196b5ef98004f91de9c8c2 (patch)
treee75e9e2441dc3f8657cc42f2daaae08737949c2b /src/core/hle/service/os/process.h
parent2ddac7b02b660bbc7bdfe4fef240699df6d52e64 (diff)
downloadyuzu-mainline-537296095ab24eddcb196b5ef98004f91de9c8c2.tar.gz
yuzu-mainline-537296095ab24eddcb196b5ef98004f91de9c8c2.zip
"Merge Tagged PR 13018"HEADmaster
Diffstat (limited to 'src/core/hle/service/os/process.h')
-rw-r--r--src/core/hle/service/os/process.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/core/hle/service/os/process.h b/src/core/hle/service/os/process.h
new file mode 100644
index 000000000..9109b7d0a
--- /dev/null
+++ b/src/core/hle/service/os/process.h
@@ -0,0 +1,58 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "common/common_types.h"
+
+namespace Core {
+class System;
+}
+
+namespace Loader {
+class AppLoader;
+enum class ResultStatus : u16;
+} // namespace Loader
+
+namespace Kernel {
+class KProcess;
+}
+
+namespace Service {
+
+class Process {
+public:
+ explicit Process(Core::System& system);
+ ~Process();
+
+ bool Initialize(Loader::AppLoader& loader, Loader::ResultStatus& out_load_result);
+ void Finalize();
+
+ bool Run();
+ void Terminate();
+ void Suspend(bool suspended);
+ void ResetSignal();
+
+ bool IsInitialized() const {
+ return m_process != nullptr;
+ }
+
+ bool IsRunning() const;
+ bool IsTerminated() const;
+
+ u64 GetProcessId() const;
+ u64 GetProgramId() const;
+
+ Kernel::KProcess* GetHandle() const {
+ return m_process;
+ }
+
+private:
+ Core::System& m_system;
+ Kernel::KProcess* m_process{};
+ s32 m_main_thread_priority{};
+ u64 m_main_thread_stack_size{};
+ bool m_process_started{};
+};
+
+} // namespace Service