Home
last modified time | relevance | path

Searched refs:PageFrameCount (Results 1 – 18 of 18) sorted by relevance

/DragonOS/kernel/src/mm/allocator/
H A Dpage_frame.rs132 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 Dbump.rs5 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 Dbuddy.rs10 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 Dkernel_allocator.rs17 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 Dno_init.rs21 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 Dearly_ioremap.rs12 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 Dkernel_mapper.rs11 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 Ducontext.rs36 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 Dsyscall.rs17 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 Dpage.rs32 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 Ddma.rs9 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 Dvirtio_impl.rs9 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 Dshm.rs9 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 Dsyscall.rs22 allocator::page_frame::{PageFrameCount, PhysPageFrame, VirtPageFrame},
316 let count = PageFrameCount::from_bytes(size).unwrap(); in shmat()
/DragonOS/kernel/src/arch/riscv64/mm/
H A Dmod.rs12 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 Dbpf.rs10 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 Dmod.rs20 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 Delf.rs24 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()