-
Notifications
You must be signed in to change notification settings - Fork 240
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
RISC-V: Make atomic emulation opt-in #904
Conversation
b8a800a
to
95f24bd
Compare
bace211
to
12aa3ba
Compare
toolchain: stable | ||
components: clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
|
||
# Run clippy on all packages targeting RISC-V. | ||
- name: clippy (esp-riscv-rt) | ||
run: cargo +stable clippy --manifest-path=esp-riscv-rt/Cargo.toml -- -D warnings | ||
run: cd esp-riscv-rt && cargo +stable clippy -- -D warnings |
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.
NGL I like the idea of checking code using the host architecture less and less
7d408fd
to
4e57335
Compare
6887325
to
e604bf8
Compare
e2119fd
to
27783b1
Compare
cca3ad6
to
199b550
Compare
I cannot comment on that line but in https://github.com/bugadani/esp-hal/blob/199b550774091788556b209e14b028259e983560/esp-hal-common/src/interrupt/riscv.rs#L467 |
7ee8e7d
to
f4ac3ca
Compare
Thanks, fixed (I think) |
7afe9ae
to
e995570
Compare
Looks good to me One thing though (w/o atomic emulation)
|
Thanks, I cleaned up and drive-by deleted the |
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.
LGTM
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 for fighting your way through this! LGTM
Thank you!
Thank you for your contribution.
Please make sure that your submission includes the following:
Must
errors
orwarnings
.cargo fmt
was run.CHANGELOG.md
in the proper section.Nice to have
Let's try to make portable-atomic work by default and demote atomic emulation traps on risc-v. Xtensa is left untouched because, due to a happy accident, it works with atomic-polyfill and trying to remove emulation causes a bunch of problems in multiple crates.
I've updated CI so Clippy now runs on the target folder, using the correct target. This is required because otherwise
portable-atomic
doesn't allow enabling theunstable-assume-single-core
feature - which is annoying, but fair when clippy wants to target the host architecture.The current idea is, that neither atomic emulation, nor portable-atomic is enabled by default. The portable-atomic feature in esp-hal isn't very useful for RISC-V, but we may (barring ULP...) enable
unsafe-assume-single-core
or other default features. Besides that, I've kept the feature just to detect mutual exclusivity with the emulation trap. I may be overthinking this part, though, I'm not sure.