-
Notifications
You must be signed in to change notification settings - Fork 155
raw_access #841
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
base: master
Are you sure you want to change the base?
raw_access #841
Conversation
I'm not sure if there's any advantage to skipping volatile_cell but still having the registers be themselves memory-mapped (with &self cast to a pointer). We still have the problem that Rust can dereference &self and perform an invalid read. Probably we have to do something similar to chiptool where the peripheral struct owns a pointer and the register methods offset it - the total memory cost is the same because instead of having reference-to-a-ZST like now, we would have an owned-pointer. It might be hard to do this and keep vcell too, but maybe we can just remove vcell support at the same time? |
904b44e
to
a816243
Compare
It is not hard. Review yet one time, please.
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
16f62df
to
1d0fea5
Compare
7c5a312
to
44ec5dc
Compare
/ci diff pr --current " --raw-access" |
Diff for comment |
Any news on this? May I help somehow? |
e564d2d
to
6eebb01
Compare
@romancardenas I've rebased but I'm not sure there is nothing missed. |
/ci diff pr --current " --raw-access" |
Diff for comment |
quote! { | ||
#[doc = #doc] | ||
#[inline(always)] | ||
pub const fn #name(&self) -> #ty { |
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.
Do we not want &#ty here? Same for the other accessors
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, with raw access, peripherals return pointers to registers instead of a reference to one of the fields of their register block. Thus, instead of borrowing access, users are "owners" of these registers.
Related to rust-embedded/wg#791
cc @adamgreig