Lines Matching refs:fpu
20 #include <asm/fpu/api.h>
21 #include <asm/fpu/xstate.h>
22 #include <asm/fpu/xcr.h>
24 #include <asm/trace/fpu.h>
29 extern void fpu__prepare_read(struct fpu *fpu);
30 extern void fpu__prepare_write(struct fpu *fpu);
31 extern void fpu__save(struct fpu *fpu);
33 extern void fpu__drop(struct fpu *fpu);
35 extern void fpu__clear_user_states(struct fpu *fpu);
36 extern void fpu__clear_all(struct fpu *fpu);
37 extern int fpu__exception_code(struct fpu *fpu, int trap_nr);
104 extern void fpstate_sanitize_xstate(struct fpu *fpu);
200 static inline void copy_fxregs_to_kernel(struct fpu *fpu)
203 asm volatile( "fxsave %[fx]" : [fx] "=m" (fpu->state.fxsave));
205 asm volatile("fxsaveq %[fx]" : [fx] "=m" (fpu->state.fxsave));
405 extern int copy_fpregs_to_fpstate(struct fpu *fpu);
443 DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
447 * valid if the fpu->last_cpu matches the CPU, and the fpu_fpregs_owner_ctx
467 static inline void __fpu_invalidate_fpregs_state(struct fpu *fpu)
469 fpu->last_cpu = -1;
472 static inline int fpregs_state_valid(struct fpu *fpu, unsigned int cpu)
474 return fpu == this_cpu_read(fpu_fpregs_owner_ctx) && cpu == fpu->last_cpu;
481 static inline void fpregs_deactivate(struct fpu *fpu)
484 trace_x86_fpu_regs_deactivated(fpu);
487 static inline void fpregs_activate(struct fpu *fpu)
489 this_cpu_write(fpu_fpregs_owner_ctx, fpu);
490 trace_x86_fpu_regs_activated(fpu);
498 struct fpu *fpu = ¤t->thread.fpu;
504 if (!fpregs_state_valid(fpu, cpu)) {
505 copy_kernel_to_fpregs(&fpu->state);
506 fpregs_activate(fpu);
507 fpu->last_cpu = cpu;
536 struct fpu *old_fpu = &prev->thread.fpu;
561 struct fpu *next_fpu = &next->thread.fpu;