]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/MetronomeDxe/Metronome.c
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
[mirror_edk2.git] / UnixPkg / MetronomeDxe / Metronome.c
diff --git a/UnixPkg/MetronomeDxe/Metronome.c b/UnixPkg/MetronomeDxe/Metronome.c
deleted file mode 100644 (file)
index be2b7e7..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, 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
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  Metronome.c\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/Metronome.h>\r
-#include "Metronome.h"\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UnixLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-//\r
-// Global Variables\r
-//\r
-EFI_METRONOME_ARCH_PROTOCOL mMetronome = {\r
-  UnixMetronomeDriverWaitForTick,\r
-  TICK_PERIOD\r
-};\r
-\r
-//\r
-// Worker Functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixMetronomeDriverWaitForTick (\r
-  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
-  IN UINT32                       TickNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The WaitForTick() function waits for the number of ticks specified by\r
-  TickNumber from a known time source in the platform.  If TickNumber of\r
-  ticks are detected, then EFI_SUCCESS is returned.  The actual time passed\r
-  between entry of this function and the first tick is between 0 and\r
-  TickPeriod 100 nS units.  If you want to guarantee that at least TickPeriod\r
-  time has elapsed, wait for two ticks.  This function waits for a hardware\r
-  event to determine when a tick occurs.  It is possible for interrupt\r
-  processing, or exception processing to interrupt the execution of the\r
-  WaitForTick() function.  Depending on the hardware source for the ticks, it\r
-  is possible for a tick to be missed.  This function cannot guarantee that\r
-  ticks will not be missed.  If a timeout occurs waiting for the specified\r
-  number of ticks, then EFI_TIMEOUT is returned.\r
-\r
-Arguments:\r
-\r
-  This       - The EFI_METRONOME_ARCH_PROTOCOL instance.\r
-  TickNumber - Number of ticks to wait.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The wait for the number of ticks specified by TickNumber\r
-                succeeded.\r
-\r
---*/\r
-{\r
-  UINT64  SleepTime;\r
-\r
-  //\r
-  // Calculate the time to sleep.  Win API smallest unit to sleep is 1 millisec\r
-  // Tick Period is in 100ns units, divide by 10000 to convert to ms\r
-  //\r
-  SleepTime = DivU64x32 (MultU64x32 ((UINT64) TickNumber, TICK_PERIOD) + 9999, 10000);\r
-  gUnix->Sleep ((UINT32) SleepTime);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixMetronomeDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Metronome Architectural Protocol driver\r
-\r
-Arguments:\r
-\r
-  ImageHandle - ImageHandle of the loaded driver\r
-\r
-\r
-  SystemTable - Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Metronome Architectural Protocol created\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-\r
-  EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-\r
-  //\r
-  // Install the Metronome Architectural Protocol onto a new handle\r
-  //\r
-  Handle = NULL;\r
-  DEBUG ((EFI_D_ERROR, "*******************file %d line %d\n", __FUNCTION__, __LINE__));\r
-  Status = gBS->InstallProtocolInterface (\r
-                  &Handle,\r
-                  &gEfiMetronomeArchProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mMetronome\r
-                  );\r
-\r
-  return Status;\r
-}\r