diff options
| author | bunnei <bunneidev@gmail.com> | 2021-02-13 01:29:32 -0800 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2021-03-21 14:45:02 -0700 |
| commit | 5872561077e8b671ee9a80ecd5d116100458a28f (patch) | |
| tree | cdb8736a1fdd7d1f8b88c3091b96045356ece5b3 /src/core/hle/kernel/k_scheduler_lock.h | |
| parent | 541b4353e4a85a1f10c53d643ea48b8e31363a62 (diff) | |
hle: kernel: Migrate some code from Common::SpinLock to KSpinLock.
Diffstat (limited to 'src/core/hle/kernel/k_scheduler_lock.h')
| -rw-r--r-- | src/core/hle/kernel/k_scheduler_lock.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/hle/kernel/k_scheduler_lock.h b/src/core/hle/kernel/k_scheduler_lock.h index 169455d18..47e315555 100644 --- a/src/core/hle/kernel/k_scheduler_lock.h +++ b/src/core/hle/kernel/k_scheduler_lock.h @@ -2,14 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -// This file references various implementation details from Atmosphere, an open-source firmware for -// the Nintendo Switch. Copyright 2018-2020 Atmosphere-NX. - #pragma once #include "common/assert.h" -#include "common/spin_lock.h" #include "core/hardware_properties.h" +#include "core/hle/kernel/k_spin_lock.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" @@ -34,7 +31,7 @@ public: } else { // Otherwise, we want to disable scheduling and acquire the spinlock. SchedulerType::DisableScheduling(kernel); - spin_lock.lock(); + spin_lock.Lock(); // For debug, ensure that our state is valid. ASSERT(lock_count == 0); @@ -58,7 +55,7 @@ public: // Note that we no longer hold the lock, and unlock the spinlock. owner_thread = nullptr; - spin_lock.unlock(); + spin_lock.Unlock(); // Enable scheduling, and perform a rescheduling operation. SchedulerType::EnableScheduling(kernel, cores_needing_scheduling); @@ -67,7 +64,7 @@ public: private: KernelCore& kernel; - Common::SpinLock spin_lock{}; + KAlignedSpinLock spin_lock{}; s32 lock_count{}; KThread* owner_thread{}; }; |
