summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_process.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-06-14 00:36:30 +0200
committerLiam <byteslice@airmail.cc>2022-06-14 16:04:11 +0200
commit888f499188cb869dc8f8f1597c46add65c005324 (patch)
tree2abcaaf69fcb2c15352c99add7a97c9eea567486 /src/core/hle/kernel/k_process.h
parentMerge pull request #8461 from Morph1984/msvc-narrow-conv (diff)
downloadyuzu-888f499188cb869dc8f8f1597c46add65c005324.tar
yuzu-888f499188cb869dc8f8f1597c46add65c005324.tar.gz
yuzu-888f499188cb869dc8f8f1597c46add65c005324.tar.bz2
yuzu-888f499188cb869dc8f8f1597c46add65c005324.tar.lz
yuzu-888f499188cb869dc8f8f1597c46add65c005324.tar.xz
yuzu-888f499188cb869dc8f8f1597c46add65c005324.tar.zst
yuzu-888f499188cb869dc8f8f1597c46add65c005324.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_process.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h
index 9f171e3da..e562a79b8 100644
--- a/src/core/hle/kernel/k_process.h
+++ b/src/core/hle/kernel/k_process.h
@@ -63,6 +63,11 @@ enum class ProcessStatus {
DebugBreak,
};
+enum class ProcessActivity : u32 {
+ Runnable,
+ Paused,
+};
+
class KProcess final : public KAutoObjectWithSlabHeapAndContainer<KProcess, KWorkerTask> {
KERNEL_AUTOOBJECT_TRAITS(KProcess, KSynchronizationObject);
@@ -282,17 +287,17 @@ public:
u64 GetTotalPhysicalMemoryUsedWithoutSystemResource() const;
/// Gets the list of all threads created with this process as their owner.
- const std::list<const KThread*>& GetThreadList() const {
+ std::list<KThread*>& GetThreadList() {
return thread_list;
}
/// Registers a thread as being created under this process,
/// adding it to this process' thread list.
- void RegisterThread(const KThread* thread);
+ void RegisterThread(KThread* thread);
/// Unregisters a thread from this process, removing it
/// from this process' thread list.
- void UnregisterThread(const KThread* thread);
+ void UnregisterThread(KThread* thread);
/// Clears the signaled state of the process if and only if it's signaled.
///
@@ -347,6 +352,8 @@ public:
void DoWorkerTaskImpl();
+ ResultCode SetActivity(ProcessActivity activity);
+
void PinCurrentThread(s32 core_id);
void UnpinCurrentThread(s32 core_id);
void UnpinThread(KThread* thread);
@@ -442,7 +449,7 @@ private:
std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy{};
/// List of threads that are running with this process as their owner.
- std::list<const KThread*> thread_list;
+ std::list<KThread*> thread_list;
/// List of shared memory that are running with this process as their owner.
std::list<KSharedMemoryInfo*> shared_memory_list;
@@ -475,6 +482,7 @@ private:
KThread* exception_thread{};
KLightLock state_lock;
+ KLightLock list_lock;
using TLPTree =
Common::IntrusiveRedBlackTreeBaseTraits<KThreadLocalPage>::TreeType<KThreadLocalPage>;