Re: [PATCH] IntelFsp2Pkg: Add function to get FspInfoHeader before stack is ready

Yao, Jiewen

Reviewed-by: Jiewen.yao@...

-----Original Message-----
From: Yarlagadda, Satya P
Sent: Thursday, August 18, 2016 1:21 PM
To: edk2-devel@...
Cc: Ma, Maurice <>; Yao, Jiewen
<jiewen.yao@...>; Mudusuru, Giri P <giri.p.mudusuru@...>
Subject: [PATCH] IntelFsp2Pkg: Add function to get FspInfoHeader before
stack is ready

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 <jiewen.yao@...>
Cc: Giri P Mudusuru <giri.p.mudusuru@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@...>
IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/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 @@

global ASM_PFX(FspInfoHeaderRelativeOff)
+ DD 0x12345678 ; This value must be patched by
the build script

global 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)]
+global ASM_PFX(AsmGetFspInfoHeaderNoStack)
+ mov eax, ASM_PFX(AsmGetFspInfoHeader)
+ sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)]
+ jmp edi

Join to automatically receive all group messages.