summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Drivers
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 11:35:10 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 11:35:10 +0000
commite100fa8c1e5218865ff6f2c5dd646c2e6ceca49d (patch)
tree5d09e83b86927b53113126e72a58b32e96fa9133 /ArmPlatformPkg/Drivers
parent1e6a5cfcec8f9ef1b5d088721ae96a8c28938792 (diff)
downloadedk2-e100fa8c1e5218865ff6f2c5dd646c2e6ceca49d.tar.gz
edk2-e100fa8c1e5218865ff6f2c5dd646c2e6ceca49d.tar.bz2
edk2-e100fa8c1e5218865ff6f2c5dd646c2e6ceca49d.zip
ArmPlatformPkg/SP804Timer: Fix IRQ handler when the Timer IRQ is shared
The handler must check if the raised interrupt belongs to the SP804 Timer controller. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11473 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Drivers')
-rw-r--r--ArmPlatformPkg/Drivers/SP804TimerDxe/SP804Timer.c16
1 files changed, 9 insertions, 7 deletions
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);