1 1.23 mgorny /* $NetBSD: fpu.h,v 1.23 2020/10/24 07:14:29 mgorny Exp $ */ 2 1.1 dsl 3 1.2 dsl #ifndef _X86_FPU_H_ 4 1.2 dsl #define _X86_FPU_H_ 5 1.1 dsl 6 1.1 dsl #include <x86/cpu_extended_state.h> 7 1.1 dsl 8 1.1 dsl #ifdef _KERNEL 9 1.2 dsl 10 1.3 dsl struct cpu_info; 11 1.3 dsl struct lwp; 12 1.1 dsl struct trapframe; 13 1.1 dsl 14 1.1 dsl void fpuinit(struct cpu_info *); 15 1.12 maxv void fpuinit_mxcsr_mask(void); 16 1.13 maxv 17 1.23 mgorny void fpu_area_save(void *, uint64_t, bool); 18 1.23 mgorny void fpu_area_restore(const void *, uint64_t, bool); 19 1.13 maxv 20 1.19 maxv void fpu_save(void); 21 1.1 dsl 22 1.5 dsl void fpu_set_default_cw(struct lwp *, unsigned int); 23 1.5 dsl 24 1.2 dsl void fputrap(struct trapframe *); 25 1.2 dsl void fpudna(struct trapframe *); 26 1.2 dsl 27 1.22 mgorny void process_xmm_to_s87(const struct fxsave *, struct save87 *); 28 1.22 mgorny void process_s87_to_xmm(const struct save87 *, struct fxsave *); 29 1.22 mgorny 30 1.16 maxv void fpu_clear(struct lwp *, unsigned int); 31 1.16 maxv void fpu_sigreset(struct lwp *); 32 1.3 dsl 33 1.19 maxv void fpu_lwp_fork(struct lwp *, struct lwp *); 34 1.19 maxv void fpu_lwp_abandon(struct lwp *l); 35 1.6 dsl 36 1.20 maxv void fpu_kern_enter(void); 37 1.20 maxv void fpu_kern_leave(void); 38 1.20 maxv 39 1.15 maxv void process_write_fpregs_xmm(struct lwp *, const struct fxsave *); 40 1.15 maxv void process_write_fpregs_s87(struct lwp *, const struct save87 *); 41 1.15 maxv 42 1.15 maxv void process_read_fpregs_xmm(struct lwp *, struct fxsave *); 43 1.15 maxv void process_read_fpregs_s87(struct lwp *, struct save87 *); 44 1.4 dsl 45 1.17 mgorny int process_read_xstate(struct lwp *, struct xstate *); 46 1.17 mgorny int process_verify_xstate(const struct xstate *); 47 1.17 mgorny int process_write_xstate(struct lwp *, const struct xstate *); 48 1.17 mgorny 49 1.1 dsl #endif 50 1.1 dsl 51 1.2 dsl #endif /* _X86_FPU_H_ */ 52