//\r
EFI_CPU_ARCH_PROTOCOL *mCpu;\r
\r
-//\r
-// Pointer to the CPU I/O Protocol instance\r
-//\r
-EFI_CPU_IO_PROTOCOL *mCpuIo;\r
-\r
//\r
// Pointer to the Legacy 8259 Protocol instance\r
//\r
// The notification function to call on every timer interrupt.\r
// A bug in the compiler prevents us from initializing this here.\r
//\r
-volatile EFI_TIMER_NOTIFY mTimerNotifyFunction;\r
+EFI_TIMER_NOTIFY mTimerNotifyFunction;\r
\r
//\r
// The current period of the timer interrupt\r
\r
--*/\r
{\r
- UINT8 Data;\r
-\r
- Data = 0x36;\r
- mCpuIo->Io.Write (mCpuIo, EfiCpuIoWidthUint8, TIMER_CONTROL_PORT, 1, &Data);\r
- mCpuIo->Io.Write (mCpuIo, EfiCpuIoWidthFifoUint8, TIMER0_COUNT_PORT, 2, &Count);\r
+ IoWrite8 (TIMER_CONTROL_PORT, 0x36);\r
+ IoWrite8 (TIMER0_COUNT_PORT, (UINT8)(Count & 0xff));\r
+ IoWrite8 (TIMER0_COUNT_PORT, (UINT8)((Count >> 8) & 0xff));\r
}\r
\r
VOID\r
//\r
mLegacy8259->DisableIrq (mLegacy8259, Efi8259Irq0);\r
} else {\r
+\r
//\r
// Convert TimerPeriod into 8254 counts\r
//\r
//\r
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiTimerArchProtocolGuid);\r
\r
- //\r
- // Find the CPU I/O Protocol.\r
- //\r
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &mCpuIo);\r
- ASSERT_EFI_ERROR (Status);\r
-\r
//\r
// Find the CPU architectural protocol.\r
//\r
//\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&mTimerHandle,\r
- &gEfiTimerArchProtocolGuid,\r
- &mTimer,\r
+ &gEfiTimerArchProtocolGuid, &mTimer,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
return Status;\r
}\r
+\r