diff mbox series

[edk2,1/2] ArmPkg: add reenable hook to ArmGenericTimerCounterLib

Message ID 20180423150057.13515-2-ard.biesheuvel@linaro.org
State Accepted
Commit 5853e2e45092ee49a88971ef0c5f97ac808ed47d
Headers show
Series Reenable timer mask quirk for Xen | expand

Commit Message

Ard Biesheuvel April 23, 2018, 3 p.m. UTC
In preparation of selectively reinstating the timer enable quirk for Xen
that we removed in commit 411a373ed642 ("ArmPkg/TimerDxe: remove workaround
for KVM timer handling"), add a ArmGenericTimerReenableTimer() library
function to ArmGenericTimerCounterLib that we will populate for Xen only.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 ArmPkg/Drivers/TimerDxe/TimerDxe.c                                           | 1 +
 ArmPkg/Include/Library/ArmGenericTimerCounterLib.h                           | 6 ++++++
 ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.c   | 8 ++++++++
 ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c | 8 ++++++++
 4 files changed, 23 insertions(+)

-- 
2.17.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/ArmPkg/Drivers/TimerDxe/TimerDxe.c b/ArmPkg/Drivers/TimerDxe/TimerDxe.c
index bd616d2efc73..478f1bece565 100644
--- a/ArmPkg/Drivers/TimerDxe/TimerDxe.c
+++ b/ArmPkg/Drivers/TimerDxe/TimerDxe.c
@@ -337,6 +337,7 @@  TimerInterruptHandler (
 
     // Set next compare value
     ArmGenericTimerSetCompareVal (CompareValue);
+    ArmGenericTimerReenableTimer ();
     ArmInstructionSynchronizationBarrier ();
   }
 
diff --git a/ArmPkg/Include/Library/ArmGenericTimerCounterLib.h b/ArmPkg/Include/Library/ArmGenericTimerCounterLib.h
index 805025baa14b..47e28b79c033 100644
--- a/ArmPkg/Include/Library/ArmGenericTimerCounterLib.h
+++ b/ArmPkg/Include/Library/ArmGenericTimerCounterLib.h
@@ -22,6 +22,12 @@  ArmGenericTimerEnableTimer (
   VOID
   );
 
+VOID
+EFIAPI
+ArmGenericTimerReenableTimer (
+  VOID
+  );
+
 VOID
 EFIAPI
 ArmGenericTimerDisableTimer (
diff --git a/ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.c b/ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.c
index d04e04fb334d..03519f50e79a 100644
--- a/ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.c
+++ b/ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.c
@@ -29,6 +29,14 @@  ArmGenericTimerEnableTimer (
   ArmWriteCntpCtl (TimerCtrlReg);
 }
 
+VOID
+EFIAPI
+ArmGenericTimerReenableTimer (
+  VOID
+  )
+{
+}
+
 VOID
 EFIAPI
 ArmGenericTimerDisableTimer (
diff --git a/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c b/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c
index c941895a3574..4bb1e1cde538 100644
--- a/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c
+++ b/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c
@@ -29,6 +29,14 @@  ArmGenericTimerEnableTimer (
   ArmWriteCntvCtl (TimerCtrlReg);
 }
 
+VOID
+EFIAPI
+ArmGenericTimerReenableTimer (
+  VOID
+  )
+{
+}
+
 VOID
 EFIAPI
 ArmGenericTimerDisableTimer (