Skip to content

Conversation

@hudson-ayers
Copy link
Contributor

Pull Request Overview

This pull request changes several more uses of llvm_asm!() --> asm!() in cortex-m/src/lib.rs. These 3 changes are necessary to update to a newer rust nightly, as naked functions are now required to contain only a single asm!() invocation using the noreturn option.

noreturn asm blocks are not required to mark their clobbers (including stack/memory/condition codes), and cannot have inputs or outputs. More details here: https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html .

The only non-straightforward change here was adding a bx lr to the end of generic_isr. As far as I can tell, the existing code was relying on falling through to the end of generic_isr, and then branching to the correct place as a result of some bx lr inserted by the compiler at the end of the function (though I am not totally clear on this, as naked functions do not generate an epilogue).

Testing Strategy

This pull request was tested by running a few userspace apps, which all seem to work correctly. Without the added bx lr at the end of generic_isr, blink panics with a kernel hardfault (undefined instruction usage fault).

TODO or Help Wanted

N/A

Documentation Updated

  • No updates are required.

Formatting

  • Ran make prepush.

@bradjc bradjc added the last-call Final review period for a pull request. label Jan 6, 2021
@bradjc
Copy link
Contributor

bradjc commented Jan 7, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 7, 2021

@bors bors bot merged commit ff60492 into tock:master Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

last-call Final review period for a pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants