summaryrefslogtreecommitdiffstats
path: root/IntelFsp2Pkg
diff options
context:
space:
mode:
authorYarlagadda, Satya P <satya.p.yarlagadda@intel.com>2016-08-01 19:41:34 +0800
committerHao Wu <hao.a.wu@intel.com>2016-10-31 09:13:07 +0800
commit323f593a6fbcde2c58eb155feb93244851cb519e (patch)
tree261b09b08057bbf9b8b88b20ea6971ecf4927e44 /IntelFsp2Pkg
parent718abfdb45f74ba1229a1268524ae1d2e550e652 (diff)
downloadedk2-323f593a6fbcde2c58eb155feb93244851cb519e.tar.gz
edk2-323f593a6fbcde2c58eb155feb93244851cb519e.tar.bz2
edk2-323f593a6fbcde2c58eb155feb93244851cb519e.zip
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 <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: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> (cherry picked from commit 8265373e60ad79acd4a20affe2c49470c68d6a9c)
Diffstat (limited to 'IntelFsp2Pkg')
-rw-r--r--IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm17
1 files changed, 8 insertions, 9 deletions
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
index 00e953b4f1..43eac973a2 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
@@ -14,22 +14,21 @@
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)
+ DB 02Dh ; opcode of sub eax, imm32
+ASM_PFX(FspInfoHeaderRelativeOff): DD 0x12345678 ; sub eax, FspInfoHeaderRelativeOff
ret