From 52ca0d9816a2bf1f9082693ca886b9d0bed95365 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 17 Nov 2008 14:21:43 +0000 Subject: Add 3 macros to manager Timer events. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6563 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/UefiLib.h | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'MdePkg/Include/Library') diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 9f888da68f..8c5b628aa9 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -29,6 +29,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#include + /// /// Unicode String Table /// @@ -56,6 +58,45 @@ typedef struct { } EFI_LOCK; +/** + Macro that returns the number of 100 ns units for a specified number of microseconds. + Useful for managing EFI timer events. + + @param Microseconds Number of microseonds. + + @return The number of 100 ns units equivalent to the number of microseconds specified + by Microseconds. + +**/ +#define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10) + + +/** + Macro that returns the number of 100 ns units for a specified number of milliseoconds. + Useful for managing EFI timer events. + + @param Milliseconds Number of milliseconds. + + @return The number of 100 ns units equivalent to the number of milliseconds specified + by Milliseconds. + +**/ +#define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000) + + +/** + Macro that returns the number of 100 ns units for a specified number of seoconds. + Useful for managing EFI timer events. + + @param Seconds Number of seconds. + + @return The number of 100 ns units equivalent to the number of seconds specified + by Seconds. + +**/ +#define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000) + + /** This function searches the list of configuration tables stored in the EFI System Table for a table with a GUID that matches TableGuid. If a match is found, -- cgit v1.2.3