From 893b0461110c4c616e1bb972e25d084d1d4a369c Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 24 Jul 2020 17:43:42 -0700 Subject: [PATCH] kern: update interrupt manager --- .../source/arch/arm64/kern_k_interrupt_manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp index 0386085db..cda867fe5 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp @@ -175,15 +175,15 @@ namespace ams::kern::arch::arm64 { /* If we need scheduling, */ if (needs_scheduling) { - /* Handle any changes needed to the user preemption state. */ - if (user_mode && GetCurrentThread().GetUserPreemptionState() != 0 && GetCurrentProcess().GetPreemptionStatePinnedThread(GetCurrentCoreId()) == nullptr) { + /* If the user disable count is set, we may need to pin the current thread. */ + if (user_mode && GetCurrentThread().GetUserDisableCount() != 0 && GetCurrentProcess().GetPinnedThread(GetCurrentCoreId()) == nullptr) { KScopedSchedulerLock sl; - /* Note the preemption state in process. */ - GetCurrentProcess().SetPreemptionState(); + /* Pin the current thread. */ + GetCurrentProcess().PinCurrentThread(); - /* Set the kernel preemption state flag. */ - GetCurrentThread().SetKernelPreemptionState(1);; + /* Set the interrupt flag for the thread. */ + GetCurrentThread().SetInterruptFlag(); /* Request interrupt scheduling. */ Kernel::GetScheduler().RequestScheduleOnInterrupt();