]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for Metronome driver.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 7 Nov 2008 09:53:51 +0000 (09:53 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 7 Nov 2008 09:53:51 +0000 (09:53 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6430 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Metronome/Metronome.c
MdeModulePkg/Universal/Metronome/Metronome.h [new file with mode: 0644]

index 9ce6c9cf74272c833fff278c3057ba64863a5343..ce15e3a6e82b33e47536eeb4c0d88a560f8e0f0c 100644 (file)
@@ -22,22 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <PiDxe.h>\r
-#include <Protocol/Metronome.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/TimerLib.h>\r
-#include <Library/DebugLib.h>\r
-\r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WaitForTick (\r
-  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
-  IN UINT32                       TickNumber\r
-  );\r
-\r
 //\r
 // Handle for the Metronome Architectural Protocol instance produced by this driver\r
 //\r
@@ -52,6 +36,9 @@ EFI_METRONOME_ARCH_PROTOCOL mMetronome = {
 };\r
 \r
 /**\r
+  Waits for the specified number of ticks.\r
+  \r
+  This function implements EFI_METRONOME_ARCH_PROTOCOL.WaitForTick().\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
diff --git a/MdeModulePkg/Universal/Metronome/Metronome.h b/MdeModulePkg/Universal/Metronome/Metronome.h
new file mode 100644 (file)
index 0000000..f199f53
--- /dev/null
@@ -0,0 +1,56 @@
+/** @file\r
+  Include file of Metronome driver.\r
+\r
+Copyright (c) 2008, Intel Corporation. <BR>\r
+All rights reserved. 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
+**/\r
+\r
+#ifndef _METRONOME_H_\r
+#define _METRONOME_H_\r
+\r
+#include <PiDxe.h>\r
+#include <Protocol/Metronome.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+/**\r
+  Waits for the specified number of ticks.\r
+  \r
+  This function implements EFI_METRONOME_ARCH_PROTOCOL.WaitForTick().\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
+  @param  This             The EFI_METRONOME_ARCH_PROTOCOL instance.\r
+  @param  TickNumber       Number of ticks to wait.\r
+\r
+  @retval EFI_SUCCESS      The wait for the number of ticks specified by TickNumber\r
+                           succeeded.\r
+  @retval EFI_TIMEOUT      A timeout occurred waiting for the specified number of ticks.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+WaitForTick (\r
+  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
+  IN UINT32                       TickNumber\r
+  );\r
+\r
+#endif\r