/DragonOS-0.1.7/kernel/src/driver/acpi/ |
D | acpi.c | 47 …m_map_phys_addr(acpi_description_header_base + PAGE_2M_SIZE * i, (*(ent + i)) & PAGE_2M_MASK, PAGE… in acpi_iter_SDT() 48 …t acpi_system_description_table_header_t *)((ul)(acpi_description_header_base + PAGE_2M_SIZE * i)); in acpi_iter_SDT() 178 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_rsdt_virt_addr_base, &size); in acpi_init() 182 mm_map(&initial_mm, acpi_rsdt_virt_addr_base, PAGE_2M_SIZE, paddr); in acpi_init() 196 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_description_header_base, &size); in acpi_init() 204 mm_map(&initial_mm, acpi_description_header_base, PAGE_2M_SIZE, paddr); in acpi_init() 215 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_rsdt_virt_addr_base, &size); in acpi_init() 220 mm_map(&initial_mm, acpi_rsdt_virt_addr_base, PAGE_2M_SIZE, paddr); in acpi_init() 235 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_description_header_base, &size); in acpi_init() 243 mm_map(&initial_mm, acpi_description_header_base, PAGE_2M_SIZE, paddr); in acpi_init()
|
/DragonOS-0.1.7/kernel/src/driver/virtio/ |
D | virtio_impl.rs | 3 alloc_pages, free_pages, memory_management_struct, Page, PAGE_2M_SHIFT, PAGE_2M_SIZE, 16 let page_num = (pages * PAGE_SIZE - 1 + PAGE_2M_SIZE as usize) / PAGE_2M_SIZE as usize; in dma_alloc() 31 let page_num = (pages * PAGE_SIZE - 1 + PAGE_2M_SIZE as usize) / PAGE_2M_SIZE as usize; in dma_dealloc()
|
/DragonOS-0.1.7/kernel/src/mm/ |
D | allocator.rs | 2 use crate::include::bindings::bindings::{gfp_t, kfree, kmalloc, PAGE_2M_SIZE}; 18 if layout.size() > (PAGE_2M_SIZE as usize / 2) { in local_alloc() 25 if layout.size() > (PAGE_2M_SIZE as usize / 2) { in local_alloc_zeroed()
|
D | slab.c | 85 slab_pool->cache_pool_entry->count_free = PAGE_2M_SIZE / slab_pool->size; in slab_create() 194 tmp_slab_obj->count_free = PAGE_2M_SIZE / slab_pool->size; in slab_malloc() 296 if (!(slab_obj_ptr->vaddr <= addr && addr <= (slab_obj_ptr->vaddr + PAGE_2M_SIZE))) in slab_free() 364 … kmalloc_cache_group[i].cache_pool_entry->count_free = PAGE_2M_SIZE / kmalloc_cache_group[i].size; in slab_init() 408 …virt = (ul *)((memory_management_struct.end_of_struct + PAGE_2M_SIZE * i + PAGE_2M_SIZE - 1) & PAG… in slab_init() 468 struct_size = sizeof(struct slab_obj) + PAGE_2M_SIZE / size / 8; in kmalloc_create_slab_obj() 470 slab_obj_ptr = (struct slab_obj *)((unsigned char *)vaddr + PAGE_2M_SIZE - struct_size); in kmalloc_create_slab_obj() 473 slab_obj_ptr->count_free = (PAGE_2M_SIZE - struct_size) / size; in kmalloc_create_slab_obj() 505 slab_obj_ptr->count_free = PAGE_2M_SIZE / size; in kmalloc_create_slab_obj()
|
D | mm-stat.c | 168 tmp.used = __count_in_using_2m_pages(ZONE_NORMAL) * PAGE_2M_SIZE; in mm_stat() 169 tmp.free = __count_empty_2m_pages(ZONE_NORMAL) * PAGE_2M_SIZE; in mm_stat()
|
D | mmap.c | 33 ent->num_PDE = (length + PAGE_2M_SIZE - 1) >> PAGE_2M_SHIFT; in mm_calculate_entry_num() 177 length_mapped += PAGE_2M_SIZE; in mm_map_proc_page_table() 182 length_mapped += PAGE_2M_SIZE; in mm_map_proc_page_table() 287 length_unmapped += PAGE_2M_SIZE; in mm_unmap_proc_table() 420 len_4k = length % PAGE_2M_SIZE; in mm_map_vma() 421 len_2m = length / PAGE_2M_SIZE; in mm_map_vma()
|
D | mm.h | 28 #define PAGE_2M_SIZE (1UL << PAGE_2M_SHIFT) macro 33 #define PAGE_2M_MASK (~(PAGE_2M_SIZE - 1)) 37 #define PAGE_2M_ALIGN(addr) (((unsigned long)(addr) + PAGE_2M_SIZE - 1) & PAGE_2M_MASK)
|
D | mm.c | 173 p->addr_phys = addr_start + PAGE_2M_SIZE * j; in mm_init() 487 …int64_t)get_CR3(), true, (ul)phys_2_virt(p->addr_phys), p->addr_phys, PAGE_2M_SIZE, PAGE_KERNEL_PA… in page_table_init() 638 for (uint64_t i = old_brk_end_addr; i < end_addr; i += PAGE_2M_SIZE) in mm_do_brk() 641 mm_create_vma(current_pcb->mm, i, PAGE_2M_SIZE, VM_USER | VM_ACCESS_FLAGS, NULL, &vma); in mm_do_brk() 642 … mm_map(current_pcb->mm, i, PAGE_2M_SIZE, alloc_pages(ZONE_NORMAL, 1, PAGE_PGT_MAPPED)->addr_phys); in mm_do_brk() 651 for (uint64_t i = end_addr; i < old_brk_end_addr; i += PAGE_2M_SIZE) in mm_do_brk()
|
D | mmio_buddy.rs | 7 vma_find, MMIO_BASE, MMIO_TOP, PAGE_1G_SHIFT, PAGE_1G_SIZE, PAGE_2M_SIZE, PAGE_4K_SHIFT, 478 let len_4k: u64 = (new_size % PAGE_2M_SIZE) as u64; in create_mmio() 491 PAGE_2M_SIZE.into(), in create_mmio() 508 loop_i += PAGE_2M_SIZE as u64; in create_mmio()
|
/DragonOS-0.1.7/kernel/src/process/ |
D | fork.c | 230 if (vma_size > PAGE_2M_SIZE / 2) in process_copy_mm() 238 … int ret = mm_create_vma(new_mms, vma->vm_start + i * PAGE_2M_SIZE, PAGE_2M_SIZE, vma->vm_flags, in process_copy_mm() 244 mm_map_vma(new_vma, pa, 0, PAGE_2M_SIZE); in process_copy_mm() 246 memcpy((void *)phys_2_virt(pa), (void *)(vma->vm_start + i * PAGE_2M_SIZE), in process_copy_mm() 247 (vma_size >= PAGE_2M_SIZE) ? PAGE_2M_SIZE : vma_size); in process_copy_mm() 248 vma_size -= PAGE_2M_SIZE; in process_copy_mm()
|
D | process.c | 279 if (remain_mem_size >= PAGE_2M_SIZE) // 接下来存在映射2M页的情况,因此将vaddr按2M向下对齐 in process_load_elf_file() 291 if (remain_mem_size >= PAGE_2M_SIZE) in process_load_elf_file() 296 … mm_create_vma(current_pcb->mm, virt_base, PAGE_2M_SIZE, VM_USER | VM_ACCESS_FLAGS, NULL, &vma); in process_load_elf_file() 302 mm_map(current_pcb->mm, virt_base, PAGE_2M_SIZE, pa); in process_load_elf_file() 305 memset((void *)virt_base, 0, PAGE_2M_SIZE); in process_load_elf_file() 306 map_size = PAGE_2M_SIZE; in process_load_elf_file() 339 … int64_t to_trans = (remain_file_size > PAGE_2M_SIZE) ? PAGE_2M_SIZE : remain_file_size; in process_load_elf_file() 381 …int val = mm_create_vma(current_pcb->mm, current_pcb->mm->stack_start - PAGE_2M_SIZE, PAGE_2M_SIZE, in process_load_elf_file() 386 mm_map_vma(vma, pa, 0, PAGE_2M_SIZE); in process_load_elf_file() 390 memset((void *)(current_pcb->mm->stack_start - PAGE_2M_SIZE), 0, PAGE_2M_SIZE); in process_load_elf_file()
|
/DragonOS-0.1.7/user/libs/libc/src/ |
D | malloc.c | 15 #define PAGE_2M_SIZE (1UL << PAGE_2M_SHIFT) macro 20 #define PAGE_2M_MASK (~(PAGE_2M_SIZE - 1)) 24 #define PAGE_2M_ALIGN(addr) (((unsigned long)(addr) + PAGE_2M_SIZE - 1) & PAGE_2M_MASK) 356 …nd->length == brk_max_addr && (uint64_t)malloc_free_list_end <= brk_max_addr - (PAGE_2M_SIZE << 1)) in release_brk() 358 … int64_t delta = ((brk_max_addr - (uint64_t)malloc_free_list_end) & PAGE_2M_MASK) - PAGE_2M_SIZE; in release_brk() 386 if (count_last_free_size > PAGE_2M_SIZE) in free()
|
/DragonOS-0.1.7/kernel/src/driver/disk/ahci/ |
D | ahci.c | 29 …mm_map_phys_addr(AHCI_MAPPING_BASE, (ul)(bar5)&PAGE_2M_MASK, PAGE_2M_SIZE, PAGE_KERNEL_PAGE | PAGE… in ahci_cpp_init()
|
/DragonOS-0.1.7/kernel/src/libs/libUI/ |
D | screen_manager.c | 47 … Page *p = alloc_pages(ZONE_NORMAL, PAGE_2M_ALIGN(video_frame_buffer_info.size) / PAGE_2M_SIZE, 0); in __create_buffer() 77 …y_to_2M_Page(virt_2_phys(buf->vaddr)), PAGE_2M_ALIGN(video_frame_buffer_info.size) / PAGE_2M_SIZE); in __destroy_buffer()
|
/DragonOS-0.1.7/kernel/src/filesystem/vfs/ |
D | syscall.rs | 9 pt_regs, verify_area, AT_REMOVEDIR, PAGE_2M_SIZE, PAGE_4K_SIZE, PROC_MAX_FD_NUM, SEEK_CUR, 178 || (user_mode(regs) && unsafe { !verify_area(ptr as u64, PAGE_2M_SIZE as u64) }) in sys_chdir() 269 || (user_mode(regs) && unsafe { !verify_area(ptr as u64, PAGE_2M_SIZE as u64) }) in sys_mkdir() 309 || (user_mode(regs) && unsafe { !verify_area(ptr as u64, PAGE_2M_SIZE as u64) }) in sys_unlink_at()
|
/DragonOS-0.1.7/kernel/src/driver/interrupt/apic/ |
D | apic.c | 89 … mm_map_phys_addr((ul)apic_ioapic_map.virtual_index_addr, apic_ioapic_map.addr_phys, PAGE_2M_SIZE, in apic_io_apic_init() 278 …mm_map_phys_addr(APIC_LOCAL_APIC_VIRT_BASE_ADDR, (ia32_apic_base & 0x1FFFFFFFFFFFFF), PAGE_2M_SIZE, in apic_local_apic_init()
|
/DragonOS-0.1.7/kernel/src/driver/pci/ |
D | pci.rs | 6 initial_mm, mm_map, mm_struct, PAGE_2M_SIZE, VM_DONTCOPY, VM_IO, 552 let size = bus_number_double * PAGE_2M_SIZE; in map()
|