/DragonOS-0.1.9/kernel/src/driver/net/ |
D | dma.rs | 14 const PAGE_SIZE: usize = 4096; constant 20 ((pages * PAGE_SIZE + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE).next_power_of_two(), in dma_alloc() 26 core::ptr::write_bytes(virt.data() as *mut u8, 0, count.data() * MMArch::PAGE_SIZE); in dma_alloc() 47 ((pages * PAGE_SIZE + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE).next_power_of_two(), in dma_dealloc()
|
/DragonOS-0.1.9/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.9/kernel/src/mm/ |
D | no_init.rs | 35 data: [u64; MMArch::PAGE_SIZE], 57 data: [0; MMArch::PAGE_SIZE], in new() 76 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in allocate_page() 87 let index = offset / MMArch::PAGE_SIZE; in free_page() 119 assert!(address.check_aligned(MMA::PAGE_SIZE)); in free() 165 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys_with_flags() 166 assert!(paddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys_with_flags() 177 let vaddr = vaddr + i * MMArch::PAGE_SIZE; in pseudo_map_phys_with_flags() 178 let paddr = paddr + i * MMArch::PAGE_SIZE; in pseudo_map_phys_with_flags() 194 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_unmap_phys() [all …]
|
D | syscall.rs | 286 if !old_vaddr.check_aligned(MMArch::PAGE_SIZE) { in mremap() 347 assert!(start_vaddr.check_aligned(MMArch::PAGE_SIZE)); in munmap() 348 assert!(check_aligned(len, MMArch::PAGE_SIZE)); in munmap() 359 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in munmap() 381 assert!(start_vaddr.check_aligned(MMArch::PAGE_SIZE)); in mprotect() 382 assert!(check_aligned(len, MMArch::PAGE_SIZE)); in mprotect() 395 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in mprotect()
|
D | kernel_mapper.rs | 114 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in map_phys_with_size() 124 vaddr += MMArch::PAGE_SIZE; in map_phys_with_size() 125 paddr += MMArch::PAGE_SIZE; in map_phys_with_size()
|
D | early_ioremap.rs | 28 const SLOT_CNT: usize = MMArch::FIXMAP_SIZE / MMArch::PAGE_SIZE; 81 if phys.check_aligned(MMArch::PAGE_SIZE) == false { in map() 126 let map_size = slot_count * MMArch::PAGE_SIZE; in map() 195 MMArch::FIXMAP_START_VADDR + idx * MMArch::PAGE_SIZE in idx_to_virt()
|
D | c_adapter.rs | 31 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_pseudo_map_phys() 40 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_map_phys() 60 vaddr += MMArch::PAGE_SIZE; in rs_map_phys() 61 paddr += MMArch::PAGE_SIZE; in rs_map_phys()
|
D | mod.rs | 396 (self.base.data() + (MMArch::PAGE_SIZE - 1)) & !(MMArch::PAGE_SIZE - 1), in area_base_aligned() 402 return PhysAddr::new((self.base.data() + self.size) & !(MMArch::PAGE_SIZE - 1)); in area_end_aligned() 456 const PAGE_SIZE: usize = 1 << Self::PAGE_SHIFT; constant 458 const PAGE_OFFSET_MASK: usize = Self::PAGE_SIZE - 1; 467 const PAGE_ADDRESS_MASK: usize = Self::PAGE_ADDRESS_SIZE - Self::PAGE_SIZE; 479 const ENTRY_ADDRESS_MASK: usize = Self::ENTRY_ADDRESS_SIZE - Self::PAGE_SIZE;
|
D | ucontext.rs | 180 PageFrameCount::new(vma_guard.region.size() / MMArch::PAGE_SIZE), in try_clone() 217 new_frame.copy_from_nonoverlapping(current_frame, MMArch::PAGE_SIZE); in try_clone() 401 if !new_vaddr.check_aligned(MMArch::PAGE_SIZE) { in mremap() 589 assert!(new_brk.check_aligned(MMArch::PAGE_SIZE)); in set_brk() 762 if requested.end() >= MMArch::USER_END_VADDR || !vaddr.check_aligned(MMArch::PAGE_SIZE) { in find_free_at() 974 assert!(region.start().check_aligned(MMArch::PAGE_SIZE)); in extract() 975 assert!(region.end().check_aligned(MMArch::PAGE_SIZE)); in extract() 1201 region: VirtRegion::new(destination.virt_address(), count.data() * MMArch::PAGE_SIZE), in physmap() 1251 page_count.data() * MMArch::PAGE_SIZE, in zeroed() 1271 MMArch::write_bytes(vaddr, 0, MMArch::PAGE_SIZE); in zeroed() [all …]
|
D | page.rs | 540 Arch::write_bytes(table_vaddr, 0, Arch::PAGE_SIZE); in create() 605 if !(virt.check_aligned(Arch::PAGE_SIZE) && phys.check_aligned(Arch::PAGE_SIZE)) { in map_phys() 646 MMArch::write_bytes(MMArch::phys_2_virt(frame).unwrap(), 0, MMArch::PAGE_SIZE); in map_phys() 750 if !virt.check_aligned(Arch::PAGE_SIZE) { in unmap_phys() 963 addr & !(MMArch::PAGE_SIZE - 1) in round_down_to_page_size() 968 round_down_to_page_size(addr + MMArch::PAGE_SIZE - 1) in round_up_to_page_size()
|
D | mmio_buddy.rs | 525 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in release_mmio() 526 assert!(length & (MMArch::PAGE_SIZE - 1) == 0); in release_mmio() 535 let page_count = length / MMArch::PAGE_SIZE; in release_mmio() 553 .unmap_phys(vaddr + i * MMArch::PAGE_SIZE, false); in release_mmio() 633 size & (MMArch::PAGE_SIZE - 1) == 0, in from_raw()
|
/DragonOS-0.1.9/kernel/src/mm/allocator/ |
D | bump.rs | 78 offset = (offset + (MMA::PAGE_SIZE - 1)) & !(MMA::PAGE_SIZE - 1); in remain_areas() 81 if offset + 1 * MMA::PAGE_SIZE <= area_end { in remain_areas() 155 offset = (offset + (MMA::PAGE_SIZE - 1)) & !(MMA::PAGE_SIZE - 1); in allocate() 158 if offset + count.data() * MMA::PAGE_SIZE <= area_end { in allocate() 161 self.offset = offset + count.data() * MMA::PAGE_SIZE; in allocate()
|
D | page_frame.rs | 22 number: paddr.data() / MMArch::PAGE_SIZE, in new() 38 return PhysAddr::new(self.number * MMArch::PAGE_SIZE); in phys_address() 97 number: vaddr.data() / MMArch::PAGE_SIZE, in new() 109 return VirtAddr::new(self.number * MMArch::PAGE_SIZE); in virt_address() 185 return self.0 * MMArch::PAGE_SIZE; in bytes() 195 return Some(Self(bytes / MMArch::PAGE_SIZE)); in from_bytes()
|
D | kernel_allocator.rs | 30 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in alloc_in_buddy() 44 allocated_frame_count.data() * MMArch::PAGE_SIZE, in alloc_in_buddy() 52 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in free_in_buddy()
|
D | buddy.rs | 76 (A::PAGE_SIZE - mem::size_of::<PageList<A>>()) / mem::size_of::<PhysAddr>(); 93 core::ptr::write_bytes(MMArch::phys_2_virt(*f)?.data() as *mut u8, 0, A::PAGE_SIZE); in new() 150 let mut entries = (remain_pages.data() * A::PAGE_SIZE) >> i; in new() 162 let mut remain_bytes = remain_pages.data() * A::PAGE_SIZE; in new()
|
/DragonOS-0.1.9/kernel/src/arch/riscv64/mm/ |
D | init.rs | 106 for i in 0..((area.size + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE) { in riscv_mm_init() 107 let paddr = area.base.add(i * MMArch::PAGE_SIZE); in riscv_mm_init() 185 for i in 0..(size / MMArch::PAGE_SIZE) { in remap_at_low_address() 186 let paddr = PhysAddr::new(base.data() + i * MMArch::PAGE_SIZE); in remap_at_low_address() 187 let vaddr = VirtAddr::new(base.data() + i * MMArch::PAGE_SIZE); in remap_at_low_address() 207 for i in 0..(size / MMArch::PAGE_SIZE) { in unmap_at_low_address() 208 let vaddr = VirtAddr::new(base.data() + i * MMArch::PAGE_SIZE); in unmap_at_low_address()
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/mm/ |
D | mod.rs | 118 VirtAddr::new((Self::PAGE_ADDRESS_SIZE >> 1) - Self::PAGE_SIZE); 245 const PAGE_SIZE: usize = 1 << Self::PAGE_SHIFT; constant 247 const PAGE_OFFSET_MASK: usize = Self::PAGE_SIZE - 1; 255 const PAGE_ADDRESS_MASK: usize = Self::PAGE_ADDRESS_SIZE - Self::PAGE_SIZE; 267 const ENTRY_ADDRESS_MASK: usize = Self::ENTRY_ADDRESS_SIZE - Self::PAGE_SIZE; 452 for i in 0..((area.size + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE) { in allocator_init() 453 let paddr = area.base.add(i * MMArch::PAGE_SIZE); in allocator_init() 539 assert!(paddr.data() % MMArch::PAGE_SIZE == 0); in test_buddy() 544 .check_aligned(allocated_frame_count.data() * MMArch::PAGE_SIZE)); in test_buddy() 546 allocated += allocated_frame_count.data() * MMArch::PAGE_SIZE; in test_buddy() [all …]
|
/DragonOS-0.1.9/kernel/src/arch/riscv64/ |
D | elf.rs | 9 const ELF_PAGE_SIZE: usize = MMArch::PAGE_SIZE;
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/ |
D | elf.rs | 9 const ELF_PAGE_SIZE: usize = MMArch::PAGE_SIZE;
|
/DragonOS-0.1.9/kernel/src/driver/net/e1000e/ |
D | e1000e.rs | 28 const PAGE_SIZE: usize = 4096; constant 103 assert!(length <= PAGE_SIZE); in new() 305 let recv_ring_length = PAGE_SIZE / size_of::<E1000ERecvDesc>(); in new() 306 let trans_ring_length = PAGE_SIZE / size_of::<E1000ETransDesc>(); in new() 323 let buffer = E1000EBuffer::new(PAGE_SIZE); in new() 330 let buffer = E1000EBuffer::new(PAGE_SIZE); in new() 353 volwrite!(receive_regs, rdlen0, PAGE_SIZE as u32); in new() 383 volwrite!(transimit_regs, tdlen0, PAGE_SIZE as u32); in new() 439 let new_buffer = E1000EBuffer::new(PAGE_SIZE); in e1000e_receive() 564 let recv_ring_length = PAGE_SIZE / size_of::<E1000ERecvDesc>(); in drop() [all …]
|
/DragonOS-0.1.9/kernel/src/virt/kvm/ |
D | host_mem.rs | 40 pub const PAGE_SIZE: u32 = 1 << PAGE_SHIFT; constant 41 pub const PAGE_MASK: u32 = !(PAGE_SIZE - 1); 102 return slot.userspace_addr + (gfn - slot.base_gfn) * (PAGE_SIZE as u64); in __gfn_to_hva()
|
D | vm.rs | 63 if (mem.memory_size & (MMArch::PAGE_SIZE - 1) as u64) != 0 in set_user_memory_region() 64 || (mem.guest_phys_addr & (MMArch::PAGE_SIZE - 1) as u64) != 0 in set_user_memory_region()
|
/DragonOS-0.1.9/kernel/src/driver/video/ |
D | mod.rs | 99 page_align_up(frame_buffer_info_guard.buf_size()) / MMArch::PAGE_SIZE, in init_frame_buffer() 116 vaddr += MMArch::PAGE_SIZE; in init_frame_buffer() 117 paddr += MMArch::PAGE_SIZE; in init_frame_buffer()
|
/DragonOS-0.1.9/kernel/src/libs/ |
D | align.rs | 130 let page_size = MMArch::PAGE_SIZE; in page_align_up() 135 let page_size = MMArch::PAGE_SIZE; in page_align_down()
|
/DragonOS-0.1.9/kernel/src/driver/open_firmware/ |
D | fdt.rs | 197 if size < (MMArch::PAGE_SIZE - (base & (!MMArch::PAGE_MASK))) { in early_init_dt_add_memory() 201 if PhysAddr::new(base).check_aligned(MMArch::PAGE_SIZE) == false { in early_init_dt_add_memory() 202 size -= MMArch::PAGE_SIZE - (base & (!MMArch::PAGE_MASK)); in early_init_dt_add_memory()
|