coreboot-kgpe-d16/src/cpu/x86/fpu_enable.inc
Martin Roth d57ace259a AUTHORS: Move src/cpu copyrights into AUTHORS file
As discussed on the mailing list and voted upon, the coreboot project
is going to move the majority of copyrights out of the headers and into
an AUTHORS file.  This will happen a bit at a time, as we'll be unifying
license headers at the same time.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Id6070fb586896653a1e44951a6af8f42f93b5a7b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35184
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-09-10 12:51:22 +00:00

33 lines
1 KiB
PHP

/*
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
__fpu_start:
/* Preserve BIST. */
movl %eax, %ebp
/*
* Clear the CR0[2] bit (the "Emulation" flag, EM).
*
* This indicates that the processor has an (internal or external)
* x87 FPU, i.e. floating point operations will be executed by the
* hardware (and not emulated in software).
*
* Additionally, if this bit is not cleared, MMX/SSE instructions won't
* work, i.e., they will trigger an invalid opcode exception (#UD).
*/
movl %cr0, %eax
andl $~(1 << 2), %eax
movl %eax, %cr0
/* Restore BIST. */
movl %ebp, %eax