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