]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
1) Added BIT0, BIT1, …, BIT63 to the Base Defines
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index fd3bdac53e5af7b01fd3ef923272b4b9d9e04557..a302c26beb51cdc983094ab53080bb0a00e7270f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   MDE UEFI library functions and macros\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2007, Intel Corporation                                                         \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
@@ -84,7 +84,7 @@ EfiCreateProtocolNotifyEvent(
   IN  EFI_TPL           NotifyTpl,\r
   IN  EFI_EVENT_NOTIFY  NotifyFunction,\r
   IN  VOID              *NotifyContext,  OPTIONAL\r
-  OUT VOID              *Registration\r
+  OUT VOID              **Registration\r
   );\r
 \r
 /**\r
@@ -109,7 +109,7 @@ EfiNamedEventListen (
   IN EFI_TPL           NotifyTpl,\r
   IN EFI_EVENT_NOTIFY  NotifyFunction,\r
   IN CONST VOID        *NotifyContext,  OPTIONAL\r
-  OUT VOID             *Registration    OPTIONAL\r
+  OUT VOID             *Registration OPTIONAL\r
   );\r
 \r
 /**\r
@@ -128,6 +128,26 @@ EfiNamedEventSignal (
   IN CONST EFI_GUID  *Name\r
   );\r
 \r
+/** \r
+  Returns the current TPL.\r
+\r
+  This function returns the current TPL.  There is no EFI service to directly \r
+  retrieve the current TPL. Instead, the RaiseTPL() function is used to raise \r
+  the TPL to TPL_HIGH_LEVEL.  This will return the current TPL.  The TPL level \r
+  can then immediately be restored back to the current TPL level with a call \r
+  to RestoreTPL().\r
+\r
+  @param  VOID\r
+\r
+  @retvale EFI_TPL              The current TPL.\r
+\r
+**/\r
+EFI_TPL\r
+EFIAPI\r
+EfiGetCurrentTpl (\r
+  VOID\r
+  );\r
+\r
 /**\r
   This function initializes a basic mutual exclusion lock to the released state \r
   and returns the lock.  Each lock provides mutual exclusion access at its task \r
@@ -189,7 +209,7 @@ EfiInitializeLock (
 \r
 \r
 /**\r
-  This function raises the system¡¯s current task priority level to the task \r
+  This function raises the system's current task priority level to the task \r
   priority level of the mutual exclusion lock.  Then, it places the lock in the \r
   acquired state.\r
 \r
@@ -203,7 +223,7 @@ EfiAcquireLock (
   );\r
 \r
 /**\r
-  This function raises the system¡¯s current task priority level to the task \r
+  This function raises the system's current task priority level to the task \r
   priority level of the mutual exclusion lock.  Then, it attempts to place the \r
   lock in the acquired state.\r
 \r
@@ -221,7 +241,7 @@ EfiAcquireLockOrFail (
 \r
 /**\r
   This function transitions a mutual exclusion lock from the acquired state to \r
-  the released state, and restores the system¡¯s task priority level to its \r
+  the released state, and restores the system's task priority level to its \r
   previous level.\r
 \r
   @param  Lock  A pointer to the lock to release.\r
@@ -233,6 +253,63 @@ EfiReleaseLock (
   IN EFI_LOCK  *Lock\r
   );\r
 \r
+/**
+  Tests whether a controller is managed by a specific driver.
+
+  This function tests whether a specific driver manages ControllerHandle by\r
+  opening on DriverBindingHandle a protocol specified by ProtocolGuid with\r
+  attribute EFI_OPEN_PROTOCOL_BY_DRIVER.  This library function is used to\r
+  implement the Component Name Protocol for EFI Drivers.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
+
+  @param  ControllerHandle     A handle for a controller to test.
+  @param  DriverBindingHandle  Specifies the driver binding handle for the
+                               driver.
+  @param  ProtocolGuid         Supplies GUID for the protocol opened by the
+                               driver on the controller. 
+
+  @retval EFI_SUCCESS          ControllerHandle is managed by the specific
+                               driver.
+  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the specific
+                               driver.
+
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestManagedDevice (\r
+  IN CONST EFI_HANDLE       ControllerHandle,\r
+  IN CONST EFI_HANDLE       DriverBindingHandle,\r
+  IN CONST EFI_GUID         *ProtocolGuid\r
+  );\r
+\r
+/**
+  Tests whether a child handle is a children device of the controller.
+
+  This function tests whether ChildHandle is one of the children of
+  ControllerHandle which are consuming a protocol specified by ProtocolGuid
+  with the attribute bit EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER set.  This
+  library function is used to implement the Component Name Protocol for EFI
+  Drivers.
+  If ProtocolGuid is NULL, then ASSERT().
+
+  @param  ControllerHandle     A handle for a (parent) controller to test. 
+  @param  ChildHandle          A child handle to test.
+  @param  ConsumsedGuid        Supplies GUID for the protocol consumed by
+                               children from controller. 
+
+  @retval EFI_SUCCESS          ChildHandle is a child of the ControllerHandle.
+  @retval EFI_UNSUPPORTED      ChildHandle is not a child of the
+                               ControllerHandle.
+
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestChildHandle (\r
+  IN CONST EFI_HANDLE       ControllerHandle,\r
+  IN CONST EFI_HANDLE       ChildHandle,\r
+  IN CONST EFI_GUID         *ProtocolGuid\r
+  );\r
+\r
 /**\r
   This function looks up a Unicode string in UnicodeStringTable.  If Language is \r
   a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable\r
@@ -400,7 +477,7 @@ EfiSignalEventLegacyBoot (
   This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
   added and now it's possible to not voilate the UEFI specification by \r
   declaring a GUID for the legacy boot event class. This library supports\r
-  the R8.5/EFI 1.10 form and R9/UEFI 2.0 form and allows common code to \r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to \r
   work both ways.\r
 \r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
@@ -415,6 +492,34 @@ EfiCreateEventLegacyBoot (
   OUT EFI_EVENT  *LegacyBootEvent\r
   );\r
 \r
+/**\r
+  Create an EFI event in the Legacy Boot Event Group and allows\r
+  the caller to specify a notification function.  \r
+  \r
+  This function abstracts the creation of the Legacy Boot Event.\r
+  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
+  This library abstracts the caller from how this event is created to prevent\r
+  to code form having to change with the version of the specification supported.\r
+  If LegacyBootEvent is NULL, then ASSERT().\r
+\r
+  @param  NotifyTpl         The task priority level of the event.\r
+  @param  NotifyFunction    The notification function to call when the event is signaled.\r
+  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventLegacyBootEx (\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT EFI_EVENT         *LegacyBootEvent\r
+  );\r
+\r
 /**\r
   Create a Read to Boot Event.  \r
   \r
@@ -422,7 +527,7 @@ EfiCreateEventLegacyBoot (
   This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
   added and now it's possible to not voilate the UEFI specification and use \r
   the ready to boot event class defined in UEFI 2.0. This library supports\r
-  the R8.5/EFI 1.10 form and R9/UEFI 2.0 form and allows common code to \r
+  the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to \r
   work both ways.\r
 \r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
@@ -437,13 +542,41 @@ EfiCreateEventReadyToBoot (
   OUT EFI_EVENT  *ReadyToBootEvent\r
   );\r
 \r
+/**\r
+  Create an EFI event in the Ready To Boot Event Group and allows\r
+  the caller to specify a notification function.  \r
+  \r
+  This function abstracts the creation of the Ready to Boot Event.\r
+  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
+  This library abstracts the caller from how this event is created to prevent\r
+  to code form having to change with the version of the specification supported.\r
+  If ReadyToBootEvent is NULL, then ASSERT().\r
+\r
+  @param  NotifyTpl         The task priority level of the event.\r
+  @param  NotifyFunction    The notification function to call when the event is signaled.\r
+  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventReadyToBootEx (\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT EFI_EVENT         *ReadyToBootEvent\r
+  );\r
+\r
 /**\r
   Initialize a Firmware Volume (FV) Media Device Path node.\r
   \r
   Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
   so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
   the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
+  device path is defined for Tiano extensions of device path. If the code \r
   is compiled to conform with the UEFI 2.0 specification use the new device path\r
   else use the old form for backwards compatability.\r
 \r
@@ -464,7 +597,7 @@ EfiInitializeFwVolDevicepathNode (
   Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
   so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
   the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
+  device path is defined for Tiano extensions of device path. If the code \r
   is compiled to conform with the UEFI 2.0 specification use the new device path\r
   else use the old form for backwards compatability. The return value to this\r
   function points to a location in FvDevicePathNode and it does not allocate\r
@@ -482,5 +615,4 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode\r
   );\r
 \r
-\r
 #endif\r