Home
last modified time | relevance | path

Searched refs:PAGE_2M_SIZE (Results 1 – 14 of 14) sorted by relevance

/DragonOS-0.1.2/kernel/src/driver/acpi/
Dacpi.c47 …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()
162 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_rsdt_virt_addr_base, &size); in acpi_init()
166 mm_map(&initial_mm, acpi_rsdt_virt_addr_base, PAGE_2M_SIZE, paddr); in acpi_init()
180 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_description_header_base, &size); in acpi_init()
188 mm_map(&initial_mm, acpi_description_header_base, PAGE_2M_SIZE, paddr); in acpi_init()
199 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_rsdt_virt_addr_base, &size); in acpi_init()
204 mm_map(&initial_mm, acpi_rsdt_virt_addr_base, PAGE_2M_SIZE, paddr); in acpi_init()
219 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_description_header_base, &size); in acpi_init()
227 mm_map(&initial_mm, acpi_description_header_base, PAGE_2M_SIZE, paddr); in acpi_init()
/DragonOS-0.1.2/kernel/src/mm/
Dallocator.rs1 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()
Dmmio.c51 uint64_t len_4k = size % PAGE_2M_SIZE; in mmio_create()
54 for (uint32_t i = 0; i < len_2m; i += PAGE_2M_SIZE) in mmio_create()
57 … retval = mm_create_vma(&initial_mm, buddy_region->vaddr + i, PAGE_2M_SIZE, vm_flags, NULL, NULL); in mmio_create()
Dslab.c85 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()
Dmm-stat.c168 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()
Dmmap.c33 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()
Dmm.h28 #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)
Dmm.c173 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()
/DragonOS-0.1.2/user/libs/libc/src/
Dmalloc.c15 #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.2/kernel/src/process/
Dfork.c255 if (vma_size > PAGE_2M_SIZE / 2) in process_copy_mm()
263 … int ret = mm_create_vma(new_mms, vma->vm_start + i * PAGE_2M_SIZE, PAGE_2M_SIZE, vma->vm_flags, in process_copy_mm()
269 mm_map_vma(new_vma, pa, 0, PAGE_2M_SIZE); in process_copy_mm()
271 memcpy((void *)phys_2_virt(pa), (void *)(vma->vm_start + i * PAGE_2M_SIZE), in process_copy_mm()
272 (vma_size >= PAGE_2M_SIZE) ? PAGE_2M_SIZE : vma_size); in process_copy_mm()
273 vma_size -= PAGE_2M_SIZE; in process_copy_mm()
Dprocess.c249 if (remain_mem_size >= PAGE_2M_SIZE) // 接下来存在映射2M页的情况,因此将vaddr按2M向下对齐 in process_load_elf_file()
261 if (remain_mem_size >= PAGE_2M_SIZE) in process_load_elf_file()
266 … mm_create_vma(current_pcb->mm, virt_base, PAGE_2M_SIZE, VM_USER | VM_ACCESS_FLAGS, NULL, &vma); in process_load_elf_file()
272 mm_map(current_pcb->mm, virt_base, PAGE_2M_SIZE, pa); in process_load_elf_file()
275 memset((void *)virt_base, 0, PAGE_2M_SIZE); in process_load_elf_file()
276 map_size = PAGE_2M_SIZE; in process_load_elf_file()
305 … int64_t to_trans = (remain_file_size > PAGE_2M_SIZE) ? PAGE_2M_SIZE : remain_file_size; in process_load_elf_file()
325 …int val = mm_create_vma(current_pcb->mm, current_pcb->mm->stack_start - PAGE_2M_SIZE, PAGE_2M_SIZE, in process_load_elf_file()
330 mm_map_vma(vma, pa, 0, PAGE_2M_SIZE); in process_load_elf_file()
334 memset((void *)(current_pcb->mm->stack_start - PAGE_2M_SIZE), 0, PAGE_2M_SIZE); in process_load_elf_file()
/DragonOS-0.1.2/kernel/src/libs/libUI/
Dscreen_manager.c47 … 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.2/kernel/src/driver/interrupt/apic/
Dapic.c87 …dr((ul)apic_ioapic_map.virtual_index_addr, apic_ioapic_map.addr_phys, PAGE_2M_SIZE, PAGE_KERNEL_PA… in apic_io_apic_init()
271 …(APIC_LOCAL_APIC_VIRT_BASE_ADDR, (ia32_apic_base & 0x1FFFFFFFFFFFFF), PAGE_2M_SIZE, PAGE_KERNEL_PA… in apic_local_apic_init()
/DragonOS-0.1.2/kernel/src/driver/disk/ahci/
Dahci.c162 …mm_map_phys_addr(AHCI_MAPPING_BASE, (ul)(bar5)&PAGE_2M_MASK, PAGE_2M_SIZE, PAGE_KERNEL_PAGE | PAGE… in ahci_init()