Home
last modified time | relevance | path

Searched refs:VirtAddr (Results 1 – 20 of 20) sorted by relevance

/DragonOS-0.1.8/kernel/src/mm/
Dmod.rs190 pub struct VirtAddr(usize); struct
192 impl VirtAddr { impl
241 impl Add<VirtAddr> for VirtAddr { implementation
245 fn add(self, rhs: VirtAddr) -> Self::Output { in add()
250 impl Add<usize> for VirtAddr { implementation
259 impl Sub<VirtAddr> for VirtAddr { implementation
263 fn sub(self, rhs: VirtAddr) -> Self::Output { in sub()
268 impl Sub<usize> for VirtAddr { implementation
277 impl AddAssign<usize> for VirtAddr { implementation
284 impl AddAssign<VirtAddr> for VirtAddr { implementation
[all …]
Dsyscall.rs16 verify_area, VirtAddr,
70 pub fn brk(new_addr: VirtAddr) -> Result<VirtAddr, SystemError> { in brk() argument
84 .set_brk(VirtAddr::new(page_align_up(new_addr.data()))) in brk()
91 pub fn sbrk(incr: isize) -> Result<VirtAddr, SystemError> { in sbrk() argument
119 start_vaddr: VirtAddr, in mmap() argument
129 if start_vaddr < VirtAddr::new(DEFAULT_MMAP_MIN_ADDR) in mmap()
170 pub fn munmap(start_vaddr: VirtAddr, len: usize) -> Result<usize, SystemError> { in munmap() argument
200 start_vaddr: VirtAddr, in mprotect() argument
Ducontext.rs35 MemoryManagementArch, PageTableKind, VirtAddr, VirtRegion,
102 pub mmap_min: VirtAddr,
106 pub elf_brk_start: VirtAddr,
107 pub elf_brk: VirtAddr,
110 pub brk_start: VirtAddr,
112 pub brk: VirtAddr,
114 pub start_code: VirtAddr,
115 pub end_code: VirtAddr,
116 pub start_data: VirtAddr,
117 pub end_data: VirtAddr,
[all …]
Dmmio_buddy.rs16 use super::VirtAddr;
25 const MMIO_BASE: VirtAddr = VirtAddr::new(0xffffa10000000000);
26 const MMIO_TOP: VirtAddr = VirtAddr::new(0xffffa20000000000);
47 pool_start_addr: VirtAddr,
95 fn create_region(&self, vaddr: VirtAddr) -> MmioBuddyAddrRegion { in create_region()
115 fn give_back_block(&self, vaddr: VirtAddr, exp: u32) -> Result<i32, SystemError> { in give_back_block() argument
325 fn calculate_block_vaddr(&self, vaddr: VirtAddr, exp: u32) -> VirtAddr { in calculate_block_vaddr() argument
326 return VirtAddr::new(vaddr.data() ^ (1 << exp as usize)); in calculate_block_vaddr()
343 vaddr: VirtAddr, in pop_buddy_block() argument
414 let vaddr: VirtAddr = list_guard.list.back().unwrap().vaddr; in merge_all_exp()
[all …]
Dc_adapter.rs19 page::PageFlags, MemoryManagementArch, PhysAddr, VirtAddr,
24 …static ref C_ALLOCATION_MAP: SpinLock<HashMap<VirtAddr, (VirtAddr, usize, usize)>> = SpinLock::new…
30 let vaddr = VirtAddr::new(vaddr); in rs_pseudo_map_phys()
39 let mut vaddr = VirtAddr::new(vaddr); in rs_map_phys()
93 let vaddr = VirtAddr::new(ptr as usize); in do_kmalloc()
117 let vaddr = VirtAddr::new(vaddr); in kfree()
Dpage.rs17 PhysAddr, VirtAddr,
23 base: VirtAddr,
33 pub unsafe fn new(base: VirtAddr, phys: PhysAddr, level: usize) -> Self { in new() argument
53 VirtAddr::new(0), in top_level_table()
67 pub fn base(&self) -> VirtAddr { in base() argument
79 pub unsafe fn virt(&self) -> VirtAddr { in virt() argument
84 pub fn entry_base(&self, i: usize) -> Option<VirtAddr> { in entry_base() argument
94 pub unsafe fn entry_virt(&self, i: usize) -> Option<VirtAddr> { in entry_virt() argument
139 pub unsafe fn index_of(&self, addr: VirtAddr) -> Option<usize> { in index_of()
140 let addr = VirtAddr::new(addr.data() & Arch::PAGE_ADDRESS_MASK); in index_of()
[all …]
Dno_init.rs17 PageTableKind, VirtAddr,
57 pub unsafe fn pseudo_map_phys(vaddr: VirtAddr, paddr: PhysAddr, count: PageFrameCount) { in pseudo_map_phys() argument
Dkernel_mapper.rs1 use super::{page::PageFlags, PageTableKind, PhysAddr, VirtAddr};
100 mut vaddr: VirtAddr, in map_phys_with_size() argument
/DragonOS-0.1.8/kernel/src/libs/
Delf.rs20 MemoryManagementArch, VirtAddr,
90 start: VirtAddr, in set_elf_brk() argument
91 end: VirtAddr, in set_elf_brk() argument
115 fn elf_page_offset(&self, addr: VirtAddr) -> usize { in elf_page_offset()
119 fn elf_page_start(&self, addr: VirtAddr) -> VirtAddr { in elf_page_start() argument
120 VirtAddr::new(addr.data() & (!(Self::ELF_PAGE_SIZE - 1))) in elf_page_start()
123 fn elf_page_align_up(&self, addr: VirtAddr) -> VirtAddr { in elf_page_align_up() argument
124 VirtAddr::new((addr.data() + Self::ELF_PAGE_SIZE - 1) & (!(Self::ELF_PAGE_SIZE - 1))) in elf_page_align_up()
168 mut addr_to_map: VirtAddr, in load_elf_segment() argument
172 ) -> Result<(VirtAddr, bool), SystemError> { in load_elf_segment() argument
[all …]
/DragonOS-0.1.8/kernel/src/syscall/
Duser_access.rs6 use crate::mm::{verify_area, VirtAddr};
24 pub unsafe fn clear_user(dest: VirtAddr, len: usize) -> Result<usize, SystemError> { in clear_user() argument
33 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user() argument
43 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user()
87 copy_from_user(&mut c, VirtAddr::new(addr as usize))?; in check_and_clone_cstr()
124 copy_from_user(&mut dst, VirtAddr::new(addr as usize))?; in check_and_clone_cstr_array()
Dmod.rs20 mm::{verify_area, MemoryManagementArch, VirtAddr},
436 let virt_addr = VirtAddr::new(buf_vaddr); in handle()
455 let virt_addr = VirtAddr::new(buf_vaddr); in handle()
498 let new_brk = VirtAddr::new(args[0]); in handle()
516 let virt_addr = VirtAddr::new(path_ptr as usize); in handle()
546 let virt_addr = VirtAddr::new(buf_vaddr); in handle()
567 let virt_path_ptr = VirtAddr::new(path_ptr); in handle()
568 let virt_argv_ptr = VirtAddr::new(argv_ptr); in handle()
569 let virt_env_ptr = VirtAddr::new(env_ptr); in handle()
590 let virt_wstatus = VirtAddr::new(wstatus as usize); in handle()
[all …]
/DragonOS-0.1.8/kernel/src/process/
Dexec.rs14 VirtAddr,
37 entry_point: VirtAddr,
41 pub fn new(entry_point: VirtAddr) -> Self { in new()
45 pub fn entry_point(&self) -> VirtAddr { in entry_point() argument
68 BadAddress(Option<VirtAddr>),
223 ) -> Result<(VirtAddr, VirtAddr), SystemError> { in push_at() argument
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/
Dmod.rs26 use crate::mm::{MemoryManagementArch, PageTableKind, PhysAddr, PhysMemoryArea, VirtAddr};
121 const USER_END_VADDR: VirtAddr = VirtAddr::new(0x0000_7eff_ffff_ffff);
122 const USER_BRK_START: VirtAddr = VirtAddr::new(0x700000000000);
123 const USER_STACK_START: VirtAddr = VirtAddr::new(0x6ffff0a00000);
157 unsafe fn invalidate_page(address: VirtAddr) { in invalidate_page() argument
188 fn virt_is_valid(virt: VirtAddr) -> bool { in virt_is_valid()
281 impl VirtAddr { implementation
325 unsafe { MMArch::virt_2_phys(VirtAddr::new(page_align_up(virt_offset))) }.unwrap(); in allocator_init()
557 pub unsafe fn kernel_page_flags<A: MemoryManagementArch>(virt: VirtAddr) -> PageFlags<A> { in kernel_page_flags()
596 let vaddr = VirtAddr::new(i * MMArch::PAGE_SIZE); in remap_at_low_address()
[all …]
/DragonOS-0.1.8/kernel/src/driver/virtio/
Dvirtio_impl.rs11 MemoryManagementArch, PhysAddr, VirtAddr,
62 let vaddr = VirtAddr::new(vaddr.as_ptr() as *mut u8 as usize); in dma_dealloc()
88 let vaddr = VirtAddr::new(buffer.as_ptr() as *mut u8 as usize); in share()
Dtransport_pci.rs21 type VirtAddr = usize; typedef
399 vaddr: VirtAddr,
/DragonOS-0.1.8/kernel/src/mm/allocator/
Dpage_frame.rs8 mm::{MemoryManagementArch, PhysAddr, VirtAddr},
84 pub fn new(vaddr: VirtAddr) -> Self { in new()
91 pub fn virt_address(&self) -> VirtAddr { in virt_address() argument
92 return VirtAddr::new(self.number * MMArch::PAGE_SIZE); in virt_address()
Dkernel_allocator.rs4 mm::{MMArch, MemoryManagementArch, VirtAddr},
51 let phy_addr = MMArch::virt_2_phys(VirtAddr::new(ptr as usize)).unwrap(); in free_in_buddy()
Dbuddy.rs9 use crate::mm::{MemoryManagementArch, PhysAddr, VirtAddr};
240 pub fn entry_virt_addr(base_addr: PhysAddr, j: usize) -> VirtAddr { in entry_virt_addr() argument
/DragonOS-0.1.8/kernel/src/arch/x86_64/
Dsyscall.rs13 mm::{ucontext::AddressSpace, verify_area, VirtAddr},
77 && (verify_area(VirtAddr::new(path_ptr), MAX_PATHLEN).is_err() in syscall_handler()
78 || verify_area(VirtAddr::new(argv_ptr), MAX_PATHLEN).is_err() in syscall_handler()
79 || verify_area(VirtAddr::new(env_ptr), MAX_PATHLEN).is_err()) in syscall_handler()
/DragonOS-0.1.8/kernel/src/driver/pci/
Dpci.rs11 use crate::mm::{PhysAddr, VirtAddr};
648 let vaddr = VirtAddr::new(virtaddress as usize); in map()
1435 let vaddr = VirtAddr::new(virtaddress as usize); in pci_bar_init()