]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/DxeServicesLib.h
Sync EDKII BaseTools to BaseTools project r1928
[mirror_edk2.git] / MdePkg / Include / Library / DxeServicesLib.h
index ef925c9c60f05ef164300e8164e8f185b63b1bf6..abfdde6d6237b22929702b9470ac43f3ae28fd31 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   MDE DXE Services Library provides functions that simplify the development of DXE Drivers.  \r
-  These functions help access data from sections of FFS files.\r
+  These functions help access data from sections of FFS files or from file path.\r
 \r
-  Copyright (c) 2008, Intel Corporation                                                         \r
+  Copyright (c) 2008 - 2010, 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
 \r
 **/\r
 \r
-#ifndef __PI_LIB_H__\r
-#define __PI_LIB_H__\r
-\r
-#include <Pi/PiFirmwareFile.h>\r
-\r
+#ifndef __DXE_SERVICES_LIB_H__\r
+#define __DXE_SERVICES_LIB_H__\r
 \r
 /**\r
-  Searches all the availables firmware volumes and returns the first matching FFS section. \r
+  Searches all the available firmware volumes and returns the first matching FFS section. \r
 \r
   This function searches all the firmware volumes for FFS files with an FFS filename specified by NameGuid.  \r
-  The order that the firmware volumes is searched is not deterministic. For each FFS file found a search \r
+  The order in which the firmware volumes are searched is not deterministic. For each FFS file found, a search \r
   is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances \r
   of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer. \r
   Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. \r
   @param  SectionType          Indicates the FFS section type to search for within the FFS file specified by NameGuid.\r
   @param  SectionInstance      Indicates which section instance within the FFS file specified by NameGuid to retrieve.\r
   @param  Buffer               On output, a pointer to a callee allocated buffer containing the FFS file section that was found.  \r
-                               Is it the caller's respobsibility to free this buffer using FreePool().\r
+                               It is the caller's responsibility to free this buffer using FreePool().\r
   @param  Size                 On output, a pointer to the size, in bytes, of Buffer.\r
 \r
   @retval  EFI_SUCCESS          The specified FFS section was returned.\r
   @retval  EFI_NOT_FOUND        The specified FFS section could not be found.\r
-  @retval  EFI_OUT_OF_RESOURCES There are not enough rsources available to retrieve the matching FFS section.\r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve the matching FFS section.\r
   @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a device error.\r
   @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the firmware volume that \r
                                 contains the matching FFS section does not allow reads.\r
@@ -69,7 +66,7 @@ GetSectionFromAnyFv  (
   Searches the firmware volume that the currently executing module was loaded from and returns the first matching FFS section. \r
 \r
   This function searches the firmware volume that the currently executing module was loaded \r
-  from for an FFS file with an FFS filename specified by NameGuid. If the FFS file is found a search \r
+  from for an FFS file with an FFS filename specified by NameGuid. If the FFS file is found, a search \r
   is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance \r
   instances of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.\r
   Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. \r
@@ -91,13 +88,13 @@ GetSectionFromAnyFv  (
   @param  SectionType          Indicates the FFS section type to search for within the FFS file specified by NameGuid.\r
   @param  SectionInstance      Indicates which section instance within the FFS file specified by NameGuid to retrieve.\r
   @param  Buffer               On output, a pointer to a callee allocated buffer containing the FFS file section that was found.  \r
-                               Is it the caller's respobsibility to free this buffer using FreePool().\r
+                               It is the caller's responsibility to free this buffer using FreePool().\r
   @param  Size                 On output, a pointer to the size, in bytes, of Buffer.\r
 \r
 \r
   @retval  EFI_SUCCESS          The specified FFS section was returned.\r
   @retval  EFI_NOT_FOUND        The specified FFS section could not be found.\r
-  @retval  EFI_OUT_OF_RESOURCES There are not enough rsources available to retrieve the matching FFS section.\r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve the matching FFS section.\r
   @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a device error.\r
   @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the firmware volume that \r
                                 contains the matching FFS section does not allow reads.  \r
@@ -137,12 +134,12 @@ GetSectionFromFv (
   @param  SectionInstance      Indicates which section instance to retrieve within the FFS file \r
                                that the currently executing module was loaded from.\r
   @param  Buffer               On output, a pointer to a callee allocated buffer containing the FFS file section that was found.  \r
-                               Is it the caller's respobsibility to free this buffer using FreePool().\r
+                               It is the caller's responsibility to free this buffer using FreePool().\r
   @param  Size                 On output, a pointer to the size, in bytes, of Buffer.\r
 \r
   @retval  EFI_SUCCESS          The specified FFS section was returned.\r
   @retval  EFI_NOT_FOUND        The specified FFS section could not be found.\r
-  @retval  EFI_OUT_OF_RESOURCES There are not enough rsources available to retrieve the matching FFS section.\r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve the matching FFS section.\r
   @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a device error.\r
   @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the firmware volume that \r
                                 contains the matching FFS section does not allow reads.  \r
@@ -157,5 +154,40 @@ GetSectionFromFfs (
   OUT UINTN                         *Size\r
   );\r
 \r
+\r
+/**\r
+  Get the image file buffer data and buffer size by its device path. \r
+  \r
+  Access the file either from a firmware volume, from a file system interface, \r
+  or from the load file interface.\r
+  \r
+  Allocate memory to store the found image. The caller is responsible to free memory.\r
+\r
+  If File is NULL, then NULL is returned.\r
+  If FileSize is NULL, then NULL is returned.\r
+  If AuthenticationStatus is NULL, then NULL is returned.\r
+\r
+  @param[in]       BootPolicy           Policy for Open Image File.If TRUE, indicates that the request \r
+                                        originates from the boot manager, and that the boot manager is\r
+                                        attempting to load FilePath as a boot selection. If FALSE, \r
+                                        then FilePath must match an exact file to be loaded.\r
+  @param[in]       FilePath             Pointer to the device path of the file that is absracted to\r
+                                        the file buffer.\r
+  @param[out]      FileSize             Pointer to the size of the abstracted file buffer.\r
+  @param[out]      AuthenticationStatus Pointer to a caller-allocated UINT32 in which the authentication\r
+                                        status is returned.\r
+\r
+  @retval NULL   File is NULL, or FileSize is NULL. Or the file can't be found.\r
+  @retval other  The abstracted file buffer. The caller is responsible to free memory.\r
+**/\r
+VOID *\r
+EFIAPI\r
+GetFileBufferByFilePath (\r
+  IN BOOLEAN                           BootPolicy,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL    *FilePath,\r
+  OUT      UINTN                       *FileSize,\r
+  OUT UINT32                           *AuthenticationStatus\r
+  );\r
+\r
 #endif\r
 \r