| 1 | /*	$NetBSD: fpu.h,v 1.23.28.1 2026/07/19 15:57:27 martin 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 *, uint64_t, bool); |
| 18 | void fpu_area_restore(const void *, uint64_t, bool); |
| 19 | |
| 20 | void fpu_save(void); |
| 21 | |
| 22 | void fpu_set_default_cw(struct lwp *, unsigned int); |
| 23 | |
| 24 | void fputrap(struct trapframe *); |
| 25 | void fpudna(struct trapframe *); |
| 26 | |
| 27 | void process_xmm_to_s87(const struct fxsave *, struct save87 *); |
| 28 | void process_s87_to_xmm(const struct save87 *, struct fxsave *); |
| 29 | |
| 30 | void fpu_clear(struct lwp *, unsigned int); |
| 31 | void fpu_sigreset(struct lwp *); |
| 32 | |
| 33 | void fpu_lwp_fork(struct lwp *, struct lwp *); |
| 34 | void fpu_lwp_abandon(struct lwp *l); |
| 35 | |
| 36 | void fpu_kern_enter(void); |
| 37 | void fpu_kern_leave(void); |
| 38 | |
| 39 | void process_write_fpregs_xmm(struct lwp *, const struct fxsave *); |
| 40 | void process_write_fpregs_s87(struct lwp *, const struct save87 *); |
| 41 | |
| 42 | void process_read_fpregs_xmm(struct lwp *, struct fxsave *); |
| 43 | void process_read_fpregs_s87(struct lwp *, struct save87 *); |
| 44 | |
| 45 | int process_read_xstate(struct lwp *, struct xstate *); |
| 46 | int process_verify_xstate(const struct xstate *); |
| 47 | int process_write_xstate(struct lwp *, const struct xstate *); |
| 48 | |
| 49 | bool process_xsave_needed_p(struct lwp *); |
| 50 | void process_read_xsave(struct lwp *, const struct xsave_header **, size_t *); |
| 51 | int process_verify_xsavelen(struct lwp *, size_t); |
| 52 | int process_verify_xsave(struct lwp *, const struct xsave_header *, size_t); |
| 53 | void process_write_xsave(struct lwp *, const struct xsave_header *, size_t); |
| 54 | |
| 55 | #endif |
| 56 | |
| 57 | #endif /* _X86_FPU_H_ */ |