]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/8254TimerDxe/Timer.c
fixed typo
[mirror_edk2.git] / DuetPkg / 8254TimerDxe / Timer.c
index c7deadd737604b05fb7145c16820292b5d8e768d..2874301bbcae60e0acd630fc6091a665b6e55952 100644 (file)
@@ -42,11 +42,6 @@ EFI_TIMER_ARCH_PROTOCOL   mTimer = {
 //\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
@@ -56,7 +51,7 @@ EFI_LEGACY_8259_PROTOCOL  *mLegacy8259;
 // 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
@@ -86,11 +81,9 @@ Returns:
 \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
@@ -262,6 +255,7 @@ Returns:
     //\r
     mLegacy8259->DisableIrq (mLegacy8259, Efi8259Irq0);\r
   } else {\r
+\r
     //\r
     // Convert TimerPeriod into 8254 counts\r
     //\r
@@ -433,12 +427,6 @@ Returns:
   //\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
@@ -481,11 +469,11 @@ Returns:
   //\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