0001
0002
0003
0004
0005 #include <asm/fpu/api.h>
0006
0007
0008
0009
0010
0011 static double __initdata x = 4195835.0;
0012 static double __initdata y = 3145727.0;
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 void __init fpu__init_check_bugs(void)
0026 {
0027 s32 fdiv_bug;
0028
0029
0030 if (!boot_cpu_has(X86_FEATURE_FPU))
0031 return;
0032
0033 kernel_fpu_begin();
0034
0035
0036
0037
0038
0039
0040
0041 __asm__("fninit\n\t"
0042 "fldl %1\n\t"
0043 "fdivl %2\n\t"
0044 "fmull %2\n\t"
0045 "fldl %1\n\t"
0046 "fsubp %%st,%%st(1)\n\t"
0047 "fistpl %0\n\t"
0048 "fwait\n\t"
0049 "fninit"
0050 : "=m" (*&fdiv_bug)
0051 : "m" (*&x), "m" (*&y));
0052
0053 kernel_fpu_end();
0054
0055 if (fdiv_bug) {
0056 set_cpu_bug(&boot_cpu_data, X86_BUG_FDIV);
0057 pr_warn("Hmm, FPU with FDIV bug\n");
0058 }
0059 }