fpu.h revision 1.8
1/*	$NetBSD: fpu.h,v 1.8 2018/05/23 07:45:35 maxv 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
10struct cpu_info;
11struct lwp;
12struct trapframe;
13
14void fpuinit(struct cpu_info *);
15void fpuinit_mxcsr_mask(void);
16void fpusave_lwp(struct lwp *, bool);
17void fpusave_cpu(bool);
18
19void fpu_set_default_cw(struct lwp *, unsigned int);
20
21void fputrap(struct trapframe *);
22void fpudna(struct trapframe *);
23
24/* Set all to defaults (eg during exec) */
25void fpu_save_area_clear(struct lwp *, unsigned int);
26/* Reset control words only - for signal handlers */
27void fpu_save_area_reset(struct lwp *);
28
29/* Copy data outside pcb during fork */
30void fpu_save_area_fork(struct pcb *, const struct pcb *);
31
32/* Load FP registers with user-supplied values */
33void process_write_fpregs_xmm(struct lwp *lwp, const struct fxsave *fpregs);
34void process_write_fpregs_s87(struct lwp *lwp, const struct save87 *fpregs);
35
36/* Save FP registers for copy to userspace */
37void process_read_fpregs_xmm(struct lwp *lwp, struct fxsave *fpregs);
38void process_read_fpregs_s87(struct lwp *lwp, struct save87 *fpregs);
39
40#endif
41
42#endif /* _X86_FPU_H_ */
43