/** @file\r
Provide generic extract guided section functions for Dxe phase.\r
\r
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2012, 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
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/ExtractGuidedSectionLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
\r
#define EXTRACT_HANDLER_TABLE_SIZE 0x10\r
\r
)\r
{\r
UINT32 Index;\r
+ VOID *GuidData;\r
+\r
//\r
- // Check input paramter.\r
+ // Check input parameter.\r
//\r
ASSERT (SectionGuid != NULL);\r
ASSERT (GetInfoHandler != NULL);\r
CopyGuid (&mExtractHandlerGuidTable [mNumberOfExtractHandler], SectionGuid);\r
mExtractDecodeHandlerTable [mNumberOfExtractHandler] = DecodeHandler;\r
mExtractGetInfoHandlerTable [mNumberOfExtractHandler++] = GetInfoHandler;\r
- \r
+\r
+ //\r
+ // Install the Guided Section GUID configuration table to record the GUID itself.\r
+ // Then the content of the configuration table buffer will be the same as the GUID value itself.\r
+ //\r
+ GuidData = AllocateCopyPool (sizeof (GUID), (VOID *) SectionGuid);\r
+ if (GuidData != NULL) {\r
+ gBS->InstallConfigurationTable ((EFI_GUID *) SectionGuid, GuidData);\r
+ }\r
+\r
return RETURN_SUCCESS;\r
}\r
\r
)\r
{\r
UINT32 Index;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
ASSERT (InputSection != NULL); \r
ASSERT (OutputBufferSize != NULL);\r
ASSERT (ScratchBufferSize != NULL);\r
ASSERT (SectionAttribute != NULL);\r
+\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\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
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {\r
//\r
// Call the match handler to getinfo for the input section data.\r
//\r
)\r
{\r
UINT32 Index;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
//\r
// Check the input parameters\r
ASSERT (OutputBuffer != NULL);\r
ASSERT (AuthenticationStatus != NULL);\r
\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
+\r
//\r
// Search the match registered extract 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
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {\r
//\r
// Call the match handler to extract raw data for the input section data.\r
//\r