From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 27F1C211BA456 for ; Thu, 24 Jan 2019 17:43:45 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2019 17:43:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,519,1539673200"; d="scan'208";a="117275450" Received: from shzintpr01.sh.intel.com (HELO [10.253.24.52]) ([10.239.4.80]) by fmsmga007.fm.intel.com with ESMTP; 24 Jan 2019 17:43:43 -0800 To: "Chasel, Chiu" , edk2-devel@lists.01.org References: <20190123053628.1664-1-chasel.chiu@intel.com> Cc: star.zeng@intel.com From: "Zeng, Star" Message-ID: Date: Fri, 25 Jan 2019 09:43:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190123053628.1664-1-chasel.chiu@intel.com> Subject: Re: [PATCH] IntelFsp2Pkg: Add function to get bootloader stack pointer X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:43:45 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2019/1/23 13:36, Chasel, Chiu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1391 > > FSP on-going enhancement for stack utilization required > to know bootloader stack pointer and this pointer can be > retrieved by first input parameter address when FSP-M > entry API invoked by bootloader. > > Test: Verified on internal platform and booting successfully > > Cc: Nate DeSimone > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Chasel Chiu Minor comments below, with them addressed, Reviewed-by: Star Zeng . > --- > IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c | 27 ++++++++++++++++++++++----- > IntelFsp2Pkg/Include/Library/FspCommonLib.h | 21 ++++++++++++++++----- > 2 files changed, 38 insertions(+), 10 deletions(-) > > diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > index 64ffba1d16..2f2861281c 100644 > --- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > +++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > @@ -1,6 +1,6 @@ > /** @file > > - Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
> + Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > which accompanies this distribution. The full text of the license may be found at > @@ -87,9 +87,9 @@ GetFspGlobalDataPointer ( > } > > /** > - This function gets back the FSP API first parameter passed by the bootlaoder. > + This function gets back the FSP API first parameter passed by the bootloader. > > - @retval ApiParameter FSP API first parameter passed by the bootlaoder. > + @retval ApiParameter FSP API first parameter passed by the bootloader. > **/ > UINT32 > EFIAPI > @@ -104,9 +104,26 @@ GetFspApiParameter ( > } > > /** > - This function gets back the FSP API second parameter passed by the bootlaoder. > + This function returns the FSP entry stack pointer from address of the first API parameter > > - @retval ApiParameter FSP API second parameter passed by the bootlaoder. > + @retval FSP entry stack pointer. > +**/ > +VOID* > +EFIAPI > +GetFspEntryStack ( > + VOID > + ) > +{ > + FSP_GLOBAL_DATA *FspData; > + > + FspData = GetFspGlobalDataPointer (); > + return (VOID*)(FspData->CoreStack + CONTEXT_STACK_OFFSET(ApiParam[0])); > +} > + > +/** > + This function gets back the FSP API second parameter passed by the bootloader. > + > + @retval ApiParameter FSP API second parameter passed by the bootloader. > **/ > UINT32 > EFIAPI > diff --git a/IntelFsp2Pkg/Include/Library/FspCommonLib.h b/IntelFsp2Pkg/Include/Library/FspCommonLib.h > index 1c99be3b1f..e98b180fca 100644 > --- a/IntelFsp2Pkg/Include/Library/FspCommonLib.h > +++ b/IntelFsp2Pkg/Include/Library/FspCommonLib.h > @@ -1,6 +1,6 @@ > /** @file > > - Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
> + Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > which accompanies this distribution. The full text of the license may be found at > @@ -40,9 +40,9 @@ GetFspGlobalDataPointer ( > ); > > /** > - This function gets back the FSP API first parameter passed by the bootlaoder. > + This function gets back the FSP API first parameter passed by the bootloader. > > - @retval ApiParameter FSP API first parameter passed by the bootlaoder. > + @retval ApiParameter FSP API first parameter passed by the bootloader. > **/ > UINT32 > EFIAPI > @@ -51,9 +51,9 @@ GetFspApiParameter ( > ); > > /** > - This function gets back the FSP API second parameter passed by the bootlaoder. > + This function gets back the FSP API second parameter passed by the bootloader. > > - @retval ApiParameter FSP API second parameter passed by the bootlaoder. > + @retval ApiParameter FSP API second parameter passed by the bootloader. > **/ > UINT32 > EFIAPI > @@ -61,6 +61,17 @@ GetFspApiParameter2 ( > VOID > ); > > + Remove this new line? > +/** > + This function returns the FSP entry stack pointer from address of the first API parameter > + > + @retval FSP entry stack pointer. > +**/ > +VOID* > +EFIAPI > +GetFspEntryStack ( > + VOID > + ); Add a new line? Thanks, Star > /** > This function sets the FSP API parameter in the stack. > >