Commit d43c6e80 authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

[PATCH] i386: move SIMD initialization

Move some code unrelated to any dealing with hardware bugs from i386's
bugs.h to a more logical place.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e43d674f
...@@ -1098,6 +1098,28 @@ void __init trap_init(void) ...@@ -1098,6 +1098,28 @@ void __init trap_init(void)
#endif #endif
set_trap_gate(19,&simd_coprocessor_error); set_trap_gate(19,&simd_coprocessor_error);
if (cpu_has_fxsr) {
/*
* Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
* Generates a compile-time "error: zero width for bit-field" if
* the alignment is wrong.
*/
struct fxsrAlignAssert {
int _:!(offsetof(struct task_struct,
thread.i387.fxsave) & 15);
};
printk(KERN_INFO "Enabling fast FPU save and restore... ");
set_in_cr4(X86_CR4_OSFXSR);
printk("done.\n");
}
if (cpu_has_xmm) {
printk(KERN_INFO "Enabling unmasked SIMD FPU exception "
"support... ");
set_in_cr4(X86_CR4_OSXMMEXCPT);
printk("done.\n");
}
set_system_gate(SYSCALL_VECTOR,&system_call); set_system_gate(SYSCALL_VECTOR,&system_call);
/* /*
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
* <rreilova@ececs.uc.edu> * <rreilova@ececs.uc.edu>
* - Channing Corn (tests & fixes), * - Channing Corn (tests & fixes),
* - Andrew D. Balsa (code cleanup). * - Andrew D. Balsa (code cleanup).
*
* Pentium III FXSR, SSE support
* Gareth Hughes <gareth@valinux.com>, May 2000
*/ */
/* /*
...@@ -76,25 +73,7 @@ static void __init check_fpu(void) ...@@ -76,25 +73,7 @@ static void __init check_fpu(void)
return; return;
} }
/* Enable FXSR and company _before_ testing for FP problems. */ /* trap_init() enabled FXSR and company _before_ testing for FP problems here. */
/*
* Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
*/
if (offsetof(struct task_struct, thread.i387.fxsave) & 15) {
extern void __buggy_fxsr_alignment(void);
__buggy_fxsr_alignment();
}
if (cpu_has_fxsr) {
printk(KERN_INFO "Enabling fast FPU save and restore... ");
set_in_cr4(X86_CR4_OSFXSR);
printk("done.\n");
}
if (cpu_has_xmm) {
printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... ");
set_in_cr4(X86_CR4_OSXMMEXCPT);
printk("done.\n");
}
/* Test for the divl bug.. */ /* Test for the divl bug.. */
__asm__("fninit\n\t" __asm__("fninit\n\t"
"fldl %1\n\t" "fldl %1\n\t"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment