X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=ArmPlatformPkg%2FDrivers%2FSP804TimerDxe%2FSP804Timer.c;fp=ArmPlatformPkg%2FDrivers%2FSP804TimerDxe%2FSP804Timer.c;h=a28a045352cf5c6a864e23a424e78654b8236820;hb=e100fa8c1e5218865ff6f2c5dd646c2e6ceca49d;hp=c6b72ad7acff92d26a78ac7162a9e5a26fa94c83;hpb=1e6a5cfcec8f9ef1b5d088721ae96a8c28938792;p=mirror_edk2.git diff --git a/ArmPlatformPkg/Drivers/SP804TimerDxe/SP804Timer.c b/ArmPlatformPkg/Drivers/SP804TimerDxe/SP804Timer.c index c6b72ad7ac..a28a045352 100644 --- a/ArmPlatformPkg/Drivers/SP804TimerDxe/SP804Timer.c +++ b/ArmPlatformPkg/Drivers/SP804TimerDxe/SP804Timer.c @@ -74,15 +74,17 @@ TimerInterruptHandler ( // OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL); - // clear the periodic interrupt + // If the interrupt is shared then we must check if this interrupt source is the one associated to this Timer + if (MmioRead32 (SP804_TIMER0_BASE + SP804_TIMER_MSK_INT_STS_REG) != 0) { + // clear the periodic interrupt + MmioWrite32 (SP804_TIMER0_BASE + SP804_TIMER_INT_CLR_REG, 0); - MmioWrite32 (SP804_TIMER0_BASE + SP804_TIMER_INT_CLR_REG, 0); + // signal end of interrupt early to help avoid losing subsequent ticks from long duration handlers + gInterrupt->EndOfInterrupt (gInterrupt, Source); - // signal end of interrupt early to help avoid losing subsequent ticks from long duration handlers - gInterrupt->EndOfInterrupt (gInterrupt, Source); - - if (mTimerNotifyFunction) { - mTimerNotifyFunction (mTimerPeriod); + if (mTimerNotifyFunction) { + mTimerNotifyFunction (mTimerPeriod); + } } gBS->RestoreTPL (OriginalTPL);