summaryrefslogtreecommitdiff
path: root/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm')
-rw-r--r--IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm40
1 files changed, 26 insertions, 14 deletions
diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
index 7dd89c5..cdebe90 100644
--- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
+++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
@@ -21,7 +21,7 @@ extern ASM_PFX(PcdGet32 (PcdFspReservedBufferSize))
; Following functions will be provided in PlatformSecLib
;
extern ASM_PFX(AsmGetFspBaseAddress)
-extern ASM_PFX(AsmGetFspInfoHeader)
+extern ASM_PFX(AsmGetFspInfoHeaderNoStack)
;extern ASM_PFX(LoadMicrocode) ; @todo: needs a weak implementation
extern ASM_PFX(SecPlatformInit) ; @todo: needs a weak implementation
extern ASM_PFX(SecCarInit)
@@ -87,6 +87,14 @@ struc LoadMicrocodeParamsFsp24
.size:
endstruc
+%macro CALL_RDI 1
+
+ mov rdi, %%ReturnAddress
+ jmp %1
+%%ReturnAddress:
+
+%endmacro
+
;
; @todo: The strong/weak implementation does not work.
; This needs to be reviewed later.
@@ -116,8 +124,7 @@ ASM_PFX(LoadMicrocodeDefault):
; Inputs:
; rcx -> LoadMicrocodeParams pointer
; Register Usage:
- ; rsp Preserved
- ; All others destroyed
+ ; All are destroyed
; Assumptions:
; No memory available, stack is hard-coded and used for return address
; Executed by SBSP and NBSP
@@ -420,10 +427,6 @@ ASM_PFX(TempRamInitApi):
ENABLE_SSE
ENABLE_AVX
;
- ; Save Input Parameter in YMM10
- ;
- SAVE_RCX
- ;
; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and YMM6
;
SAVE_REGS
@@ -434,6 +437,22 @@ ASM_PFX(TempRamInitApi):
SAVE_BFV rbp
;
+ ; Save Input Parameter in YMM10
+ ;
+ cmp rcx, 0
+ jnz ParamValid
+
+ ;
+ ; Fall back to default UPD
+ ;
+ CALL_RDI ASM_PFX(AsmGetFspInfoHeaderNoStack)
+ xor rcx, rcx
+ mov ecx, DWORD [rax + 01Ch] ; Read FsptImageBaseAddress
+ add ecx, DWORD [rax + 024h] ; Get Cfg Region base address = FsptImageBaseAddress + CfgRegionOffset
+ParamValid:
+ SAVE_RCX
+
+ ;
; Save timestamp into YMM6
;
rdtsc
@@ -442,13 +461,6 @@ ASM_PFX(TempRamInitApi):
SAVE_TS rax
;
- ; Check Parameter
- ;
- cmp rcx, 0
- mov rcx, 08000000000000002h
- jz TempRamInitExit
-
- ;
; Sec Platform Init
;
CALL_YMM ASM_PFX(SecPlatformInit)