]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/LegacyMetronome/Metronome.c
FmpDevicePkg FmpDxe: Update function comment for FmpDxeEntryPoint
[mirror_edk2.git] / DuetPkg / LegacyMetronome / Metronome.c
index acc0dad45cf63e5f6567f87c54ad78bc4f3f8f92..1fd3ecff500c400bf42202fe6db31e739f78e860 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2005, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2005, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -33,75 +33,9 @@ EFI_METRONOME_ARCH_PROTOCOL mMetronome = {
   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
@@ -130,10 +64,8 @@ Returns:
   // 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
@@ -171,14 +103,6 @@ Returns:
   //\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