]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuMpPei: Initialize FPU per UEFI specification
authorJeff Fan <jeff.fan@intel.com>
Wed, 15 Jul 2015 03:36:51 +0000 (03:36 +0000)
committervanjeff <vanjeff@Edk2>
Wed, 15 Jul 2015 03:36:51 +0000 (03:36 +0000)
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

UefiCpuPkg/CpuMpPei/CpuMpPei.h
UefiCpuPkg/CpuMpPei/CpuMpPei.inf
UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm
UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm
UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm
UefiCpuPkg/CpuMpPei/X64/MpFuncs.nasm

index 3f4fa92fc1354c55283372af9003cd578a263a5c..146422c2b5b60dcf8532970444bb89062852f66f 100644 (file)
@@ -21,6 +21,7 @@
 #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>
 
 #pragma pack(1)
 
 
 #pragma pack(1)
 
index 7cf33d32496483d1f3a27ea03e3e973b73195214..9fb9e945a8a1d85837c0cfbf7246d04ffae53e42 100644 (file)
@@ -51,6 +51,7 @@
   BaseLib
   HobLib
   PeimEntryPoint
   BaseLib
   HobLib
   PeimEntryPoint
+  UefiCpuLib
 
 
 
 
 
 
index c8bdc52e95ecaea1ca5129e895b7015657ffc636..4dc7191b801bf644223dd9e69510e7a67c587917 100644 (file)
@@ -22,6 +22,7 @@
 .model  flat
 
 include  MpEqu.inc
 .model  flat
 
 include  MpEqu.inc
+InitializeFloatingPointUnits PROTO C
 
 .code
 
 
 .code
 
@@ -124,6 +125,8 @@ CProcedureInvoke:
     push       ebp
     mov        ebp, esp
 
     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
 
     push       ebx               ; Push NumApsExecuting
     mov        eax, esi
index 379f13e6db22fe1808b84035907499f93d6f8c0a..4a1aa71b8d3852da3e7d9a32f3e6b01d116ab3fd 100644 (file)
@@ -19,6 +19,7 @@
 ;-------------------------------------------------------------------------------
 
 %include "MpEqu.inc"
 ;-------------------------------------------------------------------------------
 
 %include "MpEqu.inc"
+extern ASM_PFX(InitializeFloatingPointUnits)
 
 SECTION .text
 
 
 SECTION .text
 
@@ -114,6 +115,8 @@ CProcedureInvoke:
     push       ebp
     mov        ebp, esp
 
     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
 
     push       ebx               ; Push NumApsExecuting
     mov        eax, esi
index 54255476344585a770fb3473f80a681215904c05..425bc202fdea4401d3bd26e6ceb684b7461f3a3d 100644 (file)
@@ -19,6 +19,8 @@
 ;-------------------------------------------------------------------------------
 
 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
@@ -158,6 +160,10 @@ CProcedureInvoke:
     push       rbp
     mov        rbp, rsp
 
     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
 
     mov        edx, ebx          ; edx is NumApsExecuting
     mov        ecx, esi
index 99669ce95ede87b8f8f102b0178d7313967e7b33..3ddf26c29dc7eb6e92c1faf9d738b9f49cc8c071 100644 (file)
@@ -19,6 +19,7 @@
 ;-------------------------------------------------------------------------------
 
 %include "MpEqu.inc"
 ;-------------------------------------------------------------------------------
 
 %include "MpEqu.inc"
+extern ASM_PFX(InitializeFloatingPointUnits)
 
 DEFAULT REL
 
 
 DEFAULT REL
 
@@ -155,6 +156,10 @@ CProcedureInvoke:
     push       rbp
     mov        rbp, rsp
 
     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
 
     mov        edx, ebx          ; edx is NumApsExecuting
     mov        ecx, esi