summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2023-03-03 14:42:00 -0800
committerGravatar GitHub2023-03-03 14:42:00 -0800
commit1f98634371838cc94d01613497660937f70ff78b (patch)
tree7760b21a8fe3a407d49b531994784e43fcd87894 /src/core/hle/kernel/kernel.cpp
parentci: Actually enable LTO on MSVC (#9887) (diff)
parentkernel: be more careful about kernel address keys (diff)
downloadyuzu-1f98634371838cc94d01613497660937f70ff78b.tar.gz
yuzu-1f98634371838cc94d01613497660937f70ff78b.tar.xz
yuzu-1f98634371838cc94d01613497660937f70ff78b.zip
Merge pull request #9855 from liamwhite/kern-16-support
kernel: support for 16.0.0
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index ce94d3605..ef7057ff7 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -1318,4 +1318,97 @@ const Core::System& KernelCore::System() const {
1318 return impl->system; 1318 return impl->system;
1319} 1319}
1320 1320
1321struct KernelCore::SlabHeapContainer {
1322 KSlabHeap<KClientSession> client_session;
1323 KSlabHeap<KEvent> event;
1324 KSlabHeap<KLinkedListNode> linked_list_node;
1325 KSlabHeap<KPort> port;
1326 KSlabHeap<KProcess> process;
1327 KSlabHeap<KResourceLimit> resource_limit;
1328 KSlabHeap<KSession> session;
1329 KSlabHeap<KSharedMemory> shared_memory;
1330 KSlabHeap<KSharedMemoryInfo> shared_memory_info;
1331 KSlabHeap<KThread> thread;
1332 KSlabHeap<KTransferMemory> transfer_memory;
1333 KSlabHeap<KCodeMemory> code_memory;
1334 KSlabHeap<KDeviceAddressSpace> device_address_space;
1335 KSlabHeap<KPageBuffer> page_buffer;
1336 KSlabHeap<KThreadLocalPage> thread_local_page;
1337 KSlabHeap<KObjectName> object_name;
1338 KSlabHeap<KSessionRequest> session_request;
1339 KSlabHeap<KSecureSystemResource> secure_system_resource;
1340 KSlabHeap<KThread::LockWithPriorityInheritanceInfo> lock_info;
1341 KSlabHeap<KEventInfo> event_info;
1342 KSlabHeap<KDebug> debug;
1343};
1344
1345template <typename T>
1346KSlabHeap<T>& KernelCore::SlabHeap() {
1347 if constexpr (std::is_same_v<T, KClientSession>) {
1348 return slab_heap_container->client_session;
1349 } else if constexpr (std::is_same_v<T, KEvent>) {
1350 return slab_heap_container->event;
1351 } else if constexpr (std::is_same_v<T, KLinkedListNode>) {
1352 return slab_heap_container->linked_list_node;
1353 } else if constexpr (std::is_same_v<T, KPort>) {
1354 return slab_heap_container->port;
1355 } else if constexpr (std::is_same_v<T, KProcess>) {
1356 return slab_heap_container->process;
1357 } else if constexpr (std::is_same_v<T, KResourceLimit>) {
1358 return slab_heap_container->resource_limit;
1359 } else if constexpr (std::is_same_v<T, KSession>) {
1360 return slab_heap_container->session;
1361 } else if constexpr (std::is_same_v<T, KSharedMemory>) {
1362 return slab_heap_container->shared_memory;
1363 } else if constexpr (std::is_same_v<T, KSharedMemoryInfo>) {
1364 return slab_heap_container->shared_memory_info;
1365 } else if constexpr (std::is_same_v<T, KThread>) {
1366 return slab_heap_container->thread;
1367 } else if constexpr (std::is_same_v<T, KTransferMemory>) {
1368 return slab_heap_container->transfer_memory;
1369 } else if constexpr (std::is_same_v<T, KCodeMemory>) {
1370 return slab_heap_container->code_memory;
1371 } else if constexpr (std::is_same_v<T, KDeviceAddressSpace>) {
1372 return slab_heap_container->device_address_space;
1373 } else if constexpr (std::is_same_v<T, KPageBuffer>) {
1374 return slab_heap_container->page_buffer;
1375 } else if constexpr (std::is_same_v<T, KThreadLocalPage>) {
1376 return slab_heap_container->thread_local_page;
1377 } else if constexpr (std::is_same_v<T, KObjectName>) {
1378 return slab_heap_container->object_name;
1379 } else if constexpr (std::is_same_v<T, KSessionRequest>) {
1380 return slab_heap_container->session_request;
1381 } else if constexpr (std::is_same_v<T, KSecureSystemResource>) {
1382 return slab_heap_container->secure_system_resource;
1383 } else if constexpr (std::is_same_v<T, KThread::LockWithPriorityInheritanceInfo>) {
1384 return slab_heap_container->lock_info;
1385 } else if constexpr (std::is_same_v<T, KEventInfo>) {
1386 return slab_heap_container->event_info;
1387 } else if constexpr (std::is_same_v<T, KDebug>) {
1388 return slab_heap_container->debug;
1389 }
1390}
1391
1392template KSlabHeap<KClientSession>& KernelCore::SlabHeap();
1393template KSlabHeap<KEvent>& KernelCore::SlabHeap();
1394template KSlabHeap<KLinkedListNode>& KernelCore::SlabHeap();
1395template KSlabHeap<KPort>& KernelCore::SlabHeap();
1396template KSlabHeap<KProcess>& KernelCore::SlabHeap();
1397template KSlabHeap<KResourceLimit>& KernelCore::SlabHeap();
1398template KSlabHeap<KSession>& KernelCore::SlabHeap();
1399template KSlabHeap<KSharedMemory>& KernelCore::SlabHeap();
1400template KSlabHeap<KSharedMemoryInfo>& KernelCore::SlabHeap();
1401template KSlabHeap<KThread>& KernelCore::SlabHeap();
1402template KSlabHeap<KTransferMemory>& KernelCore::SlabHeap();
1403template KSlabHeap<KCodeMemory>& KernelCore::SlabHeap();
1404template KSlabHeap<KDeviceAddressSpace>& KernelCore::SlabHeap();
1405template KSlabHeap<KPageBuffer>& KernelCore::SlabHeap();
1406template KSlabHeap<KThreadLocalPage>& KernelCore::SlabHeap();
1407template KSlabHeap<KObjectName>& KernelCore::SlabHeap();
1408template KSlabHeap<KSessionRequest>& KernelCore::SlabHeap();
1409template KSlabHeap<KSecureSystemResource>& KernelCore::SlabHeap();
1410template KSlabHeap<KThread::LockWithPriorityInheritanceInfo>& KernelCore::SlabHeap();
1411template KSlabHeap<KEventInfo>& KernelCore::SlabHeap();
1412template KSlabHeap<KDebug>& KernelCore::SlabHeap();
1413
1321} // namespace Kernel 1414} // namespace Kernel