]>
Commit | Line | Data |
---|---|---|
7798fb83 HT |
1 | #------------------------------------------------------------------------------\r |
2 | #*\r | |
3 | #* Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r | |
4 | #* This program and the accompanying materials\r | |
5 | #* are licensed and made available under the terms and conditions of the BSD License\r | |
6 | #* which accompanies this distribution. The full text of the license may be found at\r | |
7 | #* http://opensource.org/licenses/bsd-license.php\r | |
8 | #*\r | |
9 | #* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | #* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | #*\r | |
12 | #*\r | |
13 | #------------------------------------------------------------------------------\r | |
14 | \r | |
15 | #\r | |
16 | # Initializes floating point units for requirement of UEFI specification.\r | |
17 | #\r | |
18 | # This function initializes floating-point control word to 0x037F (all exceptions\r | |
19 | # masked,double-extended-precision, round-to-nearest) and multimedia-extensions control word\r | |
20 | # (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero\r | |
21 | # for masked underflow).\r | |
22 | #\r | |
23 | ASM_GLOBAL ASM_PFX(InitializeFloatingPointUnits)\r | |
24 | ASM_PFX(InitializeFloatingPointUnits):\r | |
25 | \r | |
26 | #\r | |
27 | # Initialize floating point units\r | |
28 | #\r | |
29 | finit\r | |
30 | \r | |
31 | #\r | |
32 | # Float control word initial value: \r | |
33 | # all exceptions masked, double-precision, round-to-nearest\r | |
34 | #\r | |
35 | pushq $0x037F\r | |
36 | lea (%rsp), %rax \r | |
37 | fldcw (%rax)\r | |
38 | popq %rax\r | |
39 | \r | |
40 | #\r | |
41 | # Set OSFXSR bit 9 in CR4\r | |
42 | #\r | |
43 | movq %cr4, %rax \r | |
44 | or $0x200, %rax\r | |
45 | movq %rax, %cr4\r | |
46 | \r | |
47 | #\r | |
48 | # Multimedia-extensions control word:\r | |
49 | # all exceptions masked, round-to-nearest, flush to zero for masked underflow\r | |
50 | # \r | |
51 | pushq $0x01F80\r | |
52 | lea (%rsp), %rax\r | |
53 | ldmxcsr (%rax)\r | |
54 | popq %rax\r | |
55 | \r | |
56 | ret\r | |
57 | \r |