"fnclex\n\t"
"emms\n\t"
"fildl %P[addr]" /* set F?P to defined value */
- : : [addr] "m" (fpu->has_fpu));
+ : : [addr] "m" (fpu->fpregs_active));
}
return fpu_restore_checking(fpu);
/* Must be paired with an 'stts' after! */
static inline void __thread_clear_has_fpu(struct fpu *fpu)
{
- fpu->has_fpu = 0;
+ fpu->fpregs_active = 0;
this_cpu_write(fpu_fpregs_owner_ctx, NULL);
}
/* Must be paired with a 'clts' before! */
static inline void __thread_set_has_fpu(struct fpu *fpu)
{
- fpu->has_fpu = 1;
+ fpu->fpregs_active = 1;
this_cpu_write(fpu_fpregs_owner_ctx, fpu);
}
preempt_disable();
fpu->counter = 0;
- if (fpu->has_fpu) {
+ if (fpu->fpregs_active) {
/* Ignore delayed exceptions from user space */
asm volatile("1: fwait\n"
"2:\n"
fpu.preload = new_fpu->fpstate_active &&
(use_eager_fpu() || new_fpu->counter > 5);
- if (old_fpu->has_fpu) {
+ if (old_fpu->fpregs_active) {
if (!fpu_save_init(old_fpu))
old_fpu->last_cpu = -1;
else
old_fpu->last_cpu = cpu;
/* But leave fpu_fpregs_owner_ctx! */
- old_fpu->has_fpu = 0;
+ old_fpu->fpregs_active = 0;
/* Don't change CR0.TS if we just switch! */
if (fpu.preload) {
if (use_eager_fpu())
return true;
- return !current->thread.fpu.has_fpu && (read_cr0() & X86_CR0_TS);
+ return !current->thread.fpu.fpregs_active && (read_cr0() & X86_CR0_TS);
}
/*
kernel_fpu_disable();
- if (fpu->has_fpu) {
+ if (fpu->fpregs_active) {
fpu_save_init(fpu);
} else {
this_cpu_write(fpu_fpregs_owner_ctx, NULL);
{
struct fpu *fpu = ¤t->thread.fpu;
- if (fpu->has_fpu) {
+ if (fpu->fpregs_active) {
if (WARN_ON(restore_fpu_checking(fpu)))
fpu_reset_state(fpu);
} else if (!use_eager_fpu()) {
WARN_ON(fpu != ¤t->thread.fpu);
preempt_disable();
- if (fpu->has_fpu) {
+ if (fpu->fpregs_active) {
if (use_eager_fpu()) {
__save_fpu(fpu);
} else {
int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu)
{
dst_fpu->counter = 0;
- dst_fpu->has_fpu = 0;
+ dst_fpu->fpregs_active = 0;
dst_fpu->state = NULL;
dst_fpu->last_cpu = -1;