source: mainline/kernel/arch/ia64/include/register.h@ 4a4c8bcf

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 4a4c8bcf was 7b712b60, checked in by Jakub Jermar <jakub@…>, 15 years ago

Implement Speculation vector handler.

  • Property mode set to 100644
File size: 8.1 KB
Line 
1/*
2 * Copyright (c) 2005 Jakub Jermar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - 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.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
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.
27 */
28
29/** @addtogroup ia64
30 * @{
31 */
32/** @file
33 */
34
35#ifndef KERN_ia64_REGISTER_H_
36#define KERN_ia64_REGISTER_H_
37
38#define DCR_PP_MASK (1 << 0)
39#define DCR_BE_MASK (1 << 1)
40#define DCR_LC_MASK (1 << 2)
41#define DCR_DM_MASK (1 << 8)
42#define DCR_DP_MASK (1 << 9)
43#define DCR_DK_MASK (1 << 10)
44#define DCR_DX_MASK (1 << 11)
45#define DCR_DR_MASK (1 << 12)
46#define DCR_DA_MASK (1 << 13)
47#define DCR_DD_MASK (1 << 14)
48
49#define CR_IVR_MASK 0x0f
50
51#define PSR_IC_MASK (1 << 13)
52#define PSR_I_MASK (1 << 14)
53#define PSR_PK_MASK (1 << 15)
54#define PSR_DT_MASK (1 << 17)
55#define PSR_DFL_MASK (1 << 18)
56#define PSR_DFH_MASK (1 << 19)
57#define PSR_RT_MASK (1 << 27)
58#define PSR_IT_MASK (1 << 36)
59
60#define PSR_CPL_SHIFT 32
61#define PSR_CPL_MASK_SHIFTED 3
62
63#define PSR_RI_SHIFT 41
64#define PSR_RI_LEN 2
65
66#define PFM_MASK (~0x3fffffffff)
67
68#define RSC_MODE_MASK 3
69#define RSC_PL_MASK 12
70
71/** Application registers. */
72#define AR_KR0 0
73#define AR_KR1 1
74#define AR_KR2 2
75#define AR_KR3 3
76#define AR_KR4 4
77#define AR_KR5 5
78#define AR_KR6 6
79#define AR_KR7 7
80/* ARs 8-15 are reserved */
81#define AR_RSC 16
82#define AR_BSP 17
83#define AR_BSPSTORE 18
84#define AR_RNAT 19
85/* AR 20 is reserved */
86#define AR_FCR 21
87/* ARs 22-23 are reserved */
88#define AR_EFLAG 24
89#define AR_CSD 25
90#define AR_SSD 26
91#define AR_CFLG 27
92#define AR_FSR 28
93#define AR_FIR 29
94#define AR_FDR 30
95/* AR 31 is reserved */
96#define AR_CCV 32
97/* ARs 33-35 are reserved */
98#define AR_UNAT 36
99/* ARs 37-39 are reserved */
100#define AR_FPSR 40
101/* ARs 41-43 are reserved */
102#define AR_ITC 44
103/* ARs 45-47 are reserved */
104/* ARs 48-63 are ignored */
105#define AR_PFS 64
106#define AR_LC 65
107#define AR_EC 66
108/* ARs 67-111 are reserved */
109/* ARs 112-127 are ignored */
110
111/** Control registers. */
112#define CR_DCR 0
113#define CR_ITM 1
114#define CR_IVA 2
115/* CR3-CR7 are reserved */
116#define CR_PTA 8
117/* CR9-CR15 are reserved */
118#define CR_IPSR 16
119#define CR_ISR 17
120/* CR18 is reserved */
121#define CR_IIP 19
122#define CR_IFA 20
123#define CR_ITIR 21
124#define CR_IIPA 22
125#define CR_IFS 23
126#define CR_IIM 24
127#define CR_IHA 25
128/* CR26-CR63 are reserved */
129#define CR_LID 64
130#define CR_IVR 65
131#define CR_TPR 66
132#define CR_EOI 67
133#define CR_IRR0 68
134#define CR_IRR1 69
135#define CR_IRR2 70
136#define CR_IRR3 71
137#define CR_ITV 72
138#define CR_PMV 73
139#define CR_CMCV 74
140/* CR75-CR79 are reserved */
141#define CR_LRR0 80
142#define CR_LRR1 81
143/* CR82-CR127 are reserved */
144
145#ifndef __ASM__
146
147#ifdef KERNEL
148#include <typedefs.h>
149#else
150#include <sys/types.h>
151#endif
152
153/** Processor Status Register. */
154typedef union {
155 uint64_t value;
156 struct {
157 unsigned int : 1;
158 unsigned int be : 1; /**< Big-Endian data accesses. */
159 unsigned int up : 1; /**< User Performance monitor enable. */
160 unsigned int ac : 1; /**< Alignment Check. */
161 unsigned int mfl : 1; /**< Lower floating-point register written. */
162 unsigned int mfh : 1; /**< Upper floating-point register written. */
163 unsigned int : 7;
164 unsigned int ic : 1; /**< Interruption Collection. */
165 unsigned int i : 1; /**< Interrupt Bit. */
166 unsigned int pk : 1; /**< Protection Key enable. */
167 unsigned int : 1;
168 unsigned int dt : 1; /**< Data address Translation. */
169 unsigned int dfl : 1; /**< Disabled Floating-point Low register set. */
170 unsigned int dfh : 1; /**< Disabled Floating-point High register set. */
171 unsigned int sp : 1; /**< Secure Performance monitors. */
172 unsigned int pp : 1; /**< Privileged Performance monitor enable. */
173 unsigned int di : 1; /**< Disable Instruction set transition. */
174 unsigned int si : 1; /**< Secure Interval timer. */
175 unsigned int db : 1; /**< Debug Breakpoint fault. */
176 unsigned int lp : 1; /**< Lower Privilege transfer trap. */
177 unsigned int tb : 1; /**< Taken Branch trap. */
178 unsigned int rt : 1; /**< Register Stack Translation. */
179 unsigned int : 4;
180 unsigned int cpl : 2; /**< Current Privilege Level. */
181 unsigned int is : 1; /**< Instruction Set. */
182 unsigned int mc : 1; /**< Machine Check abort mask. */
183 unsigned int it : 1; /**< Instruction address Translation. */
184 unsigned int id : 1; /**< Instruction Debug fault disable. */
185 unsigned int da : 1; /**< Disable Data Access and Dirty-bit faults. */
186 unsigned int dd : 1; /**< Data Debug fault disable. */
187 unsigned int ss : 1; /**< Single Step enable. */
188 unsigned int ri : 2; /**< Restart Instruction. */
189 unsigned int ed : 1; /**< Exception Deferral. */
190 unsigned int bn : 1; /**< Register Bank. */
191 unsigned int ia : 1; /**< Disable Instruction Access-bit faults. */
192 } __attribute__ ((packed));
193} psr_t;
194
195/** Register Stack Configuration Register */
196typedef union {
197 uint64_t value;
198 struct {
199 unsigned int mode : 2;
200 unsigned int pl : 2; /**< Privilege Level. */
201 unsigned int be : 1; /**< Big-endian. */
202 unsigned int : 11;
203 unsigned int loadrs : 14;
204 } __attribute__ ((packed));
205} rsc_t;
206
207/** External Interrupt Vector Register */
208typedef union {
209 uint8_t vector;
210 uint64_t value;
211} cr_ivr_t;
212
213/** Task Priority Register */
214typedef union {
215 uint64_t value;
216 struct {
217 unsigned int : 4;
218 unsigned int mic: 4; /**< Mask Interrupt Class. */
219 unsigned int : 8;
220 unsigned int mmi: 1; /**< Mask Maskable Interrupts. */
221 } __attribute__ ((packed));
222} cr_tpr_t;
223
224/** Interval Timer Vector */
225typedef union {
226 uint64_t value;
227 struct {
228 unsigned int vector : 8;
229 unsigned int : 4;
230 unsigned int : 1;
231 unsigned int : 3;
232 unsigned int m : 1; /**< Mask. */
233 } __attribute__ ((packed));
234} cr_itv_t;
235
236/** Interruption Status Register */
237typedef union {
238 uint64_t value;
239 struct {
240 union {
241 /** General Exception code field structuring. */
242 uint16_t code;
243 struct {
244 unsigned int ge_na : 4;
245 unsigned int ge_code : 4;
246 } __attribute__ ((packed));
247 };
248 uint8_t vector;
249 unsigned int : 8;
250 unsigned int x : 1; /**< Execute exception. */
251 unsigned int w : 1; /**< Write exception. */
252 unsigned int r : 1; /**< Read exception. */
253 unsigned int na : 1; /**< Non-access exception. */
254 unsigned int sp : 1; /**< Speculative load exception. */
255 unsigned int rs : 1; /**< Register stack. */
256 unsigned int ir : 1; /**< Incomplete Register frame. */
257 unsigned int ni : 1; /**< Nested Interruption. */
258 unsigned int so : 1; /**< IA-32 Supervisor Override. */
259 unsigned int ei : 2; /**< Excepting Instruction. */
260 unsigned int ed : 1; /**< Exception Deferral. */
261 unsigned int : 20;
262 } __attribute__ ((packed));
263} cr_isr_t;
264
265/** CPUID Register 3 */
266typedef union {
267 uint64_t value;
268 struct {
269 uint8_t number;
270 uint8_t revision;
271 uint8_t model;
272 uint8_t family;
273 uint8_t archrev;
274 } __attribute__ ((packed));
275} cpuid3_t;
276
277#endif /* !__ASM__ */
278
279#endif
280
281/** @}
282 */
Note: See TracBrowser for help on using the repository browser.