public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch v2] EmbeddedPkg: Correct the way of handling sections with a large size
@ 2018-03-08  0:55 Ge Song
  2018-03-13 15:28 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Ge Song @ 2018-03-08  0:55 UTC (permalink / raw)
  To: edk2-devel; +Cc: Leif Lindholm, Ard Biesheuvel

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>
---
 EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c b/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c
index 7b08de8ab9fe..e94f5424ef1d 100644
--- a/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c
+++ b/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c
@@ -123,6 +123,7 @@ ExtractGuidedSectionGetInfo (
 {
   PRE_PI_EXTRACT_GUIDED_SECTION_DATA  *SavedData;
   UINT32                              Index;
+  EFI_GUID                            *SectionDefinitionGuid;
 
   if (InputSection == NULL) {
     return RETURN_INVALID_PARAMETER;
@@ -134,11 +135,17 @@ ExtractGuidedSectionGetInfo (
 
   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.
   //
   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;
     }
   }
@@ -172,6 +179,7 @@ ExtractGuidedSectionDecode (
 {
   PRE_PI_EXTRACT_GUIDED_SECTION_DATA  *SavedData;
   UINT32                              Index;
+  EFI_GUID                            *SectionDefinitionGuid;
 
   if (InputSection == NULL) {
     return RETURN_INVALID_PARAMETER;
@@ -182,11 +190,17 @@ ExtractGuidedSectionDecode (
 
   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.
   //
   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;
     }
   }
-- 
2.11.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch v2] EmbeddedPkg: Correct the way of handling sections with a large size
  2018-03-08  0:55 [Patch v2] EmbeddedPkg: Correct the way of handling sections with a large size Ge Song
@ 2018-03-13 15:28 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2018-03-13 15:28 UTC (permalink / raw)
  To: Ge Song; +Cc: edk2-devel@lists.01.org, Leif Lindholm

On 8 March 2018 at 00:55, Ge Song <ge.song@hxt-semitech.com> wrote:
> 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>

Pushed as 9384e1c011a7d5ad1eb9c6d09c0014f42fab574d

Thanks,
Ard.

> ---
>  EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c b/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c
> index 7b08de8ab9fe..e94f5424ef1d 100644
> --- a/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c
> +++ b/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c
> @@ -123,6 +123,7 @@ ExtractGuidedSectionGetInfo (
>  {
>    PRE_PI_EXTRACT_GUIDED_SECTION_DATA  *SavedData;
>    UINT32                              Index;
> +  EFI_GUID                            *SectionDefinitionGuid;
>
>    if (InputSection == NULL) {
>      return RETURN_INVALID_PARAMETER;
> @@ -134,11 +135,17 @@ ExtractGuidedSectionGetInfo (
>
>    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.
>    //
>    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;
>      }
>    }
> @@ -172,6 +179,7 @@ ExtractGuidedSectionDecode (
>  {
>    PRE_PI_EXTRACT_GUIDED_SECTION_DATA  *SavedData;
>    UINT32                              Index;
> +  EFI_GUID                            *SectionDefinitionGuid;
>
>    if (InputSection == NULL) {
>      return RETURN_INVALID_PARAMETER;
> @@ -182,11 +190,17 @@ ExtractGuidedSectionDecode (
>
>    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.
>    //
>    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;
>      }
>    }
> --
> 2.11.0
>
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-13 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-08  0:55 [Patch v2] EmbeddedPkg: Correct the way of handling sections with a large size Ge Song
2018-03-13 15:28 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox