@@ -463,13 +463,13 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu/trans
463463 /// Create an instance.
464464- pub fn from_output_addr(phys_output_addr: usize, attribute_fields: &AttributeFields) -> Self {
465465+ pub fn from_output_page(
466- + phys_output_page : *const Page<Physical>,
466+ + phys_output_page_ptr : *const Page<Physical>,
467467+ attribute_fields: &AttributeFields,
468468+ ) -> Self {
469469 let val = InMemoryRegister::<u64, STAGE1_PAGE_DESCRIPTOR::Register>::new(0);
470470
471471- let shifted = phys_output_addr as u64 >> Granule64KiB::SHIFT;
472- + let shifted = phys_output_page as u64 >> Granule64KiB::SHIFT;
472+ + let shifted = phys_output_page_ptr as u64 >> Granule64KiB::SHIFT;
473473 val.write(
474474 STAGE1_PAGE_DESCRIPTOR::OUTPUT_ADDR_64KiB.val(shifted)
475475 + STAGE1_PAGE_DESCRIPTOR::AF::True
@@ -544,9 +544,9 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu/trans
544544+ #[inline(always)]
545545+ fn lvl2_lvl3_index_from_page(
546546+ &self,
547- + virt_page : *const Page<Virtual>,
547+ + virt_page_ptr : *const Page<Virtual>,
548548+ ) -> Result<(usize, usize), &'static str> {
549- + let addr = virt_page as usize;
549+ + let addr = virt_page_ptr as usize;
550550+ let lvl2_index = addr >> Granule512MiB::SHIFT;
551551+ let lvl3_index = (addr & Granule512MiB::MASK) >> Granule64KiB::SHIFT;
552552+
@@ -568,10 +568,10 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu/trans
568568+ #[inline(always)]
569569+ fn set_page_descriptor_from_page(
570570+ &mut self,
571- + virt_page : *const Page<Virtual>,
571+ + virt_page_ptr : *const Page<Virtual>,
572572+ new_desc: &PageDescriptor,
573573+ ) -> Result<(), &'static str> {
574- + let (lvl2_index, lvl3_index) = self.lvl2_lvl3_index_from_page(virt_page )?;
574+ + let (lvl2_index, lvl3_index) = self.lvl2_lvl3_index_from_page(virt_page_ptr )?;
575575+ let desc = &mut self.lvl3[lvl2_index][lvl3_index];
576576
577577- for (l3_nr, l3_entry) in self.lvl3[l2_nr].iter_mut().enumerate() {
@@ -637,7 +637,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu/trans
637637+ return Err("Tried to map page slices with unequal sizes");
638638+ }
639639+
640- + if p.last().unwrap().as_ptr() >= bsp::memory::mmu::phys_addr_space_end_page () {
640+ + if p.last().unwrap().as_ptr() >= bsp::memory::mmu::phys_addr_space_end_page_ptr () {
641641+ return Err("Tried to map outside of physical address space");
642642+ }
643643+
@@ -1624,7 +1624,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory/mmu.rs
16241624+ }
16251625+
16261626+ /// Pointer to the last page of the physical address space.
1627- + pub fn phys_addr_space_end_page () -> *const Page<Physical> {
1627+ + pub fn phys_addr_space_end_page_ptr () -> *const Page<Physical> {
16281628+ common::align_down(
16291629+ super::phys_addr_space_end().into_usize(),
16301630+ KernelGranule::SIZE,
@@ -2582,7 +2582,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 14_virtual
25822582+ }
25832583+
25842584+ /// Return a pointer to the first page of the described slice.
2585- + const fn first_page (&self) -> *const Page<ATYPE> {
2585+ + const fn first_page_ptr (&self) -> *const Page<ATYPE> {
25862586+ self.start.into_usize() as *const _
25872587+ }
25882588+
@@ -2622,7 +2622,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 14_virtual
26222622+ ///
26232623+ /// - Same as applies for `core::slice::from_raw_parts`.
26242624+ pub unsafe fn as_slice(&self) -> &[Page<ATYPE>] {
2625- + core::slice::from_raw_parts(self.first_page (), self.num_pages)
2625+ + core::slice::from_raw_parts(self.first_page_ptr (), self.num_pages)
26262626+ }
26272627+ }
26282628+
0 commit comments