2 * Register definitions for the Hexagon architecture
6 #ifndef _ASM_REGISTERS_H
7 #define _ASM_REGISTERS_H
11 /* See kernel/entry.S for further documentation. */
14 * Entry code copies the event record out of guest registers into
15 * this structure (which is on the stack).
18 struct hvm_event_record
{
19 unsigned long vmel
; /* Event Linkage (return address) */
20 unsigned long vmest
; /* Event context - pre-event SSR values */
21 unsigned long vmpsp
; /* Previous stack pointer */
22 unsigned long vmbadva
; /* Bad virtual address for addressing events */
26 long restart_r0
; /* R0 checkpoint for syscall restart */
27 long syscall_nr
; /* Only used in system calls */
33 long long int predsusr
;
71 * Be extremely careful with rearranging these, if at all. Some code
72 * assumes the 32 registers exist exactly like this in memory;
73 * e.g. kernel/ptrace.c
74 * e.g. kernel/signal.c (restore_sigcontext)
188 /* VM dispatch pushes event record onto stack - we can build on it */
189 struct hvm_event_record hvmer
;
192 /* Defines to conveniently access the values */
195 * As of the VM spec 0.5, these registers are now set/retrieved via a
196 * VM call. On the in-bound side, we just fetch the values
197 * at the entry points and stuff them into the old record in pt_regs.
198 * However, on the outbound side, probably at VM rte, we set the
202 #define pt_elr(regs) ((regs)->hvmer.vmel)
203 #define pt_set_elr(regs, val) ((regs)->hvmer.vmel = (val))
204 #define pt_cause(regs) ((regs)->hvmer.vmest & (HVM_VMEST_CAUSE_MSK))
205 #define user_mode(regs) \
206 (((regs)->hvmer.vmest & (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT)) != 0)
207 #define ints_enabled(regs) \
208 (((regs)->hvmer.vmest & (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)) != 0)
209 #define pt_psp(regs) ((regs)->hvmer.vmpsp)
210 #define pt_badva(regs) ((regs)->hvmer.vmbadva)
212 #define pt_set_singlestep(regs) ((regs)->hvmer.vmest |= (1<<HVM_VMEST_SS_SFT))
213 #define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<<HVM_VMEST_SS_SFT))
215 #define pt_set_rte_sp(regs, sp) do {\
216 pt_psp(regs) = (regs)->r29 = (sp);\
219 #define pt_set_kmode(regs) \
220 (regs)->hvmer.vmest = (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
222 #define pt_set_usermode(regs) \
223 (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT) \
224 | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
226 #endif /* ifndef __ASSEMBLY */