Combine vma (#42)

* 合并vma

* 调整vma映射,修复bug

* 删除注释

Co-authored-by: fslongjin <longjin@RinGoTek.cn>
Co-authored-by: houmkh <100781004+houmkh@users.noreply.github.com>
This commit is contained in:
houmkh
2022-09-22 00:31:17 +08:00
committed by GitHub
parent cbbf79b2cf
commit be9ac3d58b
7 changed files with 113 additions and 42 deletions

View File

@ -615,7 +615,8 @@ uint64_t mm_do_brk(uint64_t old_brk_end_addr, int64_t offset)
{
struct vm_area_struct *vma = NULL;
mm_create_vma(current_pcb->mm, i, PAGE_2M_SIZE, VM_USER | VM_ACCESS_FLAGS, NULL, &vma);
mm_map_vma(vma, alloc_pages(ZONE_NORMAL, 1, PAGE_PGT_MAPPED)->addr_phys);
mm_map(current_pcb->mm, i, PAGE_2M_SIZE, alloc_pages(ZONE_NORMAL, 1, PAGE_PGT_MAPPED)->addr_phys);
// mm_map_vma(vma, alloc_pages(ZONE_NORMAL, 1, PAGE_PGT_MAPPED)->addr_phys, 0, PAGE_2M_SIZE);
}
current_pcb->mm->brk_end = end_addr;
}