diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index ef7057ff7..98ecaf12f 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -214,7 +214,6 @@ struct KernelCore::Impl { | |||
| 214 | cores[i] = std::make_unique<Kernel::PhysicalCore>(i, system, *schedulers[i]); | 214 | cores[i] = std::make_unique<Kernel::PhysicalCore>(i, system, *schedulers[i]); |
| 215 | 215 | ||
| 216 | auto* main_thread{Kernel::KThread::Create(system.Kernel())}; | 216 | auto* main_thread{Kernel::KThread::Create(system.Kernel())}; |
| 217 | main_thread->SetName(fmt::format("MainThread:{}", core)); | ||
| 218 | main_thread->SetCurrentCore(core); | 217 | main_thread->SetCurrentCore(core); |
| 219 | ASSERT(Kernel::KThread::InitializeMainThread(system, main_thread, core).IsSuccess()); | 218 | ASSERT(Kernel::KThread::InitializeMainThread(system, main_thread, core).IsSuccess()); |
| 220 | 219 | ||
| @@ -356,7 +355,6 @@ struct KernelCore::Impl { | |||
| 356 | ASSERT(KThread::InitializeHighPriorityThread(system, shutdown_threads[core_id], {}, {}, | 355 | ASSERT(KThread::InitializeHighPriorityThread(system, shutdown_threads[core_id], {}, {}, |
| 357 | core_id) | 356 | core_id) |
| 358 | .IsSuccess()); | 357 | .IsSuccess()); |
| 359 | shutdown_threads[core_id]->SetName(fmt::format("SuspendThread:{}", core_id)); | ||
| 360 | } | 358 | } |
| 361 | } | 359 | } |
| 362 | 360 | ||
| @@ -388,11 +386,10 @@ struct KernelCore::Impl { | |||
| 388 | 386 | ||
| 389 | // Gets the dummy KThread for the caller, allocating a new one if this is the first time | 387 | // Gets the dummy KThread for the caller, allocating a new one if this is the first time |
| 390 | KThread* GetHostDummyThread(KThread* existing_thread) { | 388 | KThread* GetHostDummyThread(KThread* existing_thread) { |
| 391 | auto initialize = [this](KThread* thread) { | 389 | const auto initialize{[](KThread* thread) { |
| 392 | ASSERT(KThread::InitializeDummyThread(thread, nullptr).IsSuccess()); | 390 | ASSERT(KThread::InitializeDummyThread(thread, nullptr).IsSuccess()); |
| 393 | thread->SetName(fmt::format("DummyThread:{}", next_host_thread_id++)); | ||
| 394 | return thread; | 391 | return thread; |
| 395 | }; | 392 | }}; |
| 396 | 393 | ||
| 397 | thread_local KThread raw_thread{system.Kernel()}; | 394 | thread_local KThread raw_thread{system.Kernel()}; |
| 398 | thread_local KThread* thread = existing_thread ? existing_thread : initialize(&raw_thread); | 395 | thread_local KThread* thread = existing_thread ? existing_thread : initialize(&raw_thread); |
| @@ -742,16 +739,15 @@ struct KernelCore::Impl { | |||
| 742 | hidbus_shared_mem = KSharedMemory::Create(system.Kernel()); | 739 | hidbus_shared_mem = KSharedMemory::Create(system.Kernel()); |
| 743 | 740 | ||
| 744 | hid_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, | 741 | hid_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, |
| 745 | Svc::MemoryPermission::Read, hid_size, "HID:SharedMemory"); | 742 | Svc::MemoryPermission::Read, hid_size); |
| 746 | font_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, | 743 | font_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, |
| 747 | Svc::MemoryPermission::Read, font_size, "Font:SharedMemory"); | 744 | Svc::MemoryPermission::Read, font_size); |
| 748 | irs_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, | 745 | irs_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, |
| 749 | Svc::MemoryPermission::Read, irs_size, "IRS:SharedMemory"); | 746 | Svc::MemoryPermission::Read, irs_size); |
| 750 | time_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, | 747 | time_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, |
| 751 | Svc::MemoryPermission::Read, time_size, "Time:SharedMemory"); | 748 | Svc::MemoryPermission::Read, time_size); |
| 752 | hidbus_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, | 749 | hidbus_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, |
| 753 | Svc::MemoryPermission::Read, hidbus_size, | 750 | Svc::MemoryPermission::Read, hidbus_size); |
| 754 | "HidBus:SharedMemory"); | ||
| 755 | } | 751 | } |
| 756 | 752 | ||
| 757 | std::mutex registered_objects_lock; | 753 | std::mutex registered_objects_lock; |
| @@ -1321,7 +1317,6 @@ const Core::System& KernelCore::System() const { | |||
| 1321 | struct KernelCore::SlabHeapContainer { | 1317 | struct KernelCore::SlabHeapContainer { |
| 1322 | KSlabHeap<KClientSession> client_session; | 1318 | KSlabHeap<KClientSession> client_session; |
| 1323 | KSlabHeap<KEvent> event; | 1319 | KSlabHeap<KEvent> event; |
| 1324 | KSlabHeap<KLinkedListNode> linked_list_node; | ||
| 1325 | KSlabHeap<KPort> port; | 1320 | KSlabHeap<KPort> port; |
| 1326 | KSlabHeap<KProcess> process; | 1321 | KSlabHeap<KProcess> process; |
| 1327 | KSlabHeap<KResourceLimit> resource_limit; | 1322 | KSlabHeap<KResourceLimit> resource_limit; |
| @@ -1348,8 +1343,6 @@ KSlabHeap<T>& KernelCore::SlabHeap() { | |||
| 1348 | return slab_heap_container->client_session; | 1343 | return slab_heap_container->client_session; |
| 1349 | } else if constexpr (std::is_same_v<T, KEvent>) { | 1344 | } else if constexpr (std::is_same_v<T, KEvent>) { |
| 1350 | return slab_heap_container->event; | 1345 | 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>) { | 1346 | } else if constexpr (std::is_same_v<T, KPort>) { |
| 1354 | return slab_heap_container->port; | 1347 | return slab_heap_container->port; |
| 1355 | } else if constexpr (std::is_same_v<T, KProcess>) { | 1348 | } else if constexpr (std::is_same_v<T, KProcess>) { |
| @@ -1391,7 +1384,6 @@ KSlabHeap<T>& KernelCore::SlabHeap() { | |||
| 1391 | 1384 | ||
| 1392 | template KSlabHeap<KClientSession>& KernelCore::SlabHeap(); | 1385 | template KSlabHeap<KClientSession>& KernelCore::SlabHeap(); |
| 1393 | template KSlabHeap<KEvent>& KernelCore::SlabHeap(); | 1386 | template KSlabHeap<KEvent>& KernelCore::SlabHeap(); |
| 1394 | template KSlabHeap<KLinkedListNode>& KernelCore::SlabHeap(); | ||
| 1395 | template KSlabHeap<KPort>& KernelCore::SlabHeap(); | 1387 | template KSlabHeap<KPort>& KernelCore::SlabHeap(); |
| 1396 | template KSlabHeap<KProcess>& KernelCore::SlabHeap(); | 1388 | template KSlabHeap<KProcess>& KernelCore::SlabHeap(); |
| 1397 | template KSlabHeap<KResourceLimit>& KernelCore::SlabHeap(); | 1389 | template KSlabHeap<KResourceLimit>& KernelCore::SlabHeap(); |