Skip to content

Update exception handlers#144

Open
thejpster wants to merge 3 commits intorust-embedded:mainfrom
thejpster:update-exception-handlers
Open

Update exception handlers#144
thejpster wants to merge 3 commits intorust-embedded:mainfrom
thejpster:update-exception-handlers

Conversation

@thejpster
Copy link
Contributor

Cleans up the exception handler assembly code

  • Makes sure all handlers are assembled as Arm, not Thumb
  • Which means we can save an instruction by doing and r12, sp, 7 and saving a mov
  • Ensure we don't make stateful changes to the current section, by using .pushsection and .popsection
  • Links to some detailed docs from Arm about how to write an IRQ handler

* Move .section down to under the function comment
* Ensure all routines are assembled as Arm, not Thumb
* Save an instruction by doing the AND directly on the SP register
Setting a section might leave other code in the wrong section. Also
https://doc.rust-lang.org/beta/reference/inline-assembly.html#r-asm.directives.stateful
says we should undo any stateful changes (like changing the section).
@thejpster thejpster mentioned this pull request Mar 5, 2026
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.

1 participant