From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.7265.1647937139890417293 for ; Tue, 22 Mar 2022 01:19:00 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=fr+SqvGJ; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647937139; x=1679473139; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=go8DnzpANpnSqD+5AVAgtdxFbT7BJRb72XVp6emz9zM=; b=fr+SqvGJODYMCo/gxkeU30a2V9xYJHGav9GeIsef3fAoBklC+JsmxP/q Splw4XGbKYocp24qDywZcF51MRzm/U8bJJA6Vpo0qvazmZPrf+oWddoBj XUHDV9vqKeO7Rh14xzA3snew4JqRQ/UaezGPGwh+IYdZOuXP34PCBTCic RgecOcu7f14kaV1pIHw+WZ1yfX4JyYHsal+3QqQa2dQpIa73X9wCbHoJ+ Q5cDGFwxBugIqB/j8OeExoOT22gTP8Nmx0c8wcey6erkkPbyKz6K24lwH SiCJL0+cynZpftskGqwrigjFKgM8X6zCWHbhAtgE/PXp+ook2Loo9BZV3 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10293"; a="257950037" X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="257950037" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 01:18:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="500489061" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga003.jf.intel.com with ESMTP; 22 Mar 2022 01:18:57 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 22 Mar 2022 01:18:57 -0700 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.2308.21 via Frontend Transport; Tue, 22 Mar 2022 01:18:57 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.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.2308.21; Tue, 22 Mar 2022 01:18:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cTDpFihztRSMLFNLALS3rTW8MJ5VwPKTD32X9fDO2N8ygMMOSx356IusvwsWfEdG95H4xeXr/ZBWWOy4rQIgFORbYHv7x59LADL6bXk0RNTT6yHVoS/8LSwifJj/Rnexgi2UrMYm0k3H37bBm+22F2KiV0gUNC1cWwyJi0M8y1pFP3st2jED0tr1ylQlhI7dmCtYbn6s/4dYx2d+guZjKFjBk4pCk6tXi1ptanJkeRe0WLcAABYY/7aw7RYhpSQheVWoCdikR9xaCSXkj9+M8NypEcsUtS1sZIfUHQGUzGV96q61UVYNhBEihc5iJSKhhG1fKRc5lf7ClChnK2bTMA== 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=rIJMYkuG4zRyYqknA8b0mrLWwD01LwsC4MC9okX0tpk=; b=JzQLpXthXD44y+D0dkfhiV9PJFHVT5LcRNz/X02KPpAeZUmwQh7CgvDu7quMUwi9BbByGnEl86/+zEq4SEzMsyps5l4e7trez7PWnxHeQu61mDt0lAJzpn2m84Vxzo+BOWqsAPIL4Qs7S34OJW5SSpKkiM2OOpyt5MH5DU29AYFr7oxVsBlXlofHtsl5a+mCxh8R++NMeyIUmYfCup99rSYtj3OaZ9rlpxIbeiHGn2cGNGC3IsIX8AXSLePor+FQA8mhhP5RafPMof5HLdBMh+GvPyuUog75uGwpz80nYvv/c6I5bpuASZoP6Lf1vBjMNME4ajZLXW4rJjRBXnWGlw== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by SN6PR11MB2927.namprd11.prod.outlook.com (2603:10b6:805:cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Tue, 22 Mar 2022 08:18:54 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809%5]) with mapi id 15.20.5102.016; Tue, 22 Mar 2022 08:18:54 +0000 From: "Chiu, Chasel" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "S, Ashraf Ali" Subject: Re: [edk2-devel][PATCH] IntelFsp2Pkg: BaseFspCommonLib Support for X64 Thread-Topic: [edk2-devel][PATCH] IntelFsp2Pkg: BaseFspCommonLib Support for X64 Thread-Index: AQHYN1ss6QUMSxCmX0WgexemyOsfk6zLG/3g Date: Tue, 22 Mar 2022 08:18:54 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f23d62b-6ec4-44c1-8857-08da0bdc9ac4 x-ms-traffictypediagnostic: SN6PR11MB2927:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Mm6av5I16TTxzRhbqVuKNoUUVBXxcppx/0kYYt7kwKijkDzxLmbAr8wW053ka9XR46/tIAVe8suZJpofJwJ7sHW2vybLEQcIdrCvP83SV7F7oznC/q3KXyylWo4IK66EpP/OBT3Yx40drT7AGCTo4SAsEGmTkxJjFf26C+72BCJys39HgKvFwLFOuaO1Q86VnNZI3b6cWvZFNeOrZIthw4LbjGUouDdPThMXnxLhQny9afqwF9OlRvl73aFyyn+nXcEut5ZSnLiN+JOC09x66WNoYe6BkEXodXR3qHNTHKnQdF/KLSYqYnvnBCEI6EF/i2Ha7K+Y6cpJRL3P8Z8NAWUPnwqXcB+EmA6GmkgtKfOBU/kiDBSpakFfo4tIOHz6FV0/sspL0z6nZ2DwHinZapnXK/aHkh1gC9SksDkachMdSYg0MQsnt1q7PKLFypvViPf7wCwCM/92b1o2Gy7VMJGyhU0NvlgIrIoiipjDxrptQ9+KhuGMDA5bnaKJq2u+sOiUD39ZzDCQ37AJzo7FiqctgjVg1u46tvxoCWfp0KN2FQ+ENA7qs09Nq2ly/roG8zRUzoQ9HlkTLwF1akXFg6Qd0rH4HHQufs2GU85FbbXQJhWavNBgSSNGJSdKqQBjAr1s8/fMX2Nb43ffxU8jF4R8ImemuMik+YsoAdP2jiEUvm20Vd5tBNnZ+/WUp7BlZl9yNKlZIcY0ZJHBcRMzkTsUQ5vmiIEu2Iylf/BHtn3SNiejTSSIbsmmhvSNloWLTWUvIkxaIJVBcWWUlvSDsFUhmk0Z2ofJFERWr2wZhsskq6G2ZkdMqq9ZsLahKQ5AAbtz3Tv26cwX8wfs8YHNnxzd54oD6ZKAuwWbk/b0YG8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(52536014)(38100700002)(110136005)(55016003)(54906003)(38070700005)(316002)(508600001)(19627235002)(8936002)(966005)(71200400001)(122000001)(82960400001)(33656002)(5660300002)(26005)(186003)(83380400001)(86362001)(2906002)(66946007)(76116006)(9686003)(53546011)(8676002)(7696005)(4326008)(64756008)(66446008)(66556008)(107886003)(66476007)(6506007)(11716005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qjzqSj5A1swVtwG19P4n7XAkn2fs/leBK86kYLdLEimkZie388Wblmi1eRJL?= =?us-ascii?Q?8WBRFv0LMjP5M/qU0ez18w0WzivC+deu2arj3Mp4GP8AlbmbHqf610pjtnXa?= =?us-ascii?Q?p9/qjI/u0lJWI8tV17Gz30Sw8BBJXd9D7O/Xc4cacBQWyZH3ht1giFKpeObw?= =?us-ascii?Q?RQZultYcQo4lvQNftcLjMnqIgfswh8rAXlj7sbbatNXeKkZ2ViYsrwpC+Bzr?= =?us-ascii?Q?+Nc3ojAZvEiPcqjelWNH7RRY6++MFs1c+EG2tWo+RO3Myqla+YU+f7c3eA0+?= =?us-ascii?Q?55s1MRIUNELk6DzIWVJagCAuNo4Twc08x3+sMT7jkfbmfADEtpows7BFbhDJ?= =?us-ascii?Q?0C/RHqwyZQ51ODJ9BvRqoF6/c+9HVY0R+xV8Um4D2XEgVO3VTglFNrJLVFRz?= =?us-ascii?Q?vqkljKftmuTw4RermYInVuEkT8CJ/nM1fOrXBCkovi/qkL1GXle+TkeoQDxd?= =?us-ascii?Q?mu/+jHCCEYp+0fi7Xg3l13J8iUal9RBnOUIoVrRZz0/JbPvif1PWqxHmJ8vx?= =?us-ascii?Q?A6yItLG11WyLJY/sd1I6kteOEeXzatanDSVz6TZM/nx7XK8rAX2UMf4MzpoH?= =?us-ascii?Q?RvbCB8YeQi+/l1KmWzwipY+fd+mmiHgtPjQFTmlWy+BRWIN6YZZrtAsTpY68?= =?us-ascii?Q?srJ4c+BcI7aWxQtT1DDFHHEZexlHAO50Gx1nno5qToS49NSCRoI2MsvaRQ+G?= =?us-ascii?Q?XRgO5THjNSwfB+StXd6xyEmkmFXNSBb6iWbUV4SCuDbA3uXgcamQ3RCe2OUU?= =?us-ascii?Q?uz8KendNT4vhlUnjvXWqQZpN53bQYQnRZpNHBO64u+4Q9vQLcYLwAZRUrMzY?= =?us-ascii?Q?1dgAl6nAyUlGPwws9zTOup1xzQOnuKhKQlbEKK8n4En43LfXJThzZUerG7YL?= =?us-ascii?Q?mLX0l9Sr8eJrDXVT5AWe/EP7HEzgInwg3avQDN4k+jnUcjtJLYXUZcc3YQCD?= =?us-ascii?Q?ERktU1h8MMFizf+D6zlYJ5veu0dBCzQxIjCJG4Do+omhJizYPKEDPY/pNNGQ?= =?us-ascii?Q?VMMA/bKnmSR9nXZBR75YxogQjplQNQmyV4ytYZA7u968pDPPKGkIOC+xV+SP?= =?us-ascii?Q?PHU22TA7eo4gd656iF4pm2BzSoH9ty4skd7mYqTdPmaGPb7Ef/mK4+1CLfxe?= =?us-ascii?Q?Ckv3j3h6uL7+A+xL8x9xlSzBweozQajQflIxY3hlEYAdxBeTTF3/TrUpzIyM?= =?us-ascii?Q?HF3ZNIgZwmJVVYoghlf9q1w1QS2eMDm+k3BrLtHxxnT4tgg1JkN9WQaFmnJd?= =?us-ascii?Q?jy215zuWZfD0GasYupdH+jdNqJGKPC0kfjE/Cb7y6RAFR//lPp4ziiBjwcAS?= =?us-ascii?Q?e9hAMsWHnUyvdhdllaXxzVK16YMV0QG6YrABV/LYOTEEyYrNZvvnpOVv3h2w?= =?us-ascii?Q?67Jf9t1/eacSYiE/qP5H7orkECiS56PWz6xeUpJ9GU2U0TGQpk2L0vTo+B3J?= =?us-ascii?Q?o4e8uisjm9w9hjxVWQ9Wq2nb+TTlY6Dx?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f23d62b-6ec4-44c1-8857-08da0bdc9ac4 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2022 08:18:54.1764 (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: N57v+I7tryAWN6IFFiuubxb95ovWpP+bqtdk37BYIfU/cdIrblxuBwu/pNwDHjwdKDHmaY+xyNitCEwJxKrbog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2927 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Patch pushed: https://github.com/tianocore/edk2/commit/ec0b54849b23efa25caf= 0055b0eef8bf9b4dec98 Thanks, Chasel > -----Original Message----- > From: Kuo, Ted > Sent: Monday, March 14, 2022 12:23 PM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star ; S, > Ashraf Ali > Subject: [edk2-devel][PATCH] IntelFsp2Pkg: BaseFspCommonLib Support for > X64 >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3867 > Add BaseFspCommonLib Support for X64. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ashraf Ali S > Signed-off-by: Ted Kuo > --- > IntelFsp2Pkg/FspSecCore/SecFsp.c | 2 +- > IntelFsp2Pkg/FspSecCore/SecFsp.h | 2 +- > IntelFsp2Pkg/Include/FspGlobalData.h | 2 +- > IntelFsp2Pkg/Include/Library/FspCommonLib.h | 6 +- > .../Library/BaseFspCommonLib/FspCommonLib.c | 65 > +++++++++++++--------- > 5 files changed, 45 insertions(+), 32 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.c > b/IntelFsp2Pkg/FspSecCore/SecFsp.c > index f79d45900e..68e588dd41 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFsp.c > +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.c > @@ -217,7 +217,7 @@ FspGlobalDataInit ( > **/ > VOID > FspDataPointerFixUp ( > - IN UINT32 OffsetGap > + IN UINTN OffsetGap > ) > { > FSP_GLOBAL_DATA *NewFspData; > diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.h > b/IntelFsp2Pkg/FspSecCore/SecFsp.h > index aacd32f7f7..7c9be85fe0 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFsp.h > +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h > @@ -61,7 +61,7 @@ FspGlobalDataInit ( > **/ > VOID > FspDataPointerFixUp ( > - IN UINT32 OffsetGap > + IN UINTN OffsetGap > ); >=20 > /** > diff --git a/IntelFsp2Pkg/Include/FspGlobalData.h > b/IntelFsp2Pkg/Include/FspGlobalData.h > index 71033121c4..2b534075ae 100644 > --- a/IntelFsp2Pkg/Include/FspGlobalData.h > +++ b/IntelFsp2Pkg/Include/FspGlobalData.h > @@ -42,7 +42,7 @@ typedef struct { > UINT32 Signature; > UINT8 Version; > UINT8 Reserved1[3]; > - UINT32 CoreStack; > + UINTN CoreStack; > UINT32 StatusCode; > UINT32 Reserved2[8]; > FSP_PLAT_DATA PlatformData; > diff --git a/IntelFsp2Pkg/Include/Library/FspCommonLib.h > b/IntelFsp2Pkg/Include/Library/FspCommonLib.h > index c70039d9e8..b5e38568e2 100644 > --- a/IntelFsp2Pkg/Include/Library/FspCommonLib.h > +++ b/IntelFsp2Pkg/Include/Library/FspCommonLib.h > @@ -38,7 +38,7 @@ GetFspGlobalDataPointer ( >=20 > @retval ApiParameter FSP API first parameter passed by the bootloader. > **/ > -UINT32 > +UINTN > EFIAPI > GetFspApiParameter ( > VOID > @@ -49,7 +49,7 @@ GetFspApiParameter ( >=20 > @retval ApiParameter FSP API second parameter passed by the > bootloader. > **/ > -UINT32 > +UINTN > EFIAPI > GetFspApiParameter2 ( > VOID > @@ -87,7 +87,7 @@ SetFspApiParameter ( > VOID > EFIAPI > SetFspApiReturnStatus ( > - IN UINT32 ReturnStatus > + IN UINTN ReturnStatus > ); >=20 > /** > diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > index 8f8453915e..cd10b63c95 100644 > --- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > +++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c > @@ -30,21 +30,34 @@ typedef struct { > UINT16 IdtrLimit; > UINT32 IdtrBase; > UINT16 Reserved; > - UINT32 Edi; > - UINT32 Esi; > - UINT32 Ebp; > - UINT32 Esp; > - UINT32 Ebx; > - UINT32 Edx; > - UINT32 Ecx; > - UINT32 Eax; > + UINT32 Registers[8]; // General Purpose Registers: Edi, Esi, Ebp,= Esp, > Ebx, Edx, Ecx and Eax > UINT16 Flags[2]; > UINT32 FspInfoHeader; > UINT32 ApiRet; > UINT32 ApiParam[2]; > } CONTEXT_STACK; >=20 > -#define CONTEXT_STACK_OFFSET(x) (UINT32)&((CONTEXT_STACK > *)(UINTN)0)->x > +// > +// API return address +0xB0 > +// push API Parameter2 +0xA8 > +// push API Parameter1 +0xA0 > +// push FspInfoHeader +0x98 > +// pushfq +0x90 > +// cli > +// PUSHA_64 +0x10 > +// sub rsp, 16 +0x00 > +// sidt [rsp] > +// > +typedef struct { > + UINT64 Idtr[2]; // IDTR Limit - bit0:bi15, IDTR Base - bit16= :bit79 > + UINT64 Registers[16]; // General Purpose Registers: RDI, RSI, RBP,= RSP, > RBX, RDX, RCX, RAX, and R15 to R8 > + UINT32 Flags[2]; > + UINT64 FspInfoHeader; > + UINT64 ApiParam[2]; > + UINT64 ApiRet; // 64bit stack format is different from the = 32bit > one due to x64 calling convention > +} CONTEXT_STACK_64; > + > +#define CONTEXT_STACK_OFFSET(x) (sizeof(UINTN) =3D=3D sizeof (UINT32) ? > +(UINTN)&((CONTEXT_STACK *)(UINTN)0)->x : > (UINTN)&((CONTEXT_STACK_64 > +*)(UINTN)0)->x) >=20 > #pragma pack() >=20 > @@ -85,7 +98,7 @@ GetFspGlobalDataPointer ( >=20 > @retval ApiParameter FSP API first parameter passed by the bootloader. > **/ > -UINT32 > +UINTN > EFIAPI > GetFspApiParameter ( > VOID > @@ -94,7 +107,7 @@ GetFspApiParameter ( > FSP_GLOBAL_DATA *FspData; >=20 > FspData =3D GetFspGlobalDataPointer (); > - return *(UINT32 *)(UINTN)(FspData->CoreStack + > CONTEXT_STACK_OFFSET (ApiParam[0])); > + return *(UINTN *)(FspData->CoreStack + CONTEXT_STACK_OFFSET > + (ApiParam[0])); > } >=20 > /** > @@ -119,7 +132,7 @@ GetFspEntryStack ( >=20 > @retval ApiParameter FSP API second parameter passed by the > bootloader. > **/ > -UINT32 > +UINTN > EFIAPI > GetFspApiParameter2 ( > VOID > @@ -128,7 +141,7 @@ GetFspApiParameter2 ( > FSP_GLOBAL_DATA *FspData; >=20 > FspData =3D GetFspGlobalDataPointer (); > - return *(UINT32 *)(UINTN)(FspData->CoreStack + > CONTEXT_STACK_OFFSET (ApiParam[1])); > + return *(UINTN *)(FspData->CoreStack + CONTEXT_STACK_OFFSET > + (ApiParam[1])); > } >=20 > /** > @@ -145,8 +158,8 @@ SetFspApiParameter ( { > FSP_GLOBAL_DATA *FspData; >=20 > - FspData = =3D GetFspGlobalDataPointer > (); > - *(UINT32 *)(UINTN)(FspData->CoreStack + CONTEXT_STACK_OFFSET > (ApiParam)) =3D Value; > + FspData =3D G= etFspGlobalDataPointer (); > + *(UINTN *)(FspData->CoreStack + CONTEXT_STACK_OFFSET (ApiParam)) > =3D > + Value; > } >=20 > /** > @@ -158,13 +171,13 @@ SetFspApiParameter ( VOID EFIAPI > SetFspApiReturnStatus ( > - IN UINT32 ReturnStatus > + IN UINTN ReturnStatus > ) > { > FSP_GLOBAL_DATA *FspData; >=20 > - FspData = =3D GetFspGlobalDataPointer (); > - *(UINT32 *)(UINTN)(FspData->CoreStack + CONTEXT_STACK_OFFSET (Eax)) > =3D ReturnStatus; > + FspData = =3D GetFspGlobalDataPointer (); > + *(UINTN *)(FspData->CoreStack + CONTEXT_STACK_OFFSET (Registers[7])) > + =3D ReturnStatus; > } >=20 > /** > @@ -180,19 +193,19 @@ SetFspCoreStackPointer ( > ) > { > FSP_GLOBAL_DATA *FspData; > - UINT32 *OldStack; > - UINT32 *NewStack; > + UINTN *OldStack; > + UINTN *NewStack; > UINT32 StackContextLen; >=20 > FspData =3D GetFspGlobalDataPointer (); > - StackContextLen =3D sizeof (CONTEXT_STACK) / sizeof (UINT32); > + StackContextLen =3D sizeof(CONTEXT_STACK) / sizeof(UINTN); >=20 > // > // Reserve space for the ContinuationFunc two parameters > // > - OldStack =3D (UINT32 *)FspData->CoreStack; > - NewStack =3D (UINT32 *)NewStackTop - StackContextLen - 2; > - FspData->CoreStack =3D (UINT32)NewStack; > + OldStack =3D (UINTN *)FspData->CoreStack; NewStack =3D (UINTN > + *)NewStackTop - StackContextLen - 2; FspData->CoreStack =3D > + (UINTN)NewStack; > while (StackContextLen-- !=3D 0) { > *NewStack++ =3D *OldStack++; > } > @@ -427,7 +440,7 @@ GetFspInfoHeaderFromApiContext ( > FSP_GLOBAL_DATA *FspData; >=20 > FspData =3D GetFspGlobalDataPointer (); > - return (FSP_INFO_HEADER *)(*(UINT32 *)(UINTN)(FspData->CoreStack + > CONTEXT_STACK_OFFSET (FspInfoHeader))); > + return (FSP_INFO_HEADER *)(*(UINTN *)(FspData->CoreStack + > + CONTEXT_STACK_OFFSET (FspInfoHeader))); > } >=20 > /** > @@ -444,7 +457,7 @@ GetFspCfgRegionDataPointer ( > FSP_INFO_HEADER *FspInfoHeader; >=20 > FspInfoHeader =3D GetFspInfoHeader (); > - return (VOID *)(FspInfoHeader->ImageBase + FspInfoHeader- > >CfgRegionOffset); > + return (VOID *)(UINTN)(FspInfoHeader->ImageBase + > + FspInfoHeader->CfgRegionOffset); > } >=20 > /** > -- > 2.16.2.windows.1