summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-07 08:43:22 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-07 08:43:22 +0000
commitb219108e5154c92975ff56cfa8e022c89e6f410b (patch)
tree07a7d00ea2ad0199a2176165413027917a912244 /MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c
parent1d940d05b5105cbbcfa0c572927aec49499dc35f (diff)
downloadedk2-platforms-b219108e5154c92975ff56cfa8e022c89e6f410b.tar.xz
added PcdPlatformBusSpeed for BaseTimerLibLocalApic, thus this timer instance needn't depend on types of CPUs
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1909 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c')
-rw-r--r--MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c b/MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c
index 87c33a7c5d..d2935cf83a 100644
--- a/MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c
+++ b/MdePkg/Library/BaseTimerLibLocalApic/x86TimerLib.c
@@ -19,18 +19,9 @@
**/
//
-// The following 2 arrays are used in calculating the frequency of local APIC
+// The following array is used in calculating the frequency of local APIC
// timer. Refer to IA-32 developers' manual for more details.
//
-
-GLOBAL_REMOVE_IF_UNREFERENCED
-CONST UINT32 mTimerLibLocalApicFrequencies[] = {
- 100000000,
- 133000000,
- 200000000,
- 166000000
-};
-
GLOBAL_REMOVE_IF_UNREFERENCED
CONST UINT8 mTimerLibLocalApicDivisor[] = {
0x02, 0x04, 0x08, 0x10,
@@ -73,7 +64,7 @@ InternalX86GetTimerFrequency (
)
{
return
- mTimerLibLocalApicFrequencies[AsmMsrBitFieldRead32 (44, 16, 18)] /
+ PcdGet32(PcdPlatformBusSpeed) /
mTimerLibLocalApicDivisor[MmioBitFieldRead32 (ApicBase + 0x3e0, 0, 3)];
}
@@ -255,5 +246,5 @@ GetPerformanceCounterProperties (
*EndValue = 0;
}
- return (UINT64)InternalX86GetTimerFrequency (ApicBase);
+ return PcdGet32(PcdPlatformBusSpeed);
}