/** @file\r
*\r
-* Copyright (c) 2011, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011 - 2014, 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
\r
-#include <Uefi.h> \r
+#include <Uefi.h>\r
#include <Chipset/ArmV7.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
{\r
// Check if the Generic/Architecture timer is implemented\r
if (ArmIsArchTimerImplemented ()) {\r
-\r
switch (Reg) {\r
-\r
case CntFrq:\r
*((UINTN *)DstBuf) = ArmReadCntFrq ();\r
- break;\r
+ return;\r
\r
case CntPct:\r
*((UINT64 *)DstBuf) = ArmReadCntPct ();\r
- break;\r
+ return;\r
\r
case CntkCtl:\r
*((UINTN *)DstBuf) = ArmReadCntkCtl();\r
- break;\r
+ return;\r
\r
case CntpTval:\r
*((UINTN *)DstBuf) = ArmReadCntpTval ();\r
- break;\r
+ return;\r
\r
case CntpCtl:\r
*((UINTN *)DstBuf) = ArmReadCntpCtl ();\r
- break;\r
+ return;\r
\r
case CntvTval:\r
*((UINTN *)DstBuf) = ArmReadCntvTval ();\r
- break;\r
+ return;\r
\r
case CntvCtl:\r
*((UINTN *)DstBuf) = ArmReadCntvCtl ();\r
- break;\r
+ return;\r
\r
case CntvCt:\r
*((UINT64 *)DstBuf) = ArmReadCntvCt ();\r
- break;\r
+ return;\r
\r
case CntpCval:\r
*((UINT64 *)DstBuf) = ArmReadCntpCval ();\r
- break;\r
+ return;\r
\r
case CntvCval:\r
*((UINT64 *)DstBuf) = ArmReadCntvCval ();\r
- break;\r
+ return;\r
\r
case CntvOff:\r
*((UINT64 *)DstBuf) = ArmReadCntvOff ();\r
- break;\r
+ return;\r
\r
case CnthCtl:\r
case CnthpTval:\r
case CnthpCtl:\r
case CnthpCval:\r
- DEBUG ((EFI_D_ERROR, "The register is related to Hypervisor Mode. Can't perform requested operation\n "));\r
+ DEBUG ((EFI_D_ERROR, "The register is related to Hypervisor Mode. Can't perform requested operation\n "));\r
break;\r
\r
default:\r
DEBUG ((EFI_D_ERROR, "Attempt to read ARM Generic Timer registers. But ARM Generic Timer extension is not implemented \n "));\r
ASSERT (0);\r
}\r
+\r
+ *((UINT64 *)DstBuf) = 0;\r
}\r
\r
VOID\r
VOID\r
)\r
{\r
- UINTN ArchTimerFreq = 0;\r
+ UINTN ArchTimerFreq;\r
ArmArchTimerReadReg (CntFrq, (VOID *)&ArchTimerFreq);\r
return ArchTimerFreq;\r
}\r