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 <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
This commit is contained in:
Yarlagadda, Satya P 2016-08-18 13:20:31 +08:00 committed by Jiewen Yao
parent 759be99db5
commit 90fadfc00a
1 changed files with 9 additions and 2 deletions

View File

@ -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