sim: correct save irq flags error when use sim 64bits

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2023-02-08 12:12:47 +08:00 committed by Xiang Xiao
parent 8aecad287c
commit 16367aa084

View File

@ -88,10 +88,11 @@
#define sim_saveusercontext(saveregs) \
({ \
irqstate_t flags = up_irq_flags(); \
uint32_t *env = (uint32_t *)saveregs + JB_FLAG; \
xcpt_reg_t *env = saveregs; \
uint32_t *val = (uint32_t *)&env[JB_FLAG]; \
\
env[0] = flags & UINT32_MAX; \
env[1] = (flags >> 32) & UINT32_MAX; \
val[0] = flags & UINT32_MAX; \
val[1] = (flags >> 32) & UINT32_MAX; \
\
setjmp(saveregs); \
})