From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 1DB991A1E10 for ; Mon, 1 Aug 2016 10:52:11 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 01 Aug 2016 10:52:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,456,1464678000"; d="scan'208";a="1006460142" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga001.jf.intel.com with ESMTP; 01 Aug 2016 10:52:12 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Aug 2016 10:52:10 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.118]) by ORSMSX151.amr.corp.intel.com ([169.254.7.179]) with mapi id 14.03.0248.002; Mon, 1 Aug 2016 10:52:10 -0700 From: "Ma, Maurice" To: "Yarlagadda, Satya P" CC: "Yao, Jiewen" , "Mudusuru, Giri P" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically Thread-Index: AQHR6+m2a1gjg8hkmEOHFhgVof58sKA0YieA Date: Mon, 1 Aug 2016 17:52:10 +0000 Message-ID: <7AAC936950815649B5F88FAE785306C284133F3D@ORSMSX113.amr.corp.intel.com> References: <20160801114134.7912-1-satya.p.yarlagadda@intel.com> In-Reply-To: <20160801114134.7912-1-satya.p.yarlagadda@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTgyMmU0ODYtY2E3Ny00YjFiLWFjYmUtNDEyZjBlNGUyNTE1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkpKQlhYekhMXC9uclFqK2JRZXpDakRLNmhIdEp2c25DRGx3ZWNzOGhnWE5rPSJ9 x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 17:52:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It looks good to me.=20 Reviewed by: Maurice Ma Regards, Maurice -----Original Message----- From: Yarlagadda, Satya P=20 Sent: Monday, August 01, 2016 4:42 AM To: edk2-devel@lists.01.org Cc: Ma, Maurice; Yao, Jiewen; Mudusuru, Giri P Subject: [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically we need to locate the FSP Info Header by calculating offset dynamically to = handle the scenario of FSP component is being rebased to different location= . Cc: Maurice Ma Cc: Jiewen Yao Cc: Giri P Mudusuru Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Satya Yarlagadda --- IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm b/IntelFsp2Pkg/Fsp= SecCore/Ia32/FspHelper.nasm index 00e953b..7d5fa5e 100644 --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm @@ -14,22 +14,22 @@ SECTION .text =20 global ASM_PFX(FspInfoHeaderRelativeOff) -ASM_PFX(FspInfoHeaderRelativeOff): - ; - ; This value will be pached by the build script - ; - DD 0x12345678 =20 global ASM_PFX(AsmGetFspBaseAddress) ASM_PFX(AsmGetFspBaseAddress): - mov eax, ASM_PFX(AsmGetFspInfoHeader) - sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] + call ASM_PFX(AsmGetFspInfoHeader) add eax, 0x1C mov eax, dword [eax] ret =20 global ASM_PFX(AsmGetFspInfoHeader) ASM_PFX(AsmGetFspInfoHeader): - mov eax, ASM_PFX(AsmGetFspInfoHeader) - sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] + call ASM_PFX(NextInstruction) +ASM_PFX(NextInstruction): + pop eax + sub eax, ASM_PFX(NextInstruction) + add eax, ASM_PFX(AsmGetFspInfoHeader) + ;sub eax, 012345678h + DB 02Dh +ASM_PFX(FspInfoHeaderRelativeOff): DD 0x12345678 ret -- 2.9.2.windows.1