]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeServicesLib/DxeServicesLib.c
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / DxeServicesLib / DxeServicesLib.c
index 1827c9216fbc231c98b756b0bc66e7c7b13c7b58..d4f366425fed300127832c4386beded29e5ec533 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-  MDE DXE Services Library provides functions that simplify the development of DXE Drivers.  \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 or from file path.\r
 \r
-  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
 /**\r
   Identify the device handle from which the Image is loaded from. As this device handle is passed to\r
-  GetSectionFromFv as the identifier for a Firmware Volume, an EFI_FIRMWARE_VOLUME2_PROTOCOL \r
+  GetSectionFromFv as the identifier for a Firmware Volume, an EFI_FIRMWARE_VOLUME2_PROTOCOL\r
   protocol instance should be located succesfully by calling gBS->HandleProtocol ().\r
 \r
   This function locates the EFI_LOADED_IMAGE_PROTOCOL instance installed\r
   on ImageHandle. It then returns EFI_LOADED_IMAGE_PROTOCOL.DeviceHandle.\r
-  \r
+\r
   If ImageHandle is NULL, then ASSERT ();\r
   If failed to locate a EFI_LOADED_IMAGE_PROTOCOL on ImageHandle, then ASSERT ();\r
-  \r
+\r
   @param  ImageHandle         The firmware allocated handle for UEFI image.\r
 \r
   @retval  EFI_HANDLE         The device handle from which the Image is loaded from.\r
@@ -51,7 +51,7 @@ InternalImageHandleToFvHandle (
 {\r
   EFI_STATUS                    Status;\r
   EFI_LOADED_IMAGE_PROTOCOL     *LoadedImage;\r
-  \r
+\r
   ASSERT (ImageHandle != NULL);\r
 \r
   Status = gBS->HandleProtocol (\r
@@ -73,47 +73,47 @@ InternalImageHandleToFvHandle (
 }\r
 \r
 /**\r
-  Allocate and fill a buffer from a Firmware Section identified by a Firmware File GUID name, a Firmware \r
+  Allocate and fill a buffer from a Firmware Section identified by a Firmware File GUID name, a Firmware\r
   Section type and instance number from the specified Firmware Volume.\r
 \r
-  This functions first locate the EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance on FvHandle in order to \r
-  carry out the Firmware Volume read operation. The function then reads the Firmware Section found sepcifed \r
-  by NameGuid, SectionType and SectionInstance. \r
-  \r
-  The details of this search order is defined in description of EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection () \r
+  This functions first locate the EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance on FvHandle in order to\r
+  carry out the Firmware Volume read operation. The function then reads the Firmware Section found sepcifed\r
+  by NameGuid, SectionType and SectionInstance.\r
+\r
+  The details of this search order is defined in description of EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection ()\r
   found in PI Specification.\r
-  \r
-  If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section \r
-  is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND \r
+\r
+  If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section\r
+  is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND\r
   is returned.\r
-  \r
-  The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated \r
+\r
+  The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated\r
   by this function. This function can be only called at TPL_NOTIFY and below.\r
-  \r
+\r
   If NameGuid is NULL, then ASSERT();\r
   If Buffer is NULL, then ASSERT();\r
   If Size is NULL, then ASSERT().\r
 \r
-  @param  FvHandle                The device handle that contains a instance of \r
+  @param  FvHandle                The device handle that contains a instance of\r
                                   EFI_FIRMWARE_VOLUME2_PROTOCOL instance.\r
   @param  NameGuid                The GUID name of a Firmware File.\r
   @param  SectionType             The Firmware Section type.\r
-  @param  SectionInstance         The instance number of Firmware Section to  \r
+  @param  SectionInstance         The instance number of Firmware Section to\r
                                   read from starting from 0.\r
-  @param  Buffer                  On output, Buffer contains the the data read \r
+  @param  Buffer                  On output, Buffer contains the the data read\r
                                   from the section in the Firmware File found.\r
   @param  Size                    On output, the size of Buffer.\r
 \r
   @retval  EFI_SUCCESS            The image is found and data and size is returned.\r
-  @retval  EFI_NOT_FOUND          The image specified by NameGuid and SectionType \r
+  @retval  EFI_NOT_FOUND          The image specified by NameGuid and SectionType\r
                                   can't be found.\r
-  @retval  EFI_OUT_OF_RESOURCES   There were not enough resources to allocate the \r
+  @retval  EFI_OUT_OF_RESOURCES   There were not enough resources to allocate the\r
                                   output data buffer or complete the operations.\r
-  @retval  EFI_DEVICE_ERROR       A hardware error occurs during reading from the \r
+  @retval  EFI_DEVICE_ERROR       A hardware error occurs during reading from the\r
                                   Firmware Volume.\r
-  @retval  EFI_ACCESS_DENIED      The firmware volume containing the searched \r
+  @retval  EFI_ACCESS_DENIED      The firmware volume containing the searched\r
                                   Firmware File is configured to disallow reads.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 InternalGetSectionFromFv (\r
@@ -132,7 +132,7 @@ InternalGetSectionFromFv (
   ASSERT (NameGuid != NULL);\r
   ASSERT (Buffer != NULL);\r
   ASSERT (Size != NULL);\r
-  \r
+\r
   if (FvHandle == NULL) {\r
     //\r
     // Return EFI_NOT_FOUND directly for NULL FvHandle.\r
@@ -166,7 +166,7 @@ InternalGetSectionFromFv (
 \r
   if (EFI_ERROR (Status) && (SectionType == EFI_SECTION_TE)) {\r
     //\r
-    // Try reading PE32 section, if the required section is TE type \r
+    // Try reading PE32 section, if the required section is TE type\r
     //\r
     *Buffer = NULL;\r
     *Size   = 0;\r
@@ -185,51 +185,51 @@ InternalGetSectionFromFv (
 }\r
 \r
 /**\r
-  Searches all the available 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 FV file type specified by FileType\r
-  The order that the firmware volumes is searched is not deterministic. For each available FV a search \r
-  is made for FFS file of type FileType. If the FV contains more than one FFS file with the same FileType, \r
-  the FileInstance instance will be the matched FFS file. 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
-  It is the caller's responsibility to use FreePool() to free the allocated buffer.  \r
-  See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections \r
+  The order that the firmware volumes is searched is not deterministic. For each available FV a search\r
+  is made for FFS file of type FileType. If the FV contains more than one FFS file with the same FileType,\r
+  the FileInstance instance will be the matched FFS file. 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
+  It is the caller's responsibility to use FreePool() to free the allocated buffer.\r
+  See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections\r
   are retrieved from an FFS file based on SectionType and SectionInstance.\r
 \r
-  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, \r
+  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,\r
   the search will be retried with a section type of EFI_SECTION_PE32.\r
   This function must be called with a TPL <= TPL_NOTIFY.\r
 \r
   If Buffer is NULL, then ASSERT().\r
   If Size is NULL, then ASSERT().\r
 \r
-  @param  FileType             Indicates the FV file type to search for within all \r
+  @param  FileType             Indicates the FV file type to search for within all\r
                                available FVs.\r
-  @param  FileInstance         Indicates which file instance within all available \r
+  @param  FileInstance         Indicates which file instance within all available\r
                                FVs specified by FileType.\r
                                FileInstance starts from zero.\r
-  @param  SectionType          Indicates the FFS section type to search for \r
-                               within the FFS file \r
+  @param  SectionType          Indicates the FFS section type to search for\r
+                               within the FFS file\r
                                specified by FileType with FileInstance.\r
-  @param  SectionInstance      Indicates which section instance within the FFS file \r
-                               specified by FileType with FileInstance to retrieve. \r
+  @param  SectionInstance      Indicates which section instance within the FFS file\r
+                               specified by FileType with FileInstance to retrieve.\r
                                SectionInstance starts from zero.\r
-  @param  Buffer               On output, a pointer to a callee allocated buffer \r
+  @param  Buffer               On output, a pointer to a callee allocated buffer\r
                                containing the FFS file section that was found.\r
-                               Is it the caller's responsibility to free this \r
+                               Is it 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 \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
+  @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 \r
-                                the firmware volume that \r
+  @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because\r
+                                the firmware volume that\r
                                 contains the matching FFS section does not allow reads.\r
 **/\r
 EFI_STATUS\r
