x86, efi: Set runtime_version to the EFI spec revision
[linux/fpc-iii.git] / arch / hexagon / include / uapi / asm / registers.h
blobc20406f63b5cb2ab1bffc1aa48007f0f84a90344
1 /*
2 * Register definitions for the Hexagon architecture
3 */
6 #ifndef _ASM_REGISTERS_H
7 #define _ASM_REGISTERS_H
9 #define SP r29
11 #ifndef __ASSEMBLY__
13 /* See kernel/entry.S for further documentation. */
16 * Entry code copies the event record out of guest registers into
17 * this structure (which is on the stack).
20 struct hvm_event_record {
21 unsigned long vmel; /* Event Linkage (return address) */
22 unsigned long vmest; /* Event context - pre-event SSR values */
23 unsigned long vmpsp; /* Previous stack pointer */
24 unsigned long vmbadva; /* Bad virtual address for addressing events */
27 struct pt_regs {
28 long restart_r0; /* R0 checkpoint for syscall restart */
29 long syscall_nr; /* Only used in system calls */
30 union {
31 struct {
32 unsigned long usr;
33 unsigned long preds;
35 long long int predsusr;
37 union {
38 struct {
39 unsigned long m0;
40 unsigned long m1;
42 long long int m1m0;
44 union {
45 struct {
46 unsigned long sa1;
47 unsigned long lc1;
49 long long int lc1sa1;
51 union {
52 struct {
53 unsigned long sa0;
54 unsigned long lc0;
56 long long int lc0sa0;
58 union {
59 struct {
60 unsigned long gp;
61 unsigned long ugp;
63 long long int ugpgp;
66 * Be extremely careful with rearranging these, if at all. Some code
67 * assumes the 32 registers exist exactly like this in memory;
68 * e.g. kernel/ptrace.c
69 * e.g. kernel/signal.c (restore_sigcontext)
71 union {
72 struct {
73 unsigned long r00;
74 unsigned long r01;
76 long long int r0100;
78 union {
79 struct {
80 unsigned long r02;
81 unsigned long r03;
83 long long int r0302;
85 union {
86 struct {
87 unsigned long r04;
88 unsigned long r05;
90 long long int r0504;
92 union {
93 struct {
94 unsigned long r06;
95 unsigned long r07;
97 long long int r0706;
99 union {
100 struct {
101 unsigned long r08;
102 unsigned long r09;
104 long long int r0908;
106 union {
107 struct {
108 unsigned long r10;
109 unsigned long r11;
111 long long int r1110;
113 union {
114 struct {
115 unsigned long r12;
116 unsigned long r13;
118 long long int r1312;
120 union {
121 struct {
122 unsigned long r14;
123 unsigned long r15;
125 long long int r1514;
127 union {
128 struct {
129 unsigned long r16;
130 unsigned long r17;
132 long long int r1716;
134 union {
135 struct {
136 unsigned long r18;
137 unsigned long r19;
139 long long int r1918;
141 union {
142 struct {
143 unsigned long r20;
144 unsigned long r21;
146 long long int r2120;
148 union {
149 struct {
150 unsigned long r22;
151 unsigned long r23;
153 long long int r2322;
155 union {
156 struct {
157 unsigned long r24;
158 unsigned long r25;
160 long long int r2524;
162 union {
163 struct {
164 unsigned long r26;
165 unsigned long r27;
167 long long int r2726;
169 union {
170 struct {
171 unsigned long r28;
172 unsigned long r29;
174 long long int r2928;
176 union {
177 struct {
178 unsigned long r30;
179 unsigned long r31;
181 long long int r3130;
183 /* VM dispatch pushes event record onto stack - we can build on it */
184 struct hvm_event_record hvmer;
187 /* Defines to conveniently access the values */
190 * As of the VM spec 0.5, these registers are now set/retrieved via a
191 * VM call. On the in-bound side, we just fetch the values
192 * at the entry points and stuff them into the old record in pt_regs.
193 * However, on the outbound side, probably at VM rte, we set the
194 * registers back.
197 #define pt_elr(regs) ((regs)->hvmer.vmel)
198 #define pt_set_elr(regs, val) ((regs)->hvmer.vmel = (val))
199 #define pt_cause(regs) ((regs)->hvmer.vmest & (HVM_VMEST_CAUSE_MSK))
200 #define user_mode(regs) \
201 (((regs)->hvmer.vmest & (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT)) != 0)
202 #define ints_enabled(regs) \
203 (((regs)->hvmer.vmest & (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)) != 0)
204 #define pt_psp(regs) ((regs)->hvmer.vmpsp)
205 #define pt_badva(regs) ((regs)->hvmer.vmbadva)
207 #define pt_set_rte_sp(regs, sp) do {\
208 pt_psp(regs) = (sp);\
209 (regs)->SP = (unsigned long) &((regs)->hvmer);\
210 } while (0)
212 #define pt_set_kmode(regs) \
213 (regs)->hvmer.vmest = (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
215 #define pt_set_usermode(regs) \
216 (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT) \
217 | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
219 #endif /* ifndef __ASSEMBLY */
221 #endif