4 * Copyright (c) 2002, 2003 Marcel Moolenaar
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef _MACHINE_REGSET_H_
32 #define _MACHINE_REGSET_H_
35 * Create register sets, based on the runtime specification. This allows
36 * us to better reuse code and to copy sets around more efficiently.
37 * Contexts are defined in terms of these sets. These include trapframe,
38 * sigframe, pcb, mcontext, reg and fpreg. Other candidates are unwind
39 * and coredump related contexts.
42 * o Constant registers (r0, f0 and f1) are not accounted for,
43 * o The stacked registers (r32-r127) are not accounted for,
44 * o Predicates are not split across sets.
47 /* A single FP register. */
49 unsigned char fpr_bits
[16];
58 unsigned long unat
; /* NaT before spilling */
62 unsigned long bspstore
;
64 unsigned long __spare
;
65 /* Userland context and syscalls */
70 /* ASYNC: Interrupt specific */
80 union _ia64_fpreg fr32
;
81 union _ia64_fpreg fr33
;
82 union _ia64_fpreg fr34
;
83 union _ia64_fpreg fr35
;
84 union _ia64_fpreg fr36
;
85 union _ia64_fpreg fr37
;
86 union _ia64_fpreg fr38
;
87 union _ia64_fpreg fr39
;
88 union _ia64_fpreg fr40
;
89 union _ia64_fpreg fr41
;
90 union _ia64_fpreg fr42
;
91 union _ia64_fpreg fr43
;
92 union _ia64_fpreg fr44
;
93 union _ia64_fpreg fr45
;
94 union _ia64_fpreg fr46
;
95 union _ia64_fpreg fr47
;
96 union _ia64_fpreg fr48
;
97 union _ia64_fpreg fr49
;
98 union _ia64_fpreg fr50
;
99 union _ia64_fpreg fr51
;
100 union _ia64_fpreg fr52
;
101 union _ia64_fpreg fr53
;
102 union _ia64_fpreg fr54
;
103 union _ia64_fpreg fr55
;
104 union _ia64_fpreg fr56
;
105 union _ia64_fpreg fr57
;
106 union _ia64_fpreg fr58
;
107 union _ia64_fpreg fr59
;
108 union _ia64_fpreg fr60
;
109 union _ia64_fpreg fr61
;
110 union _ia64_fpreg fr62
;
111 union _ia64_fpreg fr63
;
112 union _ia64_fpreg fr64
;
113 union _ia64_fpreg fr65
;
114 union _ia64_fpreg fr66
;
115 union _ia64_fpreg fr67
;
116 union _ia64_fpreg fr68
;
117 union _ia64_fpreg fr69
;
118 union _ia64_fpreg fr70
;
119 union _ia64_fpreg fr71
;
120 union _ia64_fpreg fr72
;
121 union _ia64_fpreg fr73
;
122 union _ia64_fpreg fr74
;
123 union _ia64_fpreg fr75
;
124 union _ia64_fpreg fr76
;
125 union _ia64_fpreg fr77
;
126 union _ia64_fpreg fr78
;
127 union _ia64_fpreg fr79
;
128 union _ia64_fpreg fr80
;
129 union _ia64_fpreg fr81
;
130 union _ia64_fpreg fr82
;
131 union _ia64_fpreg fr83
;
132 union _ia64_fpreg fr84
;
133 union _ia64_fpreg fr85
;
134 union _ia64_fpreg fr86
;
135 union _ia64_fpreg fr87
;
136 union _ia64_fpreg fr88
;
137 union _ia64_fpreg fr89
;
138 union _ia64_fpreg fr90
;
139 union _ia64_fpreg fr91
;
140 union _ia64_fpreg fr92
;
141 union _ia64_fpreg fr93
;
142 union _ia64_fpreg fr94
;
143 union _ia64_fpreg fr95
;
144 union _ia64_fpreg fr96
;
145 union _ia64_fpreg fr97
;
146 union _ia64_fpreg fr98
;
147 union _ia64_fpreg fr99
;
148 union _ia64_fpreg fr100
;
149 union _ia64_fpreg fr101
;
150 union _ia64_fpreg fr102
;
151 union _ia64_fpreg fr103
;
152 union _ia64_fpreg fr104
;
153 union _ia64_fpreg fr105
;
154 union _ia64_fpreg fr106
;
155 union _ia64_fpreg fr107
;
156 union _ia64_fpreg fr108
;
157 union _ia64_fpreg fr109
;
158 union _ia64_fpreg fr110
;
159 union _ia64_fpreg fr111
;
160 union _ia64_fpreg fr112
;
161 union _ia64_fpreg fr113
;
162 union _ia64_fpreg fr114
;
163 union _ia64_fpreg fr115
;
164 union _ia64_fpreg fr116
;
165 union _ia64_fpreg fr117
;
166 union _ia64_fpreg fr118
;
167 union _ia64_fpreg fr119
;
168 union _ia64_fpreg fr120
;
169 union _ia64_fpreg fr121
;
170 union _ia64_fpreg fr122
;
171 union _ia64_fpreg fr123
;
172 union _ia64_fpreg fr124
;
173 union _ia64_fpreg fr125
;
174 union _ia64_fpreg fr126
;
175 union _ia64_fpreg fr127
;
179 * Preserved registers.
181 struct _callee_saved
{
182 unsigned long unat
; /* NaT after spilling. */
193 unsigned long __spare
;
196 struct _callee_saved_fp
{
197 union _ia64_fpreg fr2
;
198 union _ia64_fpreg fr3
;
199 union _ia64_fpreg fr4
;
200 union _ia64_fpreg fr5
;
201 union _ia64_fpreg fr16
;
202 union _ia64_fpreg fr17
;
203 union _ia64_fpreg fr18
;
204 union _ia64_fpreg fr19
;
205 union _ia64_fpreg fr20
;
206 union _ia64_fpreg fr21
;
207 union _ia64_fpreg fr22
;
208 union _ia64_fpreg fr23
;
209 union _ia64_fpreg fr24
;
210 union _ia64_fpreg fr25
;
211 union _ia64_fpreg fr26
;
212 union _ia64_fpreg fr27
;
213 union _ia64_fpreg fr28
;
214 union _ia64_fpreg fr29
;
215 union _ia64_fpreg fr30
;
216 union _ia64_fpreg fr31
;
222 struct _caller_saved
{
223 unsigned long unat
; /* NaT after spilling. */
255 struct _caller_saved_fp
{
256 union _ia64_fpreg fr6
;
257 union _ia64_fpreg fr7
;
258 union _ia64_fpreg fr8
;
259 union _ia64_fpreg fr9
;
260 union _ia64_fpreg fr10
;
261 union _ia64_fpreg fr11
;
262 union _ia64_fpreg fr12
;
263 union _ia64_fpreg fr13
;
264 union _ia64_fpreg fr14
;
265 union _ia64_fpreg fr15
;
269 void restore_callee_saved(const struct _callee_saved
*);
270 void restore_callee_saved_fp(const struct _callee_saved_fp
*);
271 void restore_high_fp(const struct _high_fp
*);
272 void save_callee_saved(struct _callee_saved
*);
273 void save_callee_saved_fp(struct _callee_saved_fp
*);
274 void save_high_fp(struct _high_fp
*);
277 #endif /* _MACHINE_REGSET_H_ */