summaryrefslogtreecommitdiff
path: root/PcAtChipsetPkg
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-25 06:26:39 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-25 06:26:39 +0000
commit76cd9a03e5c2813ca8f7a653be2194611a28fb89 (patch)
tree1672ed0323b5a705c82a0adc7b319e6ededfa566 /PcAtChipsetPkg
parentcc1a5b86ff05c6b245f27cf309d06a113e511514 (diff)
downloadedk2-platforms-76cd9a03e5c2813ca8f7a653be2194611a28fb89.tar.xz
Create a MAX_TIMER_TICK_DURATION for the error handling in 8254 timer module.
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
Diffstat (limited to 'PcAtChipsetPkg')
-rw-r--r--PcAtChipsetPkg/8254TimerDxe/Timer.c6
-rw-r--r--PcAtChipsetPkg/8254TimerDxe/Timer.h8
2 files changed, 9 insertions, 5 deletions
diff --git a/PcAtChipsetPkg/8254TimerDxe/Timer.c b/PcAtChipsetPkg/8254TimerDxe/Timer.c
index da7d6af578..a7f4947002 100644
--- a/PcAtChipsetPkg/8254TimerDxe/Timer.c
+++ b/PcAtChipsetPkg/8254TimerDxe/Timer.c
@@ -1,7 +1,7 @@
/** @file
Timer Architectural Protocol as defined in the DXE CIS
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -219,9 +219,7 @@ TimerDriverSetTimerPeriod (
//
if (TimerCount >= 65536) {
TimerCount = 0;
- if (TimerPeriod >= DEFAULT_TIMER_TICK_DURATION) {
- TimerPeriod = DEFAULT_TIMER_TICK_DURATION;
- }
+ TimerPeriod = MAX_TIMER_TICK_DURATION;
}
//
// Program the 8254 timer with the new count value
diff --git a/PcAtChipsetPkg/8254TimerDxe/Timer.h b/PcAtChipsetPkg/8254TimerDxe/Timer.h
index 26935d8775..5a354a8892 100644
--- a/PcAtChipsetPkg/8254TimerDxe/Timer.h
+++ b/PcAtChipsetPkg/8254TimerDxe/Timer.h
@@ -1,7 +1,7 @@
/** @file
Private data structures
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -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
// 1,193,182 Hz
//
+
+//
+// The maximum tick duration for 8254 timer
+//
+#define MAX_TIMER_TICK_DURATION 549254
+//
// The default timer tick duration is set to 10 ms = 100000 100 ns units
//
#define DEFAULT_TIMER_TICK_DURATION 100000