]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/TimerDxe/TimerDxe.c
ArmPkg/TimerDxe: Add ISB for timer compare value reload
[mirror_edk2.git] / ArmPkg / Drivers / TimerDxe / TimerDxe.c
index 1169d426b2559b8ff2fb84e757638c06665b6f9d..a3202fa056f3026cd1c6ab3781649923d848d62c 100644 (file)
@@ -25,7 +25,6 @@
 #include <Library/PcdLib.h>\r
 #include <Library/IoLib.h>\r
 #include <Library/ArmGenericTimerCounterLib.h>\r
-#include <Library/ArmArchTimer.h>\r
 \r
 #include <Protocol/Timer.h>\r
 #include <Protocol/HardwareInterrupt.h>\r
@@ -307,12 +306,13 @@ TimerInterruptHandler (
   //\r
   OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
 \r
+  // Signal end of interrupt early to help avoid losing subsequent ticks\r
+  // from long duration handlers\r
+  gInterrupt->EndOfInterrupt (gInterrupt, Source);\r
+\r
   // Check if the timer interrupt is active\r
   if ((ArmGenericTimerGetTimerCtrlReg () ) & ARM_ARCH_TIMER_ISTATUS) {\r
 \r
-    // Signal end of interrupt early to help avoid losing subsequent ticks from long duration handlers\r
-    gInterrupt->EndOfInterrupt (gInterrupt, Source);\r
-\r
     if (mTimerNotifyFunction) {\r
       mTimerNotifyFunction (mTimerPeriod * mElapsedPeriod);\r
     }\r
@@ -338,11 +338,9 @@ TimerInterruptHandler (
     // Set next compare value\r
     ArmGenericTimerSetCompareVal (CompareValue);\r
     ArmGenericTimerEnableTimer ();\r
+    ArmInstructionSynchronizationBarrier ();\r
   }\r
 \r
-  // Enable timer interrupts\r
-  gInterrupt->EnableInterruptSource (gInterrupt, Source);\r
-\r
   gBS->RestoreTPL (OriginalTPL);\r
 }\r
 \r