From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id D6D2E1A1DFE for ; Wed, 17 Aug 2016 22:21:13 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 17 Aug 2016 22:21:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,537,1464678000"; d="scan'208";a="157570409" Received: from sprasa6-desk1.gar.corp.intel.com ([10.223.22.112]) by fmsmga004.fm.intel.com with ESMTP; 17 Aug 2016 22:21:12 -0700 From: Satya Yarlagadda To: edk2-devel@lists.01.org Cc: Maurice Ma , Jiewen Yao , Giri P Mudusuru Date: Thu, 18 Aug 2016 10:50:31 +0530 Message-Id: <20160818052031.14576-1-satya.p.yarlagadda@intel.com> X-Mailer: git-send-email 2.9.2.windows.1 Subject: [PATCH] IntelFsp2Pkg: Add function to get FspInfoHeader before stack is ready 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: Thu, 18 Aug 2016 05:21:14 -0000 we need to locate the FSP Info Header before the stack is initialized to access the cfg region for any UPD. Hence adding the AsmGetFspInfoHeaderNoStack function to support it. Note: This function is there in IntelFspPkg but got removed in IntelFsp2Pkg 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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm index 43eac97..a848dcb 100644 --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm @@ -14,6 +14,8 @@ SECTION .text global ASM_PFX(FspInfoHeaderRelativeOff) +ASM_PFX(FspInfoHeaderRelativeOff): + DD 0x12345678 ; This value must be patched by the build script global ASM_PFX(AsmGetFspBaseAddress) ASM_PFX(AsmGetFspBaseAddress): @@ -29,6 +31,11 @@ ASM_PFX(NextInstruction): pop eax sub eax, ASM_PFX(NextInstruction) add eax, ASM_PFX(AsmGetFspInfoHeader) - DB 02Dh ; opcode of sub eax, imm32 -ASM_PFX(FspInfoHeaderRelativeOff): DD 0x12345678 ; sub eax, FspInfoHeaderRelativeOff + sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] ret + +global ASM_PFX(AsmGetFspInfoHeaderNoStack) +ASM_PFX(AsmGetFspInfoHeaderNoStack): + mov eax, ASM_PFX(AsmGetFspInfoHeader) + sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] + jmp edi -- 2.9.2.windows.1