1 #ifndef __LUNAIX_AA64_ABI_H
2 #define __LUNAIX_AA64_ABI_H
4 #include <lunaix/types.h>
8 #include <asm/aa64_msrs.h>
9 #include <asm/aa64_spsr.h>
11 #define align_stack(ptr) ((ptr) & ~15)
13 #define store_retval(retval) \
14 current_thread->hstate->registers.x[0] = (retval)
16 #define store_retval_to(th, retval) \
17 (th)->hstate->registers.x[0] = (retval)
20 static inline void must_inline noret
23 asm ("b _aa64_switch_task");
32 asm ("mov %0, lr" : "=r"(lr));
38 abi_get_retaddrat(ptr_t fp)
40 return ((ptr_t*)fp)[1];
43 static inline ptr_t must_inline
47 asm volatile("mov %0, fp" : "=r"(val));
51 static inline void must_inline
52 j_usr(ptr_t sp, ptr_t pc)
54 set_sysreg(SPSR_EL1, SPSR_EL0_preset);
55 set_sysreg(SP_EL0, sp);
56 set_sysreg(ELR_E1, pc);
64 #endif /* __LUNAIX_AA64_ABI_H */