/DragonOS/kernel/src/mm/ |
H A D | mm.h | 21 #define PAGE_4K_ALIGN(addr) \ argument 22 (((unsigned long)(addr) + PAGE_4K_SIZE - 1) & PAGE_4K_MASK) 23 #define PAGE_2M_ALIGN(addr) \ argument 24 (((unsigned long)(addr) + PAGE_2M_SIZE - 1) & PAGE_2M_MASK) 27 #define virt_2_phys(addr) ((unsigned long)(addr)-PAGE_OFFSET) argument 28 #define phys_2_virt(addr) \ argument 29 ((unsigned long *)((unsigned long)(addr) + PAGE_OFFSET))
|
H A D | mod.rs | 821 pub fn contains(&self, addr: VirtAddr) -> bool { in contains() 822 return self.start() <= addr && addr < self.end(); in contains() 852 pub fn verify_area(addr: VirtAddr, size: usize) -> Result<(), SystemError> { in verify_area() 853 let end = addr.add(size); in verify_area() 854 if unlikely(end.data() < addr.data()) { in verify_area() 858 if !addr.check_user() || !end.check_user() { in verify_area()
|
H A D | no_init.rs | 83 pub fn free_page(&mut self, addr: VirtAddr) { in free_page() 86 let offset = addr.data() - start_vaddr; in free_page()
|
H A D | ucontext.rs | 263 let addr = hint.data() & (!MMArch::PAGE_OFFSET_MASK); in map_anonymous() localVariable 266 if (addr != 0) && round_to_min && (addr < DEFAULT_MMAP_MIN_ADDR) { in map_anonymous() 268 } else if addr == 0 { in map_anonymous() 271 Some(VirtAddr::new(addr)) in map_anonymous() 341 let addr = hint.data() & (!MMArch::PAGE_OFFSET_MASK); in file_mapping() localVariable 344 if (addr != 0) && round_to_min && (addr < DEFAULT_MMAP_MIN_ADDR) { in file_mapping() 346 } else if addr == 0 { in file_mapping() 349 Some(VirtAddr::new(addr)) in file_mapping() 439 addr: Option<VirtAddr>, in mmap() 451 let region = match addr { in mmap()
|
H A D | page.rs | 581 pub fn index_of(&self, addr: VirtAddr) -> Option<usize> { in index_of() 582 let addr = VirtAddr::new(addr.data() & Arch::PAGE_ADDRESS_MASK); in index_of() localVariable 586 if addr < self.base || addr >= self.base.add(mask) { in index_of() 589 return Some((addr.data() >> shift) & MMArch::PAGE_ENTRY_MASK); in index_of() 1726 pub fn round_down_to_page_size(addr: usize) -> usize { in round_down_to_page_size() 1727 addr & !(MMArch::PAGE_SIZE - 1) in round_down_to_page_size() 1731 pub fn round_up_to_page_size(addr: usize) -> usize { in round_up_to_page_size() 1732 round_down_to_page_size(addr + MMArch::PAGE_SIZE - 1) in round_up_to_page_size()
|
/DragonOS/kernel/src/debug/traceback/ |
H A D | traceback.c | 6 int lookup_kallsyms(uint64_t addr, int level) in lookup_kallsyms() argument 16 if (addr > kallsyms_address[index] && addr <= kallsyms_address[index + 1]) in lookup_kallsyms() 23 … %04d address:%#018lx\n", &str[kallsyms_names_index[index]], addr - kallsyms_address[index], addr); in lookup_kallsyms()
|
/DragonOS/kernel/src/net/ |
H A D | syscall.rs | 197 pub fn connect(fd: usize, addr: *const SockAddr, addrlen: usize) -> Result<usize, SystemError> { in connect() 198 let endpoint: Endpoint = SockAddr::to_endpoint(addr, addrlen)?; in connect() 214 pub fn bind(fd: usize, addr: *const SockAddr, addrlen: usize) -> Result<usize, SystemError> { in bind() 215 let endpoint: Endpoint = SockAddr::to_endpoint(addr, addrlen)?; in bind() 237 addr: *const SockAddr, in sendto() 240 let endpoint = if addr.is_null() { in sendto() 243 Some(SockAddr::to_endpoint(addr, addrlen)?) in sendto() 266 addr: *mut SockAddr, in recvfrom() 280 if !addr.is_null() { in recvfrom() 283 sockaddr_in.write_to_user(addr, addrlen)?; in recvfrom() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | align.rs | 133 pub const fn page_align_up(addr: usize) -> usize { in page_align_up() 135 return (addr + page_size - 1) & (!(page_size - 1)); in page_align_up() 138 pub const fn page_align_down(addr: usize) -> usize { in page_align_down() 140 return addr & (!(page_size - 1)); in page_align_down() 143 pub const fn align_up(addr: usize, align: usize) -> usize { in align_up() 145 return (addr + align - 1) & (!(align - 1)); in align_up() 148 pub const fn align_down(addr: usize, align: usize) -> usize { in align_down() 150 return addr & (!(align - 1)); in align_down()
|
/DragonOS/kernel/crates/kprobe/src/arch/loongarch64/ |
H A D | mod.rs | 17 addr: usize, field 43 let address = self.addr; in drop() 75 addr: address, in replace_inst() 98 self.addr + 4 in return_address() 110 self.addr in break_address()
|
/DragonOS/kernel/src/debug/kprobe/ |
H A D | args.rs | 13 pub addr: Option<usize>, field 26 if kprobe_info.symbol.is_none() && kprobe_info.addr.is_none() { in try_from() 29 if kprobe_info.symbol.is_some() && kprobe_info.addr.is_some() { in try_from() 48 kprobe_info.addr.unwrap() in try_from()
|
H A D | test.rs | 46 addr: Some(detect_func as usize), in kprobe_test() 66 addr: None, in kprobe_test()
|
/DragonOS/kernel/crates/kprobe/src/arch/x86/ |
H A D | mod.rs | 20 addr: usize, field 27 let address = self.addr; in drop() 99 addr: address, in replace_inst() 124 self.addr + self.old_instruction_len in return_address() 133 self.addr in break_address()
|
/DragonOS/kernel/src/virt/kvm/ |
H A D | host_mem.rs | 141 fn hva_to_pfn(addr: u64, _atomic: bool, _writable: &mut bool) -> Result<u64, SystemError> { in hva_to_pfn() 144 let raw = addr as *const i32; in hva_to_pfn() 148 let hva = VirtAddr::new(addr as usize); in hva_to_pfn() 170 let addr = __gfn_to_hva_many(slot, gfn, Some(&mut nr_pages), write)?; in __gfn_to_pfn() localVariable 171 let pfn = hva_to_pfn(addr, atomic, writable)?; in __gfn_to_pfn() 172 debug!("hva={}, pfn={}", addr, pfn); in __gfn_to_pfn()
|
/DragonOS/kernel/src/syscall/ |
H A D | user_access.rs | 90 let addr = unsafe { user.add(i) }; in check_and_clone_cstr() localVariable 93 copy_from_user(&mut c, VirtAddr::new(addr as usize))?; in check_and_clone_cstr() 127 let addr = unsafe { user.add(i) }; in check_and_clone_cstr_array() localVariable 133 copy_from_user(&mut dst, VirtAddr::new(addr as usize))?; in check_and_clone_cstr_array() 171 pub fn new<U>(addr: *const U, len: usize, from_user: bool) -> Result<Self, SystemError> { in new() 172 if from_user && verify_area(VirtAddr::new(addr as usize), len).is_err() { in new() 176 buffer: unsafe { core::slice::from_raw_parts(addr as *const u8, len) }, in new() 279 pub fn new<U>(addr: *mut U, len: usize, from_user: bool) -> Result<Self, SystemError> { in new() 280 if from_user && verify_area(VirtAddr::new(addr as usize), len).is_err() { in new() 284 buffer: unsafe { core::slice::from_raw_parts_mut(addr as *mut u8, len) }, in new()
|
H A D | mod.rs | 471 let addr = args[1] as *const SockAddr; in handle() localVariable 473 let virt_addr = VirtAddr::new(addr as usize); in handle() 479 Self::connect(args[0], addr, addrlen) in handle() 483 let addr = args[1] as *const SockAddr; in handle() localVariable 485 let virt_addr = VirtAddr::new(addr as usize); in handle() 491 Self::bind(args[0], addr, addrlen) in handle() 499 let addr = args[4] as *const SockAddr; in handle() localVariable 502 let virt_addr = VirtAddr::new(addr as usize); in handle() 509 Self::sendto(args[0], data, flags, addr, addrlen) in handle() 517 let addr = args[4] as *mut SockAddr; in handle() localVariable [all …]
|
/DragonOS/user/apps/test-for-robustfutex/src/ |
H A D | main.rs | 29 addr: *mut u32, field 33 pub fn new(addr: *mut u32) -> Self { in new() 34 return Futex { addr }; in new() 38 return unsafe { self.addr.offset(offset) }; in get_addr() 42 return unsafe { self.addr.offset(offset).read() }; in get_val() 47 self.addr.offset(offset).write(val); in set_val() 57 addr: *mut i32, field 61 pub fn new(addr: *mut i32) -> Self { in new() 62 return Lock { addr }; in new() 66 return unsafe { self.addr.offset(offset).read() }; in get_val() [all …]
|
/DragonOS/kernel/crates/kprobe/src/arch/rv64/ |
H A D | mod.rs | 27 addr: usize, field 54 let address = self.addr; in drop() 101 addr: address, in replace_inst() 139 let address = self.addr; in return_address() 155 self.addr in break_address()
|
/DragonOS/kernel/src/common/ |
H A D | glib.h | 49 static __always_inline ul ALIGN(const ul addr, const ul _align) { in ALIGN() argument 50 return (ul)((addr + _align - 1) & (~(_align - 1))); in ALIGN()
|
/DragonOS/kernel/src/driver/block/cache/ |
H A D | cached_block_device.rs | 204 addr: CacheBlockAddr, in read() 208 self.0.read().read(addr, position, buf) in read() 250 addr: CacheBlockAddr, in read() 254 if addr > self.frame_selector.size() { in read() 258 return self.root[addr] in read()
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | pages.rs | 82 let addr: usize = data_start + offset; in first_fit() localVariable 83 let alignment_ok = addr % layout.align() == 0; in first_fit() 86 return Some((idx, addr)); in first_fit() 220 Some((idx, addr)) => { in allocate() 222 addr as *mut u8 in allocate()
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | interpreter.rs | 18 addr: u64, in check_mem() 28 addr, in check_mem() 47 addr: u64, in check_mem() 55 if let Some(addr_end) = addr.checked_add(len as u64) { in check_mem() 56 if mbuff.as_ptr() as u64 <= addr && addr_end <= mbuff.as_ptr() as u64 + mbuff.len() as u64 { in check_mem() 59 if mem.as_ptr() as u64 <= addr && addr_end <= mem.as_ptr() as u64 + mem.len() as u64 { in check_mem() 62 if stack.as_ptr() as u64 <= addr && addr_end <= stack.as_ptr() as u64 + stack.len() as u64 { in check_mem() 69 access_type, insn_ptr, addr, len, in check_mem() 122 |stack: &[u8], addr: u64, len: usize, insn_ptr: usize| -> Result<(), Error> { in execute_program() 123 check_mem(addr, len, "load", insn_ptr, mbuff, mem, stack) in execute_program() [all …]
|
/DragonOS/kernel/src/arch/x86_64/init/pvh/ |
H A D | param.rs | 155 pub addr: u64, field 385 unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, in bindgen_test_layout_hvm_memmap_table_entry() 391 stringify!(addr) in bindgen_test_layout_hvm_memmap_table_entry()
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | xapic.rs | 159 let addr = g.vaddr() + offset; in new() localVariable 164 addr.data() in new() 168 apic_vaddr: addr, in new()
|
/DragonOS/kernel/src/driver/net/e1000e/ |
H A D | e1000e.rs | 71 addr: u64, field 83 addr: u64, field 323 ring.addr = buffer.as_paddr() as u64; in new() 330 ring.addr = buffer.as_paddr() as u64; in new() 440 desc.addr = new_buffer.as_paddr() as u64; in e1000e_receive() 467 desc.addr = packet.as_paddr() as u64; in e1000e_transmit()
|
/DragonOS/kernel/src/mm/allocator/ |
H A D | buddy.rs | 195 pub fn read_page<T>(addr: PhysAddr) -> T { in read_page() 196 let page_list = unsafe { A::read(A::phys_2_virt(addr).unwrap()) }; in read_page() 373 .map(|addr| (addr, PageFrameCount::new(1 << (order as usize - MIN_ORDER)))); in buddy_alloc()
|