]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
43866e37 | 6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. |
1c79356b | 7 | * |
43866e37 A |
8 | * This file contains Original Code and/or Modifications of Original Code |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14 | * | |
15 | * The Original Code and all software distributed under the License are | |
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
1c79356b A |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
43866e37 A |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
1c79356b A |
22 | * |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* | |
26 | * @OSF_COPYRIGHT@ | |
27 | */ | |
28 | /* | |
29 | * HISTORY | |
30 | * | |
31 | * Revision 1.1.1.1 1998/09/22 21:05:31 wsanchez | |
32 | * Import of Mac OS X kernel (~semeria) | |
33 | * | |
34 | * Revision 1.1.1.1 1998/03/07 02:25:47 wsanchez | |
35 | * Import of OSF Mach kernel (~mburg) | |
36 | * | |
37 | * Revision 1.2.6.1 1994/09/23 02:37:03 ezf | |
38 | * change marker to not FREE | |
39 | * [1994/09/22 21:39:57 ezf] | |
40 | * | |
41 | * Revision 1.2.2.2 1993/06/09 02:40:30 gm | |
42 | * Added to OSF/1 R1.3 from NMK15.0. | |
43 | * [1993/06/02 21:16:11 jeffc] | |
44 | * | |
45 | * Revision 1.2 1993/04/19 16:33:51 devrcs | |
46 | * ansi C conformance changes | |
47 | * [1993/02/02 18:56:01 david] | |
48 | * | |
49 | * Revision 1.1 1992/09/30 02:30:43 robert | |
50 | * Initial revision | |
51 | * | |
52 | * $EndLog$ | |
53 | */ | |
54 | /* CMU_HIST */ | |
55 | /* | |
56 | * Revision 2.1.1.1.2.1 92/03/03 16:21:23 jeffreyh | |
57 | * Merged up to Trunk | |
58 | * [92/02/26 jeffreyh] | |
59 | * | |
60 | * Revision 2.4 92/02/26 13:10:29 elf | |
61 | * Added stupid alaises to make i386/fpu.c compile. RVB will fix. | |
62 | * | |
63 | * [92/02/26 elf] | |
64 | * | |
65 | * Revision 2.3 92/02/26 12:47:46 elf | |
66 | * Installed from i386 directory. | |
67 | * [92/02/26 danner] | |
68 | * | |
69 | * | |
70 | * Revision 2.2 92/01/03 20:19:47 dbg | |
71 | * Move this file to mach/i386. Add FP_NO..FP_387 codes for | |
72 | * floating-point processor status. Error bits in control | |
73 | * register are masks, not enables. | |
74 | * [91/10/19 dbg] | |
75 | * | |
76 | */ | |
77 | /* CMU_ENDHIST */ | |
78 | /* | |
79 | * Mach Operating System | |
80 | * Copyright (c) 1992-1989 Carnegie Mellon University | |
81 | * All Rights Reserved. | |
82 | * | |
83 | * Permission to use, copy, modify and distribute this software and its | |
84 | * documentation is hereby granted, provided that both the copyright | |
85 | * notice and this permission notice appear in all copies of the | |
86 | * software, derivative works or modified versions, and any portions | |
87 | * thereof, and that both notices appear in supporting documentation. | |
88 | * | |
89 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
90 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
91 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
92 | * | |
93 | * Carnegie Mellon requests users of this software to return to | |
94 | * | |
95 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
96 | * School of Computer Science | |
97 | * Carnegie Mellon University | |
98 | * Pittsburgh PA 15213-3890 | |
99 | * | |
100 | * any improvements or extensions that they make and grant Carnegie Mellon | |
101 | * the rights to redistribute these changes. | |
102 | */ | |
103 | /* | |
104 | */ | |
105 | ||
106 | #ifndef _I386_FP_SAVE_H_ | |
107 | #define _I386_FP_SAVE_H_ | |
108 | /* | |
109 | * Floating point registers and status, as saved | |
110 | * and restored by FP save/restore instructions. | |
111 | */ | |
112 | struct i386_fp_save { | |
113 | unsigned short fp_control; /* control */ | |
114 | unsigned short fp_unused_1; | |
115 | unsigned short fp_status; /* status */ | |
116 | unsigned short fp_unused_2; | |
117 | unsigned short fp_tag; /* register tags */ | |
118 | unsigned short fp_unused_3; | |
119 | unsigned int fp_eip; /* eip at failed instruction */ | |
120 | unsigned short fp_cs; /* cs at failed instruction */ | |
121 | unsigned short fp_opcode; /* opcode of failed instruction */ | |
122 | unsigned int fp_dp; /* data address */ | |
123 | unsigned short fp_ds; /* data segment */ | |
124 | unsigned short fp_unused_4; | |
125 | }; | |
126 | ||
127 | struct i386_fp_regs { | |
128 | unsigned short fp_reg_word[5][8]; | |
129 | /* space for 8 80-bit FP registers */ | |
130 | }; | |
131 | ||
132 | /* | |
133 | * Control register | |
134 | */ | |
135 | #define FPC_IE 0x0001 /* enable invalid operation | |
136 | exception */ | |
137 | #define FPC_IM FPC_IE | |
138 | #define FPC_DE 0x0002 /* enable denormalized operation | |
139 | exception */ | |
140 | #define FPC_DM FPC_DE | |
141 | #define FPC_ZE 0x0004 /* enable zero-divide exception */ | |
142 | #define FPC_ZM FPC_ZE | |
143 | #define FPC_OE 0x0008 /* enable overflow exception */ | |
144 | #define FPC_OM FPC_OE | |
145 | #define FPC_UE 0x0010 /* enable underflow exception */ | |
146 | #define FPC_PE 0x0020 /* enable precision exception */ | |
147 | #define FPC_PC 0x0300 /* precision control: */ | |
148 | #define FPC_PC_24 0x0000 /* 24 bits */ | |
149 | #define FPC_PC_53 0x0200 /* 53 bits */ | |
150 | #define FPC_PC_64 0x0300 /* 64 bits */ | |
151 | #define FPC_RC 0x0c00 /* rounding control: */ | |
152 | #define FPC_RC_RN 0x0000 /* round to nearest or even */ | |
153 | #define FPC_RC_RD 0x0400 /* round down */ | |
154 | #define FPC_RC_RU 0x0800 /* round up */ | |
155 | #define FPC_RC_CHOP 0x0c00 /* chop */ | |
156 | #define FPC_IC 0x1000 /* infinity control (obsolete) */ | |
157 | #define FPC_IC_PROJ 0x0000 /* projective infinity */ | |
158 | #define FPC_IC_AFF 0x1000 /* affine infinity (std) */ | |
159 | ||
160 | /* | |
161 | * Status register | |
162 | */ | |
163 | #define FPS_IE 0x0001 /* invalid operation */ | |
164 | #define FPS_DE 0x0002 /* denormalized operand */ | |
165 | #define FPS_ZE 0x0004 /* divide by zero */ | |
166 | #define FPS_OE 0x0008 /* overflow */ | |
167 | #define FPS_UE 0x0010 /* underflow */ | |
168 | #define FPS_PE 0x0020 /* precision */ | |
169 | #define FPS_SF 0x0040 /* stack flag */ | |
170 | #define FPS_ES 0x0080 /* error summary */ | |
171 | #define FPS_C0 0x0100 /* condition code bit 0 */ | |
172 | #define FPS_C1 0x0200 /* condition code bit 1 */ | |
173 | #define FPS_C2 0x0400 /* condition code bit 2 */ | |
174 | #define FPS_TOS 0x3800 /* top-of-stack pointer */ | |
175 | #define FPS_TOS_SHIFT 11 | |
176 | #define FPS_C3 0x4000 /* condition code bit 3 */ | |
177 | #define FPS_BUSY 0x8000 /* FPU busy */ | |
178 | ||
179 | /* | |
180 | * Kind of floating-point support provided by kernel. | |
181 | */ | |
182 | #define FP_NO 0 /* no floating point */ | |
183 | #define FP_SOFT 1 /* software FP emulator */ | |
184 | #define FP_287 2 /* 80287 */ | |
185 | #define FP_387 3 /* 80387 or 80486 */ | |
186 | ||
187 | #endif /* _I386_FP_SAVE_H_ */ |