]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/TimerDxe/TimerDxe.c
ArmPkg: Fix various typos
[mirror_edk2.git] / ArmPkg / Drivers / TimerDxe / TimerDxe.c
index 2416c90f5545495367a835b5a6753d30e868c878..dccaeae23c29dd234ecb193ea8e95fa82e0d4959 100644 (file)
@@ -3,13 +3,7 @@
 \r
   Copyright (c) 2011-2013 ARM Ltd. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -306,12 +300,13 @@ TimerInterruptHandler (
   //\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
@@ -336,12 +331,10 @@ TimerInterruptHandler (
 \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
@@ -372,7 +365,7 @@ TimerInitialize (
   UINT32      TimerHypIntrNum;\r
 \r
   if (ArmIsArchTimerImplemented () == 0) {\r
-    DEBUG ((EFI_D_ERROR, "ARM Architectural Timer is not available in the CPU, hence cann't use this Driver \n"));\r
+    DEBUG ((DEBUG_ERROR, "ARM Architectural Timer is not available in the CPU, hence can't use this Driver \n"));\r
     ASSERT (0);\r
   }\r
 \r