-
Notifications
You must be signed in to change notification settings - Fork 173
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
userlib: add a critical-section impl for task code. #1646
Conversation
84b9f98
to
71cb33e
Compare
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.
license-eye has totally checked 508 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
507 | 1 | 0 | 0 |
Click to see the invalid file list
- sys/userlib/src/critical_section.rs
71cb33e
to
932b976
Compare
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.
looks good to me --- i'm excited for the subsequent PR to get rid of armv6m-atomic-hack
!
932b976
to
9420a69
Compare
it occurs to me that a very nice side benefit of Hubris' use of separate compilation for tasks is that we can allow an individual task to opt in/out of global |
@hawkw fwiw, this is also why we tend to appear in discussions of changing Cargo's feature unification behavior -- this is great behavior for our purposes, but is really annoying for some other people! Explaining the use case publicly would probably help, you're right. |
9420a69
to
6eed925
Compare
6eed925
to
35c48ae
Compare
The embedded ecosystem is starting to catch up with the fact that not all of us are running a single address space in privileged mode, and crates like
portable-atomics
may now be in a state where we could rely on them.Implementing things like atomic polyfills on platforms without atomics requires some way to control concurrency, and crates seem to be standardizing on the
critical-section
crate -- which unlike the old critical section incortex-m
, can be customized for our purposes.So, this commit adds a backing implementation to
userlib
to allow thecritical-section
crate to be used in tasks. I'm slightly alarmed to note that our dependency graph already includes a very old version ofcritical-section
, but I'm pretty sure that should be safe since we've never provided an impl for it. It is presumably not being linked in.I need to do more work to evaluate the code generation of crates like
portable-atomics
, but this part, at least, I think we can probably land.