2 * Register definitions for the Hexagon architecture
6 #ifndef _ASM_REGISTERS_H
7 #define _ASM_REGISTERS_H
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 */
28 long restart_r0
; /* R0 checkpoint for syscall restart */
29 long syscall_nr
; /* Only used in system calls */
35 long long int predsusr
;
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)
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
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);\
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 */