From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id 39F681A1E12 for ; Mon, 1 Aug 2016 04:41:55 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 01 Aug 2016 04:41:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,454,1464678000"; d="scan'208";a="1032876593" Received: from sprasa6-desk1.gar.corp.intel.com ([10.223.22.112]) by fmsmga002.fm.intel.com with ESMTP; 01 Aug 2016 04:41:53 -0700 From: Satya Yarlagadda To: edk2-devel@lists.01.org Cc: Maurice Ma , Jiewen Yao , Giri P Mudusuru Date: Mon, 1 Aug 2016 17:11:34 +0530 Message-Id: <20160801114134.7912-1-satya.p.yarlagadda@intel.com> X-Mailer: git-send-email 2.9.2.windows.1 Subject: [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 11:41:55 -0000 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/FspSecCore/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 global ASM_PFX(FspInfoHeaderRelativeOff) -ASM_PFX(FspInfoHeaderRelativeOff): - ; - ; This value will be pached by the build script - ; - DD 0x12345678 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 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