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
pmp: add PMP struct #2064
pmp: add PMP struct #2064
Conversation
The PMP wasn't working on the arty because the configure function wasn't actually iterating the PMP regions. This separates out the PMP from the config, and makes a lot more sense to me. And it works on the arty-e21 board.
pub struct PMPConfig<N: PMPConfigType> { | ||
pub struct PMPConfig { |
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.
This change is fine, but just noting that it is moving us more towards the macro approach as we get further away from the array generators.
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.
For general awareness, the minimum subset of const generics that will be stabilized now has its own feature gate (rust-lang/rust#74877). Its not stable yet, but clearly on the fast track now.
arch/rv32i/src/pmp.rs
Outdated
fn default() -> Self { | ||
PMPConfig { | ||
regions: [None; $x / 2], | ||
is_dirty: Cell::new(true), | ||
last_configured_for: MapCell::empty(), | ||
|
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.
There is an extra new line here
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.
Clearly an improvement today, though I share Alistair's concern about this making the move back away from using a macro harder.
bors r+
Pull Request Overview
The PMP wasn't working on the arty because the configure function wasn't actually iterating the PMP regions. This separates out the PMP from the config, and makes a lot more sense to me. And it works on the arty-e21 board.
Testing Strategy
This pull request was tested by running on arty e21.
TODO or Help Wanted
n/a
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.