-
-
Notifications
You must be signed in to change notification settings - Fork 70
rsdp: clarify PhysicalMapping documentation #162
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -10,8 +10,8 @@ where | |||||||
{ | ||||||||
physical_start: usize, | ||||||||
virtual_start: NonNull<T>, | ||||||||
region_length: usize, // Can be equal or larger than size_of::<T>() | ||||||||
mapped_length: usize, // Differs from `region_length` if padding is added for alignment | ||||||||
region_length: usize, // Desired physical memory span, can be equal or larger than size_of::<T>() | ||||||||
mapped_length: usize, // Usuable mapped length starting from `virtual_start` | ||||||||
handler: H, | ||||||||
} | ||||||||
|
||||||||
|
@@ -20,14 +20,14 @@ where | |||||||
H: AcpiHandler, | ||||||||
{ | ||||||||
/// Construct a new `PhysicalMapping`. | ||||||||
/// `mapped_length` may differ from `region_length` if padding is added for alignment. | ||||||||
/// `mapped_length` describes usable span from `virtual_start` to end of last mapped page (for paging), and thus may exceed `physical_length`. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A newline should precede this if you meant it to be on the line in the documentation after 'Construct a new
Suggested change
|
||||||||
/// | ||||||||
/// ## Safety | ||||||||
/// | ||||||||
/// This function must only be called by an `AcpiHandler` of type `H` to make sure that it's safe to unmap the mapping. | ||||||||
/// | ||||||||
/// - `virtual_start` must be a valid pointer. | ||||||||
/// - `region_length` must be equal to or larger than `size_of::<T>()`. | ||||||||
/// - `region_length` is the desired physical memory span, must be equal to or larger than `size_of::<T>()`. | ||||||||
/// - `handler` must be the same `AcpiHandler` that created the mapping. | ||||||||
Comment on lines
29
to
31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it could be mentioned that |
||||||||
pub unsafe fn new( | ||||||||
physical_start: usize, | ||||||||
|
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 you think documentation for these fields should be moved to
PhysicalMapping::new
? Its arguments are named the same as the fields, and the documentation underPhysicalMapping::new
has the benefit that it is publicly facing.