diff options
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 34 |
2 files changed, 18 insertions, 28 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 6a098f1ee..e7fd6c842 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -165,7 +165,7 @@ void Thread::CancelWakeupTimer() { static boost::optional<s32> GetNextProcessorId(u64 mask) { for (s32 index = 0; index < Core::NUM_CPU_CORES; ++index) { if (mask & (1ULL << index)) { - if (!Core::System().GetInstance().Scheduler(index)->GetCurrentThread()) { + if (!Core::System::GetInstance().Scheduler(index)->GetCurrentThread()) { // Core is enabled and not running any threads, use this one return index; } @@ -215,14 +215,14 @@ void Thread::ResumeFromWait() { new_processor_id = processor_id; } if (ideal_core != -1 && - Core::System().GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { + Core::System::GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { new_processor_id = ideal_core; } ASSERT(*new_processor_id < 4); // Add thread to new core's scheduler - auto& next_scheduler = Core::System().GetInstance().Scheduler(*new_processor_id); + auto& next_scheduler = Core::System::GetInstance().Scheduler(*new_processor_id); if (*new_processor_id != processor_id) { // Remove thread from previous core's scheduler @@ -325,7 +325,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, thread->name = std::move(name); thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); thread->owner_process = owner_process; - thread->scheduler = Core::System().GetInstance().Scheduler(processor_id); + thread->scheduler = Core::System::GetInstance().Scheduler(processor_id); thread->scheduler->AddThread(thread, priority); // Find the next available TLS index, and mark it as used @@ -481,14 +481,14 @@ void Thread::ChangeCore(u32 core, u64 mask) { new_processor_id = processor_id; } if (ideal_core != -1 && - Core::System().GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { + Core::System::GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { new_processor_id = ideal_core; } ASSERT(*new_processor_id < 4); // Add thread to new core's scheduler - auto& next_scheduler = Core::System().GetInstance().Scheduler(*new_processor_id); + auto& next_scheduler = Core::System::GetInstance().Scheduler(*new_processor_id); if (*new_processor_id != processor_id) { // Remove thread from previous core's scheduler diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 1cd7f1984..9d26fd781 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -17,30 +17,20 @@ namespace Kernel { static const char* GetMemoryStateName(MemoryState state) { - static const char* names[] = { - "Unmapped", - "Io", - "Normal", - "CodeStatic", - "CodeMutable", - "Heap", - "Shared", - "Unknown1" - "ModuleCodeStatic", - "ModuleCodeMutable", - "IpcBuffer0", - "Mapped", - "ThreadLocal", - "TransferMemoryIsolated", - "TransferMemory", - "ProcessMemory", - "Unknown2" - "IpcBuffer1", - "IpcBuffer3", - "KernelStack", + static constexpr const char* names[] = { + "Unmapped", "Io", + "Normal", "CodeStatic", + "CodeMutable", "Heap", + "Shared", "Unknown1", + "ModuleCodeStatic", "ModuleCodeMutable", + "IpcBuffer0", "Mapped", + "ThreadLocal", "TransferMemoryIsolated", + "TransferMemory", "ProcessMemory", + "Unknown2", "IpcBuffer1", + "IpcBuffer3", "KernelStack", }; - return names[(int)state]; + return names[static_cast<int>(state)]; } bool VirtualMemoryArea::CanBeMergedWith(const VirtualMemoryArea& next) const { |