#include <Library/IoLib.h>\r
#include <Library/PcdLib.h>\r
\r
+#define APIC_LVTERR 0x370\r
+#define APIC_TMICT 0x380 \r
+#define APIC_TMCCT 0x390\r
+#define APIC_TDCR 0x3e0\r
\r
//\r
// The following array is used in calculating the frequency of local APIC\r
{\r
return\r
PcdGet32(PcdFSBClock) /\r
- mTimerLibLocalApicDivisor[MmioBitFieldRead32 (ApicBase + 0x3e0, 0, 3)];\r
+ mTimerLibLocalApicDivisor[MmioBitFieldRead32 (ApicBase + APIC_TDCR, 0, 3)];\r
}\r
\r
/**\r
IN UINTN ApicBase\r
)\r
{\r
- return MmioRead32 (ApicBase + 0x390);\r
+ return MmioRead32 (ApicBase + APIC_TMCCT);\r
}\r
\r
/**\r
}\r
\r
/**\r
- Retrieves the current value of a 64-bit free running performance counter. The\r
- counter can either count up by 1 or count down by 1. If the physical\r
+ Retrieves the current value of a 64-bit free running performance counter.\r
+\r
+ The counter can either count up by 1 or count down by 1. If the physical\r
performance counter counts by a larger increment, then the counter values\r
must be translated. The properties of the counter can be retrieved from\r
GetPerformanceCounterProperties().\r
ApicBase = InternalX86GetApicBase ();\r
\r
if (StartValue != NULL) {\r
- *StartValue = MmioRead32 (ApicBase + 0x380);\r
+ *StartValue = MmioRead32 (ApicBase + APIC_TMICT);\r
}\r
\r
if (EndValue != NULL) {\r
*EndValue = 0;\r
}\r
\r
- return (UINT64) InternalX86GetTimerFrequency (ApicBase);;\r
+ return (UINT64) InternalX86GetTimerFrequency (ApicBase);\r
}\r