Home
last modified time | relevance | path

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

123

/DragonOS/kernel/src/arch/x86_64/interrupt/
H A Dentry.rs3 mm::{MemoryManagementArch, PhysAddr, VirtAddr},
297 set_intr_gate(32, 0, VirtAddr::new(irq_handler32 as usize)); in arch_setup_interrupt_gate()
298 set_intr_gate(33, 0, VirtAddr::new(irq_handler33 as usize)); in arch_setup_interrupt_gate()
299 set_intr_gate(34, 0, VirtAddr::new(irq_handler34 as usize)); in arch_setup_interrupt_gate()
300 set_intr_gate(35, 0, VirtAddr::new(irq_handler35 as usize)); in arch_setup_interrupt_gate()
301 set_intr_gate(36, 0, VirtAddr::new(irq_handler36 as usize)); in arch_setup_interrupt_gate()
302 set_intr_gate(37, 0, VirtAddr::new(irq_handler37 as usize)); in arch_setup_interrupt_gate()
303 set_intr_gate(38, 0, VirtAddr::new(irq_handler38 as usize)); in arch_setup_interrupt_gate()
304 set_intr_gate(39, 0, VirtAddr::new(irq_handler39 as usize)); in arch_setup_interrupt_gate()
305 set_intr_gate(40, 0, VirtAddr::new(irq_handler40 as usize)); in arch_setup_interrupt_gate()
[all …]
H A Dtrap.rs13 mm::VirtAddr,
84 set_intr_gate(0, 0, VirtAddr::new(trap_divide_error as usize)); in arch_trap_init()
85 set_intr_gate(1, 0, VirtAddr::new(trap_debug as usize)); in arch_trap_init()
86 set_intr_gate(2, 0, VirtAddr::new(trap_nmi as usize)); in arch_trap_init()
87 set_system_trap_gate(3, 0, VirtAddr::new(trap_int3 as usize)); in arch_trap_init()
88 set_system_trap_gate(4, 0, VirtAddr::new(trap_overflow as usize)); in arch_trap_init()
89 set_system_trap_gate(5, 0, VirtAddr::new(trap_bounds as usize)); in arch_trap_init()
90 set_intr_gate(6, 0, VirtAddr::new(trap_undefined_opcode as usize)); in arch_trap_init()
91 set_intr_gate(7, 0, VirtAddr::new(trap_dev_not_avaliable as usize)); in arch_trap_init()
92 set_intr_gate(8, 0, VirtAddr::new(trap_double_fault as usize)); in arch_trap_init()
[all …]
/DragonOS/kernel/src/mm/
H A Dmod.rs282 pub struct VirtAddr(usize); struct
284 impl VirtAddr { impl
329 impl Add<VirtAddr> for VirtAddr { implementation
333 fn add(self, rhs: VirtAddr) -> Self::Output { in add()
338 impl Add<usize> for VirtAddr { implementation
347 impl Sub<VirtAddr> for VirtAddr { implementation
351 fn sub(self, rhs: VirtAddr) -> Self::Output { in sub()
356 impl Sub<usize> for VirtAddr { implementation
365 impl AddAssign<usize> for VirtAddr { implementation
372 impl AddAssign<VirtAddr> for VirtAddr { implementation
[all …]
H A Dc_adapter.rs12 use super::{mmio_buddy::mmio_pool, VirtAddr};
16 …static ref C_ALLOCATION_MAP: SpinLock<HashMap<VirtAddr, (VirtAddr, usize, usize)>> = SpinLock::new…
38 let vaddr = VirtAddr::new(ptr as usize); in do_kmalloc()
60 let vaddr = VirtAddr::new(vaddr); in kfree()
117 .release_mmio(VirtAddr::new(vaddr as usize), length as usize) in rs_mmio_release()
H A Dno_init.rs23 PageTableKind, VirtAddr,
68 pub fn allocate_page(&mut self) -> Option<VirtAddr> { in allocate_page() argument
75 let vaddr = VirtAddr::new(p); in allocate_page()
83 pub fn free_page(&mut self, addr: VirtAddr) { in free_page() 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
160 vaddr: VirtAddr, 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 Ducontext.rs40 MemoryManagementArch, PageTableKind, VirtAddr, VirtRegion, VmFlags,
113 pub mmap_min: VirtAddr,
117 pub elf_brk_start: VirtAddr,
118 pub elf_brk: VirtAddr,
121 pub brk_start: VirtAddr,
123 pub brk: VirtAddr,
125 pub start_code: VirtAddr,
126 pub end_code: VirtAddr,
127 pub start_data: VirtAddr,
128 pub end_data: VirtAddr,
[all …]
H A Dsyscall.rs19 verify_area, MsFlags, VirtAddr, VmFlags,
253 pub fn brk(new_addr: VirtAddr) -> Result<VirtAddr, SystemError> { in brk() argument
267 .set_brk(VirtAddr::new(page_align_up(new_addr.data()))) in brk()
274 pub fn sbrk(incr: isize) -> Result<VirtAddr, SystemError> { in sbrk() argument
300 start_vaddr: VirtAddr, in mmap() argument
310 if start_vaddr < VirtAddr::new(DEFAULT_MMAP_MIN_ADDR) in mmap()
368 old_vaddr: VirtAddr, in mremap() argument
372 new_vaddr: VirtAddr, in mremap() argument
377 || new_vaddr == VirtAddr::new(0)) in mremap()
450 pub fn munmap(start_vaddr: VirtAddr, len: usize) -> Result<usize, SystemError> { in munmap() argument
[all …]
H A Dmmio_buddy.rs16 use super::{PhysAddr, VirtAddr};
44 pool_start_addr: VirtAddr,
105 fn create_region(&self, vaddr: VirtAddr) -> MmioBuddyAddrRegion { in create_region()
125 fn give_back_block(&self, vaddr: VirtAddr, exp: u32) -> Result<i32, SystemError> { in give_back_block() argument
334 fn calculate_block_vaddr(&self, vaddr: VirtAddr, exp: u32) -> VirtAddr { in calculate_block_vaddr() argument
335 return VirtAddr::new(vaddr.data() ^ (1 << exp as usize)); in calculate_block_vaddr()
352 vaddr: VirtAddr, in pop_buddy_block() argument
423 let vaddr: VirtAddr = list_guard.list.back().unwrap().vaddr; in merge_all_exp()
531 pub fn release_mmio(&self, vaddr: VirtAddr, length: usize) -> Result<i32, SystemError> { in release_mmio() argument
581 vaddr: VirtAddr,
[all …]
H A Dearly_ioremap.rs12 use super::{allocator::page_frame::PageFrameCount, MemoryManagementArch, PhysAddr, VirtAddr};
47 ) -> Result<VirtAddr, SystemError> { in map_not_aligned() argument
80 ) -> Result<(VirtAddr, usize), SystemError> { in map() argument
152 pub fn unmap(virt: VirtAddr) -> Result<(), SystemError> { in unmap()
194 fn idx_to_virt(idx: usize) -> VirtAddr { in idx_to_virt() argument
H A Dpage.rs35 MemoryManagementArch, PageTableKind, PhysAddr, VirtAddr,
465 base: VirtAddr,
475 pub unsafe fn new(base: VirtAddr, phys: PhysAddr, level: usize) -> Self { in new() argument
495 VirtAddr::new(0), in top_level_table()
509 pub fn base(&self) -> VirtAddr { in base() argument
521 pub unsafe fn virt(&self) -> VirtAddr { in virt() argument
526 pub fn entry_base(&self, i: usize) -> Option<VirtAddr> { in entry_base() argument
536 pub unsafe fn entry_virt(&self, i: usize) -> Option<VirtAddr> { in entry_virt() argument
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()
[all …]
/DragonOS/kernel/src/arch/riscv64/mm/
H A Dmod.rs17 MemoryManagementArch, PageTableKind, PhysAddr, VirtAddr, VmFlags,
34 pub(self) static mut KERNEL_BEGIN_VA: VirtAddr = VirtAddr::new(0);
36 pub(self) static mut KERNEL_END_VA: VirtAddr = VirtAddr::new(0);
49 address: VirtAddr, in remote_invalidate_page() argument
65 VirtAddr::new(0), in remote_invalidate_all()
132 const USER_END_VADDR: crate::mm::VirtAddr = VirtAddr::new(0x0000_003f_ffff_ffff);
134 const USER_BRK_START: crate::mm::VirtAddr = VirtAddr::new(0x0000_001f_ffff_ffff);
136 const USER_STACK_START: crate::mm::VirtAddr = VirtAddr::new(0x0000_001f_ffa0_0000);
139 const FIXMAP_START_VADDR: VirtAddr = VirtAddr::new(0xffff_ffff_fc00_0000);
144 const MMIO_BASE: VirtAddr = VirtAddr::new(0xffff_ffff_8000_0000);
[all …]
/DragonOS/kernel/src/libs/
H A Delf.rs27 MemoryManagementArch, VirtAddr,
120 start: VirtAddr, in set_elf_brk() argument
121 end: VirtAddr, in set_elf_brk() argument
148 fn elf_page_offset(&self, addr: VirtAddr) -> usize { in elf_page_offset()
152 fn elf_page_start(&self, addr: VirtAddr) -> VirtAddr { in elf_page_start() argument
153 VirtAddr::new(addr.data() & (!(CurrentElfArch::ELF_PAGE_SIZE - 1))) in elf_page_start()
156 fn elf_page_align_up(&self, addr: VirtAddr) -> VirtAddr { in elf_page_align_up() argument
157 VirtAddr::new( in elf_page_align_up()
205 mut addr_to_map: VirtAddr, in load_elf_segment() argument
209 ) -> Result<(VirtAddr, bool), SystemError> { in load_elf_segment() argument
[all …]
/DragonOS/kernel/src/libs/futex/
H A Dsyscall.rs4 mm::{verify_area, VirtAddr},
16 uaddr: VirtAddr, in do_futex() argument
20 uaddr2: VirtAddr, in do_futex() argument
115 pub fn set_robust_list(head_uaddr: VirtAddr, len: usize) -> Result<usize, SystemError> { in set_robust_list() argument
125 head_uaddr: VirtAddr, in get_robust_list() argument
126 len_ptr_uaddr: VirtAddr, in get_robust_list() argument
H A Dfutex.rs20 mm::{ucontext::AddressSpace, MemoryManagementArch, VirtAddr},
221 uaddr: VirtAddr, in futex_wait() argument
351 uaddr: VirtAddr, in futex_wake() argument
385 uaddr1: VirtAddr, in futex_requeue() argument
387 uaddr2: VirtAddr, in futex_requeue() argument
459 uaddr1: VirtAddr, in futex_wake_op() argument
461 uaddr2: VirtAddr, in futex_wake_op() argument
502 uaddr: VirtAddr, in get_futex_key() argument
548 pub fn futex_atomic_op_inuser(encoded_op: u32, uaddr: VirtAddr) -> Result<bool, SystemError> { in futex_atomic_op_inuser()
608 uaddr: VirtAddr, in arch_futex_atomic_op_inuser() argument
[all …]
/DragonOS/kernel/src/syscall/
H A Dmod.rs37 mm::{verify_area, MemoryManagementArch, VirtAddr},
227 let new_brk = VirtAddr::new(args[0]); in handle()
233 Self::sbrk(increment).map(|vaddr: VirtAddr| vaddr.data()) in handle()
249 let virt_addr: VirtAddr = VirtAddr::new(buf_vaddr); in handle()
270 let virt_path_ptr = VirtAddr::new(path_ptr); in handle()
271 let virt_argv_ptr = VirtAddr::new(argv_ptr); in handle()
272 let virt_env_ptr = VirtAddr::new(env_ptr); in handle()
322 let virt_req = VirtAddr::new(req as usize); in handle()
323 let virt_rem = VirtAddr::new(rem as usize); in handle()
448 let virt_optval = VirtAddr::new(optval as usize); in handle()
[all …]
H A Duser_access.rs11 use crate::mm::{verify_area, VirtAddr};
29 pub unsafe fn clear_user(dest: VirtAddr, len: usize) -> Result<usize, SystemError> { in clear_user() argument
38 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user() argument
48 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user()
93 copy_from_user(&mut c, VirtAddr::new(addr as usize))?; in check_and_clone_cstr()
133 copy_from_user(&mut dst, VirtAddr::new(addr as usize))?; in check_and_clone_cstr_array()
172 if from_user && verify_area(VirtAddr::new(addr as usize), len).is_err() { in new()
280 if from_user && verify_area(VirtAddr::new(addr as usize), len).is_err() { in new()
/DragonOS/kernel/src/process/
H A Didle.rs9 mm::{percpu::PerCpu, VirtAddr, IDLE_PROCESS_ADDRESS_SPACE},
39 VirtAddr::new(Self::stack_ptr().data() & (!(KernelStack::ALIGN - 1))); in init_idle()
88 fn stack_ptr() -> VirtAddr { in stack_ptr()
90 return VirtAddr::new(x86::current::registers::rsp() as usize); in stack_ptr()
98 return VirtAddr::new(stack_ptr); in stack_ptr()
H A Dexec.rs15 VirtAddr,
39 entry_point: VirtAddr,
43 pub fn new(entry_point: VirtAddr) -> Self { in new()
47 pub fn entry_point(&self) -> VirtAddr { in entry_point() argument
70 BadAddress(Option<VirtAddr>),
225 ) -> Result<(VirtAddr, VirtAddr), SystemError> { in push_at() argument
/DragonOS/kernel/src/arch/x86_64/mm/
H A Dmod.rs30 use crate::mm::{MemoryManagementArch, PageTableKind, PhysAddr, VirtAddr, VmFlags};
124 const USER_END_VADDR: VirtAddr =
125 VirtAddr::new((Self::PAGE_ADDRESS_SIZE >> 1) - Self::PAGE_SIZE);
126 const USER_BRK_START: VirtAddr = VirtAddr::new(0x700000000000);
127 const USER_STACK_START: VirtAddr = VirtAddr::new(0x6ffff0a00000);
129 const FIXMAP_START_VADDR: VirtAddr = VirtAddr::new(0xffffb00000000000);
133 const MMIO_BASE: VirtAddr = VirtAddr::new(0xffffa10000000000);
179 unsafe fn invalidate_page(address: VirtAddr) { in invalidate_page() argument
218 fn virt_is_valid(virt: VirtAddr) -> bool { in virt_is_valid()
286 unsafe fn read<T>(address: VirtAddr) -> T { in read()
[all …]
/DragonOS/kernel/src/arch/riscv64/process/
H A Dsyscall.rs6 mm::VirtAddr,
16 user_sp: VirtAddr, in arch_do_execve() argument
17 argv_ptr: VirtAddr, in arch_do_execve() argument
/DragonOS/kernel/src/arch/x86_64/process/
H A Dtable.rs4 mm::{percpu::PerCpu, VirtAddr},
57 VirtAddr::new(Self::current_tss() as *mut TaskStateSegment as usize), in load_tr()
63 unsafe fn set_tss_descriptor(index: u16, vaddr: VirtAddr) { in set_tss_descriptor() argument
65 let gdt_vaddr = VirtAddr::new(&GDT_Table as *const _ as usize); in set_tss_descriptor()
H A Dmod.rs19 mm::VirtAddr,
109 kaddr: VirtAddr::new(0), in new()
110 uaddr: VirtAddr::new(0), in new()
123 pub fn set_stack(&mut self, stack: VirtAddr) { in set_stack() argument
127 pub fn set_stack_base(&mut self, stack_base: VirtAddr) { in set_stack_base() argument
271 let ptr = VirtAddr::new(x86::current::registers::rsp() as usize); in arch_current_pcb()
273 let stack_base = VirtAddr::new(ptr.data() & (!(KernelStack::ALIGN - 1))); in arch_current_pcb()
318 let trap_frame_vaddr: VirtAddr = in copy_thread()
514 let trap_frame_vaddr = VirtAddr::new( in arch_switch_to_user()
528 let new_rip = VirtAddr::new(ret_from_intr as usize); in arch_switch_to_user()
/DragonOS/kernel/src/arch/x86_64/syscall/
H A Dmod.rs10 mm::VirtAddr,
31 pub(super) kaddr: VirtAddr,
32 pub(super) uaddr: VirtAddr,
37 pub fn set_kstack(&mut self, kstack: VirtAddr) { in set_kstack() argument
131 unsafe { set_system_trap_gate(0x80, 0, VirtAddr::new(syscall_int as usize)) }; // 系统调用门 in arch_syscall_init()
/DragonOS/kernel/src/net/event_poll/
H A Dsyscall.rs7 mm::VirtAddr,
35 events: VirtAddr, in epoll_wait() argument
66 pub fn epoll_ctl(epfd: i32, op: usize, fd: i32, event: VirtAddr) -> Result<usize, SystemError> { in epoll_ctl()
93 epoll_event: VirtAddr, in epoll_pwait() argument
/DragonOS/kernel/src/arch/riscv64/init/
H A Dmod.rs13 mm::{memblock::mem_block_manager, PhysAddr, VirtAddr},
27 pub fdt_vaddr: Option<VirtAddr>,
41 pub fn arch_fdt(&self) -> VirtAddr { in arch_fdt() argument
44 return VirtAddr::new(self.fdt_paddr.data()); in arch_fdt()

123