Skip to content

Commit 16367aa

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
sim: correct save irq flags error when use sim 64bits
Signed-off-by: ligd <[email protected]>
1 parent 8aecad2 commit 16367aa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/sim/src/sim/sim_internal.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@
8888
#define sim_saveusercontext(saveregs) \
8989
({ \
9090
irqstate_t flags = up_irq_flags(); \
91-
uint32_t *env = (uint32_t *)saveregs + JB_FLAG; \
91+
xcpt_reg_t *env = saveregs; \
92+
uint32_t *val = (uint32_t *)&env[JB_FLAG]; \
9293
\
93-
env[0] = flags & UINT32_MAX; \
94-
env[1] = (flags >> 32) & UINT32_MAX; \
94+
val[0] = flags & UINT32_MAX; \
95+
val[1] = (flags >> 32) & UINT32_MAX; \
9596
\
9697
setjmp(saveregs); \
9798
})

0 commit comments

Comments
 (0)