summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiExtractGuidedSectionLib
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-18 06:15:55 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-18 06:15:55 +0000
commite111752c1894be73780c6c279cbc31acf69fa6c8 (patch)
tree13b8b7aafdba227cf679044bb7bd3c673e79603f /MdePkg/Library/PeiExtractGuidedSectionLib
parenta182eb4624778902c5042300e529d47a6741c281 (diff)
downloadedk2-platforms-e111752c1894be73780c6c279cbc31acf69fa6c8.tar.xz
Fix one bug in PeiExtractGuidedSectionLib to convert the address after hob start address is changed.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4398 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiExtractGuidedSectionLib')
-rw-r--r--MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
index ce42a5dcd2..a360d59d85 100644
--- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
+++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
@@ -63,6 +63,24 @@ PeiGetExtractGuidedSectionHandlerInfo (
if (CompareGuid (&(Hob.Guid->Name), &gEfiCallerIdGuid)) {
HandlerInfo = (PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *) GET_GUID_HOB_DATA (Hob.Guid);
if (HandlerInfo->Signature == PEI_EXTRACT_HANDLER_INFO_SIGNATURE) {
+ //
+ // Update Table Pointer when hob start address is changed.
+ //
+ if (HandlerInfo->ExtractHandlerGuidTable != (GUID *) (HandlerInfo + 1)) {
+ HandlerInfo->ExtractHandlerGuidTable = (GUID *) (HandlerInfo + 1);
+ HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) (
+ (UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
+ PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID)
+ );
+ HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (
+ (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
+ PcdGet32 (PcdMaximumGuidedExtractHandler) *
+ sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)
+ );
+ }
+ //
+ // Return HandlerInfo pointer.
+ //
*InfoPointer = HandlerInfo;
return EFI_SUCCESS;
}
@@ -173,7 +191,7 @@ ExtractGuidedSectionRegisterHandlers (
// Search the match registered GetInfo handler for the input guided section.
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (&(HandlerInfo->ExtractHandlerGuidTable[Index]), SectionGuid)) {
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
break;
}
}
@@ -197,7 +215,7 @@ ExtractGuidedSectionRegisterHandlers (
//
// Register new Handler and guid value.
//
- CopyGuid (&(HandlerInfo->ExtractHandlerGuidTable [HandlerInfo->NumberOfExtractHandler]), SectionGuid);
+ CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);
HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;
HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;
@@ -261,7 +279,7 @@ ExtractGuidedSectionGetInfo (
// Search the match registered GetInfo handler for the input guided section.
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (&(HandlerInfo->ExtractHandlerGuidTable[Index]), &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
break;
}
}
@@ -338,7 +356,7 @@ ExtractGuidedSectionDecode (
// Search the match registered GetInfo handler for the input guided section.
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (&(HandlerInfo->ExtractHandlerGuidTable[Index]), &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
break;
}
}