]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/DxeServicesLib.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Library / DxeServicesLib.h
index 898793398f07766401d6e2d391021ded5417f5ef..e3536687e18bc1a425140b3fddfdd447c9bc09a2 100644 (file)
@@ -1,15 +1,15 @@
 /** @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<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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+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
+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
   If Size is NULL, then ASSERT().\r
 \r
 \r
-  @param  NameGuid             A pointer to to the FFS filename GUID to search for within \r
-                               any of the firmware volumes in the platform. \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
-                               It is the caller's responsibility to free this buffer using FreePool().\r
+  @param  NameGuid             A pointer to to the FFS filename GUID to search for  \r
+                               within any of the firmware volumes in the platform. \r
+  @param  SectionType          Indicates the FFS section type to search for within \r
+                               the FFS file specified by NameGuid.\r
+  @param  SectionInstance      Indicates which section instance within the FFS file \r
+                               specified by NameGuid to retrieve.\r
+  @param  Buffer               On output, a pointer to a callee-allocated buffer \r
+                               containing the FFS file section that was found.  \r
+                               It is the caller's responsibility to free this \r
+                               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 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
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve \r
+                                the matching FFS section.\r
+  @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a \r
+                                device error.\r
+  @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the \r
+                                firmware volume that contains the matching FFS \r
+                                section does not allow reads.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -83,21 +90,29 @@ GetSectionFromAnyFv  (
   If Buffer is NULL, then ASSERT().\r
   If Size is NULL, then ASSERT().\r
 \r
-  @param  NameGuid             A pointer to to the FFS filename GUID to search for within \r
-                               the firmware volumes that the currently executing module was loaded from.\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
-                               It is the caller's responsibility to free this buffer using FreePool().\r
+  @param  NameGuid             A pointer to to the FFS filename GUID to search for  \r
+                               within the firmware volumes that the currently \r
+                               executing module was loaded from.\r
+  @param  SectionType          Indicates the FFS section type to search for within \r
+                               the FFS file specified by NameGuid.\r
+  @param  SectionInstance      Indicates which section instance within the FFS \r
+                               file specified by NameGuid to retrieve.\r
+  @param  Buffer               On output, a pointer to a callee allocated buffer \r
+                               containing the FFS file section that was found.  \r
+                               It is the caller's responsibility to free this buffer \r
+                               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 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
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve \r
+                                the matching FFS section.\r
+  @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a \r
+                                device error.\r
+  @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the \r
+                                firmware volume that contains the matching FFS \r
+                                section does not allow reads.  \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -129,20 +144,27 @@ GetSectionFromFv (
   If Size is NULL, then ASSERT().\r
 \r
 \r
-  @param  SectionType          Indicates the FFS section type to search for within the FFS file \r
-                               that the currently executing module was loaded from.\r
-  @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
-                               It is the caller's responsibility to free this buffer using FreePool().\r
+  @param  SectionType          Indicates the FFS section type to search for within  \r
+                               the FFS file that the currently executing module \r
+                               was loaded from.\r
+  @param  SectionInstance      Indicates which section instance to retrieve within \r
+                               the FFS file that the currently executing module \r
+                               was loaded from.\r
+  @param  Buffer               On output, a pointer to a callee allocated buffer \r
+                               containing the FFS file section that was found.  \r
+                               It is the caller's responsibility to free this buffer \r
+                               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 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
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve \r
+                                the matching FFS section.\r
+  @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a \r
+                                device error.\r
+  @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the \r
+                                firmware volume that contains the matching FFS \r
+                                section does not allow reads.  \r
   \r
 **/\r
 EFI_STATUS\r
@@ -154,5 +176,42 @@ 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           The policy for Open Image File.If TRUE, \r
+                                        indicates that the request originates from \r
+                                        the boot manager, and that the boot manager is\r
+                                        attempting to load FilePath as a boot selection. \r
+                                        If FALSE, then FilePath must match an exact \r
+                                        file to be loaded.\r
+  @param[in]       FilePath             Pointer to the device path of the file that is abstracted 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