mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
Hopefully initialize FPU properly
svn path=/trunk/; revision=2242
This commit is contained in:
@@ -49,12 +49,18 @@ KiCheckFPU(VOID)
|
||||
|
||||
HardwareMathSupport = 0;
|
||||
|
||||
__asm__("movl %%cr0, %0\n\t" : "=a" (cr0));
|
||||
/* Set NE and MP. */
|
||||
cr0 = cr0 | 22;
|
||||
__asm__("movl %0, %%cr0\n\t" : : "a" (cr0));
|
||||
|
||||
__asm__("clts\n\t");
|
||||
__asm__("fninit\n\t");
|
||||
__asm__("fstsw %0\n\t" : "=a" (status));
|
||||
if (status != 0)
|
||||
{
|
||||
__asm__("movl %%cr0, %0\n\t" : "=a" (cr0));
|
||||
/* Set the EM flag in CR0 so any FPU instructions cause a trap. */
|
||||
cr0 = cr0 | 0x4;
|
||||
__asm__("movl %0, %%cr0\n\t" :
|
||||
: "a" (cr0));
|
||||
|
||||
Reference in New Issue
Block a user