]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.S
Fix stray charcter in comment.
[mirror_edk2.git] / UefiCpuPkg / Library / BaseUefiCpuLib / X64 / InitializeFpu.S
CommitLineData
989322c3 1#------------------------------------------------------------------------------
2#*
3#* Copyright 2009, Intel Corporation
4#* All rights reserved. This program and the accompanying materials
5#* are licensed and made available under the terms and conditions of the BSD License
6#* which accompanies this distribution. The full text of the license may be found at
7#* http://opensource.org/licenses/bsd-license.php
8#*
9#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11#*
12#*
13#------------------------------------------------------------------------------
14
15
16#\r
17# Float control word initial value: \r
18# all exceptions masked, double-precision, round-to-nearest\r
19#\r
20ASM_PFX(mFpuControlWord): .word 0x027F\r
21#\r
22# Multimedia-extensions control word:\r
23# all exceptions masked, round-to-nearest, flush to zero for masked underflow\r
24#\r
25ASM_PFX(mMmxControlWord): .long 0x01F80\r
26
27#
28# Initializes floating point units for requirement of UEFI specification.\r
29#\r
30# This function initializes floating-point control word to 0x027F (all exceptions\r
31# masked,double-precision, round-to-nearest) and multimedia-extensions control word\r
32# (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero\r
33# for masked underflow).
34#
35ASM_GLOBAL ASM_PFX(InitializeFloatingPointUnits)
36ASM_PFX(InitializeFloatingPointUnits):
37
38 #\r
39 # Initialize floating point units\r
40 #\r
41 finit\r
42 fldcw ASM_PFX(mFpuControlWord)\r
43
44 #
45 # Set OSFXSR bit 9 in CR4
46 #
47 movq %cr4, %rax
48 or $200, %rax
49 movq %rax, %cr4
50
51 ldmxcsr ASM_PFX(mMmxControlWord)
52
53 ret
54