Skip to content

Fix SEC_STAT.IRM bit handling in ARC SEM interrupt entry/exit #1182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions portable/ThirdParty/GCC/ARC_EM_HS/arc_support.s
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ start_r:
exc_entry_cpu:

EXCEPTION_PROLOGUE
lr r3, [0x09] /* store SEC_STAT.IRM */
and r3, r3, 0x8
PUSH r3

mov blink, sp
mov r3, sp /* as exception handler's para(p_excinfo) */
Expand Down Expand Up @@ -185,6 +188,8 @@ ret_exc:
ret_exc_1: /* return from non-task context, interrupts or exceptions are nested */

EXCEPTION_EPILOGUE
POP r3 /* restore SEC_STAT.IRM */
sflag r3
rtie

/* there is a dispatch request */
Expand Down Expand Up @@ -215,6 +220,8 @@ ret_exc_r:

RESTORE_CALLEE_REGS /* recover registers */
EXCEPTION_EPILOGUE
POP r3 /* restore SEC_STAT.IRM */
sflag r3
rtie

/****** entry for normal interrupt exception handling ******/
Expand All @@ -235,6 +242,9 @@ exc_entry_int:
#endif
#endif
INTERRUPT_PROLOGUE
lr r3, [0x09] /* store SEC_STAT.IRM */
and r3, r3, 0x8
PUSH r3

mov blink, sp

Expand Down Expand Up @@ -294,6 +304,8 @@ ret_int:
brne r0, 0, ret_int_2
ret_int_1: /* return from non-task context */
INTERRUPT_EPILOGUE
POP r3 /* restore SEC_STAT.IRM */
sflag r3
rtie
/* there is a dispatch request */
ret_int_2:
Expand All @@ -319,6 +331,8 @@ ret_int_r:
RESTORE_CALLEE_REGS /* recover registers */
POPAX AUX_IRQ_ACT
INTERRUPT_EPILOGUE
POP r3 /* restore SEC_STAT.IRM */
sflag r3
rtie

#if ARC_FEATURE_FIRQ == 1
Expand Down