[−][src]Struct r3_port_arm::MemoryMapSection
Implementations
impl MemoryMapSection
[src]
pub const fn new(virtual_range: Range<u64>, physical_start: u64) -> Self
[src]
Construct a MemoryMapSection
for normal read/write memory access.
-
All endpoints must be aligned to 1MiB blocks (
0x???0_0000
). -
virtual_range
must not be empty. -
virtual_range
must be a strict subset of0..0x1_0000_0000
. -
physical_start
is of typeu64
, but using a large physical address (> 4GiB) isn't supported yet.
The memory section is configured as a read/writable (but not executable) Normal memory with a Outer and Inner Write-Back, Write-Allocate attribute.
Examples
use r3_port_arm::MemoryMapSection; // Map VA `0x2000_0000..0x2800_0000` to PA `0xc000_0000.0xc800_0000` MemoryMapSection::new(0x2000_0000..0x2800_0000, 0xc000_0000);
This function panics if an invalid parameter is supplied.
// Empty range MemoryMapSection::new(0x2000_0000..0x2000_0000, 0xc000_0000);
// VA is not in range `0..0x1_0000_0000` MemoryMapSection::new(0x9000_0000..0x11000_0000, 0xc000_0000);
pub const fn as_device_memory(self) -> Self
[src]
Modify the memory attribute for a Device memory, returning the modified
self
.
pub const fn with_sharable(self, sharable: bool) -> Self
[src]
Change the sharability, returning the modified self
.
pub const fn with_executable(self, executable: bool) -> Self
[src]
Change the executability, returning the modified self
.
pub const fn with_writable(self, writable: bool) -> Self
[src]
Change the writability, returning the modified self
.
Trait Implementations
impl Clone for MemoryMapSection
[src]
fn clone(&self) -> MemoryMapSection
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MemoryMapSection
[src]
impl Debug for MemoryMapSection
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,