5 * Copyright (C) 1992,1993,1994
6 * W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
7 * Australia. E-mail billm@vaxc.cc.monash.edu.au
10 * This copyright notice covers the redistribution and use of the
11 * FPU emulator developed by W. Metzenthen. It covers only its use
12 * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
13 * use is not permitted under this copyright.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must include information specifying
21 * that source code for the emulator is freely available and include
23 * a) an offer to provide the source code for a nominal distribution
25 * b) list at least two alternative methods whereby the source
26 * can be obtained, e.g. a publically accessible bulletin board
27 * and an anonymous ftp site from which the software can be
29 * 3. All advertising materials specifically mentioning features or use of
30 * this emulator must acknowledge that it was developed by W. Metzenthen.
31 * 4. The name of W. Metzenthen may not be used to endorse or promote
32 * products derived from this software without specific prior written
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
36 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
37 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
38 * W. METZENTHEN BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
39 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 * The purpose of this copyright, based upon the Berkeley copyright, is to
48 * ensure that the covered software remains freely available to everyone.
50 * The software (with necessary differences) is also available, but under
51 * the terms of the GNU copyleft, for the Linux operating system and for
52 * the djgpp ms-dos extender.
54 * W. Metzenthen June 1994.
57 * $FreeBSD: src/sys/gnu/i386/fpemul/fpu_system.h,v 1.7.2.1 2001/08/15 01:23:49 peter Exp $
58 * $DragonFly: src/sys/platform/pc32/gnu/fpemul/Attic/fpu_system.h,v 1.2 2003/06/17 04:28:34 dillon Exp $
66 /* system dependent definitions */
69 #include <linux/sched.h>
70 #include <linux/kernel.h>
73 #define I387 (*(union i387_union *)&(((struct pcb *)curproc->p_addr)->pcb_save.sv_87))
74 #define FPU_info (I387.soft.frame)
76 #define FPU_CS (*(unsigned short *) &(FPU_info->tf_cs))
77 #define FPU_DS (*(unsigned short *) &(FPU_info->tf_ds))
78 #define FPU_EAX (FPU_info->tf_eax)
79 #define FPU_EFLAGS (FPU_info->tf_eflags)
80 #define FPU_EIP (FPU_info->tf_eip)
81 /*#define FPU_ORIG_EIP (FPU_info->___orig_eip) */
82 /*#define FPU_ORIG_EIP (FPU_info->tf_isp)*/
83 #define FPU_ORIG_EIP (I387.soft.orig_eip)
85 #define FPU_lookahead (I387.soft.lookahead)
86 #define FPU_entry_eip (I387.soft.entry_eip)
88 #define status_word (I387.soft.swd)
89 #define control_word (I387.soft.cwd)
90 #define regs (I387.soft.regs)
91 #define top (I387.soft.top)
93 #define ip_offset (I387.soft.fip)
94 #define cs_selector (I387.soft.fcs)
95 #define data_operand_offset (I387.soft.foo)
96 #define operand_selector (I387.soft.fos)