public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
To: edk2-devel@lists.01.org
Cc: Maurice Ma <maurice.ma@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Giri P Mudusuru <giri.p.mudusuru@intel.com>
Subject: [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically
Date: Mon,  1 Aug 2016 17:11:34 +0530	[thread overview]
Message-ID: <20160801114134.7912-1-satya.p.yarlagadda@intel.com> (raw)

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>
---
 IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
index 00e953b..7d5fa5e 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
@@ -14,22 +14,22 @@
     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)
+   ;sub   eax, 012345678h
+   DB    02Dh
+ASM_PFX(FspInfoHeaderRelativeOff):    DD    0x12345678
    ret
-- 
2.9.2.windows.1



             reply	other threads:[~2016-08-01 11:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 11:41 Satya Yarlagadda [this message]
2016-08-01 17:52 ` [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically Ma, Maurice
2016-08-01 18:06 ` Mudusuru, Giri P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160801114134.7912-1-satya.p.yarlagadda@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox