From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4003:c06::242; helo=mail-oi0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-oi0-x242.google.com (mail-oi0-x242.google.com [IPv6:2607:f8b0:4003:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 15557224CCC06 for ; Tue, 13 Mar 2018 08:21:41 -0700 (PDT) Received: by mail-oi0-x242.google.com with SMTP id h23so15647610oib.5 for ; Tue, 13 Mar 2018 08:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1p6R40DlqidnxUFFEO76fEu5XU0PIM4Ecpy+5OoWeRc=; b=cnycqksKsivTtKMCchy9iBZnt42vL/RlTfrtoIccdHOyLAtTb3dlPT3GOSDVC64/iQ LPDFvEXnNwkfm0VqBYy89xemAuEpl8U67osx9DtUL6Ff70PD5ZsD2CdNRXela3okgjHF Lk7ji+FV/McWOGWnJmoigj1jJMfmT7HAgz3Hc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1p6R40DlqidnxUFFEO76fEu5XU0PIM4Ecpy+5OoWeRc=; b=cPHaFd+uWOvbLHVp9HyuMgV6wGcpOioxVe2bpSbaRPKhFFh1qndrO/PSowjlJGHYq6 HbE74WJvtGp+kAAWbq4Qoxf3UAMlHEg2WpeX5S2YdwOGTlOU1iZetizudBzaRYfCRshO exuKj8e52wdG5WOcyPqdPxZCEtXzVCGzL9pjv4ZQ/i6NLlsAyze8Xb21puUSFViGhrIX oI652aawsNM/T54+3AgJ3drQAD1MdH2r/usJlsEBsPRmFS/kR9qWIivkcwOK4UOqYvTj rMBk/x9wjWwWHv3r6cPs/rQDYqTa0kBOQF+/VEcfnsSq6LDEVU6XFO7cIrsgUtoGJD/m GGGg== X-Gm-Message-State: AElRT7FBGz2ZcSoWpLMZGSV/0cWy/1A0DqmTDnTnqOk2eg9s32EgMNaF hUG6kB13uBF1TRfa0DBfjgQvbY4eFuvqzp24hb37Wn9ISkQ= X-Google-Smtp-Source: AG47ELtFHDza0ucJCQIUGe0X6SR5LWGLo7AzBszJGgMWhb1YmouElWMzLkv5K0JWxWdn7vZgnL1ig3eEoK67OUuEJec= X-Received: by 10.202.104.165 with SMTP id o37mr660588oik.296.1520954882690; Tue, 13 Mar 2018 08:28:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:d02:0:0:0:0:0 with HTTP; Tue, 13 Mar 2018 08:28:01 -0700 (PDT) In-Reply-To: <20180308005510.31525-1-ge.song@hxt-semitech.com> References: <20180308005510.31525-1-ge.song@hxt-semitech.com> From: Ard Biesheuvel Date: Tue, 13 Mar 2018 15:28:01 +0000 Message-ID: To: Ge Song Cc: "edk2-devel@lists.01.org" , Leif Lindholm Subject: Re: [Patch v2] EmbeddedPkg: Correct the way of handling sections with a large size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 15:21:42 -0000 Content-Type: text/plain; charset="UTF-8" On 8 March 2018 at 00:55, Ge Song wrote: > Correct the way of handling EFI_SECTION_GUID_DEFINED type sections > with a large size > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ge Song > Reviewed-by: Ard Biesheuvel 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