]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add 3 macros to manager Timer events.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Nov 2008 14:21:43 +0000 (14:21 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Nov 2008 14:21:43 +0000 (14:21 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6563 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/UefiLib.h

index 9f888da68fdcab7f9858201bad5540f77d6bcd9d..8c5b628aa94ea04bb6bcb444e1a49310d9140cd6 100644 (file)
@@ -29,6 +29,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/DriverDiagnostics.h>\r
 #include <Protocol/DriverDiagnostics2.h>\r
 \r
+#include <Library/BaseLib.h>\r
+\r
 ///\r
 /// Unicode String Table\r
 ///\r
@@ -56,6 +58,45 @@ typedef struct {
 } EFI_LOCK;\r
 \r
 \r
+/**\r
+  Macro that returns the number of 100 ns units for a specified number of microseconds.\r
+  Useful for managing EFI timer events.\r
+\r
+  @param  Microseconds           Number of microseonds.\r
+\r
+  @return The number of 100 ns units equivalent to the number of microseconds specified\r
+          by Microseconds.\r
+\r
+**/\r
+#define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10)\r
+\r
+\r
+/**\r
+  Macro that returns the number of 100 ns units for a specified number of milliseoconds.\r
+  Useful for managing EFI timer events.\r
+\r
+  @param  Milliseconds           Number of milliseconds.\r
+\r
+  @return The number of 100 ns units equivalent to the number of milliseconds specified\r
+          by Milliseconds.\r
+\r
+**/\r
+#define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)\r
+\r
+\r
+/**\r
+  Macro that returns the number of 100 ns units for a specified number of seoconds.\r
+  Useful for managing EFI timer events.\r
+\r
+  @param  Seconds                Number of seconds.\r
+\r
+  @return The number of 100 ns units equivalent to the number of seconds specified\r
+          by Seconds.\r
+\r
+**/\r
+#define EFI_TIMER_PERIOD_SECONDS(Seconds)           MultU64x32((UINT64)(Seconds), 10000000)\r
+\r
+\r
 /**\r
   This function searches the list of configuration tables stored in the EFI System \r
   Table for a table with a GUID that matches TableGuid.  If a match is found, \r