public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically
@ 2016-08-01 11:41 Satya Yarlagadda
  2016-08-01 17:52 ` Ma, Maurice
  2016-08-01 18:06 ` Mudusuru, Giri P
  0 siblings, 2 replies; 3+ messages in thread
From: Satya Yarlagadda @ 2016-08-01 11:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Maurice Ma, Jiewen Yao, Giri P Mudusuru

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



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

* Re: [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically
  2016-08-01 11:41 [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically Satya Yarlagadda
@ 2016-08-01 17:52 ` Ma, Maurice
  2016-08-01 18:06 ` Mudusuru, Giri P
  1 sibling, 0 replies; 3+ messages in thread
From: Ma, Maurice @ 2016-08-01 17:52 UTC (permalink / raw)
  To: Yarlagadda, Satya P
  Cc: Yao, Jiewen, Mudusuru, Giri P, edk2-devel@lists.01.org

It looks good to me. 
Reviewed by: Maurice Ma <maurice.ma@intel.com>

Regards,
Maurice

-----Original Message-----
From: Yarlagadda, Satya P 
Sent: Monday, August 01, 2016 4:42 AM
To: edk2-devel@lists.01.org
Cc: Ma, Maurice; Yao, Jiewen; Mudusuru, Giri P
Subject: [PATCH] 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>
---
 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



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

* Re: [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically
  2016-08-01 11:41 [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically Satya Yarlagadda
  2016-08-01 17:52 ` Ma, Maurice
@ 2016-08-01 18:06 ` Mudusuru, Giri P
  1 sibling, 0 replies; 3+ messages in thread
From: Mudusuru, Giri P @ 2016-08-01 18:06 UTC (permalink / raw)
  To: Yarlagadda, Satya P, edk2-devel@lists.01.org; +Cc: Ma, Maurice, Yao, Jiewen

Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> 

Please update the comments for the opcode to be in line similar to the https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm 

Thanks,
-Giri

> -----Original Message-----
> From: Yarlagadda, Satya P
> Sent: Monday, August 1, 2016 4:42 AM
> To: edk2-devel@lists.01.org
> Cc: Ma, Maurice <maurice.ma@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Mudusuru, Giri P <giri.p.mudusuru@intel.com>
> Subject: [PATCH] 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>
> ---
>  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



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

end of thread, other threads:[~2016-08-01 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-01 11:41 [PATCH] IntelFsp2Pkg: Locate FSP Info Header dynamically Satya Yarlagadda
2016-08-01 17:52 ` Ma, Maurice
2016-08-01 18:06 ` Mudusuru, Giri P

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