Skip to content

Support handling IRQ on SVC stack (and some EL2 fixes)#193

Merged
adamgreig merged 4 commits into
rust-embedded:mainfrom
thejpster:add-svc-stack-interrupt
Jun 24, 2026
Merged

Support handling IRQ on SVC stack (and some EL2 fixes)#193
adamgreig merged 4 commits into
rust-embedded:mainfrom
thejpster:add-svc-stack-interrupt

Conversation

@thejpster

Copy link
Copy Markdown
Contributor
  • Adds the svc-stack-interrupt feature so you can handle IRQs on the SVC stack instead of the SYS stack (which is useful if you are running an RTOS and the SYS stack is in fact the USR stack of the running thread and your ISR might cause the running thread to change)
  • Add missing docs about el2-mode feature
  • Fix bug in EL2 interrupt handler
  • Add nested interrupt test for EL2 mode
  • Remove redundant SCTLR print in all interrupt related tests

Lets interrupt routines for Armv4 and Armv7 (but not Armv8 in EL2 mode)
use SVC mode stack for the handler and not SYS mode stack. Useful if you
are writing an RTOS and your SYS stack is actually the USR stack for the
running task.

Also better document the IRQ handlers, and fix a bug in the EL2 handler
where ELR_hyp might have been corrupted.
We were not restoring the stack ELR_hyp register.
Also removes SCTLR dump because that wasn't useful (interrupt mask
state is in CPSR, not SCTLR, and we know the interrupt is being unmasked
OK).
@adamgreig adamgreig added this pull request to the merge queue Jun 24, 2026
Merged via the queue into rust-embedded:main with commit 2463ab3 Jun 24, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants