Invoke InitializeFloatingPointUnits() to initialize FPU per UEFI specification
before call C function in assembly code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17993
6f19259b-4bc3-4df7-8a09-
765794883524
#include <Library/BaseLib.h>
#include <Library/HobLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/BaseLib.h>
#include <Library/HobLib.h>
#include <Library/PeimEntryPoint.h>
+#include <Library/UefiCpuLib.h>
BaseLib
HobLib
PeimEntryPoint
BaseLib
HobLib
PeimEntryPoint
.model flat
include MpEqu.inc
.model flat
include MpEqu.inc
+InitializeFloatingPointUnits PROTO C
+ mov eax, InitializeFloatingPointUnits
+ call eax ; Call assembly function to initialize FPU per UEFI spec
push ebx ; Push NumApsExecuting
mov eax, esi
push ebx ; Push NumApsExecuting
mov eax, esi
;-------------------------------------------------------------------------------
%include "MpEqu.inc"
;-------------------------------------------------------------------------------
%include "MpEqu.inc"
+extern ASM_PFX(InitializeFloatingPointUnits)
+ mov eax, ASM_PFX(InitializeFloatingPointUnits)
+ call eax ; Call assembly function to initialize FPU per UEFI spec
push ebx ; Push NumApsExecuting
mov eax, esi
push ebx ; Push NumApsExecuting
mov eax, esi
;-------------------------------------------------------------------------------
include MpEqu.inc
;-------------------------------------------------------------------------------
include MpEqu.inc
+extern InitializeFloatingPointUnits:PROC
+
.code
;-------------------------------------------------------------------------------------
;RendezvousFunnelProc procedure follows. All APs execute their procedure. This
.code
;-------------------------------------------------------------------------------------
;RendezvousFunnelProc procedure follows. All APs execute their procedure. This
+ mov rax, InitializeFloatingPointUnits
+ sub rsp, 20h
+ call rax ; Call assembly function to initialize FPU per UEFI spec
+ add rsp, 20h
mov edx, ebx ; edx is NumApsExecuting
mov ecx, esi
mov edx, ebx ; edx is NumApsExecuting
mov ecx, esi
;-------------------------------------------------------------------------------
%include "MpEqu.inc"
;-------------------------------------------------------------------------------
%include "MpEqu.inc"
+extern ASM_PFX(InitializeFloatingPointUnits)
+ mov rax, ASM_PFX(InitializeFloatingPointUnits)
+ sub rsp, 20h
+ call rax ; Call assembly function to initialize FPU per UEFI spec
+ add rsp, 20h
mov edx, ebx ; edx is NumApsExecuting
mov ecx, esi
mov edx, ebx ; edx is NumApsExecuting
mov ecx, esi