public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelFsp2Pkg/FspSecCore: Make FSP funcitons position independent
@ 2016-10-13  1:03 Maurice Ma
  2016-10-13  1:56 ` Mudusuru, Giri P
  0 siblings, 1 reply; 3+ messages in thread
From: Maurice Ma @ 2016-10-13  1:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Maurice Ma, Jiewen Yao, Giri P Mudusuru

The current AsmGetFspInfoHeader function in FspHeader.nasm is
position dependent code since it uses absolute address. Change
to use relative address instead to make it position independent.

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: Maurice Ma <maurice.ma@intel.com>
---
 IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
index a848dcbc0298..ad631943e32d 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
@@ -31,7 +31,7 @@ ASM_PFX(NextInstruction):
    pop   eax
    sub   eax, ASM_PFX(NextInstruction)
    add   eax, ASM_PFX(AsmGetFspInfoHeader)
-   sub   eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)]
+   sub   eax, dword [eax - ASM_PFX(AsmGetFspInfoHeader) + ASM_PFX(FspInfoHeaderRelativeOff)]
    ret
 
 global ASM_PFX(AsmGetFspInfoHeaderNoStack)
-- 
1.9.5.msysgit.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-13  4:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13  1:03 [PATCH] IntelFsp2Pkg/FspSecCore: Make FSP funcitons position independent Maurice Ma
2016-10-13  1:56 ` Mudusuru, Giri P
2016-10-13  4:02   ` Ma, Maurice

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox