/DragonOS-0.1.8/kernel/src/mm/ |
D | no_init.rs | 11 use crate::mm::{MMArch, MemoryManagementArch, PhysAddr}; 58 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys() 59 assert!(paddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys() 61 let mut pseudo_allocator = PseudoAllocator::<MMArch>::new(); in pseudo_map_phys() 63 let mut mapper = crate::mm::page::PageMapper::<MMArch, _>::new( in pseudo_map_phys() 65 MMArch::table(PageTableKind::Kernel), in pseudo_map_phys() 69 let flags: PageFlags<MMArch> = PageFlags::new().set_write(true).set_execute(true); in pseudo_map_phys() 72 let vaddr = vaddr + i * MMArch::PAGE_SIZE; in pseudo_map_phys() 73 let paddr = paddr + i * MMArch::PAGE_SIZE; in pseudo_map_phys()
|
D | ucontext.rs | 19 arch::{asm::current::current_pcb, mm::PageMapper, CurrentIrqArch, MMArch}, 123 user_mapper: MMArch::setup_new_usermapper()?, in new() 128 brk_start: MMArch::USER_BRK_START, in new() 129 brk: MMArch::USER_BRK_START, in new() 167 let tmp_flags: PageFlags<MMArch> = PageFlags::new().set_write(true); in try_clone() 172 PageFrameCount::new(vma_guard.region.size() / MMArch::PAGE_SIZE), in try_clone() 183 MMArch::phys_2_virt( in try_clone() 194 MMArch::phys_2_virt( in try_clone() 208 new_frame.copy_from_nonoverlapping(current_frame, MMArch::PAGE_SIZE); in try_clone() 247 let addr = hint.data() & (!MMArch::PAGE_OFFSET_MASK); in map_anonymous() [all …]
|
D | syscall.rs | 6 arch::MMArch, 75 if new_addr < address_space.brk_start || new_addr >= MMArch::USER_END_VADDR { in brk() 171 assert!(start_vaddr.check_aligned(MMArch::PAGE_SIZE)); in munmap() 172 assert!(check_aligned(len, MMArch::PAGE_SIZE)); in munmap() 183 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in munmap() 204 assert!(start_vaddr.check_aligned(MMArch::PAGE_SIZE)); in mprotect() 205 assert!(check_aligned(len, MMArch::PAGE_SIZE)); in mprotect() 218 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in mprotect()
|
D | kernel_mapper.rs | 10 mm::{MMArch, MemoryManagementArch}, 103 flags: PageFlags<MMArch>, in map_phys_with_size() argument 110 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in map_phys_with_size() 120 vaddr += MMArch::PAGE_SIZE; in map_phys_with_size() 121 paddr += MMArch::PAGE_SIZE; in map_phys_with_size()
|
D | c_adapter.rs | 13 mm::MMArch, 32 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_pseudo_map_phys() 41 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_map_phys() 44 let mut page_flags: PageFlags<MMArch> = PageFlags::new().set_execute(true).set_write(true); in rs_map_phys() 61 vaddr += MMArch::PAGE_SIZE; in rs_map_phys() 62 paddr += MMArch::PAGE_SIZE; in rs_map_phys()
|
D | page.rs | 10 arch::{interrupt::ipi::send_ipi, MMArch}, 143 let mask = (MMArch::PAGE_ENTRY_NUM << shift) - 1; in index_of() 147 return Some((addr.data() >> shift) & MMArch::PAGE_ENTRY_MASK); in index_of() 603 MMArch::write_bytes(MMArch::phys_2_virt(frame).unwrap(), 0, MMArch::PAGE_SIZE); in map_phys() 613 let flags: PageFlags<MMArch> = in map_phys() 901 impl Flusher<MMArch> for InactiveFlusher { 902 fn consume(&mut self, flush: PageFlush<MMArch>) { in consume() argument 918 addr & !(MMArch::PAGE_SIZE - 1) in round_down_to_page_size() 923 round_down_to_page_size(addr + MMArch::PAGE_SIZE - 1) in round_up_to_page_size()
|
D | mmio_buddy.rs | 8 mm::{MMArch, MemoryManagementArch}, 532 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in release_mmio() 533 assert!(length & (MMArch::PAGE_SIZE - 1) == 0); in release_mmio() 542 let page_count = length / MMArch::PAGE_SIZE; in release_mmio() 556 .unmap(vaddr + i * MMArch::PAGE_SIZE, true) in release_mmio()
|
D | mod.rs | 4 arch::MMArch, 223 if self < &MMArch::USER_END_VADDR { in check_user()
|
/DragonOS-0.1.8/kernel/src/driver/virtio/ |
D | virtio_impl.rs | 3 use crate::arch::MMArch; 26 ((pages * PAGE_SIZE + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE).next_power_of_two(), in dma_alloc() 31 let virt = MMArch::phys_2_virt(paddr).unwrap(); in dma_alloc() 33 core::ptr::write_bytes(virt.data() as *mut u8, 0, count.data() * MMArch::PAGE_SIZE); in dma_alloc() 35 let dma_flags: PageFlags<MMArch> = PageFlags::mmio_flags(); in dma_alloc() 45 NonNull::new(MMArch::phys_2_virt(paddr).unwrap().data() as _).unwrap(), in dma_alloc() 58 ((pages * PAGE_SIZE + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE).next_power_of_two(), in dma_dealloc() 91 return MMArch::virt_2_phys(vaddr).unwrap().data(); in share()
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/ |
D | mod.rs | 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() [all …]
|
/DragonOS-0.1.8/kernel/src/mm/allocator/ |
D | kernel_allocator.rs | 4 mm::{MMArch, MemoryManagementArch, VirtAddr}, 27 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in alloc_in_buddy() 33 let virt_addr = unsafe { MMArch::phys_2_virt(phy_addr).ok_or(AllocError)? }; in alloc_in_buddy() 41 allocated_frame_count.data() * MMArch::PAGE_SIZE, in alloc_in_buddy() 49 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in free_in_buddy() 51 let phy_addr = MMArch::virt_2_phys(VirtAddr::new(ptr as usize)).unwrap(); in free_in_buddy()
|
D | page_frame.rs | 7 arch::{mm::LockedFrameAllocator, MMArch}, 22 number: paddr.data() / MMArch::PAGE_SIZE, in new() 28 return PhysAddr::new(self.number * MMArch::PAGE_SIZE); in phys_address() 86 number: vaddr.data() / MMArch::PAGE_SIZE, in new() 92 return VirtAddr::new(self.number * MMArch::PAGE_SIZE); in virt_address() 168 return self.0 * MMArch::PAGE_SIZE; in bytes() 175 if bytes & MMArch::PAGE_OFFSET_MASK != 0 { in from_bytes() 178 return Some(Self(bytes / MMArch::PAGE_SIZE)); in from_bytes()
|
D | buddy.rs | 6 use crate::arch::MMArch; 97 core::ptr::write_bytes(MMArch::phys_2_virt(*f)?.data() as *mut u8, 0, A::PAGE_SIZE); in new() 108 MMArch::phys_2_virt(curr_page)?.data() as *mut u8, in new() 299 self.buddy_free(page_list_addr, MMArch::PAGE_SHIFT as u8); in pop_front() 342 unsafe { self.buddy_free(page_list_addr, MMArch::PAGE_SHIFT as u8) }; in pop_front()
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/ |
D | mod.rs | 18 pub use self::mm::X86_64MMArch as MMArch;
|
/DragonOS-0.1.8/kernel/src/libs/ |
D | align.rs | 6 use crate::{arch::MMArch, mm::MemoryManagementArch, syscall::SystemError, KERNEL_ALLOCATOR}; 122 let page_size = MMArch::PAGE_SIZE; in page_align_up()
|
D | elf.rs | 11 arch::MMArch, 41 pub const ELF_PAGE_SIZE: usize = MMArch::PAGE_SIZE; 356 .insert(AtType::PageSize as u8, MMArch::PAGE_SIZE); in create_auxv() 632 || seg_to_load.p_memsz > MMArch::USER_END_VADDR.data() as u64 in load()
|
/DragonOS-0.1.8/kernel/src/syscall/ |
D | mod.rs | 9 arch::{cpu::cpu_reset, MMArch}, 940 if addr & MMArch::PAGE_SIZE != 0 { in handle() 950 if addr & MMArch::PAGE_SIZE != 0 { in handle()
|