|
Lines 11-16
Link Here
|
| 11 |
#include <linux/config.h> |
11 |
#include <linux/config.h> |
| 12 |
#include <linux/sched.h> |
12 |
#include <linux/sched.h> |
| 13 |
#include <linux/init.h> |
13 |
#include <linux/init.h> |
|
|
14 |
#include <linux/kernel_stat.h> |
| 14 |
#include <asm/processor.h> |
15 |
#include <asm/processor.h> |
| 15 |
#include <asm/i387.h> |
16 |
#include <asm/i387.h> |
| 16 |
#include <asm/math_emu.h> |
17 |
#include <asm/math_emu.h> |
|
Lines 70-77
void init_fpu(void)
Link Here
|
| 70 |
static inline void __save_init_fpu( struct task_struct *tsk ) |
71 |
static inline void __save_init_fpu( struct task_struct *tsk ) |
| 71 |
{ |
72 |
{ |
| 72 |
if ( cpu_has_fxsr ) { |
73 |
if ( cpu_has_fxsr ) { |
| 73 |
asm volatile( "fxsave %0 ; fnclex" |
74 |
asm volatile( "fxsave %0" |
| 74 |
: "=m" (tsk->thread.i387.fxsave) ); |
75 |
: "=m" (tsk->thread.i387.fxsave) ); |
|
|
76 |
if (tsk->thread.i387.fxsave.swd & (1<<7)) |
| 77 |
asm volatile("fnclex"); |
| 78 |
/* AMD CPUs leak F?P. Clear it here */ |
| 79 |
asm volatile("ffree %%st(7) ; fildl %0" :: "m" (kstat.context_swtch)); |
| 75 |
} else { |
80 |
} else { |
| 76 |
asm volatile( "fnsave %0 ; fwait" |
81 |
asm volatile( "fnsave %0 ; fwait" |
| 77 |
: "=m" (tsk->thread.i387.fsave) ); |
82 |
: "=m" (tsk->thread.i387.fsave) ); |