/DragonOS/kernel/src/mm/allocator/ |
H A D | page_frame.rs | 132 pub fn add(&self, n: PageFrameCount) -> Self { in add() 173 pub struct PageFrameCount(usize); struct 175 impl PageFrameCount { impl 207 impl Add for PageFrameCount { implementation 215 impl AddAssign for PageFrameCount { implementation 221 impl Sub for PageFrameCount { implementation 229 impl SubAssign for PageFrameCount { implementation 235 impl Mul for PageFrameCount { implementation 243 impl Add<usize> for PageFrameCount { implementation 251 impl AddAssign<usize> for PageFrameCount { implementation [all …]
|
H A D | bump.rs | 5 use super::page_frame::{FrameAllocator, PageFrameCount, PageFrameUsage}; 102 unsafe fn ensure_early_mapping(&self, start_paddr: PhysAddr, count: PageFrameCount) { in ensure_early_mapping() argument 120 pseudo_map_phys(vaddr, p.phys_address(), PageFrameCount::new(1)); in ensure_early_mapping() 132 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 172 unsafe fn free(&mut self, _address: PhysAddr, _count: PageFrameCount) { in free() argument 200 let frame = PageFrameUsage::new(PageFrameCount::new(used), PageFrameCount::new(total)); in usage()
|
H A D | buddy.rs | 10 use crate::mm::allocator::page_frame::{FrameAllocator, PageFrameCount, PageFrameUsage}; 71 total: PageFrameCount, 103 total: PageFrameCount::new(0), in new() 107 let mut total_pages_to_buddy = PageFrameCount::new(0); in new() 118 PageFrameCount::from_bytes(area.area_end_aligned().data() - paddr).unwrap(); in new() 352 fn buddy_alloc(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in buddy_alloc() argument 373 .map(|addr| (addr, PageFrameCount::new(1 << (order as usize - MIN_ORDER)))); in buddy_alloc() 516 self.buddy_alloc(PageFrameCount::new(1)) in buddy_free() 579 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 593 unsafe fn free(&mut self, base: PhysAddr, count: PageFrameCount) { in free() argument [all …]
|
H A D | kernel_allocator.rs | 17 page_frame::{FrameAllocator, PageFrameCount}, 35 let page_frame_count = PageFrameCount::new(count); in alloc_in_buddy() 57 let page_frame_count = PageFrameCount::new(count); in free_in_buddy()
|
/DragonOS/kernel/src/mm/ |
H A D | no_init.rs | 21 allocator::page_frame::{FrameAllocator, PageFrameCount, PageFrameUsage}, 110 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 117 unsafe fn free(&mut self, address: PhysAddr, count: PageFrameCount) { in free() argument 143 pub unsafe fn pseudo_map_phys(vaddr: VirtAddr, paddr: PhysAddr, count: PageFrameCount) { in pseudo_map_phys() argument 152 pub unsafe fn pseudo_map_phys_ro(vaddr: VirtAddr, paddr: PhysAddr, count: PageFrameCount) { in pseudo_map_phys_ro() argument 162 count: PageFrameCount, in pseudo_map_phys_with_flags() argument 193 pub unsafe fn pseudo_unmap_phys(vaddr: VirtAddr, count: PageFrameCount) { in pseudo_unmap_phys() argument
|
H A D | early_ioremap.rs | 12 use super::{allocator::page_frame::PageFrameCount, MemoryManagementArch, PhysAddr, VirtAddr}; 89 let slot_count = PageFrameCount::from_bytes(page_align_up(size)) in map() 115 let page_count = PageFrameCount::new(slot_count); in map() 179 let count = PageFrameCount::from_bytes(slot_guard[idx].size as usize).unwrap(); in unmap()
|
H A D | kernel_mapper.rs | 11 mm::{allocator::page_frame::PageFrameCount, MMArch, MemoryManagementArch}, 114 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in map_phys_with_size()
|
H A D | ucontext.rs | 36 deallocate_page_frames, PageFrameCount, PhysPageFrame, VirtPageFrame, VirtPageFrameIter, 283 PageFrameCount::from_bytes(len).unwrap(), in map_anonymous() 377 PageFrameCount::from_bytes(len).unwrap(), in file_mapping() 431 PageFrameCount, in mmap() argument 440 page_count: PageFrameCount, in mmap() argument 445 if page_count == PageFrameCount::new(0) { in mmap() 543 let page_count = PageFrameCount::from_bytes(new_len).unwrap(); in mremap() 578 page_count: PageFrameCount, in munmap() argument 614 page_count: PageFrameCount, in mprotect() argument 680 page_count: PageFrameCount, in madvise() argument [all …]
|
H A D | syscall.rs | 17 allocator::page_frame::{PageFrameCount, VirtPageFrame}, 463 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in munmap() 499 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in mprotect() 535 let page_count = PageFrameCount::new(len / MMArch::PAGE_SIZE); in madvise()
|
H A D | page.rs | 32 allocator::page_frame::{FrameAllocator, PageFrameCount}, 147 page_reclaimer_lock_irqsave().shrink_list(PageFrameCount::new(page_to_free)); in page_reclaim_thread() 187 pub fn shrink_list(&mut self, count: PageFrameCount) { in shrink_list() argument 1290 let (phys, count) = self.frame_allocator.allocate(PageFrameCount::new( in map_huge_page()
|
/DragonOS/kernel/src/driver/net/ |
H A D | dma.rs | 9 allocate_page_frames, deallocate_page_frames, PageFrameCount, PhysPageFrame, 19 let page_num = PageFrameCount::new( in dma_alloc() 48 let page_count = PageFrameCount::new( in dma_dealloc()
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | virtio_impl.rs | 9 allocate_page_frames, deallocate_page_frames, PageFrameCount, PhysPageFrame, 25 let page_num = PageFrameCount::new( in dma_alloc() 59 let page_count = PageFrameCount::new( in dma_dealloc()
|
/DragonOS/kernel/src/ipc/ |
H A D | shm.rs | 9 allocator::page_frame::{FrameAllocator, PageFrameCount, PhysPageFrame}, 161 let page_count = PageFrameCount::from_bytes(page_align_up(size)).unwrap(); in add() 231 acc + PageFrameCount::from_bytes(page_align_up(kernel_shm.shm_size)) in shm_info() 318 let count = PageFrameCount::from_bytes(page_align_up(kernel_shm.shm_size)).unwrap(); in ipc_rmid() 340 LockedFrameAllocator.free(paddr, PageFrameCount::new(1)); in ipc_rmid() 442 let page_count = PageFrameCount::from_bytes(page_align_up(self.shm_size)).unwrap(); in map_count()
|
H A D | syscall.rs | 22 allocator::page_frame::{PageFrameCount, PhysPageFrame, VirtPageFrame}, 316 let count = PageFrameCount::from_bytes(size).unwrap(); in shmat()
|
/DragonOS/kernel/src/arch/riscv64/mm/ |
H A D | mod.rs | 12 page_frame::{FrameAllocator, PageFrameCount, PageFrameUsage, PhysPageFrame}, 350 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 358 unsafe fn free(&mut self, address: crate::mm::PhysAddr, count: PageFrameCount) { in free() argument
|
/DragonOS/kernel/src/perf/ |
H A D | bpf.rs | 10 use crate::mm::allocator::page_frame::{FrameAllocator, PageFrameCount, PhysPageFrame}; 237 unsafe { LockedFrameAllocator.allocate(PageFrameCount::new(len / PAGE_SIZE)) } in do_mmap() 269 let page_count = PageFrameCount::new(len / PAGE_SIZE); in drop()
|
/DragonOS/kernel/src/arch/x86_64/mm/ |
H A D | mod.rs | 20 use crate::mm::allocator::page_frame::{FrameAllocator, PageFrameCount, PageFrameUsage}; 564 let mut v: Vec<(PhysAddr, PageFrameCount)> = Vec::with_capacity(60 * 1024); in test_buddy() 582 let random_size = PageFrameCount::from_bytes(random_size.next_power_of_two()).unwrap(); in test_buddy() 651 unsafe fn allocate(&mut self, mut count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 660 unsafe fn free(&mut self, address: crate::mm::PhysAddr, count: PageFrameCount) { in free() argument
|
/DragonOS/kernel/src/libs/ |
H A D | elf.rs | 24 allocator::page_frame::{PageFrameCount, VirtPageFrame}, 268 PageFrameCount::from_bytes(to_unmap_size).unwrap(), in load_elf_segment() 281 PageFrameCount::from_bytes(page_align_up(map_size)).unwrap(), in load_elf_segment() 307 PageFrameCount::from_bytes(page_align_up(map_size)).unwrap(), in load_elf_segment()
|