Lines Matching refs:MMArch

20     arch::MMArch,
53 static INNER_ALLOCATOR: SpinLock<Option<BuddyAllocator<MMArch>>> = SpinLock::new(None);
311 MMArch::phys_2_virt(PhysAddr::new(0)).unwrap().data() in mm_init()
325 unsafe { MMArch::virt_2_phys(VirtAddr::new(page_align_up(virt_offset))) }.unwrap(); in allocator_init()
338 let _old_page_table = MMArch::table(PageTableKind::Kernel); in allocator_init()
344 let mut mapper: crate::mm::page::PageMapper<MMArch, &mut BumpAllocator<MMArch>> = in allocator_init()
345 crate::mm::page::PageMapper::<MMArch, _>::create( in allocator_init()
356 let empty_entry = PageEntry::<MMArch>::new(0); in allocator_init()
357 for i in 0..MMArch::PAGE_ENTRY_NUM { in allocator_init()
367 for i in 0..((area.size + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE) { in allocator_init()
368 let paddr = area.base.add(i * MMArch::PAGE_SIZE); in allocator_init()
369 let vaddr = unsafe { MMArch::phys_2_virt(paddr) }.unwrap(); in allocator_init()
370 let flags = kernel_page_flags::<MMArch>(vaddr); in allocator_init()
408 let mapper = crate::mm::page::PageMapper::<MMArch, _>::new( in allocator_init()
466 assert!(paddr.data() % MMArch::PAGE_SIZE == 0); in test_buddy()
468 assert!(MMArch::phys_2_virt(paddr) in test_buddy()
471 .check_aligned(allocated_frame_count.data() * MMArch::PAGE_SIZE)); in test_buddy()
473 allocated += allocated_frame_count.data() * MMArch::PAGE_SIZE; in test_buddy()
478 let vaddr = unsafe { MMArch::phys_2_virt(paddr).unwrap() }; in test_buddy()
482 allocated_frame_count.data() * MMArch::PAGE_SIZE, in test_buddy()
502 free_count += allocated_frame_count.data() * MMArch::PAGE_SIZE; in test_buddy()
518 free_count += allocated_frame_count.data() * MMArch::PAGE_SIZE; in test_buddy()
571 unsafe fn set_inner_allocator(allocator: BuddyAllocator<MMArch>) { in set_inner_allocator() argument
592 mapper: &mut crate::mm::page::PageMapper<MMArch, &mut BumpAllocator<MMArch>>, in remap_at_low_address() argument
594 for i in 0..(Self::REMAP_SIZE / MMArch::PAGE_SIZE) { in remap_at_low_address()
595 let paddr = PhysAddr::new(i * MMArch::PAGE_SIZE); in remap_at_low_address()
596 let vaddr = VirtAddr::new(i * MMArch::PAGE_SIZE); in remap_at_low_address()
597 let flags = kernel_page_flags::<MMArch>(vaddr); in remap_at_low_address()
611 for i in 0..(Self::REMAP_SIZE / MMArch::PAGE_SIZE) { in unmap_at_low_address()
612 let vaddr = VirtAddr::new(i * MMArch::PAGE_SIZE); in unmap_at_low_address()