core: Make System references const where applicable

This commit is contained in:
Lioncash 2018-10-28 17:44:46 -04:00
parent b77f571d20
commit a973a049b7
2 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@ namespace Kernel {
*/ */
static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] int cycles_late) { static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] int cycles_late) {
const auto proper_handle = static_cast<Handle>(thread_handle); const auto proper_handle = static_cast<Handle>(thread_handle);
auto& system = Core::System::GetInstance(); const auto& system = Core::System::GetInstance();
// Lock the global kernel mutex when we enter the kernel HLE. // Lock the global kernel mutex when we enter the kernel HLE.
std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock); std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock);
@ -90,7 +90,7 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] int cycles_
/// The timer callback event, called when a timer is fired /// The timer callback event, called when a timer is fired
static void TimerCallback(u64 timer_handle, int cycles_late) { static void TimerCallback(u64 timer_handle, int cycles_late) {
const auto proper_handle = static_cast<Handle>(timer_handle); const auto proper_handle = static_cast<Handle>(timer_handle);
auto& system = Core::System::GetInstance(); const auto& system = Core::System::GetInstance();
SharedPtr<Timer> timer = system.Kernel().RetrieveTimerFromCallbackHandleTable(proper_handle); SharedPtr<Timer> timer = system.Kernel().RetrieveTimerFromCallbackHandleTable(proper_handle);
if (timer == nullptr) { if (timer == nullptr) {

View file

@ -572,7 +572,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
return ERR_INVALID_HANDLE; return ERR_INVALID_HANDLE;
} }
auto& system = Core::System::GetInstance(); const auto& system = Core::System::GetInstance();
const auto& scheduler = system.CurrentScheduler(); const auto& scheduler = system.CurrentScheduler();
const auto* const current_thread = scheduler.GetCurrentThread(); const auto* const current_thread = scheduler.GetCurrentThread();
const bool same_thread = current_thread == thread; const bool same_thread = current_thread == thread;