[][src]Struct r3_port_arm::MemoryMapSection

pub struct MemoryMapSection { /* fields omitted */ }

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 of 0..0x1_0000_0000.

  • physical_start is of type u64, 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.

This example panics
// Empty range
MemoryMapSection::new(0x2000_0000..0x2000_0000, 0xc000_0000);
This example panics
// 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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.