ASSERT (DestinationSize != NULL);\r
ASSERT (ScratchSize != NULL);\r
\r
- *ScratchSize = sizeof (SCRATCH_DATA);\r
-\r
if (SourceSize < 8) {\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
- CopyMem (&CompressedSize, Source, sizeof (UINT32));\r
- CopyMem (DestinationSize, (VOID *)((UINT8 *)Source + 4), sizeof (UINT32));\r
-\r
+ CompressedSize = *(UINT32 *) Source;\r
if (SourceSize < (CompressedSize + 8)) {\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
+ *ScratchSize = sizeof (SCRATCH_DATA);\r
+ *DestinationSize = *((UINT32 *) Source + 1);\r
+\r
return RETURN_SUCCESS;\r
}\r
\r
\r
RETURN_STATUS\r
EFIAPI\r
-CustomDecompressGetInfo (\r
- IN CONST GUID *DecompressGuid,\r
- IN CONST VOID *Source,\r
- IN UINT32 SourceSize,\r
- OUT UINT32 *DestinationSize,\r
- OUT UINT32 *ScratchSize\r
+TianoDecompressGetInfo (\r
+ IN CONST VOID *InputSection,\r
+ OUT UINT32 *OutputBufferSize,\r
+ OUT UINT32 *ScratchBufferSize,\r
+ OUT UINT16 *SectionAttribute\r
)\r
/*++\r
\r
Routine Description:\r
\r
- The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().\r
+ The internal implementation of Tiano decompress GetInfo.\r
\r
Arguments:\r
- DecompressGuid The guid matches this decompress method.\r
- Source - The source buffer containing the compressed data.\r
- SourceSize - The size of source buffer\r
- DestinationSize - The size of destination buffer.\r
- ScratchSize - The size of scratch buffer.\r
+ InputSection Buffer containing the input GUIDed section to be processed. \r
+ OutputBufferSize The size of OutputBuffer.\r
+ ScratchBufferSize The size of ScratchBuffer.\r
+ SectionAttribute The attribute of the input guided section.\r
\r
Returns:\r
\r
RETURN_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.\r
RETURN_INVALID_PARAMETER - The source data is corrupted\r
- RETURN_UNSUPPORTED - Decompress method is not supported.\r
\r
--*/\r
{\r
- if (CompareGuid (DecompressGuid, &gTianoCustomDecompressGuid)) {\r
- return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);\r
- } else {\r
- return RETURN_UNSUPPORTED;\r
+ ASSERT (SectionAttribute != NULL);\r
+\r
+ if (InputSection == NULL) {\r
+ return RETURN_INVALID_PARAMETER;\r
}\r
+ //\r
+ // Get guid attribute of guid section. \r
+ //\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
+\r
+ //\r
+ // Call Tiano GetInfo to get the required size info.\r
+ //\r
+ return UefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
}\r
\r
RETURN_STATUS\r
EFIAPI\r
-CustomDecompress (\r
- IN CONST GUID *DecompressGuid,\r
- IN CONST VOID *Source,\r
- IN OUT VOID *Destination,\r
- IN OUT VOID *Scratch\r
+TianoDecompress (\r
+ IN CONST VOID *InputSection,\r
+ OUT VOID **OutputBuffer,\r
+ IN VOID *ScratchBuffer, OPTIONAL\r
+ OUT UINT32 *AuthenticationStatus\r
)\r
/*++\r
\r
Routine Description:\r
\r
- The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().\r
+ The implementation of Tiano Decompress().\r
\r
Arguments:\r
- DecompressGuid The guid matches this decompress method.\r
- Source - The source buffer containing the compressed data.\r
- Destination - The destination buffer to store the decompressed data\r
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.\r
+ InputSection Buffer containing the input GUIDed section to be processed. \r
+ OutputBuffer OutputBuffer to point to the start of the section's contents.\r
+ if guided data is not prcessed. Otherwise,\r
+ OutputBuffer to contain the output data, which is allocated by the caller.\r
+ ScratchBuffer A pointer to a caller-allocated buffer for function internal use. \r
+ AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates the\r
+ authentication status of the output buffer.
\r
Returns:\r
\r
RETURN_SUCCESS - Decompression is successfull\r
RETURN_INVALID_PARAMETER - The source data is corrupted\r
- RETURN_UNSUPPORTED - Decompress method is not supported.\r
\r
--*/\r
{\r
- if (CompareGuid (DecompressGuid, &gTianoCustomDecompressGuid)) {\r
- return UefiTianoDecompress (Source, Destination, Scratch, 2);\r
- } else {\r
- return RETURN_UNSUPPORTED;\r
- }\r
+ ASSERT (OutputBuffer != NULL);\r
+\r
+ if (InputSection == NULL) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ } \r
+ //\r
+ // Set Authentication to Zero.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+ \r
+ //\r
+ // Call Tiano Decompress to get the raw data\r
+ //\r
+ return UefiTianoDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer,\r
+ 2\r
+ );\r
}\r
\r
/**
- Get decompress method guid list.\r
-\r
- @param[in, out] AlgorithmGuidTable The decompress method guid list.
- @param[in, out] NumberOfAlgorithms The number of decompress methods.
+ Register TianoDecompress handler.\r
- @retval RETURN_SUCCESS Get all algorithmes list successfully.\r
- @retval RETURN_OUT_OF_RESOURCES Source is not enough.\r
-\r
+ @retval RETURN_SUCCESS Register successfully.\r
+ @retval RETURN_OUT_OF_RESOURCES No enough memory to store this handler.
**/\r
-RETURN_STATUS\r
+EFI_STATUS\r
EFIAPI\r
-CustomDecompressGetAlgorithms (\r
- IN OUT GUID **AlgorithmGuidTable,\r
- IN OUT UINT32 *NumberOfAlgorithms\r
- )\r
+TianoDecompressLibConstructor (\r
+)\r
{\r
- ASSERT (NumberOfAlgorithms != NULL);\r
- \r
- if (*NumberOfAlgorithms < 1) {\r
- *NumberOfAlgorithms = 1;\r
- return RETURN_OUT_OF_RESOURCES;\r
- }\r
- \r
- ASSERT (AlgorithmGuidTable != NULL);\r
-\r
- AlgorithmGuidTable [0] = &gTianoCustomDecompressGuid;\r
- *NumberOfAlgorithms = 1;\r
- \r
- return RETURN_SUCCESS; \r
+ return ExtractGuidedSectionRegisterHandlers (\r
+ &gTianoCustomDecompressGuid,\r
+ TianoDecompressGetInfo,\r
+ TianoDecompress\r
+ ); \r
}\r
FILE_GUID = d774c4d9-c121-4da3-a5e2-0f317e3c630c\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = CustomDecompressLib\r
LIBRARY_CLASS = UefiDecompressLib\r
EDK_RELEASE_VERSION = 0x00020000\r
EFI_SPECIFICATION_VERSION = 0x00020000\r
\r
+ CONSTRUCTOR = TianoDecompressLibConstructor\r
+\r
#\r
# The following information is for reference only and not required by the build tools.\r
#\r
BaseUefiTianoCustomDecompressLibInternals.h\r
BaseUefiTianoCustomDecompressLib.c\r
\r
-\r
[Packages]\r
MdePkg/MdePkg.dec\r
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
\r
[LibraryClasses]\r
- BaseMemoryLib\r
DebugLib\r
+ ExtractGuidedSectionLib\r
\r
[Guids]\r
gTianoCustomDecompressGuid \r
#ifndef __BASE_UEFI_TIANO_CUSTOM_DECOMPRESS_LIB_INTERNALS_H__\r
#define __BASE_UEFI_TIANO_CUSTOM_DECOMPRESS_LIB_INTERNALS_H__\r
\r
-\r
-#include <Base.h>\r
+#include <PiPei.h>\r
\r
#include <Library/UefiDecompressLib.h>\r
-#include <Library/CustomDecompressLib.h>\r
#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
+#include <Library/ExtractGuidedSectionLib.h>\r
\r
//\r
// Decompression algorithm begins here\r
#include <Library/HobLib.h>\r
#include <Library/PerformanceLib.h>\r
#include <Library/UefiDecompressLib.h>\r
-#include <Library/CustomDecompressLib.h>\r
+#include <Library/ExtractGuidedSectionLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/PeCoffLib.h>\r
BaseMemoryLib\r
CacheMaintenanceLib\r
UefiDecompressLib\r
- CustomDecompressLib\r
PerformanceLib\r
HobLib\r
BaseLib\r
DebugLib\r
DxeCoreEntryPoint\r
PeCoffLib\r
+ ExtractGuidedSectionLib\r
\r
[Guids]\r
gEfiEventLegacyBootGuid # ALWAYS_CONSUMED\r
);\r
\r
EFI_STATUS\r
-CustomDecompressExtractSection (\r
+CustomGuidedSectionExtract (\r
IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,\r
IN CONST VOID *InputSection,\r
OUT VOID **OutputBuffer,\r
CloseSectionStream\r
};\r
\r
-EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL mCustomDecompressExtraction = {\r
- CustomDecompressExtractSection\r
+EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL mCustomGuidedSectionExtractionProtocol = {\r
+ CustomGuidedSectionExtract\r
};\r
\r
EFI_STATUS\r
--*/\r
{\r
EFI_STATUS Status;\r
- EFI_GUID **DecompressGuidList;\r
- UINT32 DecompressMethodNumber;\r
+ EFI_GUID *ExtractHandlerGuidTable;\r
+ UINTN ExtractHandlerNumber;\r
\r
//\r
// Install SEP to a new handle\r
ASSERT_EFI_ERROR (Status);\r
\r
//\r
- // Get custom decompress method guid list \r
+ // Get custom extract guided section method guid list \r
//\r
- DecompressGuidList = NULL;\r
- DecompressMethodNumber = 0;\r
- Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);\r
- if (Status == EFI_OUT_OF_RESOURCES) {\r
- DecompressGuidList = (EFI_GUID **) CoreAllocateBootServicesPool (DecompressMethodNumber * sizeof (EFI_GUID *));\r
- ASSERT (DecompressGuidList != NULL);\r
- Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);\r
- }\r
- ASSERT_EFI_ERROR(Status);\r
+ ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);\r
\r
//\r
- // Install custom decompress guided extraction protocol \r
+ // Install custom guided extraction protocol \r
//\r
- while (DecompressMethodNumber-- > 0) {\r
+ while (ExtractHandlerNumber-- > 0) {\r
Status = CoreInstallProtocolInterface (\r
&mSectionExtractionHandle,\r
- DecompressGuidList [DecompressMethodNumber],\r
+ &ExtractHandlerGuidTable [ExtractHandlerNumber],\r
EFI_NATIVE_INTERFACE,\r
- &mCustomDecompressExtraction\r
+ &mCustomGuidedSectionExtractionProtocol\r
);\r
ASSERT_EFI_ERROR (Status);\r
}\r
- \r
- CoreFreePool (DecompressGuidList);\r
\r
return Status;\r
}\r
\r
**/\r
EFI_STATUS\r
-CustomDecompressExtractSection (\r
+CustomGuidedSectionExtract (\r
IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,\r
IN CONST VOID *InputSection,\r
OUT VOID **OutputBuffer,\r
)\r
{\r
EFI_STATUS Status;\r
- UINT8 *ScratchBuffer;\r
- UINT32 DestinationSize;\r
- UINT32 ScratchSize;\r
- UINT32 SectionLength; \r
+ VOID *ScratchBuffer;\r
+ VOID *AllocatedOutputBuffer;\r
+ UINT32 OutputBufferSize;\r
+ UINT32 ScratchBufferSize;\r
+ UINT16 SectionAttribute;\r
\r
//\r
- // Set authentic value to zero.\r
- //\r
- *AuthenticationStatus = 0;\r
+ // Init local variable\r
//\r
- // Calculate Section data Size\r
- //\r
- SectionLength = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;\r
+ ScratchBuffer = NULL;\r
+ AllocatedOutputBuffer = NULL;\r
+\r
//\r
- // Get compressed data information\r
+ // Call GetInfo to get the size and attribute of input guided section data.\r
//\r
- Status = CustomDecompressGetInfo (\r
- (GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),\r
- (UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),\r
- SectionLength - sizeof (EFI_GUID_DEFINED_SECTION),\r
- &DestinationSize,\r
- &ScratchSize\r
- );\r
+ Status = ExtractGuidedSectionGetInfo (\r
+ InputSection,\r
+ &OutputBufferSize,\r
+ &ScratchBufferSize,\r
+ &SectionAttribute\r
+ );\r
+ \r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "GetInfo from guided section Failed - %r\n", Status));\r
+ return Status;\r
+ }\r
+ \r
+ if (ScratchBufferSize != 0) {\r
//\r
- // GetInfo failed\r
+ // Allocate scratch buffer\r
//\r
- DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));\r
- return Status;\r
+ ScratchBuffer = CoreAllocateBootServicesPool (ScratchBufferSize);\r
+ if (ScratchBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
}\r
\r
- //\r
- // Allocate scratch buffer\r
- //\r
- ScratchBuffer = CoreAllocateBootServicesPool (ScratchSize);\r
- if (ScratchBuffer == NULL) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
- //\r
- // Allocate destination buffer\r
- //\r
- *OutputSize = (UINTN) DestinationSize;\r
- *OutputBuffer = CoreAllocateBootServicesPool (*OutputSize);\r
- if (*OutputBuffer == NULL) {\r
- CoreFreePool (ScratchBuffer);\r
- return EFI_OUT_OF_RESOURCES;\r
+ if (OutputBufferSize > 0) { \r
+ //\r
+ // Allocate output buffer\r
+ //\r
+ AllocatedOutputBuffer = CoreAllocateBootServicesPool (OutputBufferSize);\r
+ if (AllocatedOutputBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ *OutputBuffer = AllocatedOutputBuffer;\r
}\r
\r
//\r
- // Call decompress function\r
+ // Call decode function to extract raw data from the guided section.\r
//\r
- Status = CustomDecompress (\r
- (GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),\r
- (UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),\r
- *OutputBuffer,\r
- ScratchBuffer\r
- );\r
+ Status = ExtractGuidedSectionDecode (\r
+ InputSection, \r
+ OutputBuffer,\r
+ ScratchBuffer,\r
+ AuthenticationStatus\r
+ );\r
if (EFI_ERROR (Status)) {\r
//\r
- // Decompress failed\r
+ // Decode failed\r
//\r
- CoreFreePool (ScratchBuffer);\r
- CoreFreePool (*OutputBuffer);\r
+ if (AllocatedOutputBuffer != NULL) {\r
+ CoreFreePool (AllocatedOutputBuffer);\r
+ }\r
+ if (ScratchBuffer != NULL) {\r
+ CoreFreePool (ScratchBuffer);\r
+ }\r
DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));\r
return Status;\r
}\r
- \r
+\r
+ if (*OutputBuffer != AllocatedOutputBuffer) {\r
+ //\r
+ // OutputBuffer was returned as a different value, \r
+ // so copy section contents to the allocated memory buffer.\r
+ // \r
+ CopyMem (AllocatedOutputBuffer, *OutputBuffer, OutputBufferSize);\r
+ *OutputBuffer = AllocatedOutputBuffer;\r
+ }\r
+\r
+ //\r
+ // Set real size of output buffer.\r
+ //\r
+ *OutputSize = (UINTN) OutputBufferSize;\r
+\r
//\r
// Free unused scratch buffer.\r
//\r
- CoreFreePool (ScratchBuffer);\r
- \r
+ if (ScratchBuffer != NULL) {\r
+ CoreFreePool (ScratchBuffer);\r
+ }\r
+\r
return EFI_SUCCESS;\r
}\r
#include <Library/ReportStatusCodeLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/UefiDecompressLib.h>\r
-#include <Library/CustomDecompressLib.h>\r
+#include <Library/ExtractGuidedSectionLib.h>\r
#include <Library/PeiServicesTablePointerLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
MemoryAllocationLib\r
BaseMemoryLib\r
PeiServicesTablePointerLib\r
- CustomDecompressLib\r
+ ExtractGuidedSectionLib\r
UefiDecompressLib\r
CacheMaintenanceLib\r
ReportStatusCodeLib\r
#include <FrameworkPei.h>\r
\r
EFI_STATUS\r
-CustomDecompressExtractSection (\r
+CustomGuidedSectionExtract (\r
IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,\r
IN CONST VOID *InputSection,\r
OUT VOID **OutputBuffer,\r
DxeLoadCore\r
};\r
\r
-STATIC EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI mCustomDecompressExtractiongPpi = {\r
- CustomDecompressExtractSection\r
+STATIC EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI mCustomGuidedSectionExtractionPpi = {\r
+ CustomGuidedSectionExtract\r
};\r
\r
STATIC EFI_PEI_DECOMPRESS_PPI mDecompressPpi = {\r
{\r
EFI_STATUS Status;\r
EFI_BOOT_MODE BootMode;\r
- EFI_GUID **DecompressGuidList;\r
- UINT32 DecompressMethodNumber;\r
+ EFI_GUID *ExtractHandlerGuidTable;\r
+ UINTN ExtractHandlerNumber;\r
EFI_PEI_PPI_DESCRIPTOR *GuidPpi;\r
\r
Status = PeiServicesGetBootMode (&BootMode);\r
gInMemory = TRUE;\r
\r
//\r
- // Get custom decompress method guid list \r
+ // Get custom extract guided section method guid list \r
//\r
- DecompressGuidList = NULL;\r
- DecompressMethodNumber = 0;\r
- Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);\r
- if (Status == EFI_OUT_OF_RESOURCES) {\r
- DecompressGuidList = (EFI_GUID **) AllocatePages (EFI_SIZE_TO_PAGES (DecompressMethodNumber * sizeof (EFI_GUID *)));\r
- ASSERT (DecompressGuidList != NULL);\r
- Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);\r
- }\r
- ASSERT_EFI_ERROR(Status);\r
+ ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);\r
\r
//\r
- // Install custom decompress extraction guid ppi\r
+ // Install custom extraction guid ppi\r
//\r
- if (DecompressMethodNumber > 0) {\r
+ if (ExtractHandlerNumber > 0) {\r
GuidPpi = NULL;\r
- GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *) AllocatePages (EFI_SIZE_TO_PAGES (DecompressMethodNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR)));\r
+ GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *) AllocatePool (ExtractHandlerNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR));\r
ASSERT (GuidPpi != NULL);\r
- while (DecompressMethodNumber-- > 0) {\r
+ while (ExtractHandlerNumber-- > 0) {\r
GuidPpi->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;\r
- GuidPpi->Ppi = &mCustomDecompressExtractiongPpi;\r
- GuidPpi->Guid = DecompressGuidList [DecompressMethodNumber];\r
+ GuidPpi->Ppi = &mCustomGuidedSectionExtractionPpi;\r
+ GuidPpi->Guid = &(ExtractHandlerGuidTable [ExtractHandlerNumber]);\r
Status = PeiServicesInstallPpi (GuidPpi++);\r
ASSERT_EFI_ERROR(Status);\r
}\r
GUIDed Section Extraction PPI.\r
**/\r
EFI_STATUS\r
-CustomDecompressExtractSection (\r
+CustomGuidedSectionExtract (\r
IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,\r
IN CONST VOID *InputSection,\r
OUT VOID **OutputBuffer,\r
{\r
EFI_STATUS Status;\r
UINT8 *ScratchBuffer;\r
- UINT32 ScratchSize;\r
- UINT32 SectionLength;\r
- UINT32 DestinationSize; \r
+ UINT32 ScratchBufferSize;\r
+ UINT32 OutputBufferSize;\r
+ UINT16 SectionAttribute;\r
\r
//\r
- // Set authentic value to zero.\r
- //\r
- *AuthenticationStatus = 0;\r
+ // Init local variable\r
//\r
- // Calculate Section data Size\r
- //\r
- SectionLength = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;\r
+ ScratchBuffer = NULL;\r
+\r
//\r
- // Get compressed data information\r
+ // Call GetInfo to get the size and attribute of input guided section data.\r
//\r
- Status = CustomDecompressGetInfo (\r
- (GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),\r
- (UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),\r
- SectionLength - sizeof (EFI_GUID_DEFINED_SECTION),\r
- &DestinationSize,\r
- &ScratchSize\r
- );\r
+ Status = ExtractGuidedSectionGetInfo (\r
+ InputSection,\r
+ &OutputBufferSize,\r
+ &ScratchBufferSize,\r
+ &SectionAttribute\r
+ );\r
+ \r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "GetInfo from guided section Failed - %r\n", Status));\r
+ return Status;\r
+ }\r
+ \r
+ if (ScratchBufferSize != 0) {\r
//\r
- // GetInfo failed\r
+ // Allocate scratch buffer\r
//\r
- DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));\r
- return Status;\r
+ ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));\r
+ if (ScratchBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
}\r
\r
- //\r
- // Allocate scratch buffer\r
- //\r
- ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchSize));\r
- if (ScratchBuffer == NULL) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
- //\r
- // Allocate destination buffer\r
- //\r
- *OutputSize = (UINTN) DestinationSize;\r
- *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (*OutputSize));\r
- if (*OutputBuffer == NULL) {\r
- return EFI_OUT_OF_RESOURCES;\r
+ if ((SectionAttribute & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) && OutputBufferSize > 0) { \r
+ //\r
+ // Allocate output buffer\r
+ //\r
+ *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize));\r
+ if (*OutputBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
}\r
-\r
- //\r
- // Call decompress function\r
- //\r
- Status = CustomDecompress (\r
- (GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),\r
- (UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),\r
- *OutputBuffer,\r
- ScratchBuffer\r
- );\r
+ \r
+ Status = ExtractGuidedSectionDecode (\r
+ InputSection, \r
+ OutputBuffer,\r
+ ScratchBuffer,\r
+ AuthenticationStatus\r
+ );\r
\r
if (EFI_ERROR (Status)) {\r
//\r
- // Decompress failed\r
+ // Decode failed\r
//\r
DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));\r
return Status;\r
}\r
\r
+ *OutputSize = (UINTN) OutputBufferSize;\r
+ \r
return EFI_SUCCESS;\r
}\r
\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
- CustomDecompressLib|MdePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf\r
S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
+ ExtractGuidedSectionLib|MdePkg/Library/PeiDxeExtractGuidedSectionLib/PeiDxeExtractGuidedSectionLib.inf\r
\r
[LibraryClasses.IA32]\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1\r
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|0\r
-\r
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10\r
\r
[PcdsFixedAtBuild.IPF]\r
gEfiMdePkgTokenSpaceGuid.PcdIoBlockBaseAddressForIpf|0x0ffffc000000\r
--- /dev/null
+/** @file\r
+ Extract Guided Section Library class\r
+\r
+ Copyright (c) 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
+ 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
+ ExtractGuidedSectionLib.h\r
+**/\r
+#ifndef __EXTRACT_GUIDED_SECTION_H__\r
+#define __EXTRACT_GUIDED_SECTION_H__\r
+\r
+/**
+ Get information Handler for the input guided section data.\r
+ It will ASSERT () if the pointer to OutputBufferSize is NULL.\r
+ It will ASSERT () if the pointer to ScratchBufferSize is NULL.
+ It will ASSERT () if the pointer to SectionAttribute is NULL.\r
+\r
+ @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r
+ @param[out] OutputBufferSize The size of OutputBuffer.\r
+ @param[out] ScratchBufferSize The size of ScratchBuffer.\r
+ @param[out] SectionAttribute The attribute of the input guided section.\r
+
+ @retval RETURN_SUCCESS Get the required information successfully.\r
+ @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly.\r
+\r
+**/\r
+typedef\r
+RETURN_STATUS\r
+(EFIAPI *EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)(\r
+ IN CONST VOID *InputSection,\r
+ OUT UINT32 *OutputBufferSize,\r
+ OUT UINT32 *ScratchBufferSize,\r
+ OUT UINT16 *SectionAttribute\r
+ );\r
+\r
+/**
+ Extract data Handler for one specific guided section.
+ It will ASSERT () if the pointer to OutputBuffer is NULL.\r
+ It will ASSERT () if the pointer to AuthenticationStatus is NULL.\r
+\r
+ @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r
+ @param[out] OutputBuffer OutputBuffer to point to the start of the section's contents.\r
+ if guided data is not prcessed. Otherwise,\r
+ OutputBuffer to contain the output data, which is allocated by the caller.\r
+ @param[out] ScratchBuffer A pointer to a caller-allocated buffer for function internal use. \r
+ @param[out] AuthenticationStatus \r
+ A pointer to a caller-allocated UINT32 that indicates the\r
+ authentication status of the output buffer.
+
+ @retval RETURN_SUCCESS Get the output data and AuthenticationStatus successfully.\r
+ @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly.\r
+\r
+**/\r
+typedef\r
+RETURN_STATUS\r
+(EFIAPI *EXTRACT_GUIDED_SECTION_DECODE_HANDLER)(\r
+ IN CONST VOID *InputSection,\r
+ OUT VOID **OutputBuffer,\r
+ IN VOID *ScratchBuffer, OPTIONAL\r
+ OUT UINT32 *AuthenticationStatus\r
+ );\r
+\r
+/**
+ Register Guided Section Extract and GetInfo Handler.\r
+\r
+ @param[in] SectionGuid The guid matches this Extraction Handler.
+ @param[in] GetInfoHandler Handler to get info from guided section.\r
+ @param[in] DecodeHandler Handler to extract guided section.
+
+ @retval RETURN_SUCCESS Register Guided Section Extract Handler successfully.
+ @retval RETURN_OUT_OF_RESOURCES Resource is not enough to register new Handler. \r
+ @retval RETURN_INVALID_PARAMETER Input pointer to Guid value is not valid.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ExtractGuidedSectionRegisterHandlers (\r
+ IN CONST GUID *SectionGuid,\r
+ IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER GetInfoHandler,\r
+ IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler\r
+ );\r
+\r
+/**
+ Get the supported exract guided section Handler guid list.\r
+ It will ASSERT () if ExtractHandlerGuidTable = NULL.\r
+\r
+ @param[in, out] ExtractHandlerGuidTable The extract Handler guid pointer list.
+\r
+ @retval return the number of the supported extract guided Handler.
+**/\r
+UINTN\r
+EFIAPI\r
+ExtractGuidedSectionGetGuidList (\r
+ IN OUT GUID **ExtractHandlerGuidTable\r
+ );\r
+\r
+/**
+ Get information from the guided section. This function first gets the guid value\r
+ from guided section header, then match this guid in the registered extract Handler list\r
+ to its corresponding getinfo Handler. \r
+ If not found, RETURN_UNSUPPORTED will be return. \r
+ If found, it will call the getinfo Handler to get the required size and attribute.\r
+\r
+ It will ASSERT () if the pointer to OutputBufferSize is NULL.\r
+ It will ASSERT () if the pointer to ScratchBufferSize is NULL.
+ It will ASSERT () if the pointer to SectionAttribute is NULL.\r
+\r
+ @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r
+ @param[out] OutputBufferSize The size of OutputBuffer.\r
+ @param[out] ScratchBufferSize The size of ScratchBuffer. \r
+ @param[out] SectionAttribute The attribute of the input guided section.\r
+
+ @retval RETURN_SUCCESS Get the required information successfully.\r
+ @retval RETURN_UNSUPPORTED Guided section data is not supported.\r
+ @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ExtractGuidedSectionGetInfo (\r
+ IN CONST VOID *InputSection,\r
+ OUT UINT32 *OutputBufferSize,\r
+ OUT UINT32 *ScratchBufferSize,\r
+ OUT UINT16 *SectionAttribute \r
+ );\r
+\r
+/**
+ Extract data from the guided section. This function first gets the guid value\r
+ from guided section header, then match this guid in the registered extract Handler list\r
+ to its corresponding extract Handler. \r
+ If not found, RETURN_UNSUPPORTED will be return. \r
+ If found, it will call this extract Handler to get output data and AuthenticationStatus.
+\r
+ It will ASSERT () if the pointer to OutputBuffer is NULL.\r
+ It will ASSERT () if the pointer to AuthenticationStatus is NULL.\r
+\r
+ @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r
+ @param[out] OutputBuffer OutputBuffer to point the start of the section's contents \r
+ if guided data is not required prcessing. Otherwise,\r
+ OutputBuffer to contain the output data, which is \r
+ allocated by the caller.\r
+ @param[out] ScratchBuffer A pointer to a caller-allocated buffer for function internal use. \r
+ @param[out] AuthenticationStatus \r
+ A pointer to a caller-allocated UINT32 that indicates the\r
+ authentication status of the output buffer.
+
+ @retval RETURN_SUCCESS Get the output data, size and AuthenticationStatus successfully.\r
+ @retval RETURN_UNSUPPORTED Guided section data is not supported to be decoded.\r
+ @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly.
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ExtractGuidedSectionDecode (\r
+ IN CONST VOID *InputSection,\r
+ OUT VOID **OutputBuffer,\r
+ OUT VOID *ScratchBuffer, OPTIONAL\r
+ OUT UINT32 *AuthenticationStatus \r
+ );\r
+\r
+#endif\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 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
+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
+Module Name:\r
+\r
+ PeiDxeExtractGuidedSectionLib.c\r
+\r
+Abstract:\r
+\r
+ Provide generic extract guided section functions. \r
+\r
+--*/\r
+\r
+#include <PiPei.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/ExtractGuidedSectionLib.h>\r
+\r
+STATIC GUID *mExtractHandlerGuidTable;\r
+STATIC UINT32 mNumberOfExtractHandler;\r
+\r
+STATIC EXTRACT_GUIDED_SECTION_DECODE_HANDLER *mExtractDecodeHandlerTable;\r
+STATIC EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *mExtractGetInfoHandlerTable;\r
+\r
+/**
+ Construtor allocates the global memory to store the registered guid and Handler list.\r
+
+ @retval RETURN_SUCCESS Allocate the global memory space to store guid and funciton tables.\r
+ @retval RETURN_OUT_OF_RESOURCES No enough memory to allocated.
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+PeiDxeExtractGuidedSectionLibConstructor (\r
+ )\r
+{\r
+ //\r
+ // Allocate global pool space to store the registered handler and its guid value.\r
+ //\r
+ mExtractHandlerGuidTable = (GUID *) AllocatePool (PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID));\r
+ if (mExtractHandlerGuidTable == NULL) {\r
+ return RETURN_OUT_OF_RESOURCES;\r
+ }\r
+ \r
+ mExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) AllocatePool (PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER));\r
+ if (mExtractDecodeHandlerTable == NULL) {\r
+ return RETURN_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ mExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) AllocatePool (PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER));\r
+ if (mExtractGetInfoHandlerTable == NULL) {\r
+ return RETURN_OUT_OF_RESOURCES;\r
+ }\r
+ \r
+ //\r
+ // the initialized number is Zero.\r
+ //\r
+ mNumberOfExtractHandler = 0;\r
+ \r
+ return RETURN_SUCCESS;\r
+}\r
+\r
+/**
+ Get the supported exract guided section Handler guid list.\r
+ If ExtractHandlerGuidTable = NULL, then ASSERT.\r
+\r
+ @param[in, out] ExtractHandlerGuidTable The extract Handler guid pointer list.
+\r
+ @retval return the number of the supported extract guided Handler.
+**/\r
+UINTN\r
+EFIAPI\r
+ExtractGuidedSectionGetGuidList (\r
+ IN OUT GUID **ExtractHandlerGuidTable\r
+ )\r
+{\r
+ ASSERT (ExtractHandlerGuidTable != NULL);\r
+\r
+ *ExtractHandlerGuidTable = mExtractHandlerGuidTable;\r
+ return mNumberOfExtractHandler;\r
+}\r
+\r
+/**
+ Register Guided Section Extract and GetInfo handler.\r
+\r
+ @param[in] SectionGuid The guid matches this Extraction function.
+ @param[in] GetInfoHandler Function to get info from guided section.\r
+ @param[in] DecodeHandler Function to extract guided section.
+
+ @retval RETURN_SUCCESS Register Guided Section Extract function successfully.
+ @retval RETURN_OUT_OF_RESOURCES Resource is not enough to register new function. \r
+ @retval RETURN_INVALID_PARAMETER Input pointer to Guid value is not valid.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ExtractGuidedSectionRegisterHandlers (\r
+ IN CONST GUID *SectionGuid,\r
+ IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER GetInfoHandler,\r
+ IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler\r
+ )\r
+{\r
+ //\r
+ // Check input paramter.\r
+ //\r
+ if (SectionGuid == NULL) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+ //\r
+ // Check the global table is enough to contain new Handler.\r
+ //\r
+ if (mNumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {\r
+ return RETURN_OUT_OF_RESOURCES;\r
+ }\r
+ \r
+ //\r
+ // Register new Handler and guid value.\r
+ //\r
+ CopyGuid (&mExtractHandlerGuidTable [mNumberOfExtractHandler], SectionGuid);\r
+ mExtractDecodeHandlerTable [mNumberOfExtractHandler] = DecodeHandler;\r
+ mExtractGetInfoHandlerTable [mNumberOfExtractHandler++] = GetInfoHandler;\r
+ \r
+ return RETURN_SUCCESS;\r
+}\r
+\r
+/**
+ Get information from the guided section. This function first gets the guid value\r
+ from guided section header, then match this guid in the registered extract Handler list\r
+ to its corresponding getinfo Handler. \r
+ If not found, RETURN_UNSUPPORTED will be return. \r
+ If found, it will call the getinfo Handler to get the required size and attribute.\r
+\r
+ It will ASSERT () if the pointer to OutputBufferSize is NULL.\r
+ It will ASSERT () if the pointer to ScratchBufferSize is NULL.
+ It will ASSERT () if the pointer to SectionAttribute is NULL.\r
+\r
+ @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r
+ @param[out] OutputBufferSize The size of OutputBuffer.\r
+ @param[out] ScratchBufferSize The size of ScratchBuffer. \r
+ @param[out] SectionAttribute The attribute of the input guided section.\r
+
+ @retval RETURN_SUCCESS Get the required information successfully.\r
+ @retval RETURN_UNSUPPORTED Guided section data is not supported.\r
+ @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ExtractGuidedSectionGetInfo (\r
+ IN CONST VOID *InputSection,\r
+ OUT UINT32 *OutputBufferSize,\r
+ OUT UINT32 *ScratchBufferSize,\r
+ OUT UINT16 *SectionAttribute \r
+ )\r
+{\r
+ UINT32 Index;\r
+ \r
+ if (InputSection == NULL) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+ \r
+ ASSERT (OutputBufferSize != NULL);\r
+ ASSERT (ScratchBufferSize != NULL);\r
+ ASSERT (SectionAttribute != NULL);\r
+ \r
+ //\r
+ // Search the match registered GetInfo handler for the input guided section.\r
+ //\r
+ for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {\r
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Not found, the input guided section is not supported. \r
+ //\r
+ if (Index == mNumberOfExtractHandler) {\r
+ return RETURN_UNSUPPORTED;\r
+ }\r
+\r
+ //\r
+ // Call the match handler to getinfo for the input section data.\r
+ //\r
+ return mExtractGetInfoHandlerTable [Index] (\r
+ InputSection,\r
+ OutputBufferSize,\r
+ ScratchBufferSize,\r
+ SectionAttribute\r
+ );\r
+}\r
+\r
+/**
+ Extract data from the guided section. This function first gets the guid value\r
+ from guided section header, then match this guid in the registered extract Handler list\r
+ to its corresponding extract Handler. \r
+ If not found, RETURN_UNSUPPORTED will be return. \r
+ If found, it will call this extract Handler to get output data and AuthenticationStatus.
+\r
+ It will ASSERT () if the pointer to OutputBuffer is NULL.\r
+ It will ASSERT () if the pointer to AuthenticationStatus is NULL.\r
+\r
+ @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r
+ @param[out] OutputBuffer OutputBuffer to point the start of the section's contents \r
+ if guided data is not required prcessing. Otherwise,\r
+ OutputBuffer to contain the output data, which is \r
+ allocated by the caller.\r
+ @param[out] ScratchBuffer A pointer to a caller-allocated buffer for function internal use. \r
+ @param[out] AuthenticationStatus \r
+ A pointer to a caller-allocated UINT32 that indicates the\r
+ authentication status of the output buffer.
+
+ @retval RETURN_SUCCESS Get the output data, size and AuthenticationStatus successfully.\r
+ @retval RETURN_UNSUPPORTED Guided section data is not supported to be decoded.\r
+ @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly.\r
+
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ExtractGuidedSectionDecode (\r
+ IN CONST VOID *InputSection,\r
+ OUT VOID **OutputBuffer,\r
+ OUT VOID *ScratchBuffer, OPTIONAL\r
+ OUT UINT32 *AuthenticationStatus \r
+ )\r
+{\r
+ UINT32 Index;\r
+ \r
+ if (InputSection == NULL) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+ \r
+ ASSERT (OutputBuffer != NULL);\r
+ ASSERT (AuthenticationStatus != NULL);\r
+\r
+ //\r
+ // Search the match registered GetInfo handler for the input guided section.\r
+ //\r
+ for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {\r
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Not found, the input guided section is not supported. \r
+ //\r
+ if (Index == mNumberOfExtractHandler) {\r
+ return RETURN_UNSUPPORTED;\r
+ }\r
+\r
+ //\r
+ // Call the match handler to getinfo for the input section data.\r
+ //\r
+ return mExtractDecodeHandlerTable [Index] (\r
+ InputSection,\r
+ OutputBuffer,\r
+ ScratchBuffer,\r
+ AuthenticationStatus\r
+ );\r
+}\r
--- /dev/null
+#/** @file\r
+# Component description file for DxeCore Performance Library\r
+#\r
+# This library provides intrastructure for DxeCore to log performance.\r
+# Copyright (c) 2007, Intel Corporation.\r
+#\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
+# 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
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiDxeExtractGuidedSectionLib\r
+ FILE_GUID = EF97E3EB-9321-4dfc-8353-CF473FD98F03\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = ExtractGuidedSectionLib\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+ CONSTRUCTOR = PeiDxeExtractGuidedSectionLibConstructor\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+ PeiDxeExtractGuidedSectionLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+\r
+[LibraryClasses]\r
+ MemoryAllocationLib\r
+ BaseMemoryLib\r
+ DebugLib\r
+\r
+[FixedPcd.common]\r
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler \r
+\r
+\r
Include/Ebc\r
\r
[LibraryClasses.common]\r
- CustomDecompressLib|Include/Library/CustomDecompressLib.h\r
UsbLib|Include/Library/UsbLib.h\r
UefiRuntimeServicesTableLib|Include/Library/UefiRuntimeServicesTableLib.h\r
UefiRuntimeLib|Include/Library/UefiRuntimeLib.h\r
BaseLib|Include/Library/BaseLib.h\r
BasePeCoffLib|Include/Library/PeCoffLib.h\r
GraphicsLib|Include/Library/GraphicsLib.h\r
+ ExtractGuidedSectionLib|Include/Library/ExtractGuidedSectionLib.h\r
\r
[LibraryClasses.IPF]\r
SalLib|Include/Library/SalLib.h\r
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueRemoteConsoleReset|0x01040001|UINT32|0x00000018 # EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_PC_RESET\r
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueRemoteConsoleInputError|0x01040007|UINT32|0x00000019 # EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_INPUT_ERROR\r
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueRemoteConsoleOutputError|0x01040008|UINT32|0x0000001a # EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_OUTPUT_ERROR\r
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10|UINT32|0x0000001b\r
\r
[PcdsFixedAtBuild.IPF]\r
gEfiMdePkgTokenSpaceGuid.PcdIoBlockBaseAddressForIpf|0x0ffffc000000|UINT64|0x0000000f\r
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000\r
gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000\r
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320\r
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10\r
\r
[PcdsFixedAtBuild.IPF]\r
gEfiMdePkgTokenSpaceGuid.PcdIoBlockBaseAddressForIpf|0x0ffffc000000\r
MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
MdePkg/Library/DxeMemoryLib/DxeMemoryLib.inf\r
- MdePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf\r
MdePkg/Library/DxeDebugLibSerialPort/DxeDebugLibSerialPort.inf\r
MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
+ MdePkg/Library/PeiDxeExtractGuidedSectionLib/PeiDxeExtractGuidedSectionLib.inf\r
\r
[Components.IA32]\r
MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf\r
GraphicsLib|IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf\r
FvbServiceLib|MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
- CustomDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
-\r
+ ExtractGuidedSectionLib|MdePkg/Library/PeiDxeExtractGuidedSectionLib/PeiDxeExtractGuidedSectionLib.inf\r
\r
[LibraryClasses.common.BASE]\r
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x10000\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x2000\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00c000\r
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10\r
\r
[PcdsFeatureFlag.IA32]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiPcdDatabaseTraverseEnabled|TRUE\r
Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf\r
Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf\r
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-\r
##\r
# DXE Phase modules\r
##\r