From nobody Thu Apr 25 07:42:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+59921+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59921+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589945644; cv=none; d=zohomail.com; s=zohoarc; b=jkvNlGestcU9qHnwafRc2l2UBZskUsWeugEolWTNO7RZGitjCkXotgQHhxyTAF0nqaXxYQd80sNn0wLzEQksfbx03sxbLuFSC87yV+6wkQN5E6LzozNcXH2Md0QA/NdzZTX1Rkt6R30lOANZEqB5CuDcBybveJ+yc25H3mfM+aE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589945644; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=lExgEzY5MJiH7yQFXLQmgAn1zXBf2NOPVkE0pRZXhcI=; b=PJTU2f4NOTDaKevQ/PR7FUEm5Idw3GC43MEgWFYZ0jGqEFeUuDwu9sfvfNc5rQKBBDqmzhWMU7JMUZVHUIRxLTWoUjnn4wpiVoYXnziOz9qDFcVl2Wmn6MbVnuiDsvJn+pT0RoefGV74rIbBw0Jl/UskNrqhC8jqT3lupjOXgno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59921+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589945644444952.2324833823718; Tue, 19 May 2020 20:34:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ETTiYY1788612xxrbA4bZFF8; Tue, 19 May 2020 20:34:03 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.6239.1589945643407332018 for ; Tue, 19 May 2020 20:34:03 -0700 IronPort-SDR: x/6Nb9b76k6cybyzT0tRZBKVebX9+TqYiN7Xh1adH+vkQ+1yd/wU4K+4qJEYmxt3kJdNzPc2Fw 898Xi3zw2uoA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 20:34:02 -0700 IronPort-SDR: Dq9PsCnRmH5jnhf4R+6Gnl8qZS9pBJS6tgIUGMmv0lsaf3qJRtjFbGLzGVaS19vfOGnPp0Nfo+ hlgtN2bZHUEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,412,1583222400"; d="scan'208";a="253556215" X-Received: from cchiu4-mobl1.gar.corp.intel.com ([10.254.98.30]) by fmsmga007.fm.intel.com with ESMTP; 19 May 2020 20:34:01 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Maurice Ma , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: Add FunctionParametePtr to FspGlobalData. Date: Wed, 20 May 2020 11:33:56 +0800 Message-Id: <20200520033356.5708-1-chasel.chiu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: nHDmZNhCKd3P76jGVABYUz1Ux1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589945643; bh=rF43AJvMx/Sh87V9t0sD0T6/IzdXxtLqZACHZemFUEU=; h=Cc:Date:From:Reply-To:Subject:To; b=UZJ9jBVg0PCbeVH2HxTQxu3buEqIog1efXHvSkZwaI9td7W7xYKKgv+gOPmqSd22AZl ELPOVpmd2pmE4E/Rl7gGX6z6wK46NeyJBiWmBhOBcyxTOtJJZppViLkfgLh3AXQP8QAzh f9clDrUKM2rjFs7+AYEHA2RVfhDxKep5lgs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2726 When FSP switching stack and calling bootloader functions, the function parameter in stack may not be accessible easily. We can store the function parameter pointer to FspGlobalData and retrieve it after stack switched. Also need to add Loader2PeiSwitchStack () to header file as public function for platform FSP code to consume. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone --- IntelFsp2Pkg/Include/FspGlobalData.h | 12 ++++++++++-- IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/IntelFsp2Pkg/Include/FspGlobalData.h b/IntelFsp2Pkg/Include/Fs= pGlobalData.h index 5bde316893..dba9b48e1a 100644 --- a/IntelFsp2Pkg/Include/FspGlobalData.h +++ b/IntelFsp2Pkg/Include/FspGlobalData.h @@ -52,12 +52,20 @@ typedef struct { VOID *MemoryInitUpdPtr; VOID *SiliconInitUpdPtr; UINT8 ApiIdx; - UINT8 FspMode; // 0: FSP in API mode; 1: FSP in DISPATCH m= ode + /// + /// 0: FSP in API mode; 1: FSP in DISPATCH mode + /// + UINT8 FspMode; UINT8 OnSeparateStack; UINT8 Reserved3; UINT32 NumberOfPhases; UINT32 PhasesExecuted; - UINT8 Reserved4[20]; + /// + /// To store function parameters pointer + /// so it can be retrieved after stack switched. + /// + VOID *FunctionParameterPtr; + UINT8 Reserved4[16]; UINT32 PerfSig; UINT16 PerfLen; UINT16 Reserved5; diff --git a/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h b/IntelFsp2Pk= g/Include/Library/FspSwitchStackLib.h index 0c76e9f022..bed2a5d677 100644 --- a/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h +++ b/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -36,4 +36,20 @@ Pei2LoaderSwitchStack ( VOID ); =20 +/** + + This function is equilivant to Pei2LoaderSwitchStack () but just indicat= es + the stack after switched is FSP stack. + + @return ReturnKey After switching to the saved stack, + this value will be saved in eax before return= ing. + + +**/ +UINT32 +EFIAPI +Loader2PeiSwitchStack ( + VOID + ); + #endif --=20 2.13.3.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#59921): https://edk2.groups.io/g/devel/message/59921 Mute This Topic: https://groups.io/mt/74342444/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-