summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r--src/core/hle/kernel/kernel.h67
1 files changed, 2 insertions, 65 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 4449f6949..1b380a07b 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -305,49 +305,7 @@ public:
305 305
306 /// Gets the slab heap for the specified kernel object type. 306 /// Gets the slab heap for the specified kernel object type.
307 template <typename T> 307 template <typename T>
308 KSlabHeap<T>& SlabHeap() { 308 KSlabHeap<T>& SlabHeap();
309 if constexpr (std::is_same_v<T, KClientSession>) {
310 return slab_heap_container->client_session;
311 } else if constexpr (std::is_same_v<T, KEvent>) {
312 return slab_heap_container->event;
313 } else if constexpr (std::is_same_v<T, KLinkedListNode>) {
314 return slab_heap_container->linked_list_node;
315 } else if constexpr (std::is_same_v<T, KPort>) {
316 return slab_heap_container->port;
317 } else if constexpr (std::is_same_v<T, KProcess>) {
318 return slab_heap_container->process;
319 } else if constexpr (std::is_same_v<T, KResourceLimit>) {
320 return slab_heap_container->resource_limit;
321 } else if constexpr (std::is_same_v<T, KSession>) {
322 return slab_heap_container->session;
323 } else if constexpr (std::is_same_v<T, KSharedMemory>) {
324 return slab_heap_container->shared_memory;
325 } else if constexpr (std::is_same_v<T, KSharedMemoryInfo>) {
326 return slab_heap_container->shared_memory_info;
327 } else if constexpr (std::is_same_v<T, KThread>) {
328 return slab_heap_container->thread;
329 } else if constexpr (std::is_same_v<T, KTransferMemory>) {
330 return slab_heap_container->transfer_memory;
331 } else if constexpr (std::is_same_v<T, KCodeMemory>) {
332 return slab_heap_container->code_memory;
333 } else if constexpr (std::is_same_v<T, KDeviceAddressSpace>) {
334 return slab_heap_container->device_address_space;
335 } else if constexpr (std::is_same_v<T, KPageBuffer>) {
336 return slab_heap_container->page_buffer;
337 } else if constexpr (std::is_same_v<T, KThreadLocalPage>) {
338 return slab_heap_container->thread_local_page;
339 } else if constexpr (std::is_same_v<T, KObjectName>) {
340 return slab_heap_container->object_name;
341 } else if constexpr (std::is_same_v<T, KSessionRequest>) {
342 return slab_heap_container->session_request;
343 } else if constexpr (std::is_same_v<T, KSecureSystemResource>) {
344 return slab_heap_container->secure_system_resource;
345 } else if constexpr (std::is_same_v<T, KEventInfo>) {
346 return slab_heap_container->event_info;
347 } else if constexpr (std::is_same_v<T, KDebug>) {
348 return slab_heap_container->debug;
349 }
350 }
351 309
352 /// Gets the current slab resource counts. 310 /// Gets the current slab resource counts.
353 Init::KSlabResourceCounts& SlabResourceCounts(); 311 Init::KSlabResourceCounts& SlabResourceCounts();
@@ -393,28 +351,7 @@ private:
393 351
394private: 352private:
395 /// Helper to encapsulate all slab heaps in a single heap allocated container 353 /// Helper to encapsulate all slab heaps in a single heap allocated container
396 struct SlabHeapContainer { 354 struct SlabHeapContainer;
397 KSlabHeap<KClientSession> client_session;
398 KSlabHeap<KEvent> event;
399 KSlabHeap<KLinkedListNode> linked_list_node;
400 KSlabHeap<KPort> port;
401 KSlabHeap<KProcess> process;
402 KSlabHeap<KResourceLimit> resource_limit;
403 KSlabHeap<KSession> session;
404 KSlabHeap<KSharedMemory> shared_memory;
405 KSlabHeap<KSharedMemoryInfo> shared_memory_info;
406 KSlabHeap<KThread> thread;
407 KSlabHeap<KTransferMemory> transfer_memory;
408 KSlabHeap<KCodeMemory> code_memory;
409 KSlabHeap<KDeviceAddressSpace> device_address_space;
410 KSlabHeap<KPageBuffer> page_buffer;
411 KSlabHeap<KThreadLocalPage> thread_local_page;
412 KSlabHeap<KObjectName> object_name;
413 KSlabHeap<KSessionRequest> session_request;
414 KSlabHeap<KSecureSystemResource> secure_system_resource;
415 KSlabHeap<KEventInfo> event_info;
416 KSlabHeap<KDebug> debug;
417 };
418 355
419 std::unique_ptr<SlabHeapContainer> slab_heap_container; 356 std::unique_ptr<SlabHeapContainer> slab_heap_container;
420}; 357};