TICK_PERIOD\r
};\r
\r
-//\r
-// The CPU I/O Protocol used to access system hardware\r
-//\r
-EFI_CPU_IO_PROTOCOL *mCpuIo = NULL;\r
-\r
//\r
// Worker Functions\r
//\r
-VOID\r
-IoWrite8 (\r
- UINT16 Port,\r
- UINT8 Data\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Write an 8 bit value to an I/O port and save it to the S3 script\r
-\r
-Arguments:\r
-\r
-Returns: \r
-\r
- None.\r
-\r
---*/\r
-// TODO: Port - add argument and description to function comment\r
-// TODO: Data - add argument and description to function comment\r
-{\r
- mCpuIo->Io.Write (\r
- mCpuIo,\r
- EfiCpuIoWidthUint8,\r
- Port,\r
- 1,\r
- &Data\r
- );\r
-\r
-}\r
-\r
-UINT8\r
-ReadRefresh (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Read the refresh bit from the REFRESH_PORT\r
-\r
-Arguments:\r
-\r
-Returns: \r
-\r
- None.\r
-\r
---*/\r
-{\r
- UINT8 Data;\r
-\r
- mCpuIo->Io.Read (\r
- mCpuIo,\r
- EfiCpuIoWidthUint8,\r
- REFRESH_PORT,\r
- 1,\r
- &Data\r
- );\r
- return (UINT8) (Data & REFRESH_ON);\r
-}\r
-\r
EFI_STATUS\r
EFIAPI\r
WaitForTick (\r
// Wait for TickNumber toggles of the Refresh bit\r
//\r
for (; TickNumber != 0x00; TickNumber--) {\r
- while (ReadRefresh () == REFRESH_ON)\r
- ;\r
- while (ReadRefresh () == REFRESH_OFF)\r
- ;\r
+ while ((IoRead8(REFRESH_PORT) & REFRESH_ON) == REFRESH_ON);\r
+ while ((IoRead8(REFRESH_PORT) & REFRESH_ON) == REFRESH_OFF);\r
}\r
\r
return EFI_SUCCESS;\r
//\r
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiMetronomeArchProtocolGuid);\r
\r
- //\r
- // Get the CPU I/O Protocol that this driver requires\r
- // If the CPU I/O Protocol is not found, then ASSERT because the dependency expression\r
- // should guarantee that it is present in the handle database.\r
- //\r
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mCpuIo);\r
- ASSERT_EFI_ERROR (Status);\r
-\r
//\r
// Program port 61 timer 1 as refresh timer. We could use ACPI timer in the\r
// future.\r