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

Ard Biesheuvel posted 2 patches 6 years, 6 months ago
[edk2] [PATCH 1/2] ArmPkg: add reenable hook to ArmGenericTimerCounterLib
Posted by Ard Biesheuvel 6 years, 6 months ago
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(+)

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 (
-- 
2.17.0

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