8000 Add reset function to cortexm::support by alexandruradovici · Pull Request #3404 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

alexandruradovici
Copy link
Contributor
@alexandruradovici alexandruradovici commented Feb 21, 2023

Pull Request Overview

This pull request adds a reset function to the cortexm crate in cortexm::support::reset. The function can be directly used by the process console as a reset function. Before this, boards had to define a function fn reset() -> ! that used the cortexm::scb::reset function.

As discussed in #3398 (review), the reset function is marked as being safe as capsules do jot depend on the cortexm 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

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

Comment on lines +61 to +68
scb::reset();
}
loop {
// This is required to avoid the empty loop clippy
// warning #[warn(clippy::empty_loop)]
nop();
}
}
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry hudson

@bradjc
Copy link
Contributor
bradjc commented Mar 8, 2023

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.

bradjc
bradjc previously approved these changes Mar 8, 2023
brghena
brghena previously approved these changes Mar 9, 2023
@lschuermann
Copy link
Member

I agree that reset is an incredibly useful command to have in the console and this is a net improvement. I rebased this as a562de8. Can you force push your branch to that commit, @alexandruradovici?

@alexandruradovici alexandruradovici dismissed stale reviews from brghena and bradjc via a00aeac July 21, 2023 12:33
@alexandruradovici
Copy link
Contributor Author

@lschuermann I am not sure what you want me to do 😄 , my git skills are not that good.

@lschuermann lschuermann enabled auto-merge July 21, 2023 12:39
@lschuermann lschuermann added this pull request to the merge queue Jul 21, 2023
Merged via the queue into tock:master with commit 62603be Jul 21, 2023
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

Successfully merging this pull request may close these issues.

6 participants
0