We do not consider microcode not found as critical error, because Microcode 
might already be already applied or be applied later.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao, Jiewen <[email protected]>
Cc: Ma, Maurice <[email protected]>;
Cc: Rangarajan, Ravi P <[email protected]>
---
 .../Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.S    | 10 ++++++++++
 .../Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.asm  | 12 +++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git 
a/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.S 
b/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.S
index 24bc36b..045f1fb 100644
--- a/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.S
+++ b/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.S
@@ -210,12 +210,22 @@ FspHeaderFound:
   jmp  *%eax
 
 TempRamInitDone:
+  cmp  $0x8000000E, %eax   #Check if EFI_NOT_FOUND returned. Error code for 
Microcode Update not found.
+  je   CallSecFspInit      #If microcode not found, don't hang, but continue.
+
   cmp  $0x0, %eax
   jnz  FspApiFailed
 
   #   ECX: start of range
   #   EDX: end of range
+CallSecFspInit:
+  xorl    %eax, %eax
   movl    %edx, %esp
+
+  # Align the stack at DWORD
+  addl  $3, %esp
+  andl  $0xFFFFFFFC, %esp
+
   pushl   %edx
   pushl   %ecx
   pushl   %eax # zero - no hob list yet
diff --git 
a/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.asm 
b/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.asm
index 0e0c5c5..3c0bca3 100644
--- a/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.asm
+++ b/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.asm
@@ -220,12 +220,22 @@ FspHeaderFound:
   jmp eax
 
 TempRamInitDone:
-  cmp eax, 0
+  cmp eax, 8000000Eh      ;Check if EFI_NOT_FOUND returned. Error code for 
Microcode Update not found.
+  je  CallSecFspInit      ;If microcode not found, don't hang, but continue.
+
+  cmp eax, 0              ;Check if EFI_SUCCESS retuned.
   jnz FspApiFailed
 
   ;   ECX: start of range
   ;   EDX: end of range
+CallSecFspInit:
+  xor     eax, eax
   mov     esp, edx
+
+  ; Align the stack at DWORD
+  add  esp,  3
+  and  esp, 0FFFFFFFCh
+
   push    edx
   push    ecx
   push    eax ; zero - no hob list yet
-- 
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to