/** @file\r
Section Extraction PEIM\r
\r
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
-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
- \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
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+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
+\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
output buffer. If the input\r
section's GuidedSectionHeader.\r
Attributes field has the\r
- EFI_GUIDED_SECTION_AUTH_STATUS_VALID \r
+ EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
bit as clear,\r
AuthenticationStatus must return\r
zero. These bits reflect the\r
EFI_SUCCESS, the value of\r
AuthenticationStatus is\r
undefined.\r
- \r
+\r
@retval EFI_SUCCESS The InputSection was\r
successfully processed and the\r
section contents were returned.\r
- \r
+\r
@retval EFI_OUT_OF_RESOURCES The system has insufficient\r
resources to process the request.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER The GUID in InputSection does\r
not match this instance of the\r
GUIDed Section Extraction PPI.\r
output buffer. If the input\r
section's GuidedSectionHeader.\r
Attributes field has the\r
- EFI_GUIDED_SECTION_AUTH_STATUS_VALID \r
+ EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
bit as clear,\r
AuthenticationStatus must return\r
zero. These bits reflect the\r
EFI_SUCCESS, the value of\r
AuthenticationStatus is\r
undefined.\r
- \r
+\r
@retval EFI_SUCCESS The InputSection was\r
successfully processed and the\r
section contents were returned.\r
- \r
+\r
@retval EFI_OUT_OF_RESOURCES The system has insufficient\r
resources to process the request.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER The GUID in InputSection does\r
not match this instance of the\r
GUIDed Section Extraction PPI.\r
UINT32 ScratchBufferSize;\r
UINT32 OutputBufferSize;\r
UINT16 SectionAttribute;\r
- \r
+\r
//\r
// Init local variable\r
//\r
&ScratchBufferSize,\r
&SectionAttribute\r
);\r
- \r
+\r
if (EFI_ERROR (Status)) {\r
DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status));\r
return Status;\r
}\r
- \r
+\r
if (ScratchBufferSize != 0) {\r
//\r
// Allocate scratch buffer\r
}\r
}\r
\r
- if (((SectionAttribute & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) && OutputBufferSize > 0) { \r
+ if (((SectionAttribute & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) && OutputBufferSize > 0) {\r
//\r
// Allocate output buffer\r
//\r
- *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) + 1);\r
+ *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize));\r
if (*OutputBuffer == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));\r
- //\r
- // *OutputBuffer still is one section. Adjust *OutputBuffer offset, \r
- // skip EFI section header to make section data at page alignment.\r
- //\r
- *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER));\r
}\r
- \r
+\r
Status = ExtractGuidedSectionDecode (\r
- InputSection, \r
+ InputSection,\r
OutputBuffer,\r
ScratchBuffer,\r
AuthenticationStatus\r
DEBUG ((DEBUG_ERROR, "Extract guided section Failed - %r\n", Status));\r
return Status;\r
}\r
- \r
+\r
*OutputSize = (UINTN) OutputBufferSize;\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
Main entry for Section Extraction PEIM driver.\r
- \r
- This routine registers the Section Extraction PPIs that have been registered \r
+\r
+ This routine registers the Section Extraction PPIs that have been registered\r
with the Section Extraction Library.\r
\r
@param FileHandle Handle of the file being invoked.\r
SectionExtractionPeiEntry (\r
IN EFI_PEI_FILE_HANDLE FileHandle,\r
IN CONST EFI_PEI_SERVICES **PeiServices\r
- ) \r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_GUID *ExtractHandlerGuidTable;\r
EFI_PEI_PPI_DESCRIPTOR *GuidPpi;\r
\r
//\r
- // Get custom extract guided section method guid list \r
+ // Get custom extract guided section method guid list\r
//\r
ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);\r
- \r
+\r
//\r
// Install custom extraction guid PPI\r
//\r
ASSERT_EFI_ERROR (Status);\r
}\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r