]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Create a MAX_TIMER_TICK_DURATION for the error handling in 8254 timer module.
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Oct 2012 06:26:39 +0000 (06:26 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Oct 2012 06:26:39 +0000 (06:26 +0000)
Signed-off-by: Li Elvin <elvin.li@intel.com>
Reviewed-by: Tian Hot <hot.tian@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13884 6f19259b-4bc3-4df7-8a09-765794883524

PcAtChipsetPkg/8254TimerDxe/Timer.c
PcAtChipsetPkg/8254TimerDxe/Timer.h

index da7d6af57806ff753a7010cc31949d53dedcb57f..a7f49470021c22920690e1ba8cac649f95b83f53 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Timer Architectural Protocol as defined in the DXE CIS\r
 \r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, 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
@@ -219,9 +219,7 @@ TimerDriverSetTimerPeriod (
     //\r
     if (TimerCount >= 65536) {\r
       TimerCount = 0;\r
-      if (TimerPeriod >= DEFAULT_TIMER_TICK_DURATION) {\r
-        TimerPeriod = DEFAULT_TIMER_TICK_DURATION;\r
-      }\r
+      TimerPeriod = MAX_TIMER_TICK_DURATION;\r
     }\r
     //\r
     // Program the 8254 timer with the new count value\r
index 26935d8775416f28a9f1d618d6f21a6a24132ddc..5a354a8892f7222c0d107e07b23da7a64073432a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Private data structures\r
 \r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, 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
@@ -34,6 +34,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 // ---------------- * 1,000,000 uS/S = 54925.4 uS = 549254 * 100 ns\r
 //   1,193,182 Hz\r
 //\r
+\r
+//\r
+// The maximum tick duration for 8254 timer\r
+//\r
+#define MAX_TIMER_TICK_DURATION     549254\r
+//\r
 // The default timer tick duration is set to 10 ms = 100000 100 ns units\r
 //\r
 #define DEFAULT_TIMER_TICK_DURATION 100000\r