npx.h (10b3b54548f2290bbe8d8f88c59c28d12b7a635d) npx.h (6cf9a08d2c338e25f0be42326e6880f089156562)
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

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

138
139#ifdef _KERNEL
140
141#define IO_NPX 0x0F0 /* Numeric Coprocessor */
142#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
143
144#define IRQ_NPX 13
145
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

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

138
139#ifdef _KERNEL
140
141#define IO_NPX 0x0F0 /* Numeric Coprocessor */
142#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
143
144#define IRQ_NPX 13
145
146struct fpu_kern_ctx {
147 union savefpu hwstate;
148 union savefpu *prev;
149 uint32_t flags;
150};
151#define FPU_KERN_CTX_NPXINITDONE 0x01
152
153#define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNNPX) == 0)
154
146/* full reset on some systems, NOP on others */
147#define npx_full_reset() outb(IO_NPX + 1, 0)
148
149int npxdna(void);
150void npxdrop(void);
151void npxexit(struct thread *td);
152int npxformat(void);
153int npxgetregs(struct thread *td, union savefpu *addr);
155/* full reset on some systems, NOP on others */
156#define npx_full_reset() outb(IO_NPX + 1, 0)
157
158int npxdna(void);
159void npxdrop(void);
160void npxexit(struct thread *td);
161int npxformat(void);
162int npxgetregs(struct thread *td, union savefpu *addr);
163int npxgetuserregs(struct thread *td, union savefpu *addr);
154void npxinit(void);
155void npxsave(union savefpu *addr);
156void npxsetregs(struct thread *td, union savefpu *addr);
164void npxinit(void);
165void npxsave(union savefpu *addr);
166void npxsetregs(struct thread *td, union savefpu *addr);
167void npxsetuserregs(struct thread *td, union savefpu *addr);
157int npxtrap(void);
168int npxtrap(void);
169int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx,
170 u_int flags);
171int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx);
172int fpu_kern_thread(u_int flags);
173int is_fpu_kern_thread(u_int flags);
158
174
175/*
176 * Flags for fpu_kern_enter() and fpu_kern_thread().
177 */
178#define FPU_KERN_NORMAL 0x0000
179
159#endif
160
161#endif /* !_MACHINE_NPX_H_ */
180#endif
181
182#endif /* !_MACHINE_NPX_H_ */