arch: remove the use of z_arch_esf_t
completely from internal
Created `GEN_OFFSET_STRUCT` & `GEN_NAMED_OFFSET_STRUCT` that works for `struct`, and remove the use of `z_arch_esf_t` completely. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
parent
e54b27b967
commit
6a3cb93d88
12 changed files with 195 additions and 190 deletions
|
@ -73,7 +73,7 @@
|
|||
/*
|
||||
* Size of the SW managed part of the ESF in case of exception
|
||||
*/
|
||||
#define ESF_SW_EXC_SIZEOF (__z_arch_esf_t_SIZEOF - ESF_HW_SIZEOF)
|
||||
#define ESF_SW_EXC_SIZEOF (__struct_arch_esf_SIZEOF - ESF_HW_SIZEOF)
|
||||
|
||||
/*
|
||||
* Size of the SW managed part of the ESF in case of interrupt
|
||||
|
@ -90,17 +90,17 @@
|
|||
#define MEPC_SP_ALIGN_BIT_MASK (0x1UL)
|
||||
|
||||
#define STORE_SP_ALIGN_BIT_FROM_MEPC \
|
||||
addi t1, sp, __z_arch_esf_t_soc_context_OFFSET; \
|
||||
lr t0, __z_arch_esf_t_mepc_OFFSET(sp); \
|
||||
addi t1, sp, __struct_arch_esf_soc_context_OFFSET; \
|
||||
lr t0, __struct_arch_esf_mepc_OFFSET(sp); \
|
||||
andi t0, t0, MEPC_SP_ALIGN_BIT_MASK; \
|
||||
sr t0, __soc_esf_t_sp_align_OFFSET(t1)
|
||||
|
||||
#define RESTORE_SP_ALIGN_BIT_TO_MEPC \
|
||||
addi t1, sp, __z_arch_esf_t_soc_context_OFFSET; \
|
||||
addi t1, sp, __struct_arch_esf_soc_context_OFFSET; \
|
||||
lr t0, __soc_esf_t_sp_align_OFFSET(t1); \
|
||||
lr t1, __z_arch_esf_t_mepc_OFFSET(sp); \
|
||||
lr t1, __struct_arch_esf_mepc_OFFSET(sp); \
|
||||
or t2, t1, t0; \
|
||||
sr t2, __z_arch_esf_t_mepc_OFFSET(sp)
|
||||
sr t2, __struct_arch_esf_mepc_OFFSET(sp)
|
||||
|
||||
#define SOC_ISR_SW_STACKING \
|
||||
csrw mscratch, t0; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue