]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c
EmbeddedPkg/VirtualRealTimeClockLib: Explicit cast to UINT32
[mirror_edk2.git] / EmbeddedPkg / Library / VirtualRealTimeClockLib / VirtualRealTimeClockLib.c
index 8ad2df90e702ede2c0562f8091a5cd114fe49439..5c13ed4cf190327b6eb3d2912fb5e8cabcbb6a27 100644 (file)
@@ -8,13 +8,7 @@
  *  Copyright (c) 2008-2010, Apple Inc. All rights reserved.\r
  *  Copyright (c) Microsoft Corporation. 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
- *  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
  *  Based on ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf\r
  *\r
@@ -208,14 +202,14 @@ LibGetTime (
   // Because we use the performance counter, we can fill the Nanosecond attribute\r
   // provided that the remainder doesn't overflow 64-bit during multiplication.\r
   if (Remainder <= 18446744073U) {\r
-    Time->Nanosecond = MultU64x64 (Remainder, 1000000000U) / Freq;\r
+    Time->Nanosecond = (UINT32)(MultU64x64 (Remainder, 1000000000U) / Freq);\r
   } else {\r
     DEBUG ((DEBUG_WARN, "LibGetTime: Nanosecond value not set (64-bit overflow).\n"));\r
   }\r
 \r
   if (Capabilities) {\r
     Capabilities->Accuracy   = 0;\r
-    Capabilities->Resolution = Freq;\r
+    Capabilities->Resolution = 1;\r
     Capabilities->SetsToZero = FALSE;\r
   }\r
 \r