Revision: 17496
          http://sourceforge.net/p/edk2/code/17496
Author:   jyao1
Date:     2015-05-22 07:49:34 +0000 (Fri, 22 May 2015)
Log Message:
-----------
IntelFspPkg/FspSecCore add AsmGetFspBaseAddressNoStack and 
AsmGetFspInfoHeaderNoStack

Fix GCC issue on FspInfoHeaderRelativeOff.
Clean up comments for platform ID matching on Microcode and 
PcdFspBootFirmwareVolumeBase

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <[email protected]>
Reviewed-by: "Rangarajan, Ravi P" <[email protected]>
Reviewed-by: "Mudusuru, Giri P" <[email protected]>
Reviewed-by: "Ma, Maurice" <[email protected]>

Modified Paths:
--------------
    trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.asm
    trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.s
    trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.asm
    trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.s

Modified: trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.asm
===================================================================
--- trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.asm      2015-05-22 
06:53:44 UTC (rev 17495)
+++ trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.asm      2015-05-22 
07:49:34 UTC (rev 17496)
@@ -143,8 +143,8 @@
    mov   ecx, MSR_IA32_PLATFORM_ID
    rdmsr
    mov   ecx, edx
-   shr   ecx, 50-32
-   and   ecx, 7h
+   shr   ecx, 50-32                          ; shift (50d-32d=18d=0x12) bits
+   and   ecx, 7h                             ; platform id at bit[52..50]
    mov   edx, 1
    shl   edx, cl
 
@@ -569,7 +569,7 @@
   ;
   ; Pass BFV into the PEI Core
   ; It uses relative address to calucate the actual boot FV base
-  ; For FSP impleantion with single FV, PcdFlashFvRecoveryBase and
+  ; For FSP implementation with single FV, PcdFspBootFirmwareVolumeBase and
   ; PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,
   ; they are different. The code below can handle both cases.
   ;

Modified: trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.s
===================================================================
--- trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.s        2015-05-22 
06:53:44 UTC (rev 17495)
+++ trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspApiEntry.s        2015-05-22 
07:49:34 UTC (rev 17496)
@@ -297,8 +297,8 @@
    movl   $MSR_IA32_PLATFORM_ID, %ecx
    rdmsr
    movl   %edx, %ecx
-   shrl   $0x12, %ecx                        #($50-$32)
-   andl   $0x07, %ecx
+   shrl   $0x12, %ecx                        # shift (50d-32d=18d=0x12) bits
+   andl   $0x07, %ecx                        # platform id at bit[52..50]
    movl   $0x01, %edx
    shll   %cl,%edx
 
@@ -784,7 +784,7 @@
   #
   # Pass BFV into the PEI Core
   # It uses relative address to calucate the actual boot FV base
-  # For FSP impleantion with single FV, PcdFlashFvRecoveryBase and
+  # For FSP implementation with single FV, PcdFspBootFirmwareVolumeBase and
   # PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,
   # they are different. The code below can handle both cases.
   #

Modified: trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.asm
===================================================================
--- trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.asm        2015-05-22 
06:53:44 UTC (rev 17495)
+++ trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.asm        2015-05-22 
07:49:34 UTC (rev 17496)
@@ -15,6 +15,10 @@
     .model  flat,C
     .code
 
+;
+; FspInfoHeaderRelativeOff is patched during build process and initialized to 
offset of the  AsmGetFspBaseAddress 
+; from the FSP Info header. 
+;
 FspInfoHeaderRelativeOff    PROC      NEAR    PUBLIC
    ;
    ; This value will be pached by the build script
@@ -22,6 +26,11 @@
    DD    012345678h
 FspInfoHeaderRelativeOff    ENDP
 
+;
+; Returns FSP Base Address. 
+;
+; This function gets the FSP Info Header using relative addressing and returns 
the FSP Base from the header structure
+;
 AsmGetFspBaseAddress        PROC      NEAR    PUBLIC
    mov   eax, AsmGetFspBaseAddress
    sub   eax, dword ptr [FspInfoHeaderRelativeOff]