@@ -300,7 +300,7 @@ GetSectionFromAnyFvByFileType  (
     //\r
     if (IndexFile == 0) {\r
       Status = InternalGetSectionFromFv (\r
-                 HandleBuffer[IndexFv], \r
+                 HandleBuffer[IndexFv],\r
                  &NameGuid,\r
                  SectionType,\r
                  SectionInstance,\r
@@ -315,14 +315,14 @@ GetSectionFromAnyFvByFileType  (
   }\r
 \r
   //\r
-  // The required FFS section file is not found. \r
+  // The required FFS section file is not found.\r
   //\r
   if (IndexFv == HandleCount) {\r
     Status = EFI_NOT_FOUND;\r
   }\r
 \r
 Done:\r
-  if (HandleBuffer != NULL) {  \r
+  if (HandleBuffer != NULL) {\r
     FreePool(HandleBuffer);\r
   }\r
 \r
@@ -330,18 +330,18 @@ Done:
 }\r
 \r
 /**\r
-  Searches all the availables 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
-  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
-  It is the caller's responsibility to use FreePool() to free the allocated buffer.  \r
-  See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections \r
+  Searches all the availables 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
+  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
+  It is the caller's responsibility to use FreePool() to free the allocated buffer.\r
+  See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections\r
   are retrieved from an FFS file based on SectionType and SectionInstance.\r
 \r
-  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, \r
+  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,\r
   the search will be retried with a section type of EFI_SECTION_PE32.\r
   This function must be called with a TPL <= TPL_NOTIFY.\r
 \r
@@ -350,26 +350,26 @@ Done:
   If Size is NULL, then ASSERT().\r
 \r
 \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
+  @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
+  @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
-                               Is it the caller's responsibility to free this buffer \r
+  @param  Buffer               On output, a pointer to a callee allocated buffer\r
+                               containing the FFS file section that was found.\r
+                               Is it 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 \r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources available to\r
                                 retrieve the matching FFS section.\r
-  @retval  EFI_DEVICE_ERROR     The FFS section could not be retrieves due to a \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 \r
+  @retval  EFI_ACCESS_DENIED    The FFS section could not be retrieves because the\r
+                                firmware volume that\r
                                 contains the matching FFS section does not allow reads.\r
 **/\r
 EFI_STATUS\r
@@ -425,11 +425,11 @@ GetSectionFromAnyFv  (
     //\r
     if (HandleBuffer[Index] != FvHandle) {\r
       Status = InternalGetSectionFromFv (\r
-                 HandleBuffer[Index], \r
-                 NameGuid, \r
-                 SectionType, \r
+                 HandleBuffer[Index],\r
+                 NameGuid,\r
+                 SectionType,\r
                  SectionInstance,\r
-                 Buffer, \r
+                 Buffer,\r
                  Size\r
                  );\r
 \r
@@ -445,58 +445,58 @@ GetSectionFromAnyFv  (
   }\r
 \r
 Done:\r
-  \r
-  if (HandleBuffer != NULL) {  \r
+\r
+  if (HandleBuffer != NULL) {\r
     FreePool(HandleBuffer);\r
   }\r
   return Status;\r
-  \r
+\r
 }\r
 \r
 /**\r
-  Searches the firmware volume that the currently executing module was loaded from and returns the first matching FFS section. \r
+  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
-  is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance \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
+  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
-  It is the caller's responsibility to use FreePool() to free the allocated buffer. \r
-  See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections are retrieved from \r
+  Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.\r
+  It is the caller's responsibility to use FreePool() to free the allocated buffer.\r
+  See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections are retrieved from\r
   an FFS file based on SectionType and SectionInstance.\r
 \r
   If the currently executing module was not loaded from a firmware volume, then EFI_NOT_FOUND is returned.\r
-  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, \r
+  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,\r
   the search will be retried with a section type of EFI_SECTION_PE32.\r
-  \r
+\r
   This function must be called with a TPL <= TPL_NOTIFY.\r
   If NameGuid is NULL, then ASSERT().\r
   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 \r
-                               within the firmware volumes that the currently \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
+  @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
+  @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
-                               Is it the caller's responsibility to free this buffer \r
+  @param  Buffer               On output, a pointer to a callee allocated buffer\r
+                               containing the FFS file section that was found.\r
+                               Is it 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 \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
+  @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
+  @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
@@ -523,43 +523,43 @@ GetSectionFromFv (
   Searches the FFS file the the currently executing module was loaded from and returns the first matching FFS section.\r
 \r
   This function searches the FFS file that the currently executing module was loaded from for a FFS sections of type SectionType.\r
-  If the FFS file contains at least SectionInstance instances of the FFS section specified by SectionType, \r
-  then the SectionInstance instance is returned in Buffer. Buffer is allocated using AllocatePool(), \r
-  and the size of the allocated buffer is returned in Size. It is the caller's responsibility \r
-  to use FreePool() to free the allocated buffer. See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for \r
+  If the FFS file contains at least SectionInstance instances of the FFS section specified by SectionType,\r
+  then the SectionInstance instance is returned in Buffer. Buffer is allocated using AllocatePool(),\r
+  and the size of the allocated buffer is returned in Size. It is the caller's responsibility\r
+  to use FreePool() to free the allocated buffer. See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for\r
   details on how sections are retrieved from an FFS file based on SectionType and SectionInstance.\r
 \r
   If the currently executing module was not loaded from an FFS file, then EFI_NOT_FOUND is returned.\r
-  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, \r
+  If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,\r
   the search will be retried with a section type of EFI_SECTION_PE32.\r
   This function must be called with a TPL <= TPL_NOTIFY.\r
-  \r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Size is NULL, then ASSERT().\r
 \r
 \r
-  @param  SectionType          Indicates the FFS section type to search for within \r
-                               the FFS file that the currently executing module \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
+  @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
-                               Is it the caller's responsibility to free this buffer \r
+  @param  Buffer               On output, a pointer to a callee allocated buffer\r
+                               containing the FFS file section that was found.\r
+                               Is it 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 \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
+  @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
+  @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
 EFIAPI\r
@@ -582,26 +582,26 @@ GetSectionFromFfs (
 \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
+  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
+\r
   Allocate memory to store the found image. The caller is responsible to free memory.\r
 \r
   If FilePath 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 \r
-                                        that the request originates from the boot \r
+  @param[in]       BootPolicy           Policy for Open Image File.If TRUE, indicates\r
+                                        that the request originates from the boot\r
                                         manager, and that the boot manager is\r
                                         attempting to load FilePath as a boot\r
-                                        selection. If FALSE, then FilePath must \r
+                                        selection. If FALSE, then FilePath must\r
                                         match an exact file to be loaded.\r
   @param[in]       FilePath             The pointer to the device path of the file\r
                                         that is absracted to the file buffer.\r
-  @param[out]      FileSize             The pointer to the size of the abstracted \r
+  @param[out]      FileSize             The pointer to the size of the abstracted\r
                                         file buffer.\r
   @param[out]      AuthenticationStatus Pointer to the authentication status.\r
 \r
@@ -654,7 +654,7 @@ GetFileBufferByFilePath (
   ImageBuffer         = NULL;\r
   ImageBufferSize     = 0;\r
   *AuthenticationStatus = 0;\r
-  \r
+\r
   //\r
   // Copy File Device Path\r
   //\r
@@ -758,10 +758,10 @@ GetFileBufferByFilePath (
             Status = EFI_UNSUPPORTED;\r
             break;\r
           }\r
-  \r
+\r
           LastHandle = FileHandle;\r
           FileHandle = NULL;\r
-  \r
+\r
           Status = LastHandle->Open (\r
                                 LastHandle,\r
                                 &FileHandle,\r
@@ -769,15 +769,15 @@ GetFileBufferByFilePath (
                                 EFI_FILE_MODE_READ,\r
                                 0\r
                                 );\r
-  \r
+\r
           //\r
           // Close the previous node\r
           //\r
           LastHandle->Close (LastHandle);\r
-  \r
+\r
           DevicePathNode = NextDevicePathNode (DevicePathNode);\r
         }\r
-  \r
+\r
         if (!EFI_ERROR (Status)) {\r
           //\r
           // We have found the file. Now we need to read it. Before we can read the file we need to\r
@@ -791,7 +791,7 @@ GetFileBufferByFilePath (
                                 &FileInfoSize,\r
                                 FileInfo\r
                                 );\r
-  \r
+\r
           if (Status == EFI_BUFFER_TOO_SMALL) {\r
             FileInfo = AllocatePool (FileInfoSize);\r
             if (FileInfo == NULL) {\r
@@ -805,7 +805,7 @@ GetFileBufferByFilePath (
                                     );\r
             }\r
           }\r
-          \r
+\r
           if (!EFI_ERROR (Status) && (FileInfo != NULL)) {\r
             if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == 0) {\r
               //\r
@@ -826,7 +826,7 @@ GetFileBufferByFilePath (
         }\r
         //\r
         // Close the file and Free FileInfo and TempDevicePathNode since we are done\r
-        // \r
+        //\r
         if (FileInfo != NULL) {\r
           FreePool (FileInfo);\r
         }\r