-
Notifications
You must be signed in to change notification settings - Fork 747
Add reset function to cortexm::support #3404
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
Add reset function to cortexm::support #3404
Conversation
scb::reset(); | ||
} | ||
loop { | ||
// This is required to avoid the empty loop clippy | ||
// warning #[warn(clippy::empty_loop)] | ||
nop(); | ||
} | ||
} |
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.
I think that scb::reset should also have the signature fn () -> !
and the nop loop should be moved into there.
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.
Sorry hudson
I think in theory, boards would wrap the unsafe cortexm::reset function in a safe version, and pass that to pconsole. That would effectively be using the board's authority to call unsafe to determine that it is ok for that capsule to have what is an unsafe function. But, I think that adds unnecessary overhead. What is here looks fine. |
I agree that |
@lschuermann I am not sure what you want me to do 😄 , my git skills are not that good. |
Pull Request Overview
This pull request adds a reset function to the
cortexm
crate incortexm::support::reset
. The function can be directly used by the process console as a reset function. Before this, boards had to define a functionfn reset() -> !
that used thecortexm::scb::reset
function.As discussed in #3398 (review), the
reset
function is marked as being safe as capsules do jot depend on thecortexm
crate. I am not sure about this, maybe we should guard this using a permission so that even if a capsules does depend ion the arch crate, it cannot use this function.Testing Strategy
N/A
TODO or Help Wanted
N/A
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.