VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/Ia32/InitializeFpu.nasm

最後變更 在這個檔案是 101291,由 vboxsync 提交於 18 月 前

EFI/FirmwareNew: Make edk2-stable202308 build on all supported platforms (using gcc at least, msvc not tested yet), bugref:4643

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:mime-type 設為 text/x-asm
檔案大小: 1.6 KB
 
1;------------------------------------------------------------------------------
2;*
3;* Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
4;* SPDX-License-Identifier: BSD-2-Clause-Patent
5;*
6;*
7;------------------------------------------------------------------------------
8
9 SECTION .rodata
10
11;
12; Float control word initial value:
13; all exceptions masked, double-precision, round-to-nearest
14;
15mFpuControlWord: DW 0x27F
16;
17; Multimedia-extensions control word:
18; all exceptions masked, round-to-nearest, flush to zero for masked underflow
19;
20mMmxControlWord: DD 0x1F80
21
22 SECTION .text
23
24;
25; Initializes floating point units for requirement of UEFI specification.
26;
27; This function initializes floating-point control word to 0x027F (all exceptions
28; masked,double-precision, round-to-nearest) and multimedia-extensions control word
29; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
30; for masked underflow).
31;
32global ASM_PFX(InitializeFloatingPointUnits)
33ASM_PFX(InitializeFloatingPointUnits):
34
35 push ebx
36
37 ;
38 ; Initialize floating point units
39 ;
40 finit
41 fldcw [mFpuControlWord]
42
43 ;
44 ; Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test
45 ; whether the processor supports SSE instruction.
46 ;
47 mov eax, 1
48 cpuid
49 bt edx, 25
50 jnc Done
51
52 ;
53 ; Set OSFXSR bit 9 in CR4
54 ;
55 mov eax, cr4
56 or eax, BIT9
57 mov cr4, eax
58
59 ;
60 ; The processor should support SSE instruction and we can use
61 ; ldmxcsr instruction
62 ;
63 ldmxcsr [mMmxControlWord]
64Done:
65 pop ebx
66
67 ret
68
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette