/DragonOS-0.1.5/kernel/src/debug/ |
D | kallsyms.c | 20 #define symbol_to_write(vaddr, tv, etv) \ argument 21 ((vaddr < tv || vaddr > etv) ? 0 : 1) 29 uint64_t vaddr; member 54 int retval = fscanf(filp, "%llx %c %510s\n", &entry->vaddr, &entry->type, str); in read_symbol() 100 text_vaddr = symbol_table[i].vaddr; in read_map() 102 etext_vaddr = symbol_table[i].vaddr; in read_map() 125 if (!symbol_to_write(symbol_table[i].vaddr, text_vaddr, etext_vaddr)) in generate_result() 128 if (symbol_table[i].vaddr == last_vaddr) in generate_result() 132 printf("\t.quad\t%#llx\n", symbol_table[i].vaddr); in generate_result() 135 last_vaddr = symbol_table[i].vaddr; in generate_result() [all …]
|
/DragonOS-0.1.5/kernel/src/mm/ |
D | mmio_buddy.rs | 60 fn create_region(&self, vaddr: u64) -> Box<MmioBuddyAddrRegion> { in create_region() 62 region.vaddr = vaddr; in create_region() 77 fn give_back_block(&self, vaddr: u64, exp: u32) -> Result<i32, i32> { in give_back_block() 79 if (vaddr & ((1 << exp) - 1)) != 0 { in give_back_block() 82 let region: Box<MmioBuddyAddrRegion> = self.create_region(vaddr); in give_back_block() 103 let vaddr: u64 = self.calculate_block_vaddr(region.vaddr, exp - 1); in split_block() localVariable 104 let new_region: Box<MmioBuddyAddrRegion> = self.create_region(vaddr); in split_block() 290 fn calculate_block_vaddr(&self, vaddr: u64, exp: u32) -> u64 { in calculate_block_vaddr() 291 return vaddr ^ (1 << exp); in calculate_block_vaddr() 308 vaddr: u64, in pop_buddy_block() [all …]
|
D | utils.c | 12 uint64_t __mm_get_paddr(struct mm_struct *mm, uint64_t vaddr) in __mm_get_paddr() argument 16 tmp = phys_2_virt((ul *)(((ul)mm->pgd) & (~0xfffUL)) + ((vaddr >> PAGE_GDT_SHIFT) & 0x1ff)); in __mm_get_paddr() 22 tmp = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + ((vaddr >> PAGE_1G_SHIFT) & 0x1ff)); in __mm_get_paddr() 29 tmp = phys_2_virt(((ul *)(*tmp & (~0xfffUL)) + (((ul)(vaddr) >> PAGE_2M_SHIFT) & 0x1ff))); in __mm_get_paddr() 43 tmp = phys_2_virt(((ul *)(*tmp & (~0xfffUL)) + (((ul)(vaddr) >> PAGE_4K_SHIFT) & 0x1ff))); in __mm_get_paddr()
|
D | slab.h | 27 void *vaddr; member 49 void *(*constructor)(void *vaddr, ul arg); 50 void *(*destructor)(void *vaddr, ul arg); 91 …lab *slab_create(ul size, void *(*constructor)(void *vaddr, ul arg), void *(*destructor)(void *vad…
|
D | mmap.c | 143 uint64_t *vaddr = kmalloc(PAGE_4K_SIZE, 0); in mm_map_proc_page_table() local 144 memset(vaddr, 0, PAGE_4K_SIZE); in mm_map_proc_page_table() 145 … set_pdt(pde_ptr, mk_pdt(virt_2_phys(vaddr), (user ? PAGE_USER_PDE : PAGE_KERNEL_PDE))); in mm_map_proc_page_table() 320 int mm_create_vma(struct mm_struct *mm, uint64_t vaddr, uint64_t length, vm_flags_t vm_flags, struc… in mm_create_vma() argument 324 if (unlikely(vaddr & (PAGE_4K_SIZE - 1))) in mm_create_vma() 332 vma->vm_start = vaddr; in mm_create_vma() 333 vma->vm_end = vaddr + length; in mm_create_vma() 473 int mm_map(struct mm_struct *mm, uint64_t vaddr, uint64_t length, uint64_t paddr) in mm_map() argument 480 struct vm_area_struct *vma = vma_find(mm, vaddr + mapped); in mm_map() 483 …kerror("Map addr failed: vma not found. At address: %#018lx, pid=%ld", vaddr + mapped, current_pcb… in mm_map() [all …]
|
D | slab.c | 33 …lab *slab_create(ul size, void *(*constructor)(void *vaddr, ul arg), void *(*destructor)(void *vad… in slab_create() argument 89 slab_pool->cache_pool_entry->vaddr = phys_2_virt(slab_pool->cache_pool_entry->page->addr_phys); in slab_create() 195 tmp_slab_obj->vaddr = phys_2_virt(tmp_slab_obj->page->addr_phys); in slab_malloc() 255 … return slab_pool->constructor((char *)slab_obj_ptr->vaddr + slab_pool->size * i, arg); in slab_malloc() 259 return (void *)((char *)slab_obj_ptr->vaddr + slab_pool->size * i); in slab_malloc() 296 if (!(slab_obj_ptr->vaddr <= addr && addr <= (slab_obj_ptr->vaddr + PAGE_2M_SIZE))) in slab_free() 304 int index = (addr - slab_obj_ptr->vaddr) / slab_pool->size; in slab_free() 317 slab_pool->destructor((char *)slab_obj_ptr->vaddr + slab_pool->size * index, arg); in slab_free() 423 kmalloc_cache_group[i].cache_pool_entry->vaddr = virt; in slab_init() 451 ul *vaddr = NULL; in kmalloc_create_slab_obj() local [all …]
|
D | mmio.h | 6 extern int mmio_release(int vaddr, int length);
|
D | internal.h | 33 uint64_t __mm_get_paddr(struct mm_struct *mm, uint64_t vaddr);
|
D | mm.h | 455 int mm_create_vma(struct mm_struct *mm, uint64_t vaddr, uint64_t length, vm_flags_t vm_flags, 478 int mm_map(struct mm_struct *mm, uint64_t vaddr, uint64_t length, uint64_t paddr); 499 int mm_unmap(struct mm_struct *mm, uint64_t vaddr, uint64_t length, bool destroy);
|
/DragonOS-0.1.5/docs/kernel/memory_management/ |
D | mmio.md | 93 │ │ │ list │ │ │ vaddr │ │ vaddr │ │ 149 vaddr: u64, 162 …; `MmioFreeRegionList`中的元素类型为`MmioBuddyAddrRegion`结构体,`MmioBuddyAddrRegion`记录了内存块的起始地址(vaddr)。 170 | __create_region(&self, vaddr) | 将虚拟地址传入,创建新的内存块地址结构体 … 171 | __give_back_block(&self, vaddr, exp) | 将地址为vaddr,幂为exp的内存块归还给buddy … 176 | __buddy_block_vaddr(&self, vaddr, exp) | 根据地址和内存块大小,计算伙伴块虚拟内存的地址 … 177 | __pop_buddy_block( &self, vaddr,exp,list_guard) | 寻找并弹出指定内存块的伙伴块 … 189 | mmio_release(vaddr, length) | 取消地址为vaddr,大小为length的mmio的映射并将其归还到buddy中 |
|
/DragonOS-0.1.5/kernel/src/common/ |
D | glib.h | 284 static __always_inline void __write8b(uint64_t vaddr, uint64_t value) in __write8b() argument 286 asm volatile("movq %%rdx, 0(%%rax)" ::"a"(vaddr), "d"(value) in __write8b() 298 static __always_inline void __write4b(uint64_t vaddr, uint32_t value) in __write4b() argument 300 asm volatile("movl %%edx, 0(%%rax)" ::"a"(vaddr), "d"(value) in __write4b() 312 static __always_inline uint64_t __read8b(uint64_t vaddr) in __read8b() argument 317 : "a"(vaddr) in __read8b() 329 static __always_inline uint32_t __read4b(uint64_t vaddr) in __read4b() argument 334 : "a"(vaddr) in __read4b()
|
/DragonOS-0.1.5/kernel/src/driver/video/ |
D | video.c | 40 …video_frame_buffer_info.vaddr = SPECIAL_MEMOEY_MAPPING_VIRT_ADDR_BASE + FRAME_BUFFER_MAPPING_OFFSE… in init_frame_buffer() 41 …mm_map_proc_page_table(global_CR3, true, video_frame_buffer_info.vaddr, __fb_info.framebuffer_addr, in init_frame_buffer() 66 memcpy((void *)video_frame_buffer_info.vaddr, (void *)video_refresh_target->vaddr, in video_refresh_daemon() 186 video_frame_buffer_info.vaddr = 0xffff800003000000; in video_init() 187 …mm_map_phys_addr(video_frame_buffer_info.vaddr, __fb_info.framebuffer_addr, video_frame_buffer_inf… in video_init()
|
/DragonOS-0.1.5/kernel/src/driver/virtio/ |
D | virtio_impl.rs | 58 let vaddr = buffer.as_ptr() as *mut u8 as usize; in share() localVariable 60 virt_to_phys(vaddr) in share() 72 fn virt_to_phys(vaddr: VirtAddr) -> PhysAddr { in virt_to_phys() 73 vaddr - PAGE_OFFSET as usize in virt_to_phys()
|
D | transport_pci.rs | 416 vaddr: VirtAddr, 455 Self::Misaligned { vaddr, alignment } => write!( in fmt() 458 vaddr, alignment in fmt() 491 let vaddr = (bar_info in get_bar_region() localVariable 495 if vaddr % align_of::<T>() != 0 { in get_bar_region() 497 vaddr, in get_bar_region() 501 Ok(NonNull::new((vaddr) as _).unwrap()) in get_bar_region()
|
/DragonOS-0.1.5/kernel/src/libs/libUI/ |
D | screen_manager.c | 50 buf->vaddr = (uint64_t)phys_2_virt(p->addr_phys); in __create_buffer() 68 if (unlikely(buf->vaddr == NULL)) in __destroy_buffer() 70 if (unlikely(verify_area(buf->vaddr, buf->size) == true)) in __destroy_buffer() 77 …free_pages(Phy_to_2M_Page(virt_2_phys(buf->vaddr)), PAGE_2M_ALIGN(video_frame_buffer_info.size) / … in __destroy_buffer() 286 if (ui->buf->vaddr == NULL) in scm_framework_enable()
|
D | screen_manager.h | 26 uint64_t vaddr; // 帧缓冲区的地址 member
|
D | textui-render.c | 124 uint32_t *fb = (uint32_t *)textui_framework.buf->vaddr; in __textui_render_chromatic()
|
D | textui.c | 94 memcpy((void *)buf->vaddr, (void *)(textui_framework.buf->vaddr), textui_framework.buf->size); in textui_change_handler()
|
/DragonOS-0.1.5/kernel/src/driver/usb/xhci/ |
D | xhci.c | 161 static __always_inline void __write_slot(const uint64_t vaddr, struct xhci_slot_context_t *slot_ctx) in __write_slot() argument 163 memcpy((void *)vaddr, slot_ctx, sizeof(struct xhci_slot_context_t)); in __write_slot() 546 const uint64_t vaddr = (uint64_t)kmalloc(total_size, 0); in xhci_create_ring() local 548 memset((void *)vaddr, 0, total_size); in xhci_create_ring() 551 xhci_TRB_set_link_cmd(vaddr + total_size - sizeof(struct xhci_TRB_t)); in xhci_create_ring() 553 return vaddr; in xhci_create_ring()
|