]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/SecPeiDxeTimerLibUefiCpu/X86TimerLib.c
UefiCpuPkg: Clean up source files
[mirror_edk2.git] / UefiCpuPkg / Library / SecPeiDxeTimerLibUefiCpu / X86TimerLib.c
index 52ae7717ddf5aff8b98a2b3011137a2a3937320e..801ebdb1917b98651aa768cfeb3448274187381e 100644 (file)
@@ -2,8 +2,8 @@
   Timer Library functions built upon local APIC on IA32/x64.\r
 \r
   This library uses the local APIC library so that it supports x2APIC mode.\r
-  \r
-  Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+\r
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\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
@@ -45,6 +45,9 @@ InternalX86GetTimerFrequency (
   Stalls the CPU for at least the given number of ticks. It's invoked by\r
   MicroSecondDelay() and NanoSecondDelay().\r
 \r
+  This function will ASSERT if the APIC timer intial count returned from\r
+  GetApicTimerInitCount() is zero.\r
+\r
   @param  Delay     A period of time to delay in ticks.\r
 \r
 **/\r
@@ -67,6 +70,7 @@ InternalX86Delay (
   // Delay and the Init Count.\r
   //\r
   InitCount = GetApicTimerInitCount ();\r
+  ASSERT (InitCount != 0);\r
   Times     = Delay / (InitCount / 2);\r
   Delay     = Delay % (InitCount / 2);\r
 \r