]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c
PcAtChipsetPkg AcpiTimerLib: Clear bits [31:24] after reading by IoRead32()
[mirror_edk2.git] / PcAtChipsetPkg / Library / AcpiTimerLib / AcpiTimerLib.c
index 020031e3f4a53c62eb14db7c6e1e113b145e40c5..792781a33f3fb03ee97a6b74f1cbabc227802465 100644 (file)
@@ -162,14 +162,14 @@ InternalAcpiDelay (
     //\r
     // The target timer count is calculated here\r
     //\r
-    Ticks = IoRead32 (Port) + Delay;\r
+    Ticks = IoBitFieldRead32 (Port, 0, 23) + Delay;\r
     Delay = BIT22;\r
     //\r
     // Wait until time out\r
     // Delay >= 2^23 could not be handled by this function\r
     // Timer wrap-arounds are handled correctly by this function\r
     //\r
-    while (((Ticks - IoRead32 (Port)) & BIT23) == 0) {\r
+    while (((Ticks - IoBitFieldRead32 (Port, 0, 23)) & BIT23) == 0) {\r
       CpuPause ();\r
     }\r
   } while (Times-- > 0);\r
@@ -371,7 +371,7 @@ InternalCalculateTscFrequency (
   // Use 363 * 9861 = 3579543 Hz which is within 2 Hz of ACPI_TIMER_FREQUENCY.\r
   // 363 counts is a calibration time of 101.4 uS.\r
   //\r
-  Ticks = IoRead32 (TimerAddr) + 363;\r
+  Ticks = IoBitFieldRead32 (TimerAddr, 0, 23) + 363;\r
 \r
   StartTSC = AsmReadTsc ();                                         // Get base value for the TSC\r
   //\r
@@ -380,7 +380,7 @@ InternalCalculateTscFrequency (
   // When the current ACPI timer value is greater than 'Ticks',\r
   // the while loop will exit.\r
   //\r
-  while (((Ticks - IoRead32 (TimerAddr)) & BIT23) == 0) {\r
+  while (((Ticks - IoBitFieldRead32 (TimerAddr, 0, 23)) & BIT23) == 0) {\r
     CpuPause();\r
   }\r
   EndTSC = AsmReadTsc ();                                           // TSC value 101.4 us later\r