Lines Matching refs:fpu

24 extern void fpu__activate_curr(struct fpu *fpu);
25 extern void fpu__activate_fpstate_read(struct fpu *fpu);
26 extern void fpu__activate_fpstate_write(struct fpu *fpu);
27 extern void fpu__save(struct fpu *fpu);
28 extern void fpu__restore(struct fpu *fpu);
30 extern void fpu__drop(struct fpu *fpu);
31 extern int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu);
32 extern void fpu__clear(struct fpu *fpu);
33 extern int fpu__exception_code(struct fpu *fpu, int trap_nr);
95 extern void fpstate_sanitize_xstate(struct fpu *fpu);
186 static inline void copy_fxregs_to_kernel(struct fpu *fpu) in copy_fxregs_to_kernel() argument
189 asm volatile( "fxsave %[fx]" : [fx] "=m" (fpu->state.fxsave)); in copy_fxregs_to_kernel()
191 asm volatile("fxsaveq %[fx]" : [fx] "=m" (fpu->state.fxsave)); in copy_fxregs_to_kernel()
215 : "=m" (fpu->state.fxsave) in copy_fxregs_to_kernel()
216 : [fx] "R" (&fpu->state.fxsave)); in copy_fxregs_to_kernel()
429 static inline int copy_fpregs_to_fpstate(struct fpu *fpu) in copy_fpregs_to_fpstate() argument
432 copy_xregs_to_kernel(&fpu->state.xsave); in copy_fpregs_to_fpstate()
437 copy_fxregs_to_kernel(fpu); in copy_fpregs_to_fpstate()
445 asm volatile("fnsave %[fp]; fwait" : [fp] "=m" (fpu->state.fsave)); in copy_fpregs_to_fpstate()
486 DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
500 static inline int fpu_want_lazy_restore(struct fpu *fpu, unsigned int cpu) in fpu_want_lazy_restore() argument
502 return fpu == this_cpu_read_stable(fpu_fpregs_owner_ctx) && cpu == fpu->last_cpu; in fpu_want_lazy_restore()
524 static inline void __fpregs_deactivate(struct fpu *fpu) in __fpregs_deactivate() argument
526 WARN_ON_FPU(!fpu->fpregs_active); in __fpregs_deactivate()
528 fpu->fpregs_active = 0; in __fpregs_deactivate()
533 static inline void __fpregs_activate(struct fpu *fpu) in __fpregs_activate() argument
535 WARN_ON_FPU(fpu->fpregs_active); in __fpregs_activate()
537 fpu->fpregs_active = 1; in __fpregs_activate()
538 this_cpu_write(fpu_fpregs_owner_ctx, fpu); in __fpregs_activate()
553 return current->thread.fpu.fpregs_active; in fpregs_active()
563 static inline void fpregs_activate(struct fpu *fpu) in fpregs_activate() argument
566 __fpregs_activate(fpu); in fpregs_activate()
569 static inline void fpregs_deactivate(struct fpu *fpu) in fpregs_deactivate() argument
571 __fpregs_deactivate(fpu); in fpregs_deactivate()
590 switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu) in switch_fpu_prepare()
592 fpu_switch_t fpu; in switch_fpu_prepare() local
598 fpu.preload = new_fpu->fpstate_active && in switch_fpu_prepare()
611 if (fpu.preload) { in switch_fpu_prepare()
621 if (fpu.preload) { in switch_fpu_prepare()
624 fpu.preload = 0; in switch_fpu_prepare()
630 return fpu; in switch_fpu_prepare()
643 static inline void switch_fpu_finish(struct fpu *new_fpu, fpu_switch_t fpu_switch) in switch_fpu_finish()
659 struct fpu *fpu = &current->thread.fpu; in user_fpu_begin() local
663 fpregs_activate(fpu); in user_fpu_begin()