fpu.h revision 1.14 1 1.14 maxv /* $NetBSD: fpu.h,v 1.14 2019/01/20 16:55:21 maxv 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.14 maxv void fpu_area_save(void *, uint64_t);
18 1.14 maxv void fpu_area_restore(void *, uint64_t);
19 1.13 maxv
20 1.1 dsl void fpusave_lwp(struct lwp *, bool);
21 1.1 dsl void fpusave_cpu(bool);
22 1.1 dsl
23 1.9 maxv void fpu_eagerswitch(struct lwp *, struct lwp *);
24 1.9 maxv
25 1.5 dsl void fpu_set_default_cw(struct lwp *, unsigned int);
26 1.5 dsl
27 1.2 dsl void fputrap(struct trapframe *);
28 1.2 dsl void fpudna(struct trapframe *);
29 1.2 dsl
30 1.3 dsl /* Set all to defaults (eg during exec) */
31 1.3 dsl void fpu_save_area_clear(struct lwp *, unsigned int);
32 1.3 dsl /* Reset control words only - for signal handlers */
33 1.3 dsl void fpu_save_area_reset(struct lwp *);
34 1.3 dsl
35 1.6 dsl /* Copy data outside pcb during fork */
36 1.6 dsl void fpu_save_area_fork(struct pcb *, const struct pcb *);
37 1.6 dsl
38 1.4 dsl /* Load FP registers with user-supplied values */
39 1.4 dsl void process_write_fpregs_xmm(struct lwp *lwp, const struct fxsave *fpregs);
40 1.4 dsl void process_write_fpregs_s87(struct lwp *lwp, const struct save87 *fpregs);
41 1.4 dsl
42 1.4 dsl /* Save FP registers for copy to userspace */
43 1.4 dsl void process_read_fpregs_xmm(struct lwp *lwp, struct fxsave *fpregs);
44 1.4 dsl void process_read_fpregs_s87(struct lwp *lwp, struct save87 *fpregs);
45 1.4 dsl
46 1.1 dsl #endif
47 1.1 dsl
48 1.2 dsl #endif /* _X86_FPU_H_ */
49