diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index 3f4fa92fc1..146422c2b5 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -21,6 +21,7 @@ #include #include #include +#include #pragma pack(1) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf index 7cf33d3249..9fb9e945a8 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf @@ -51,6 +51,7 @@ BaseLib HobLib PeimEntryPoint + UefiCpuLib diff --git a/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm b/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm index c8bdc52e95..4dc7191b80 100644 --- a/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm +++ b/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm @@ -22,6 +22,7 @@ .model flat include MpEqu.inc +InitializeFloatingPointUnits PROTO C .code @@ -124,6 +125,8 @@ CProcedureInvoke: push ebp mov ebp, esp + mov eax, InitializeFloatingPointUnits + call eax ; Call assembly function to initialize FPU per UEFI spec push ebx ; Push NumApsExecuting mov eax, esi diff --git a/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm b/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm index 379f13e6db..4a1aa71b8d 100644 --- a/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm +++ b/UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm @@ -19,6 +19,7 @@ ;------------------------------------------------------------------------------- %include "MpEqu.inc" +extern ASM_PFX(InitializeFloatingPointUnits) SECTION .text @@ -114,6 +115,8 @@ CProcedureInvoke: push ebp mov ebp, esp + mov eax, ASM_PFX(InitializeFloatingPointUnits) + call eax ; Call assembly function to initialize FPU per UEFI spec push ebx ; Push NumApsExecuting mov eax, esi diff --git a/UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm b/UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm index 5425547634..425bc202fd 100644 --- a/UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm +++ b/UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm @@ -19,6 +19,8 @@ ;------------------------------------------------------------------------------- include MpEqu.inc +extern InitializeFloatingPointUnits:PROC + .code ;------------------------------------------------------------------------------------- ;RendezvousFunnelProc procedure follows. All APs execute their procedure. This @@ -158,6 +160,10 @@ CProcedureInvoke: push rbp mov rbp, rsp + 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 diff --git a/UefiCpuPkg/CpuMpPei/X64/MpFuncs.nasm b/UefiCpuPkg/CpuMpPei/X64/MpFuncs.nasm index 99669ce95e..3ddf26c29d 100644 --- a/UefiCpuPkg/CpuMpPei/X64/MpFuncs.nasm +++ b/UefiCpuPkg/CpuMpPei/X64/MpFuncs.nasm @@ -19,6 +19,7 @@ ;------------------------------------------------------------------------------- %include "MpEqu.inc" +extern ASM_PFX(InitializeFloatingPointUnits) DEFAULT REL @@ -155,6 +156,10 @@ CProcedureInvoke: push rbp mov rbp, rsp + 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