pub unsafe fn map_memory(origin: *mut u8, size: usize, attributes: u64) -> *mut u8 {
  // the mmu configuration depends on the exception level we are running in
  let el = currentel::read(currentel::EL::Field).value();
  if el == 1 {
    ttbr1::maintain_pages(origin, size, attributes)
  } else {
    origin
  }
}
/// Map a given address to a virtual address with the specified memory attributes.
/// TODO: Memory attributes shall be a specific allowed set only - create a new type for this!
///
/// # Safety
/// This is safe if the MMU has been configured already. Also the given raw pointer need to point to an
/// address provided from a call to `alloc::alloc(...)` with at least `size` bytes and is aligned to the actual
/// page size boundries.
/// # Hint
/// If the MMU is not configured to use the TTBR1 virtual address mapping this call has no effect and the returned
/// address can not being used.
Map a given address to a virtual address with the specified memory attributes.
TODO: Memory attributes shall be a specific allowed set only - create a new type for this!
Map a given address to a virtual address with the specified memory attributes . TODO : Memory attributes shall be a specific allowed set only - create a new type for this!
pub unsafe fn map_memory(origin: *mut u8, size: usize, attributes: u64) -> *mut u8 {
  // the mmu configuration depends on the exception level we are running in
  let el = currentel::read(currentel::EL::Field).value();
  if el == 1 {
    ttbr1::maintain_pages(origin, size, attributes)
  } else {
    origin
  }
}
pub unsafe fn map_memory ( origin : * mut u8 , size : usize , attributes : u64 ) -> * mut u8 { // the mmu configuration depends on the exception level we are running in let el = currentel :: read ( currentel :: EL :: Field ) . value ( ) ; if el == 1 { ttbr1 :: maintain_pages ( origin , size , attributes ) } else { origin } }
Map a given address to a virtual address with the specified memory attributes.
Map a given address to a virtual address with the specified memory attributes .
origin
*mut u8
size
usize
attributes
u64
safety
This is safe if the MMU has been configured already. Also the given raw pointer need to point to an
address provided from a call to `alloc::alloc(...)` with at least `size` bytes and is aligned to the actual
page size boundries.
This is safe if the MMU has been configured already . Also the given raw pointer need to point to an address provided from a call to ` alloc :: alloc ( ... ) ` with at least ` size ` bytes and is aligned to the actual page size boundries .
hint
If the MMU is not configured to use the TTBR1 virtual address mapping this call has no effect and the returned
address can not being used.
If the MMU is not configured to use the TTBR1 virtual address mapping this call has no effect and the returned address can not being used .