diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-30 23:53:22 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:52 +0200 |
commit | 0b27c721c994e10200893c3306cdab2184e5143c (patch) | |
tree | 4b5242fc2ed4f3ebfa34f0568c2b662c617d48ff /src/core/hle/kernel/k_process.cpp | |
parent | hle: kernel: Rename Process to KProcess. (diff) | |
download | yuzu-0b27c721c994e10200893c3306cdab2184e5143c.tar yuzu-0b27c721c994e10200893c3306cdab2184e5143c.tar.gz yuzu-0b27c721c994e10200893c3306cdab2184e5143c.tar.bz2 yuzu-0b27c721c994e10200893c3306cdab2184e5143c.tar.lz yuzu-0b27c721c994e10200893c3306cdab2184e5143c.tar.xz yuzu-0b27c721c994e10200893c3306cdab2184e5143c.tar.zst yuzu-0b27c721c994e10200893c3306cdab2184e5143c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_process.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index edc3b5175..e542b1f07 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp @@ -21,6 +21,7 @@ #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_slab_heap.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" @@ -247,6 +248,30 @@ void KProcess::UnpinCurrentThread() { KScheduler::SetSchedulerUpdateNeeded(kernel); } +ResultCode KProcess::AddSharedMemory(KSharedMemory* shmem, [[maybe_unused]] VAddr address, + [[maybe_unused]] size_t size) { + // Lock ourselves, to prevent concurrent access. + KScopedLightLock lk(state_lock); + + // TODO(bunnei): Manage KSharedMemoryInfo list here. + + // Open a reference to the shared memory. + shmem->Open(); + + return RESULT_SUCCESS; +} + +void KProcess::RemoveSharedMemory(KSharedMemory* shmem, [[maybe_unused]] VAddr address, + [[maybe_unused]] size_t size) { + // Lock ourselves, to prevent concurrent access. + KScopedLightLock lk(state_lock); + + // TODO(bunnei): Manage KSharedMemoryInfo list here. + + // Close a reference to the shared memory. + shmem->Close(); +} + void KProcess::RegisterThread(const KThread* thread) { thread_list.push_back(thread); } |