From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web09.1569.1667813516017762817 for ; Mon, 07 Nov 2022 01:31:56 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=g8W44KPd; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ashraf.ali.s@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667813516; x=1699349516; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=LOVapncYzbBOsvgbQGeYhxScoHAfLypcnXuSao0J11U=; b=g8W44KPdqEdulRAacQCTR6ZhIslhwE2yK7CY4V692ZcnvSI5LvogYeFW l/YglYOJHZjrEk2u0rAPJ5CnF02PNaBn7aRSowI5+fputGz3+SHI/qd9h /F/T5wUDhINyBA8Uj9GwgZs5nbHXYO0PbsDWWCh44gABE/Kj6lIIuM0PS E9HGRbWyeaCudJlFjGl+IE6P1L9d8enE1gAoam3ZuJmAsRqMu1h3gh8yx 3v0mI1OW+Yej4QXJV79cw5uA9PMUzU91TQt3pOf3Qq3X5wUWLfN56zyE/ 2WyraV0R2HvSst3gbT9LR63ZH2+dTGVwoN4jSvS2drdahW9YYy4p3CTlk Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="290092939" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="290092939" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 01:31:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="667108796" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="667108796" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 07 Nov 2022 01:31:54 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 01:31:54 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 01:31:53 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 7 Nov 2022 01:31:53 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 7 Nov 2022 01:31:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ndvfNCDqM49iIMdbVJQxKusoUvipcge+PQm864g0SjpAHQXhMNDf5NWjE/xKuBzDm4LiGsTfheOrRJuIkpgR6Ozp7/Jn3MGjeN1KBqXwUMqS6LWWt33b9Cgq4BXxq1qaQ87iQ4R8966f9LORjACVmKCFyfPqKcSvkMneVkuXVQGzKuuARL+lGM97vGvgd4smbpdctklPj8GIAgu4weCF7vu+/9cEofcMcYK8iuPv9h7uz/Lr3LxbWXAnwtVbG2BWWkt4scsszhkc+6oN12wEnbMR849U7rM/AJBPGPM5XFQaVa6k3BoDlIIrriebQimyMyT3+SP7OcJxb5iNNjezCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2MIe+cL9/kB5/TnwS7pahg8v1rTj2EeWuA0Rcu0swho=; b=Mi/zeq1ckEb7ta1LjcHECx2kK8cJQalwYkn6T36fimgVFyaBITivgWmG/i5xvxCYev3hGYs07GzAs0SfHSvzv3CNdoHvGteGVWdD5IGCHDyYVQXNXqMO62dHSzAZuAdxr62kDUiLPI5ctQ5GLp6dlkFGZp0kitm7Ic+gNUf1LDm8VzXqQwhYh4bfuHslESCpFAUItlMjFmIgJehZoUwR42ZhiQBaU2GZTa4aeGxvjWuK7au7vJdNHH/dP2xr6aQkGqnOYVqZI/HJaCaBCre+T9JHzY/nPwbv2HVu7c9b/L3K7E/GN820vXbi9deANfg8gbU6+Rocz0byfyWswQ45zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5280.namprd11.prod.outlook.com (2603:10b6:5:38b::18) by CY8PR11MB6841.namprd11.prod.outlook.com (2603:10b6:930:62::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.26; Mon, 7 Nov 2022 09:31:52 +0000 Received: from DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::2fc5:ebb9:bf89:5b23]) by DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::2fc5:ebb9:bf89:5b23%6]) with mapi id 15.20.5791.026; Mon, 7 Nov 2022 09:31:52 +0000 From: "Ashraf Ali S" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Zeng, Star" , "Duggapu, Chinni B" , "Chan, Amy" , "Chaganty, Rangasai V" Subject: Re: [edk2-devel][PATCH v1] IntelFsp2Pkg: Adding FspHelperLib Thread-Topic: [edk2-devel][PATCH v1] IntelFsp2Pkg: Adding FspHelperLib Thread-Index: AQHY8oUYRSb8GvCup0WikobuwUHO0a4zMfxw Date: Mon, 7 Nov 2022 09:31:51 +0000 Message-ID: References: <28da0d3ce6289e39e542990fdabd3002a4c665a2.1667810598.git.ted.kuo@intel.com> In-Reply-To: <28da0d3ce6289e39e542990fdabd3002a4c665a2.1667810598.git.ted.kuo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5280:EE_|CY8PR11MB6841:EE_ x-ms-office365-filtering-correlation-id: 465dc174-3e4f-4769-45c1-08dac0a2e707 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gk4PysuSo+bI+m9skKSKQSWxWIAdNH0Kc94h+9eWYOeRCw3uR5jMliXCgWw8kw7QAeRNVJirGTXAyTzZJf1i281qpSjqFotXq3vck3d/dTsgEnfUeOCZNd7yP+91DvPH6tC/abhgN5Ncor8PmfyDHRUgKyNsWmXAjFvaVBlG7CLquuUS7SSVHknN+BeFCs9XlB9Jj50w6gsiO41J1JXwy7UH3w6qQhEjr8FqZ92UMn8uJoucpm45FEtqQ0ledE18zY4ajSj9+ziXiL7UdKHAUvzJP8eZ8umWP3iv3npwxkNi+B0tKxWrJa1KADn2nJLHoYjP8/5QIHAmr/fsVFzp7JWIDnysQb5gxcuY48nqQ37huxRzNQS83P7i8hMTs6NYRY4v+uf8zu75y3Ad6lpqfWFFqyepV/L7QLZCq7lKwo2Z9Jf/VMQ0SNQHpEWjWGHtqQJ7acO5e9f9CD9rnAru66cdSy+Z2xGW2L45yHU4AWUp5jaEJKics7wESXCf+TeKOGL34H6jYZ1bmMQjl75awxAiim52RFWmdr3xcpH4OMaPYAw/3d0JGonpjWB53LDqHxyoWWEjJ0PSN1PEDfZLj2vmIeHeM2xfGaCNGDms8vtNXM03eAZKcB8b9oSKJrdCPuqkF+ULCobRV08n2xR7IspmFsSa4KTtEBbZrctkVUeUMyc8ZXQ0lI9EZcG9Ug/90IqK8zqvsS3JrHfhkMqPbQfK+1aAH8lCrwX8ZTI5M0Bk78sUX7qsWmQvEZ/R3VpeVyDjC0lwRwDrPzWCjqWXHWDguUxpFb15CP1hNOdyJH8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5280.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(396003)(376002)(39860400002)(136003)(346002)(451199015)(186003)(55236004)(53546011)(26005)(7696005)(107886003)(6506007)(38100700002)(9686003)(83380400001)(122000001)(5660300002)(2906002)(55016003)(110136005)(71200400001)(478600001)(8936002)(41300700001)(52536014)(4326008)(19627235002)(8676002)(64756008)(66476007)(66946007)(316002)(66446008)(66556008)(76116006)(54906003)(33656002)(38070700005)(82960400001)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?xhQzd7yvzmNYkgtZ/pcY3ec08cQFNdJHpV0reshwEkrxOqdMG/Ac3zMxJG?= =?iso-8859-1?Q?nZZ2xQN9KlqMd4Lbzfwf0fqlw6CcnrDDsmpojxrg4FUalhzxu8vsYQGWAH?= =?iso-8859-1?Q?z9rEF64YmhhukeZ/DuHM1Tn6RlAwPOCjI8UE8QDM29spuA8RaQsofSQBMt?= =?iso-8859-1?Q?UFmdi1MpghZ00H5l57p6l/bPdY8vbH5LOmTpHUkbRtjo6onAt3Vayn6rwO?= =?iso-8859-1?Q?4avJPjDGGEasxBUYGYmFbkjwEeHfhrTsspQillNPE7yBS5k9buO5PQmOJm?= =?iso-8859-1?Q?ySfeGU+NTaa5X2KGww9qW7iYfGTWvzPyT9EsrHhuxLFrAQIFO5TkXODWOb?= =?iso-8859-1?Q?OMuMCNcjdLzXSyUT1+yfQAWTrFL8u+ZRZP3jT+zBcx7kh2a7cd/x8xw+uh?= =?iso-8859-1?Q?Pk3/MfagqlJY6mtR9ptPGqXji5J8pzii8Yl3Sy/nAh733xlHlw4JWlgFbl?= =?iso-8859-1?Q?mxNgdUbbm4EWdxVvfA21yK62oicSlpUF+LJIK9iQq1K0aUOj1Gds5kyPRr?= =?iso-8859-1?Q?GMz1ao5Jz5mIRH1uAH0xw0FVBY9r5bmFS7yVqLAe1Ed0e2wIdS3lakMtO3?= =?iso-8859-1?Q?zWrLO3cbxPp4MuHK4dfXHRmNXUo9dTSYnLWAB9df8HGWDkpQPnGxH23Vt4?= =?iso-8859-1?Q?uLWrFjHKmoK74vzRvi2/ZLVwOAf5bB5YHKZnjNLSillNZdxwXbKRmR647Z?= =?iso-8859-1?Q?t1JsUfZ2p92qbebCy0muU35OgXsv7Y3K4Iin/8Gqj5zEH06ACxiF+7LXe0?= =?iso-8859-1?Q?Lcoi+hFKNMMrBAguN76/kNoiSn2EJQHKEfL8RZbVshiBSEG/rJ+eQ/Lk5c?= =?iso-8859-1?Q?yD1q4ZOEFD5TpkH17r8qpkyrjyQWBDYoxrhpDteh7AfCHe86rIE4UuXJ1v?= =?iso-8859-1?Q?iSpra1h07cmmexfaIa4jB1uUikESvMKUvaNqwMTe1qLtoST2S4hHIknozT?= =?iso-8859-1?Q?ihTM6OgZGwrhSL9pYDmW/1nclzv5/xuDa3iJDxyOVVwN+dhNfznNW5te16?= =?iso-8859-1?Q?1DMJWgDneEB2+o/96+m+O2cpT1sjAWxLR7Fksi31n1xXr9V98b1+8kx+CR?= =?iso-8859-1?Q?+oGMJUlW0ITrJLTyNxOT95sUHN5942v3jnny0WhHH1s3kveyfWLZVcGBLI?= =?iso-8859-1?Q?IEH8iDWI6jHMy4l3x8f55OgPMP2yyXpGGIgzMZbJZnIJrTM0B2ASd96sgA?= =?iso-8859-1?Q?X20okpEy79mUj9vdY0Mxsg4ECIOdA6GprU4HO6B+9Mj2EKvPin1k1jzZgt?= =?iso-8859-1?Q?mG8AVSgM8mApwCrAbPHxw/4zTH3rXvUSTZ9KIcwyiAjTZfB/N1YFF7L42F?= =?iso-8859-1?Q?T6c4c5MzAEtZYIa3HNRhqtGUJJQRs1Y2jax1OZqxx2dEYGAKygxkECfee8?= =?iso-8859-1?Q?NUtxeBSjNSPxrZYbI+5ZJuy50+OVWVhSn6uB9RlDUhn/f+Q6Ugd23+GQ/r?= =?iso-8859-1?Q?nFNobprJWeCNqC3/v8ublpVBBgOWLOXzPKbLn6Sw3f/alyZWTlVovsikyg?= =?iso-8859-1?Q?4mhJAfVmXZhL7Y/hoEEeWatLSssdEWU8eSXkC0pC9SeQ9k823Ixd55vsQL?= =?iso-8859-1?Q?DLzk6vgyWwxRVRB4lI643zPFm0GdR9ZrVrusBgaepO5xjRYQdfgKhLjaqv?= =?iso-8859-1?Q?LiC58BGgqI+7Mvs4VvyML0EMrDZ8dhEkQ7?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5280.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 465dc174-3e4f-4769-45c1-08dac0a2e707 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2022 09:31:51.9438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ya83WG+wMt/H8ar8pECI9mvBptj5Rozph0I4Oz+XNMyhASJabX90cwEP8Dw3JFSoUj3tLSATT4RYpEZiHg+4zA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6841 Return-Path: ashraf.ali.s@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi., Instead of Hardcoded FSP ImageBase as 0x1C in FspHelper.nasm, can we have s= truct from there we can get it. So that in future if the Header is changing= assembly code will not get impacted. Regards, Ashraf Ali S Intel Technology India Pvt. Ltd.=A0 -----Original Message----- From: Kuo, Ted =20 Sent: Monday, November 7, 2022 2:14 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Zeng, Star ; S, Ashraf Ali ; Duggapu, Chinni B ; Chan,= Amy Subject: [edk2-devel][PATCH v1] IntelFsp2Pkg: Adding FspHelperLib REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D4128 Adding FspHelperLib for platform code to consume. There will be another pat= ch raised later for FspSecCore to consume FspHelperLib. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng Cc: Ashraf Ali S Cc: Chinni B Duggapu Cc: Amy Chan Signed-off-by: Ted Kuo --- IntelFsp2Pkg/FspSecCore/SecFsp.h | 25 +--------- IntelFsp2Pkg/Include/Library/FspHelperLib.h | 35 +++++++++++++ IntelFsp2Pkg/IntelFsp2Pkg.dsc | 2 + .../BaseFspHelperLib/BaseFspHelperLib.inf | 50 +++++++++++++++++++ .../BaseFspHelperLib/Ia32/FspHelper.nasm | 35 +++++++++++++ .../BaseFspHelperLib/X64/FspHelper.nasm | 34 +++++++++++++ 6 files changed, 157 insertions(+), 24 deletions(-) create mode 100644 In= telFsp2Pkg/Include/Library/FspHelperLib.h create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.= inf create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/Ia32/FspHelper.na= sm create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/X64/FspHelper.nas= m diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.h b/IntelFsp2Pkg/FspSecCore/Sec= Fsp.h index d7a5976c12..f12769890f 100644 --- a/IntelFsp2Pkg/FspSecCore/SecFsp.h +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h @@ -17,6 +17,7 @@ #include #include #incl= ude +#include #defin= e FSP_MCUD_SIGNATURE SIGNATURE_32 ('M', 'C', 'U', 'D') #define FSP_PER0_SI= GNATURE SIGNATURE_32 ('P', 'E', 'R', '0')@@ -64,28 +65,4 @@ FspDataPointer= FixUp ( IN UINTN OffsetGap ); -/**- This interface returns the base address = of FSP binary.-- @return FSP binary base address.--**/-UINTN-EFIAPI-AsmG= etFspBaseAddress (- VOID- );--/**- This interface gets FspInfoHeader poi= nter-- @return FSP binary base address.--**/-UINTN-EFIAPI-AsmGetFspInfoH= eader (- VOID- );- #endifdiff --git a/IntelFsp2Pkg/Include/Library/FspHel= perLib.h b/IntelFsp2Pkg/Include/Library/FspHelperLib.h new file mode 100644 index 0000000000..84b74fa7aa --- /dev/null +++ b/IntelFsp2Pkg/Include/Library/FspHelperLib.h @@ -0,0 +1,35 @@ +/** @file+ Header file for FSP Helper Library.++ Copyright (c) 2022, Int= el Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-C= lause-Patent++**/++#ifndef _FSP_HELPER_LIB_H_+#define _FSP_HELPER_LIB_H_++/= **+ This interface returns the base address of FSP binary.++ @return FS= P binary base address.++**/+UINTN+EFIAPI+AsmGetFspBaseAddress (+ VOID+ );= ++/**+ This interface gets FspInfoHeader pointer++ @return FSP info hea= der.+**/+UINTN+EFIAPI+AsmGetFspInfoHeader (+ VOID+ );++#endif // _FSP_HEL= PER_LIB_H_diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFs= p2Pkg.dsc index 0713f0028d..09893d70e8 100644 --- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc +++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc @@ -46,6 +46,7 @@ FspSwitchStackLib|IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwit= chStackLib.inf FspSecPlatformLib|IntelFsp2Pkg/Library/SecFspSecPlatformLi= bNull/SecFspSecPlatformLibNull.inf FspMultiPhaseLib|IntelFsp2Pkg/Library/= BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf+ FspHelperLib|IntelFsp2Pkg/L= ibrary/BaseFspHelperLib/BaseFspHelperLib.inf [LibraryClasses.common.PEIM] = PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf@@ -66,6 += 67,7 @@ IntelFsp2Pkg/Library/BaseDebugDeviceLibNull/BaseDebugDeviceLibNull.inf = IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf= IntelFsp2Pkg/Library/BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf+ Int= elFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf IntelFsp2Pkg/Fsp= SecCore/FspSecCoreT.inf IntelFsp2Pkg/FspSecCore/FspSecCoreM.infdiff --git= a/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf b/IntelFsp2Pk= g/Library/BaseFspHelperLib/BaseFspHelperLib.inf new file mode 100644 index 0000000000..318ad65330 --- /dev/null +++ b/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf @@ -0,0 +1,50 @@ +## @file+# FSP Helper Library.+#+# Copyright (c) 2022, Intel Corporation= . All rights reserved.
+#+# SPDX-License-Identifier: BSD-2-Clause-Paten= t+#+##++###################################################################= #############+#+# Defines Section - statements that will be processed to cr= eate a Makefile.+#+########################################################= ########################++[Defines]+ INF_VERSION =3D 0x= 00010005+ BASE_NAME =3D FspHelperLib+ FILE_GUID = =3D 65746991-8a41-4b89-b0f4-eb4e24b5b471+ MODULE_TYPE = =3D BASE+ VERSION_STRING =3D 1.0+ LIBRARY= _CLASS =3D FspHelperLib++#+# The following information is = for reference only and not required by the build tools.+#+# VALID_ARCHITEC= TURES =3D IA32 X64+#++###########################################= #####################################+#+# Sources Section - list of files t= hat are required for the build to succeed.+#+##############################= ##################################################++[Sources.IA32]+ Ia32/F= spHelper.nasm++[Sources.X64]+ X64/FspHelper.nasm++########################= ########################################################+#+# Package Depend= ency Section - list of Package files that are required for+# = this module.+#+#############################################= ###################################++[Packages]+ MdePkg/MdePkg.decdiff --g= it a/IntelFsp2Pkg/Library/BaseFspHelperLib/Ia32/FspHelper.nasm b/IntelFsp2P= kg/Library/BaseFspHelperLib/Ia32/FspHelper.nasm new file mode 100644 index 0000000000..e3e1945473 --- /dev/null +++ b/IntelFsp2Pkg/Library/BaseFspHelperLib/Ia32/FspHelper.nasm @@ -0,0 +1,35 @@ +;; @file+; Provide FSP helper function.+;+; Copyright (c) 2015 - 2016, In= tel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-= Clause-Patent+;;++ SECTION .text++global ASM_PFX(FspInfoHeaderRelativeOf= f)+ASM_PFX(FspInfoHeaderRelativeOff):+ DD 0x12345678 ; T= his value must be patched by the build script++global ASM_PFX(AsmGetFspBase= Address)+ASM_PFX(AsmGetFspBaseAddress):+ call ASM_PFX(AsmGetFspInfoHeade= r)+ add eax, 0x1C+ mov eax, dword [eax]+ ret++global ASM_PFX(AsmG= etFspInfoHeader)+ASM_PFX(AsmGetFspInfoHeader):+ call ASM_PFX(NextInstruc= tion)+ASM_PFX(NextInstruction):+ pop eax+ sub eax, ASM_PFX(NextInst= ruction)+ add eax, ASM_PFX(AsmGetFspInfoHeader)+ sub eax, dword [ea= x - ASM_PFX(AsmGetFspInfoHeader) + ASM_PFX(FspInfoHeaderRelativeOff)]+ re= t++global ASM_PFX(AsmGetFspInfoHeaderNoStack)+ASM_PFX(AsmGetFspInfoHeaderNo= Stack):+ mov eax, ASM_PFX(AsmGetFspInfoHeader)+ sub eax, dword [ASM= _PFX(FspInfoHeaderRelativeOff)]+ jmp edidiff --git a/IntelFsp2Pkg/Libra= ry/BaseFspHelperLib/X64/FspHelper.nasm b/IntelFsp2Pkg/Library/BaseFspHelper= Lib/X64/FspHelper.nasm new file mode 100644 index 0000000000..122fa1d174 --- /dev/null +++ b/IntelFsp2Pkg/Library/BaseFspHelperLib/X64/FspHelper.nasm @@ -0,0 +1,34 @@ +;; @file+; Provide FSP helper function.+;+; Copyright (c) 2022, Intel Cor= poration. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-= Patent+;;+ DEFAULT REL+ SECTION .text++global ASM_PFX(AsmGetFspBaseA= ddress)+ASM_PFX(AsmGetFspBaseAddress):+ call ASM_PFX(AsmGetFspInfoHeader= )+ add rax, 0x1C+ mov eax, [rax]+ ret++global ASM_PFX(AsmGetFspIn= foHeader)+ASM_PFX(AsmGetFspInfoHeader):+ lea rax, [ASM_PFX(AsmGetFspInf= oHeader)]+ DB 0x48, 0x2d ; sub rax, 0x????????+global AS= M_PFX(FspInfoHeaderRelativeOff)+ASM_PFX(FspInfoHeaderRelativeOff):+ DD = 0x12345678 ; This value must be patched by the build script+= and rax, 0xffffffff+ ret++global ASM_PFX(AsmGetFspInfoHeaderNoStack)= +ASM_PFX(AsmGetFspInfoHeaderNoStack):+ lea rax, [ASM_PFX(AsmGetFspInfoH= eader)]+ lea rcx, [ASM_PFX(FspInfoHeaderRelativeOff)]+ mov ecx, [rc= x]+ sub rax, rcx+ and rax, 0xffffffff+ jmp rdi--=20 2.35.3.windows.1