-
Notifications
You must be signed in to change notification settings - Fork 168
Documentation: What is the contract to call NVIC::unmask soundly? #197
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
Comments
Copying some discussion from the matrix channel here.
|
The commit that introduced |
I’m at a loss. I don’t see how Pseudo code
The only potential I see here for UB is if a theoretical function existed that temporarily masked some interrupts, returning a critical section token.
This could potentially result in a data race, but the call to The anonymous function itself should be |
@jamesmunns I know japaric has been busy with other things, so I’d like to avoid pinging him as the original author of the code. Can you provide some more insight on this? Am I understanding this correctly? |
Neither It was decided that this was an unacceptable tradeoff, as almost every user would have to make sure to use these unsafe interfaces correctly, so "enable interrupts" was made |
198: Discard .ARM.exidx, closes #197 r=thejpster a=adamgreig Co-authored-by: Adam Greig <[email protected]>
NVIC::enable()
was deprecated with the following warning.https://docs.rs/stm32f3xx-hal/0.3.0/stm32f3xx_hal/stm32/struct.NVIC.html#method.enable
NVIC::unmask()
has the following documentation.https://docs.rs/stm32f3xx-hal/0.3.0/stm32f3xx_hal/stm32/struct.NVIC.html#method.unmask
This isn't sufficient information for someone to know how they can soundly call the
unmask
function to enable interrupts. The documentation should include a# Safety
section per the API guidelines describing the invariants the caller is expected to uphold.The text was updated successfully, but these errors were encountered: