Lines Matching refs:PhysAddr
11 use crate::mm::{MemoryManagementArch, PhysAddr, PhysMemoryArea, VirtAddr};
30 next_page: PhysAddr,
49 next_page: PhysAddr::new(0), in empty()
53 fn new(entry_num: usize, next_page: PhysAddr) -> Self { in new()
69 free_area: [PhysAddr; MAX_ORDER - MIN_ORDER],
78 (A::PAGE_SIZE - mem::size_of::<PageList<A>>()) / mem::size_of::<PhysAddr>();
86 let mut free_area: [PhysAddr; MAX_ORDER - MIN_ORDER] = in new()
87 [PhysAddr::new(0); MAX_ORDER - MIN_ORDER]; in new()
97 let page_list: PageList<A> = PageList::new(0, PhysAddr::new(0)); in new()
143 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
154 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
170 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
187 pub fn entry_virt_addr(base_addr: PhysAddr, j: usize) -> VirtAddr { in entry_virt_addr() argument
191 pub fn entry_addr(base_addr: PhysAddr, j: usize) -> PhysAddr { in entry_addr() argument
192 let entry_addr = base_addr + mem::size_of::<PageList<A>>() + j * mem::size_of::<PhysAddr>(); in entry_addr()
195 pub fn read_page<T>(addr: PhysAddr) -> T { in read_page()
200 pub fn write_page(curr_page: PhysAddr, page_list: PageList<A>) { in write_page() argument
226 fn pop_front(&mut self, order: u8) -> Option<PhysAddr> { in pop_front() argument
257 let entry: PhysAddr = unsafe { in pop_front()
267 PhysAddr::new(0), in pop_front()
306 let result: Option<PhysAddr> = alloc_in_specific_order(order); in pop_front()
314 let mut x: Option<PhysAddr> = None; in pop_front()
352 fn buddy_alloc(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in buddy_alloc() argument
382 unsafe fn buddy_free(&mut self, mut base: PhysAddr, order: u8) { in buddy_free() argument
398 let buddy_addr = PhysAddr::new(base.data() ^ (1 << order)); in buddy_free()
412 let entry: PhysAddr = unsafe { A::read(entry_virt_addr) }; in buddy_free()
450 let entry: PhysAddr = unsafe { in buddy_free()
464 PhysAddr::new(0), in buddy_free()
472 let last_entry: PhysAddr = unsafe { in buddy_free()
486 PhysAddr::new(0), in buddy_free()
493 PhysAddr::new(0), 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