Struct memflow::types::physical_address::PhysicalAddress
source · #[repr(C)]pub struct PhysicalAddress {
pub address: Address,
pub page_type: PageType,
/* private fields */
}
Expand description
This type represents a wrapper over a address with additional information about the containing page in the physical memory domain.
This type will mostly be used by the virtual to physical address translation. When a physical address is translated from a virtual address the additional information about the allocated page the virtual address points to can be obtained from this structure.
Most architectures have support multiple page sizes (see huge pages)
which will be represented by the containing page
of the PhysicalAddress
struct.
Fields§
§address: Address
§page_type: PageType
Implementations§
source§impl PhysicalAddress
impl PhysicalAddress
sourcepub const NULL: PhysicalAddress = _
pub const NULL: PhysicalAddress = _
A physical address with a value of zero.
sourcepub const INVALID: PhysicalAddress = _
pub const INVALID: PhysicalAddress = _
A physical address with an invalid value.
sourcepub fn with_page(address: Address, page_type: PageType, page_size: umem) -> Self
pub fn with_page(address: Address, page_type: PageType, page_size: umem) -> Self
Constructs a new PhysicalAddress
form an Address
with
additional information about the page this address
is contained in.
Note: The page size must be a power of 2.
sourcepub const fn has_page(&self) -> bool
pub const fn has_page(&self) -> bool
Checks wether the physical address also contains page informations or not.
sourcepub const fn page_type(&self) -> PageType
pub const fn page_type(&self) -> PageType
Returns the type of page this physical address is contained in.
sourcepub fn page_size(&self) -> umem
pub fn page_size(&self) -> umem
Returns the size of the page this physical address is contained in.
sourcepub fn containing_page(&self) -> Page
pub fn containing_page(&self) -> Page
Converts the physical address into it’s containing page page
Trait Implementations§
source§impl Clone for PhysicalAddress
impl Clone for PhysicalAddress
source§fn clone(&self) -> PhysicalAddress
fn clone(&self) -> PhysicalAddress
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PhysicalAddress
impl Debug for PhysicalAddress
source§impl Default for PhysicalAddress
impl Default for PhysicalAddress
Returns a physical address with a value of zero.
source§impl<'de> Deserialize<'de> for PhysicalAddress
impl<'de> Deserialize<'de> for PhysicalAddress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for PhysicalAddress
impl Display for PhysicalAddress
source§impl From<Address> for PhysicalAddress
impl From<Address> for PhysicalAddress
Converts a PhysicalAddress
into a Address
.
source§impl From<PhysicalAddress> for Address
impl From<PhysicalAddress> for Address
Converts a PhysicalAddress
into a Address
.
source§fn from(address: PhysicalAddress) -> Self
fn from(address: PhysicalAddress) -> Self
source§impl<U: PrimitiveAddress, T: ?Sized> From<Pointer<U, T>> for PhysicalAddress
impl<U: PrimitiveAddress, T: ?Sized> From<Pointer<U, T>> for PhysicalAddress
source§impl<U: PrimitiveAddress> From<U> for PhysicalAddress
impl<U: PrimitiveAddress> From<U> for PhysicalAddress
source§impl From<i16> for PhysicalAddress
impl From<i16> for PhysicalAddress
source§impl From<i32> for PhysicalAddress
impl From<i32> for PhysicalAddress
source§impl From<i64> for PhysicalAddress
impl From<i64> for PhysicalAddress
source§impl From<i8> for PhysicalAddress
impl From<i8> for PhysicalAddress
source§impl From<u8> for PhysicalAddress
impl From<u8> for PhysicalAddress
source§impl From<usize> for PhysicalAddress
impl From<usize> for PhysicalAddress
source§impl GetStaticEquivalent_ for PhysicalAddress
impl GetStaticEquivalent_ for PhysicalAddress
type StaticEquivalent = _static_PhysicalAddress
source§impl LowerHex for PhysicalAddress
impl LowerHex for PhysicalAddress
source§impl Ord for PhysicalAddress
impl Ord for PhysicalAddress
source§fn cmp(&self, other: &PhysicalAddress) -> Ordering
fn cmp(&self, other: &PhysicalAddress) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for PhysicalAddress
impl PartialEq for PhysicalAddress
source§fn eq(&self, other: &PhysicalAddress) -> bool
fn eq(&self, other: &PhysicalAddress) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for PhysicalAddress
impl PartialOrd for PhysicalAddress
source§fn partial_cmp(&self, other: &PhysicalAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &PhysicalAddress) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for PhysicalAddress
impl Serialize for PhysicalAddress
source§impl StableAbi for PhysicalAddress
impl StableAbi for PhysicalAddress
§type IsNonZeroType = False
type IsNonZeroType = False
source§const LAYOUT: &'static TypeLayout = _
const LAYOUT: &'static TypeLayout = _
source§const ABI_CONSTS: AbiConsts = _
const ABI_CONSTS: AbiConsts = _
const
-equivalents of the associated types.source§impl UpperHex for PhysicalAddress
impl UpperHex for PhysicalAddress
impl Copy for PhysicalAddress
impl Eq for PhysicalAddress
impl StructuralEq for PhysicalAddress
impl StructuralPartialEq for PhysicalAddress
Auto Trait Implementations§
impl RefUnwindSafe for PhysicalAddress
impl Send for PhysicalAddress
impl Sync for PhysicalAddress
impl Unpin for PhysicalAddress
impl UnwindSafe for PhysicalAddress
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<'a, T> BorrowOwned<'a> for Twhere
T: 'a + Clone,
impl<'a, T> BorrowOwned<'a> for Twhere
T: 'a + Clone,
fn r_borrow( this: &'a <T as BorrowOwned<'a>>::ROwned ) -> <T as BorrowOwned<'a>>::RBorrowed
fn r_to_owned( this: <T as BorrowOwned<'a>>::RBorrowed ) -> <T as BorrowOwned<'a>>::ROwned
fn deref_borrowed(this: &<T as BorrowOwned<'a>>::RBorrowed) -> &T
fn deref_owned(this: &<T as BorrowOwned<'a>>::ROwned) -> &T
fn from_cow_borrow(this: &'a T) -> <T as BorrowOwned<'a>>::RBorrowed
fn from_cow_owned(this: <T as ToOwned>::Owned) -> <T as BorrowOwned<'a>>::ROwned
fn into_cow_borrow(this: <T as BorrowOwned<'a>>::RBorrowed) -> &'a T
fn into_cow_owned(this: <T as BorrowOwned<'a>>::ROwned) -> <T as ToOwned>::Owned
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> GetWithMetadata for T
impl<T> GetWithMetadata for T
§type ForSelf = WithMetadata_<T, T>
type ForSelf = WithMetadata_<T, T>
WithMetadata_<Self, Self>
§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset
. Read more§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset
. Read more§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset
. Read more§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset
. Read more§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read more§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read more§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
§fn piped_ref<'a, F, U>(&'a self, f: F) -> U
fn piped_ref<'a, F, U>(&'a self, f: F) -> U
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read more§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read more