]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
ARM Packages: Remove GCC filter for AARCH64 assembly files
[mirror_edk2.git] / ArmPkg / Library / ArmArchTimerLib / ArmArchTimerLib.c
index d4602738ec4b8d7ae5c4955a9647f85d5a036315..4373e8c2e74c8c5172b0ab00287e7fb54f2521dc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Generic ARM implementation of TimerLib.h\r
 \r
-  Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
   \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
 \r
 #include <Base.h>\r
+#include <Library/ArmLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/TimerLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/ArmV7ArchTimerLib.h>\r
-#include <Chipset/ArmV7.h>\r
+#include <Library/ArmArchTimerLib.h>\r
 \r
 #define TICKS_PER_MICRO_SEC     (PcdGet32 (PcdArmArchTimerFreqInHz)/1000000U)\r
 \r
@@ -43,18 +43,21 @@ TimerConstructor (
     // manual lower bound of the frequency is in the range of 1-10MHz\r
     ASSERT (TICKS_PER_MICRO_SEC);\r
 \r
+#ifdef MDE_CPU_ARM\r
+    // Only set the frequency for ARMv7. We expect the secure firmware to have already do it\r
     // If the security extensions are not implemented set Timer Frequency\r
     if ((ArmReadIdPfr1 () & 0xF0) == 0x0) {\r
       ArmArchTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));\r
     }\r
+#endif\r
 \r
     // Architectural Timer Frequency must be set in the Secure privileged(if secure extensions are supported) mode.\r
     // If the reset value (0) is returned just ASSERT.\r
     TimerFreq = ArmArchTimerGetTimerFreq ();\r
-    ASSERT (TimerFreq);\r
+    ASSERT (TimerFreq != 0);\r
 \r
   } else {\r
-    DEBUG ((EFI_D_ERROR, "ARM Architectural Timer is not available in the CPU, Hence cann't use this library \n"));\r
+    DEBUG ((EFI_D_ERROR, "ARM Architectural Timer is not available in the CPU, hence this library can not be used.\n"));\r
     ASSERT (0);\r
   }\r
 \r
@@ -79,7 +82,7 @@ MicroSecondDelay (
   UINT64 TimerTicks64;\r
   UINT64 SystemCounterVal;\r
 \r
-  // Calculate counter ticks that can represent requsted delay\r
+  // Calculate counter ticks that can represent requested delay\r
   TimerTicks64 = MultU64x32 (MicroSeconds, TICKS_PER_MICRO_SEC);\r
 \r
   // Read System Counter value\r
@@ -106,7 +109,7 @@ MicroSecondDelay (
 \r
   @param  NanoSeconds The minimum number of nanoseconds to delay.\r
 \r
-  @return The value of NanoSeconds inputted.\r
+  @return The value of NanoSeconds inputed.\r
 \r
 **/\r
 UINTN\r