Home
last modified time | relevance | path

Searched refs:phys_2_virt (Results 1 – 13 of 13) sorted by relevance

/DragonOS-0.1.2/kernel/src/mm/
Dutils.c16 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()
61 …tmp = phys_2_virt((ul *)((ul)page_table_phys_addr & (~0xfffUL)) + ((virt_addr >> PAGE_GDT_SHIFT) &… in mm_check_mapped()
67 tmp = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + ((virt_addr >> PAGE_1G_SHIFT) & 0x1ff)); in mm_check_mapped()
74 tmp = phys_2_virt(((ul *)(*tmp & (~0xfffUL)) + (((ul)(virt_addr) >> PAGE_2M_SHIFT) & 0x1ff))); in mm_check_mapped()
88 … tmp = phys_2_virt(((ul *)(*tmp & (~0xfffUL)) + (((ul)(virt_addr) >> PAGE_4K_SHIFT) & 0x1ff))); in mm_check_mapped()
Dmmap.c90 pml4_ptr = phys_2_virt((ul *)((ul)proc_page_table_addr & (~0xfffUL))); in mm_map_proc_page_table()
111 uint64_t *pdpt_ptr = (uint64_t *)phys_2_virt(*pml4e_ptr & (~0xfffUL)); in mm_map_proc_page_table()
128 uint64_t *pd_ptr = (uint64_t *)phys_2_virt(*pdpte_ptr & (~0xfffUL)); in mm_map_proc_page_table()
154 uint64_t *pt_ptr = (uint64_t *)phys_2_virt(*pde_ptr & (~0xfffUL)); in mm_map_proc_page_table()
215 pml4_ptr = phys_2_virt((ul *)((ul)proc_page_table_addr & (~0xfffUL))); in mm_unmap_proc_table()
235 uint64_t *pdpt_ptr = (uint64_t *)phys_2_virt(*pml4e_ptr & (~0xfffUL)); in mm_unmap_proc_table()
252 uint64_t *pd_ptr = (uint64_t *)phys_2_virt(*pdpte_ptr & (~0xfffUL)); in mm_unmap_proc_table()
267 uint64_t *pt_ptr = (uint64_t *)phys_2_virt(*pde_ptr & (~0xfffUL)); in mm_unmap_proc_table()
Dmm.c487 …mm_map_proc_page_table((uint64_t)get_CR3(), true, (ul)phys_2_virt(p->addr_phys), p->addr_phys, PAG… in page_table_init()
501 uint64_t *idle_pml4t_vaddr = (uint64_t *)phys_2_virt((uint64_t)get_CR3() & (~0xfffUL)); in page_table_init()
534 …tmp = phys_2_virt((ul *)((ul)proc_page_table_addr & (~0xfffUL)) + ((virt_addr >> PAGE_GDT_SHIFT) &… in mm_get_PDE()
542 tmp = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + ((virt_addr >> PAGE_1G_SHIFT) & 0x1ff)); in mm_get_PDE()
549 tmp = phys_2_virt(((ul *)(*tmp & (~0xfffUL)) + (((ul)(virt_addr) >> PAGE_2M_SHIFT) & 0x1ff))); in mm_get_PDE()
653 … uint64_t phys = mm_get_PDE((uint64_t)phys_2_virt((uint64_t)current_pcb->mm->pgd), false, i, true); in mm_do_brk()
666 …mm_unmap_proc_table((uint64_t)phys_2_virt((uint64_t)current_pcb->mm->pgd), false, end_addr, PAGE_2… in mm_do_brk()
Dslab.c89 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()
466 vaddr = phys_2_virt(page->addr_phys); in kmalloc_create_slab_obj()
518 slab_obj_ptr->vaddr = phys_2_virt(page->addr_phys); in kmalloc_create_slab_obj()
Dmm.h41 #define phys_2_virt(addr) ((unsigned long *)((unsigned long)(addr) + PAGE_OFFSET)) macro
/DragonOS-0.1.2/kernel/src/exception/
Dgate.h105 …*(unsigned long *)(phys_2_virt(GDT_Table + n)) = (limit & 0xffff) | (((unsigned long)addr & 0xffff… in set_tss_descriptor()
106 …*(unsigned long *)(phys_2_virt(GDT_Table + n + 1)) = (((unsigned long)addr >> 32) & 0xffffffff) | … in set_tss_descriptor()
129 _set_gate(phys_2_virt(IDT_Table + n), 0x8E, ist, addr); // p=1,DPL=0, type=E in set_intr_gate()
146 _set_gate(phys_2_virt(IDT_Table + n), 0x8F, ist, addr); // p=1,DPL=0, type=F in set_trap_gate()
161 _set_gate(phys_2_virt(IDT_Table + n), 0xEF, ist, addr); // p=1,DPL=3, type=F in set_system_trap_gate()
167 _set_gate(phys_2_virt(IDT_Table + n) , 0xEE , ist , addr); //P,DPL=3,TYPE=E in set_system_intr_gate()
/DragonOS-0.1.2/kernel/src/
Dmain.c54 gdtp.gdt_vaddr = (ul)phys_2_virt((ul)&GDT_Table); in reload_gdt()
63 idtp.idt_vaddr = (ul)phys_2_virt((ul)&IDT_Table); in reload_idt()
82 ul tss_item_addr = (ul)phys_2_virt(0x7c00); in system_initialize()
/DragonOS-0.1.2/kernel/src/process/
Dfork.c233 memset(phys_2_virt(new_mms->pgd), 0, PAGE_4K_SIZE / 2); in process_copy_mm()
236 …memcpy(phys_2_virt(new_mms->pgd) + 256, phys_2_virt(initial_proc[proc_current_cpu_id]->mm->pgd) + … in process_copy_mm()
239 uint64_t *current_pgd = (uint64_t *)phys_2_virt(current_pcb->mm->pgd); in process_copy_mm()
241 uint64_t *new_pml4t = (uint64_t *)phys_2_virt(new_mms->pgd); in process_copy_mm()
271 memcpy((void *)phys_2_virt(pa), (void *)(vma->vm_start + i * PAGE_2M_SIZE), in process_copy_mm()
Dprocess.c292 kfree(phys_2_virt(paddr)); in process_load_elf_file()
371 memset(phys_2_virt(new_mms->pgd), 0, PAGE_4K_SIZE / 2); in do_execve()
374 …memcpy(phys_2_virt(new_mms->pgd) + 256, phys_2_virt(initial_proc[proc_current_cpu_id]) + 256, PAGE… in do_execve()
751 pml4t_t *current_pgd = (pml4t_t *)phys_2_virt(pcb->mm->pgd); in process_exit_mm()
771 kfree(phys_2_virt(pa)); in process_exit_mm()
/DragonOS-0.1.2/kernel/src/driver/disk/ahci/
Dahci.c304 memset((void *)(phys_2_virt(port->clb)), 0, 1024); in port_rebase()
310 memset((void *)(phys_2_virt(port->fb)), 0, 256); in port_rebase()
314 HBA_CMD_HEADER *cmdheader = (HBA_CMD_HEADER *)(phys_2_virt(port->clb)); in port_rebase()
322 memset((void *)phys_2_virt(cmdheader[i].ctba), 0, 256); in port_rebase()
348 HBA_CMD_HEADER *cmdheader = (HBA_CMD_HEADER *)phys_2_virt(port->clb); in ahci_read()
354 HBA_CMD_TBL *cmdtbl = (HBA_CMD_TBL *)phys_2_virt(cmdheader->ctba); in ahci_read()
442 HBA_CMD_HEADER *cmdheader = (HBA_CMD_HEADER *)phys_2_virt(port->clb); in ahci_write()
451 HBA_CMD_TBL *cmdtbl = (HBA_CMD_TBL *)phys_2_virt(cmdheader->ctba); in ahci_write()
/DragonOS-0.1.2/kernel/src/smp/
Dsmp.c40 memcpy((unsigned char *)phys_2_virt(0x20000), _apu_boot_start, in smp_init()
131 *(ul *)(phys_2_virt(global_CR3) + i) = 0UL; in smp_init()
/DragonOS-0.1.2/kernel/src/libs/libUI/
Dscreen_manager.c50 buf->vaddr = (uint64_t)phys_2_virt(p->addr_phys); in __create_buffer()
/DragonOS-0.1.2/kernel/src/driver/usb/xhci/
Dxhci.c225 return (uint64_t)phys_2_virt( in xhci_get_device_context_vaddr()
710 origin_vaddr = (uint64_t)phys_2_virt(event_trb.param); in xhci_hc_irq_handler()
747 __write4b((uint64_t)phys_2_virt(event_trb.param), in xhci_hc_irq_handler()