Struct x86_64::addr::PhysAddr[][src]

#[repr(transparent)]
pub struct PhysAddr(_);
Expand description

A 64-bit physical memory address.

This is a wrapper type around an u64, so it is always 8 bytes, even when compiled on non 64-bit systems. The TryFrom trait can be used for performing conversions between u64 and usize.

On x86_64, only the 52 lower bits of a physical address can be used. The top 12 bits need to be zero. This type guarantees that it always represents a valid physical address.

Implementations

Creates a new physical address.

Panics

This function panics if a bit in the range 52 to 64 is set.

Creates a new physical address, throwing bits 52..64 away.

Creates a new physical address, without any checks.

Safety

You must make sure bits 52..64 are zero. This is not checked.

Tries to create a new physical address.

Fails if any bits in the range 52 to 64 are set.

Creates a physical address that points to 0.

Converts the address to an u64.

Convenience method for checking if a physical address is null.

Aligns the physical address upwards to the given alignment.

See the align_up function for more information.

Aligns the physical address downwards to the given alignment.

See the align_down function for more information.

Checks whether the physical address has the demanded alignment.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Formats the value using the given formatter.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Formats the value using the given formatter.

Formats the value using the given formatter.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Formats the value using the given formatter.

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Formats the value using the given formatter.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.