mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
EmbeddedPkg: Correct the way of handling sections with a large size
Correct the way of handling EFI_SECTION_GUID_DEFINED type sections with a large size Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ge Song <ge.song@hxt-semitech.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
parent
ea30f8e813
commit
9384e1c011
@ -123,6 +123,7 @@ ExtractGuidedSectionGetInfo (
|
|||||||
{
|
{
|
||||||
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;
|
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;
|
||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
|
EFI_GUID *SectionDefinitionGuid;
|
||||||
|
|
||||||
if (InputSection == NULL) {
|
if (InputSection == NULL) {
|
||||||
return RETURN_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
@ -134,11 +135,17 @@ ExtractGuidedSectionGetInfo (
|
|||||||
|
|
||||||
SavedData = GetSavedData();
|
SavedData = GetSavedData();
|
||||||
|
|
||||||
|
if (IS_SECTION2 (InputSection)) {
|
||||||
|
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
|
||||||
|
} else {
|
||||||
|
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search the match registered GetInfo handler for the input guided section.
|
// Search the match registered GetInfo handler for the input guided section.
|
||||||
//
|
//
|
||||||
for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index ++) {
|
for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index ++) {
|
||||||
if (CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
|
if (CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,6 +179,7 @@ ExtractGuidedSectionDecode (
|
|||||||
{
|
{
|
||||||
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;
|
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;
|
||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
|
EFI_GUID *SectionDefinitionGuid;
|
||||||
|
|
||||||
if (InputSection == NULL) {
|
if (InputSection == NULL) {
|
||||||
return RETURN_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
@ -182,11 +190,17 @@ ExtractGuidedSectionDecode (
|
|||||||
|
|
||||||
SavedData = GetSavedData();
|
SavedData = GetSavedData();
|
||||||
|
|
||||||
|
if (IS_SECTION2 (InputSection)) {
|
||||||
|
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
|
||||||
|
} else {
|
||||||
|
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search the match registered GetInfo handler for the input guided section.
|
// Search the match registered GetInfo handler for the input guided section.
|
||||||
//
|
//
|
||||||
for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index ++) {
|
for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index ++) {
|
||||||
if (CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
|
if (CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user