Skip to content

Add PhysicalAddress/VirtualAddress to uefi-raw and use them from uefi #789

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 1 commit into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions uefi-raw/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ mod status;

pub use status::Status;
pub use uguid::{guid, Guid};

/// Physical memory address. This is always a 64-bit value, regardless
/// of target platform.
pub type PhysicalAddress = u64;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how beneficial this is.

Copy link
Member Author

Choose a reason for hiding this comment

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

This typedef is part of the spec: EFI_PHYSICAL_ADDRESS

It gets used in a fair number of function definitions in the spec, so I think it's good to have.


/// Virtual memory address. This is always a 64-bit value, regardless
/// of target platform.
pub type VirtualAddress = u64;
10 changes: 2 additions & 8 deletions uefi/src/data_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ pub trait Align {
}
}

/// Physical memory address. This is always a 64-bit value, regardless
/// of target platform.
pub type PhysicalAddress = u64;

/// Virtual memory address. This is always a 64-bit value, regardless
/// of target platform.
pub type VirtualAddress = u64;

mod guid;
pub use self::guid::{Guid, Identify};

Expand All @@ -143,6 +135,8 @@ pub use self::owned_strs::{CString16, FromStrError};
mod unaligned_slice;
pub use unaligned_slice::UnalignedSlice;

pub use uefi_raw::{PhysicalAddress, VirtualAddress};

#[cfg(test)]
mod tests {
use super::*;
Expand Down