-
Notifications
You must be signed in to change notification settings - Fork 168
Add implementation for critical-section 1.0 #447
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
Conversation
r? @adamgreig (rust-highfive has picked a reviewer for you, use r? to override) |
It's not stalled. I was just waiting for another review, same as my other open PRs. Feel free to ping me next time if you want me to rebase a PR. Thanks anyways for picking this up. The workflow |
src/interrupt.rs
Outdated
@@ -54,20 +53,18 @@ pub unsafe fn enable() { | |||
} | |||
|
|||
/// Execute closure `f` in an interrupt-free context. |
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.
Perhaps this method should now refer to critical-section, something like this:
/// Execute closure `f` in an interrupt-free context. | |
/// Execute closure `f` in an interrupt-free context. | |
/// | |
/// This method does not synchronise multiple cores and may disable required | |
/// interrupts on some platforms; see the critical-section crate for a cross-platform | |
/// way to enter a critical section which provides a `CriticalSection` token. | |
/// | |
/// This crate provides an implementation for critical-section that simply disables | |
/// all interrupts which may be enabled with the `critical-section-single-core` feature. |
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.
Done!
Co-Authored-By: Markus Reiter <me@reitermark.us>
448: Add implementation for critical-section 1.0, for cortex-m v0.7.x r=adamgreig a=Dirbaio This is a subset of #447 without any breaking changes, just adding the `critical-section` implementation. The goal is to release it in 0.7.6 so `critical-section` becomes usable without having to wait for cortex-m 0.8. TODO before merging: - [x] Wait for `critical-section 1.0` release rust-embedded/critical-section#19 Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
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.
bors r+
447: Add implementation for critical-section 1.0 r=adamgreig a=Dirbaio Picking up #433 since it seems stalled. Changes from #433 are: - Update to `critical-section 1.0.0-alpha.2` - Use `bool` restore token - Name Cargo feature `critical-section-single-core`. TODO before merging: - [x] Wait for `critical-section 1.0` release rust-embedded/critical-section#19 Co-Authored-By: Markus Reiter `@reitermarkus` Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Build failed: |
bors retry should go after #450 merges... |
651: Use `critical_section` for `Peripherals::take`. r=therealprof a=reitermarkus - `cortex_m` rust-embedded/cortex-m#447 - `msp430` rust-embedded/msp430#13 - `riscv` rust-embedded/riscv#110 - `xtensa_lx` esp-rs/xtensa-lx#20, esp-rs/esp-hal#151 - `mips_mcu` kiffie/pic32-rs#5 Co-authored-by: Markus Reiter <me@reitermark.us>
689: defmt-rtt: Update to critical-section 1.0 r=Urhengulas a=Dirbaio This is a breaking change, because 1.0 no longer supplies any critical section implementation by default. The user has to opt-in to one instead (for example, by enabling the `critical-section-single-core` feature in `cortex-m`: rust-embedded/cortex-m#447). Thankfully it needs bumping only `defmt-rtt`, and not `defmt`. So it won't cause the painful ecosystem split like the `defmt 0.2 -> 0.3` update. TODO before merging: - [x] Wait for `critical-section 1.0` release rust-embedded/critical-section#19 Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
9: Update to critical-section 1.0 r=jonas-schievink a=Dirbaio This is a breaking change, because 1.0 no longer supplies any critical section implementation by default. The user has to opt-in to one instead (for example, by enabling the `critical-section-single-core` feature in `cortex-m`: rust-embedded/cortex-m#447 (comment)). TODO before merging: - [x] Wait for `critical-section 1.0` release rust-embedded/critical-section#19 Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
110: Add critical-section 1.0 implementation, fix multicore unsoundness. r=almindor a=Dirbaio ~~Requires #109~~ This adds a [critical-section](https://github.com/rust-embedded/critical-section) implementation for single-core chips, based on disabling all interrupts. `interrupt::free` is is unsound on multicore systems because it only disables interrupts in the current core. For multicore chips, a chip-specific critical section implementationis needed instead. Unsoundness is fixed by not returning the `CriticalSection` token. This is a breaking change. This is the riscv equivalent of rust-embedded/cortex-m#447 and rust-embedded/cortex-m#448 Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Picking up #433 since it seems stalled. Changes from #433 are:
critical-section 1.0.0-alpha.2
bool
restore tokencritical-section-single-core
.TODO before merging:
critical-section 1.0
release v1.0.0 release critical-section#19Co-Authored-By: Markus Reiter @reitermarkus