cortex-m naked functions: llvm_asm --> asm #2318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This pull request changes several more uses of
llvm_asm!()-->asm!()incortex-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 singleasm!()invocation using thenoreturnoption.noreturnasm 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 lrto the end ofgeneric_isr. As far as I can tell, the existing code was relying on falling through to the end ofgeneric_isr, and then branching to the correct place as a result of somebx lrinserted 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 lrat the end ofgeneric_isr, blink panics with a kernel hardfault (undefined instruction usage fault).TODO or Help Wanted
N/A
Documentation Updated
Formatting
make prepush.