Skip to content
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

Abundant critical sections for lack of bit-band access #1

Open
chrysn opened this issue Jan 27, 2019 · 1 comment
Open

Abundant critical sections for lack of bit-band access #1

chrysn opened this issue Jan 27, 2019 · 1 comment

Comments

@chrysn
Copy link
Owner

chrysn commented Jan 27, 2019

There are currently several read-modify-write operations that are unprotected against race conditions.

These occur when a peripheral has been split into parts, and a part logically owns a few bits inside a register. That part could safely read-modify-write on that part of a single 32bit peripheral register, but a different part could simultaneously do the same with different bits of the same register.

Currently, those sections only have big FIXME comments (to be pointed towards this issue).

Paths forward on this issue would be packing them into critical sections, or (at least for setBit/clearBit use) bitband access (cf. rust-embedded/svd2rust#226).

chrysn added a commit that referenced this issue Jan 29, 2019
@chrysn
Copy link
Owner Author

chrysn commented Jan 29, 2019

The race-condition part has been replaced with critical sections -- would be nicer to just set the bits, but at last now that's a matter of style and efficiency rather than soundness.

@chrysn chrysn changed the title Open race conditions for lack of bit-band access Abundant critical sections for lack of bit-band access Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant