-
Notifications
You must be signed in to change notification settings - Fork 152
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
asm/inline: explicitly use asm macro #372
Conversation
removed from prelude in current nightly rust-lang/rust#91728 close rust-embedded#371 Signed-off-by: Robert Jördens <[email protected]>
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @therealprof (or someone else) soon. Please see the contribution instructions for more information. |
LGTM, any reason it's still marked as draft? |
Just that I haven't actually been able to test it with the affected new nightly... |
Looks like it should be
|
@adamgreig good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bors merge
372: asm/inline: explicitly use asm macro r=adamgreig a=jordens `asm!()` removed from prelude in current nightly rust-lang/rust#91728 close #371 This is also a good candidate for the cortex-m v0.7 series. Co-authored-by: Robert Jördens <[email protected]>
Build failed: |
Ah, the pinned nightly we use to build the pre-built binaries is too old to know about |
I think every user of |
@adamgreig do you prefer a minimal bump or a maximal bump to 2021-12-16? --- 2020-08-20-lib 2021-12-17 08:21:37.685375537 +0100
+++ 2021-12-16-lib 2021-12-17 08:26:04.931123275 +0100
@@ -6,229 +6,291 @@
Disassembly of section .text.__bkpt:
00000000 <__bkpt>:
- 0: be00 bkpt 0x0000
- 2: 4770 bx lr
+ 0: b580 push {r7, lr}
+ 2: 466f mov r7, sp
+ 4: be00 bkpt 0x0000
+ 6: bd80 pop {r7, pc}
Disassembly of section .text.__control_r:
00000000 <__control_r>:
- 0: f3ef 8014 mrs r0, CONTROL
- 4: 4770 bx lr
+ 0: b580 push {r7, lr}
+ 2: 466f mov r7, sp
+ 4: f3ef 8014 mrs r0, CONTROL
+ 8: bd80 pop {r7, pc}
Disassembly of section .text.__control_w:
00000000 <__control_w>:
- 0: f380 8814 msr CONTROL, r0
- 4: f3bf 8f6f isb sy
- 8: 4770 bx lr
+ 0: b580 push {r7, lr}
+ 2: 466f mov r7, sp
+ 4: f380 8814 msr CONTROL, r0
+ 8: f3bf 8f6f isb sy
+ c: bd80 pop {r7, pc}
Disassembly of section .text.__cpsid:
00000000 <__cpsid>:
- 0: b672 cpsid i
- 2: 4770 bx lr
+ 0: b580 push {r7, lr}
+ 2: 466f mov r7, sp
+ 4: b672 cpsid i
+ 6: bd80 pop {r7, pc}
... |
I'll try a minimal bump. |
Oh jeez, the new assembly doesn't look good indeed. I wonder what changed there. |
There is no nightly that has |
Thanks for checking, I'd just been going down that path myself. Adding suitable |
Absolutely! Thanks! |
Hm, github is suggesting I can add more commits by pushing to quartiq/cortex-m, but I get permission denied when I try to actually do that. Anyway, it's this commit. @rust-embedded/cortex-m, anyone else able to check over the new The reference for what the options mean is here. With this change the disassembly output is identical to what we have now (phew). |
Feel free to hijack this (close, reopen with your branch). Alternatively, I can just pull your changes. |
I went through the functions and checked their behavior w.r.t. the options constraints. Looks correct AFAICT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took that to mean "without nostack
, you may use the stack, but you must restore SP to its original value before finishing", but without the further implication that "if you do specify nostack
, it's fine to mess with the stack pointer".
Anyway, good enough for now, thanks for the PR and checking the options!
bors merge
Build succeeded: |
It just says that with nostack it may be fine to mess with the stack pointer. Without it you have to undo what you did. |
372: asm/inline: explicitly use asm macro r=adamgreig a=jordens `asm!()` removed from prelude in current nightly rust-lang/rust#91728 close #371 This is also a good candidate for the cortex-m v0.7 series. Co-authored-by: Robert Jördens <[email protected]> Co-authored-by: Adam Greig <[email protected]>
375: Prepare v0.7.4 r=thejpster a=adamgreig I've created a new branch, `v0.7.x`, which is currently at the latest non-breaking commit (so includes #346 #349 #347 #351 #339 #352 #348 #363 #362 #361 but does not include #342), to track the 0.7 series since master now contains breaking changes for v0.8. This PR (which targets the new branch) cherry-picks #372 #369 #374 and bumps the version to v0.7.4 (and updates CHANGELOG) ready for a new v0.7.4 release. Once complete I'll also backport the changelog entries and bump the version in master to 0.7.4. I think this is everything that should be in 0.7 -- the only excluded PRs from master are #342 and #367 I believe, and I don't think we have any open PRs targeting 0.7 either. Any other thoughts on items for inclusion in 0.7.4 (or other changelog entries I missed)? Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Adam Greig <[email protected]>
This release includes [rust-embedded/cortex-m#372][1], which is necessary for compatibility with the current nightly compiler. [1]: rust-embedded/cortex-m#372
If
|
asm!()
removed from prelude in current nightlyrust-lang/rust#91728
close #371
This is also a good candidate for the cortex-m v0.7 series.