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