@@ -30,10 +39,35 @@
    ret
 AsmGetFspBaseAddress        ENDP
 
+;
+; No stack counter part of AsmGetFspBaseAddress. Return address is in edi.
+;
+AsmGetFspBaseAddressNoStack    PROC      NEAR    PUBLIC
+   mov   eax, AsmGetFspBaseAddress
+   sub   eax, dword ptr [FspInfoHeaderRelativeOff]
+   add   eax, 01Ch   
+   mov   eax, dword ptr [eax]
+   jmp   edi
+AsmGetFspBaseAddressNoStack    ENDP
+
+;
+; Returns FSP Info Header. 
+;
+; This function gets the FSP Info Header using relative addressing and returns 
it
+;
 AsmGetFspInfoHeader         PROC      NEAR    PUBLIC
    mov   eax, AsmGetFspBaseAddress
    sub   eax, dword ptr [FspInfoHeaderRelativeOff]
    ret
 AsmGetFspInfoHeader         ENDP
 
+;
+; No stack counter part of AsmGetFspInfoHeader. Return address is in edi.
+;
+AsmGetFspInfoHeaderNoStack         PROC      NEAR    PUBLIC
+   mov   eax, AsmGetFspBaseAddress
+   sub   eax, dword ptr [FspInfoHeaderRelativeOff]
+   jmp   edi
+AsmGetFspInfoHeaderNoStack         ENDP
+
      END
\ No newline at end of file

Modified: trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.s
===================================================================
--- trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.s  2015-05-22 06:53:44 UTC 
(rev 17495)
+++ trunk/edk2/IntelFspPkg/FspSecCore/Ia32/FspHelper.s  2015-05-22 07:49:34 UTC 
(rev 17496)
@@ -15,6 +15,10 @@
 #
 #------------------------------------------------------------------------------
 
+#
+# FspInfoHeaderRelativeOff is patched during build process and initialized to 
offset of the  AsmGetFspBaseAddress 
+# from the FSP Info header. 
+#
 ASM_GLOBAL ASM_PFX(FspInfoHeaderRelativeOff)
 ASM_PFX(FspInfoHeaderRelativeOff):
    #
@@ -22,17 +26,46 @@
    #
    .long    0x012345678
 
-
+#
+# Returns FSP Base Address. 
+#
+# This function gets the FSP Info Header using relative addressing and returns 
the FSP Base from the header structure
+#
 ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddress)
 ASM_PFX(AsmGetFspBaseAddress):
    mov    $AsmGetFspBaseAddress, %eax
-   sub    $FspInfoHeaderRelativeOff, %eax
+   sub    FspInfoHeaderRelativeOff, %eax
    add    $0x01C, %eax
    mov    (%eax), %eax
    ret
 
+#
+# No stack counter part of AsmGetFspBaseAddress. Return address is in edi.
+#
+ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddressNoStack)
+ASM_PFX(AsmGetFspBaseAddressNoStack):
+   mov    $AsmGetFspBaseAddress, %eax
+   sub    FspInfoHeaderRelativeOff, %eax
+   add    $0x01C, %eax 
+   mov    (%eax), %eax
+   jmp    *%edi
+
+#
+# Returns FSP Info Header. 
+#
+# This function gets the FSP Info Header using relative addressing and returns 
it
+#
 ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeader)
 ASM_PFX(AsmGetFspInfoHeader):
    mov    $AsmGetFspBaseAddress, %eax
-   sub    $FspInfoHeaderRelativeOff, %eax
+   sub    FspInfoHeaderRelativeOff, %eax
    ret
+   
+#
+# No stack counter part of AsmGetFspInfoHeader. Return address is in edi.
+#
+ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeaderNoStack)
+ASM_PFX(AsmGetFspInfoHeaderNoStack):
+   mov    $AsmGetFspBaseAddress, %eax
+   sub    FspInfoHeaderRelativeOff, %eax
+   jmp    *%edi


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to