diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-21 06:28:11 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:52 +0200 |
commit | b57c5a9b54b23a348d7e80e51943f27a54fb8c2f (patch) | |
tree | e3f3c81a2fddb94c43b6a1dd641c61a7ca9c8225 /src/core/hle/kernel/kernel.h | |
parent | hle: kernel: svc: Migrate WaitSynchronization. (diff) | |
download | yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.tar yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.tar.gz yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.tar.bz2 yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.tar.lz yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.tar.xz yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.tar.zst yuzu-b57c5a9b54b23a348d7e80e51943f27a54fb8c2f.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r-- | src/core/hle/kernel/kernel.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index f07f0276e..43e49603b 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -92,7 +92,10 @@ public: void Shutdown(); /// Retrieves a shared pointer to the system resource limit instance. - std::shared_ptr<KResourceLimit> GetSystemResourceLimit() const; + const KResourceLimit* GetSystemResourceLimit() const; + + /// Retrieves a shared pointer to the system resource limit instance. + KResourceLimit* GetSystemResourceLimit(); /// Retrieves a shared pointer to a Thread instance within the thread wakeup handle table. KScopedAutoObject<KThread> RetrieveThreadFromGlobalHandleTable(Handle handle) const; @@ -263,24 +266,26 @@ public: /// Gets the slab heap for the specified kernel object type. template <typename T> KSlabHeap<T>& SlabHeap() { - if constexpr (std::is_same_v<T, Process>) { - return slab_heap_container->process; - } else if constexpr (std::is_same_v<T, KThread>) { - return slab_heap_container->thread; + if constexpr (std::is_same_v<T, KClientSession>) { + return slab_heap_container->client_session; } else if constexpr (std::is_same_v<T, KEvent>) { return slab_heap_container->event; - } else if constexpr (std::is_same_v<T, KSharedMemory>) { - return slab_heap_container->shared_memory; } else if constexpr (std::is_same_v<T, KLinkedListNode>) { return slab_heap_container->linked_list_node; - } else if constexpr (std::is_same_v<T, KWritableEvent>) { - return slab_heap_container->writeable_event; - } else if constexpr (std::is_same_v<T, KClientSession>) { - return slab_heap_container->client_session; + } else if constexpr (std::is_same_v<T, Process>) { + return slab_heap_container->process; + } else if constexpr (std::is_same_v<T, KResourceLimit>) { + return slab_heap_container->resource_limit; } else if constexpr (std::is_same_v<T, KSession>) { return slab_heap_container->session; + } else if constexpr (std::is_same_v<T, KSharedMemory>) { + return slab_heap_container->shared_memory; + } else if constexpr (std::is_same_v<T, KThread>) { + return slab_heap_container->thread; } else if constexpr (std::is_same_v<T, KTransferMemory>) { return slab_heap_container->transfer_memory; + } else if constexpr (std::is_same_v<T, KWritableEvent>) { + return slab_heap_container->writeable_event; } } @@ -315,15 +320,16 @@ private: private: /// Helper to encapsulate all slab heaps in a single heap allocated container struct SlabHeapContainer { - KSlabHeap<Process> process; - KSlabHeap<KThread> thread; + KSlabHeap<KClientSession> client_session; KSlabHeap<KEvent> event; - KSlabHeap<KSharedMemory> shared_memory; KSlabHeap<KLinkedListNode> linked_list_node; - KSlabHeap<KWritableEvent> writeable_event; - KSlabHeap<KClientSession> client_session; + KSlabHeap<Process> process; + KSlabHeap<KResourceLimit> resource_limit; KSlabHeap<KSession> session; + KSlabHeap<KSharedMemory> shared_memory; + KSlabHeap<KThread> thread; KSlabHeap<KTransferMemory> transfer_memory; + KSlabHeap<KWritableEvent> writeable_event; }; std::unique_ptr<SlabHeapContainer> slab_heap_container; |