/DragonOS-0.1.8/kernel/src/mm/allocator/ |
D | bump.rs | 53 let area_base = (area.base.data() + (MMA::PAGE_SIZE - 1)) & !(MMA::PAGE_SIZE - 1); in allocate() 56 let area_end = (area.base.data() + area.size) & !(MMA::PAGE_SIZE - 1); in allocate() 68 offset = (offset + (MMA::PAGE_SIZE - 1)) & !(MMA::PAGE_SIZE - 1); in allocate() 71 if offset + count.data() * MMA::PAGE_SIZE <= area_end { in allocate() 74 self.offset = offset + count.data() * MMA::PAGE_SIZE; in allocate()
|
D | page_frame.rs | 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() 178 return Some(Self(bytes / MMArch::PAGE_SIZE)); in from_bytes()
|
D | kernel_allocator.rs | 27 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); 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()
|
D | buddy.rs | 74 (A::PAGE_SIZE - mem::size_of::<PageList<A>>()) / mem::size_of::<PhysAddr>(); 83 (((initial_free_pages.data() * A::PAGE_SIZE) >> (MAX_ORDER - 1)) + Self::BUDDY_ENTRIES in new() 97 core::ptr::write_bytes(MMArch::phys_2_virt(*f)?.data() as *mut u8, 0, A::PAGE_SIZE); in new() 110 A::PAGE_SIZE, in new() 155 let mut entries = (remain_pages.data() * A::PAGE_SIZE) >> i; in new() 205 let mut remain_bytes = remain_pages.data() * A::PAGE_SIZE; in new() 228 assert!(paddr == initial_bump_offset + pages_to_buddy.data() * A::PAGE_SIZE); in new()
|
/DragonOS-0.1.8/kernel/src/driver/virtio/ |
D | virtio_impl.rs | 14 use virtio_drivers::{BufferDirection, Hal, PAGE_SIZE}; 26 ((pages * PAGE_SIZE + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE).next_power_of_two(), in dma_alloc() 33 core::ptr::write_bytes(virt.data() as *mut u8, 0, count.data() * MMArch::PAGE_SIZE); in dma_alloc() 58 ((pages * PAGE_SIZE + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE).next_power_of_two(), in dma_dealloc()
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | no_init.rs | 58 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys() 59 assert!(paddr.check_aligned(MMArch::PAGE_SIZE)); 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 | syscall.rs | 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 | 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 | 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() 61 vaddr += MMArch::PAGE_SIZE; in rs_map_phys() 62 paddr += MMArch::PAGE_SIZE; in rs_map_phys()
|
D | ucontext.rs | 172 PageFrameCount::new(vma_guard.region.size() / MMArch::PAGE_SIZE), in try_clone() 208 new_frame.copy_from_nonoverlapping(current_frame, MMArch::PAGE_SIZE); in try_clone() 501 assert!(new_brk.check_aligned(MMArch::PAGE_SIZE)); in set_brk() 673 if requested.end() >= MMArch::USER_END_VADDR || !vaddr.check_aligned(MMArch::PAGE_SIZE) { in find_free_at() 885 assert!(region.start().check_aligned(MMArch::PAGE_SIZE)); in extract() 886 assert!(region.end().check_aligned(MMArch::PAGE_SIZE)); in extract() 1063 region: VirtRegion::new(destination.virt_address(), count.data() * MMArch::PAGE_SIZE), in physmap() 1110 page_count.data() * MMArch::PAGE_SIZE, in zeroed() 1128 MMArch::write_bytes(vaddr, 0, MMArch::PAGE_SIZE); in zeroed() 1188 assert!(stack_bottom.check_aligned(MMArch::PAGE_SIZE)); in new() [all …]
|
D | page.rs | 499 Arch::write_bytes(table_vaddr, 0, Arch::PAGE_SIZE); in create() 564 if !(virt.check_aligned(Arch::PAGE_SIZE) && phys.check_aligned(Arch::PAGE_SIZE)) { in map_phys() 603 MMArch::write_bytes(MMArch::phys_2_virt(frame).unwrap(), 0, MMArch::PAGE_SIZE); in map_phys() 713 if !virt.check_aligned(Arch::PAGE_SIZE) { in unmap_phys() 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 | 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 | 355 const PAGE_SIZE: usize = 1 << Self::PAGE_SHIFT; constant 357 const PAGE_OFFSET_MASK: usize = Self::PAGE_SIZE - 1; 364 const PAGE_ADDRESS_MASK: usize = Self::PAGE_ADDRESS_SIZE - Self::PAGE_SIZE; 376 const ENTRY_ADDRESS_MASK: usize = Self::ENTRY_ADDRESS_SIZE - Self::PAGE_SIZE;
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/ |
D | mod.rs | 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() 466 assert!(paddr.data() % MMArch::PAGE_SIZE == 0); 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() 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() 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() [all …]
|
/DragonOS-0.1.8/kernel/src/libs/ |
D | align.rs | 122 let page_size = MMArch::PAGE_SIZE; in page_align_up()
|
D | elf.rs | 41 pub const ELF_PAGE_SIZE: usize = MMArch::PAGE_SIZE; 356 .insert(AtType::PageSize as u8, MMArch::PAGE_SIZE); in create_auxv()
|
/DragonOS-0.1.8/kernel/src/syscall/ |
D | mod.rs | 940 if addr & MMArch::PAGE_SIZE != 0 { in handle() 950 if addr & MMArch::PAGE_SIZE != 0 { in handle()
|