#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
//\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
\r
// Set next compare value\r
ArmGenericTimerSetCompareVal (CompareValue);\r
- ArmGenericTimerEnableTimer ();\r
+ ArmGenericTimerReenableTimer ();\r
+ ArmInstructionSynchronizationBarrier ();\r
}\r
\r
- // Enable timer interrupts\r
- gInterrupt->EnableInterruptSource (gInterrupt, Source);\r
-\r
gBS->RestoreTPL (OriginalTPL);\r
}\r
\r