1*0a6a1f1dSLionel Sambuc /* $NetBSD: fpu.h,v 1.6 2014/02/25 22:16:52 dsl Exp $ */ 2*0a6a1f1dSLionel Sambuc 3*0a6a1f1dSLionel Sambuc #ifndef _X86_FPU_H_ 4*0a6a1f1dSLionel Sambuc #define _X86_FPU_H_ 5*0a6a1f1dSLionel Sambuc 6*0a6a1f1dSLionel Sambuc #include <x86/cpu_extended_state.h> 7*0a6a1f1dSLionel Sambuc 8*0a6a1f1dSLionel Sambuc #ifdef _KERNEL 9*0a6a1f1dSLionel Sambuc 10*0a6a1f1dSLionel Sambuc struct cpu_info; 11*0a6a1f1dSLionel Sambuc struct lwp; 12*0a6a1f1dSLionel Sambuc struct trapframe; 13*0a6a1f1dSLionel Sambuc 14*0a6a1f1dSLionel Sambuc void fpuinit(struct cpu_info *); 15*0a6a1f1dSLionel Sambuc void fpusave_lwp(struct lwp *, bool); 16*0a6a1f1dSLionel Sambuc void fpusave_cpu(bool); 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel Sambuc void fpu_set_default_cw(struct lwp *, unsigned int); 19*0a6a1f1dSLionel Sambuc 20*0a6a1f1dSLionel Sambuc void fputrap(struct trapframe *); 21*0a6a1f1dSLionel Sambuc void fpudna(struct trapframe *); 22*0a6a1f1dSLionel Sambuc 23*0a6a1f1dSLionel Sambuc void process_xmm_to_s87(const struct fxsave *, struct save87 *); 24*0a6a1f1dSLionel Sambuc void process_s87_to_xmm(const struct save87 *, struct fxsave *); 25*0a6a1f1dSLionel Sambuc 26*0a6a1f1dSLionel Sambuc /* Set all to defaults (eg during exec) */ 27*0a6a1f1dSLionel Sambuc void fpu_save_area_clear(struct lwp *, unsigned int); 28*0a6a1f1dSLionel Sambuc /* Reset control words only - for signal handlers */ 29*0a6a1f1dSLionel Sambuc void fpu_save_area_reset(struct lwp *); 30*0a6a1f1dSLionel Sambuc 31*0a6a1f1dSLionel Sambuc /* Copy data outside pcb during fork */ 32*0a6a1f1dSLionel Sambuc void fpu_save_area_fork(struct pcb *, const struct pcb *); 33*0a6a1f1dSLionel Sambuc 34*0a6a1f1dSLionel Sambuc /* Load FP registers with user-supplied values */ 35*0a6a1f1dSLionel Sambuc void process_write_fpregs_xmm(struct lwp *lwp, const struct fxsave *fpregs); 36*0a6a1f1dSLionel Sambuc void process_write_fpregs_s87(struct lwp *lwp, const struct save87 *fpregs); 37*0a6a1f1dSLionel Sambuc 38*0a6a1f1dSLionel Sambuc /* Save FP registers for copy to userspace */ 39*0a6a1f1dSLionel Sambuc void process_read_fpregs_xmm(struct lwp *lwp, struct fxsave *fpregs); 40*0a6a1f1dSLionel Sambuc void process_read_fpregs_s87(struct lwp *lwp, struct save87 *fpregs); 41*0a6a1f1dSLionel Sambuc 42*0a6a1f1dSLionel Sambuc #endif 43*0a6a1f1dSLionel Sambuc 44*0a6a1f1dSLionel Sambuc #endif /* _X86_FPU_H_ */ 45