/DragonOS-0.1.8/kernel/src/mm/allocator/ |
D | buddy.rs | 9 use crate::mm::{MemoryManagementArch, PhysAddr, VirtAddr}; 28 next_page: PhysAddr, 47 next_page: PhysAddr::new(0), in empty() 51 fn new(entry_num: usize, next_page: PhysAddr) -> Self { in new() 67 free_area: [PhysAddr; (MAX_ORDER - MIN_ORDER) as usize], 74 (A::PAGE_SIZE - mem::size_of::<PageList<A>>()) / mem::size_of::<PhysAddr>(); 88 let mut free_area: [PhysAddr; (MAX_ORDER - MIN_ORDER) as usize] = in new() 89 [PhysAddr::new(0); (MAX_ORDER - MIN_ORDER) as usize]; in new() 99 let page_list: PageList<A> = PageList::new(0, PhysAddr::new(0)); in new() 138 let page_list_paddr: PhysAddr = free_area[Self::order2index(i as u8)]; in new() [all …]
|
D | page_frame.rs | 8 mm::{MemoryManagementArch, PhysAddr, VirtAddr}, 20 pub fn new(paddr: PhysAddr) -> Self { in new() 27 pub fn phys_address(&self) -> PhysAddr { in phys_address() argument 28 return PhysAddr::new(self.number * MMArch::PAGE_SIZE); in phys_address() 287 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)>; in allocate() argument 290 unsafe fn free(&mut self, address: PhysAddr, count: PageFrameCount); in free() argument 292 unsafe fn allocate_one(&mut self) -> Option<PhysAddr> { in allocate_one() argument 296 unsafe fn free_one(&mut self, address: PhysAddr) { in free_one() argument 305 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 308 unsafe fn free(&mut self, address: PhysAddr, count: PageFrameCount) { in free() argument [all …]
|
D | bump.rs | 6 use crate::mm::{MemoryManagementArch, PhysAddr, PhysMemoryArea}; 47 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 76 return Some((PhysAddr(res_page_phys), count)); in allocate() 82 unsafe fn free(&mut self, _address: PhysAddr, _count: PageFrameCount) { in free() argument
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | mod.rs | 85 pub struct PhysAddr(usize); struct 87 impl PhysAddr { impl 117 impl Debug for PhysAddr { implementation 123 impl core::ops::Add<usize> for PhysAddr { implementation 132 impl core::ops::AddAssign<usize> for PhysAddr { implementation 139 impl core::ops::Add<PhysAddr> for PhysAddr { implementation 143 fn add(self, rhs: PhysAddr) -> Self::Output { in add() 148 impl core::ops::AddAssign<PhysAddr> for PhysAddr { implementation 150 fn add_assign(&mut self, rhs: PhysAddr) { in add_assign() argument 155 impl core::ops::Sub<usize> for PhysAddr { implementation [all …]
|
D | no_init.rs | 11 use crate::mm::{MMArch, MemoryManagementArch, PhysAddr}; 35 unsafe fn allocate(&mut self, _count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate() argument 39 unsafe fn free(&mut self, _address: PhysAddr, _count: PageFrameCount) { in free() argument 57 pub unsafe fn pseudo_map_phys(vaddr: VirtAddr, paddr: PhysAddr, count: PageFrameCount) { in pseudo_map_phys() argument
|
D | page.rs | 17 PhysAddr, VirtAddr, 25 phys: PhysAddr, 33 pub unsafe fn new(base: VirtAddr, phys: PhysAddr, level: usize) -> Self { in new() argument 61 pub fn phys(&self) -> PhysAddr { in phys() argument 200 pub fn address(&self) -> Result<PhysAddr, PhysAddr> { in address() argument 201 let paddr = PhysAddr::new(self.data & Arch::PAGE_ADDRESS_MASK); in address() 468 table_paddr: PhysAddr, 485 pub unsafe fn new(table_kind: PageTableKind, table_paddr: PhysAddr, allocator: F) -> Self { in new() argument 551 let phys: PhysAddr = self.frame_allocator.allocate_one()?; in map() 560 phys: PhysAddr, in map_phys() argument [all …]
|
D | c_adapter.rs | 19 page::PageFlags, MemoryManagementArch, PhysAddr, VirtAddr, 31 let paddr = PhysAddr::new(paddr); in rs_pseudo_map_phys() 40 let mut paddr = PhysAddr::new(paddr); in rs_map_phys()
|
D | kernel_mapper.rs | 1 use super::{page::PageFlags, PageTableKind, PhysAddr, VirtAddr}; 101 mut paddr: PhysAddr, in map_phys_with_size() argument
|
/DragonOS-0.1.8/kernel/src/driver/virtio/ |
D | virtio_impl.rs | 11 MemoryManagementArch, PhysAddr, VirtAddr, 24 ) -> (virtio_drivers::PhysAddr, NonNull<u8>) { in dma_alloc() argument 53 paddr: virtio_drivers::PhysAddr, in dma_dealloc() argument 71 deallocate_page_frames(PhysPageFrame::new(PhysAddr::new(paddr)), page_count); in dma_dealloc() 78 unsafe fn mmio_phys_to_virt(_paddr: virtio_drivers::PhysAddr, _size: usize) -> NonNull<u8> { in mmio_phys_to_virt() argument 87 ) -> virtio_drivers::PhysAddr { in share() argument 95 _paddr: virtio_drivers::PhysAddr, in unshare() argument
|
D | transport_pci.rs | 18 Error, Hal, PhysAddr, 265 descriptors: PhysAddr, in queue_set() argument 266 driver_area: PhysAddr, in queue_set() argument 267 device_area: PhysAddr, in queue_set() argument
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/ |
D | mod.rs | 26 use crate::mm::{MemoryManagementArch, PageTableKind, PhysAddr, PhysMemoryArea, VirtAddr}; 42 base: PhysAddr::new(0), 47 static mut INITIAL_CR3_VALUE: PhysAddr = PhysAddr::new(0); 172 unsafe fn table(_table_kind: PageTableKind) -> PhysAddr { in table() argument 177 return PhysAddr::new(paddr); in table() 181 unsafe fn set_table(_table_kind: PageTableKind, table: PhysAddr) { in set_table() argument 193 fn initial_page_table() -> PhysAddr { in initial_page_table() 253 PHYS_MEMORY_AREAS[areas_count].base = PhysAddr::new(mb2_mem_info[i].addr as usize); in init_memory_area_from_multiboot2() 311 MMArch::phys_2_virt(PhysAddr::new(0)).unwrap().data() in mm_init() 340 let new_page_table: PhysAddr; in allocator_init() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/pci/ |
D | pci.rs | 11 use crate::mm::{PhysAddr, VirtAddr}; 649 let paddr = PhysAddr::new(self.physical_address_base as usize); in map() 1436 let paddr = PhysAddr::new(address as usize); in pci_bar_init()
|