npx.h (4e27d36d38f4c3b12bcc1855c5d41527d08d1ce0) npx.h (824fc46089a4b86003cef4fcbfa8493591e87719)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 31 unchanged lines hidden (view full) ---

40
41#ifndef _MACHINE_NPX_H_
42#define _MACHINE_NPX_H_
43
44#include <x86/fpu.h>
45
46#ifdef _KERNEL
47
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 31 unchanged lines hidden (view full) ---

40
41#ifndef _MACHINE_NPX_H_
42#define _MACHINE_NPX_H_
43
44#include <x86/fpu.h>
45
46#ifdef _KERNEL
47
48struct fpu_kern_ctx;
49
48#define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNNPX) == 0)
49
50#define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNNPX) == 0)
51
52#define XSAVE_AREA_ALIGN 64
53
50int npxdna(void);
51void npxdrop(void);
52void npxexit(struct thread *td);
53int npxformat(void);
54int npxgetregs(struct thread *td);
54int npxdna(void);
55void npxdrop(void);
56void npxexit(struct thread *td);
57int npxformat(void);
58int npxgetregs(struct thread *td);
55void npxinit(void);
59void npxinit(bool bsp);
56void npxresume(union savefpu *addr);
57void npxsave(union savefpu *addr);
60void npxresume(union savefpu *addr);
61void npxsave(union savefpu *addr);
58void npxsetregs(struct thread *td, union savefpu *addr);
62int npxsetregs(struct thread *td, union savefpu *addr,
63 char *xfpustate, size_t xfpustate_size);
64int npxsetxstate(struct thread *td, char *xfpustate,
65 size_t xfpustate_size);
59void npxsuspend(union savefpu *addr);
60int npxtrap_x87(void);
61int npxtrap_sse(void);
62void npxuserinited(struct thread *);
63struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags);
64void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx);
65int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx,
66 u_int flags);
67int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx);
68int fpu_kern_thread(u_int flags);
69int is_fpu_kern_thread(u_int flags);
70
66void npxsuspend(union savefpu *addr);
67int npxtrap_x87(void);
68int npxtrap_sse(void);
69void npxuserinited(struct thread *);
70struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags);
71void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx);
72int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx,
73 u_int flags);
74int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx);
75int fpu_kern_thread(u_int flags);
76int is_fpu_kern_thread(u_int flags);
77
78union savefpu *fpu_save_area_alloc(void);
79void fpu_save_area_free(union savefpu *fsa);
80void fpu_save_area_reset(union savefpu *fsa);
81
71/*
82/*
72 * Flags for fpu_kern_enter() and fpu_kern_thread().
83 * Flags for fpu_kern_alloc_ctx(), fpu_kern_enter() and fpu_kern_thread().
73 */
74#define FPU_KERN_NORMAL 0x0000
75#define FPU_KERN_NOWAIT 0x0001
76#define FPU_KERN_KTHR 0x0002
77
78#endif
79
80#endif /* !_MACHINE_NPX_H_ */
84 */
85#define FPU_KERN_NORMAL 0x0000
86#define FPU_KERN_NOWAIT 0x0001
87#define FPU_KERN_KTHR 0x0002
88
89#endif
90
91#endif /* !_MACHINE_NPX_H_ */