pub unsafe fn initialize(core: u32, vc_mem_start: u32, vc_mem_size: u32) {
  // the mmu configuration depends on the exception level we are running in
  let el = currentel::read(currentel::EL::Field).value();

  // disable MMU before changing any settings and re-activating
  match el {
    1 => el1::disable_mmu(),
    2 => el2::disable_mmu(),
    _ => unimplemented!(),
  }

  // setup translation table entries
  let ttlb0_base_addr = ttbr0::setup_translation_tables(core, vc_mem_start, vc_mem_size) as u64;
  match el {
    1 => {
      let ttlb1_base_addr = ttbr1::setup_translation_tables(core) as u64;
      el1::enable_mmu(ttlb0_base_addr, ttlb1_base_addr);
    }
    2 => el2::enable_mmu(ttlb0_base_addr),
    _ => unimplemented!(),
  }
}
/// Initialize the MMU. This configures an initial 1:1 mapping accross the whole available
/// memory of the Raspberry Pi. Only the memory region from 0x3F00_0000 to 0x4002_0000 is configured
/// as device memory as this is the area the memory mapped peripherals and the core mailboxes are
/// located at.
///
/// # Safety
/// The call to this function is safe when executed as part of the initial setup of the Raspberry Pi kernel and is
/// called only once for each core.
Initialize the MMU. This configures an initial 1:1 mapping accross the whole available
memory of the Raspberry Pi. Only the memory region from 0x3F00_0000 to 0x4002_0000 is configured
as device memory as this is the area the memory mapped peripherals and the core mailboxes are
located at.
Initialize the MMU . This configures an initial 1 : 1 mapping accross the whole available memory of the Raspberry Pi . Only the memory region from 0x3F00_0000 to 0x4002_0000 is configured as device memory as this is the area the memory mapped peripherals and the core mailboxes are located at .
pub unsafe fn initialize(core: u32, vc_mem_start: u32, vc_mem_size: u32) {
  // the mmu configuration depends on the exception level we are running in
  let el = currentel::read(currentel::EL::Field).value();
  // disable MMU before changing any settings and re-activating
  match el {
    1 => el1::disable_mmu(),
    2 => el2::disable_mmu(),
    _ => unimplemented!(),
  }
  // setup translation table entries
  let ttlb0_base_addr = ttbr0::setup_translation_tables(core, vc_mem_start, vc_mem_size) as u64;
  match el {
    1 => {
      let ttlb1_base_addr = ttbr1::setup_translation_tables(core) as u64;
      el1::enable_mmu(ttlb0_base_addr, ttlb1_base_addr);
    }
    2 => el2::enable_mmu(ttlb0_base_addr),
    _ => unimplemented!(),
  }
}
pub unsafe fn initialize ( core : u32 , vc_mem_start : u32 , vc_mem_size : u32 ) { // the mmu configuration depends on the exception level we are running in let el = currentel :: read ( currentel :: EL :: Field ) . value ( ) ; // disable MMU before changing any settings and re-activating match el { 1 => el1 :: disable_mmu ( ) , 2 => el2 :: disable_mmu ( ) , _ => unimplemented ! ( ) , } // setup translation table entries let ttlb0_base_addr = ttbr0 :: setup_translation_tables ( core , vc_mem_start , vc_mem_size ) as u64 ; match el { 1 => { let ttlb1_base_addr = ttbr1 :: setup_translation_tables ( core ) as u64 ; el1 :: enable_mmu ( ttlb0_base_addr , ttlb1_base_addr ) ; } 2 => el2 :: enable_mmu ( ttlb0_base_addr ) , _ => unimplemented ! ( ) , } }
Initialize the MMU.
Initialize the MMU .
core
u32
vc_mem_start
u32
vc_mem_size
u32
safety
The call to this function is safe when executed as part of the initial setup of the Raspberry Pi kernel and is
called only once for each core.
The call to this function is safe when executed as part of the initial setup of the Raspberry Pi kernel and is called only once for each core .