// mm_create - alloc a mm_struct & initialize it. struct mm_struct * mm_create(void) { struct mm_struct *mm = kmalloc(sizeof(struct mm_struct)); if (mm != NULL) { list_init(&(mm->mmap_list)); mm->mmap_tree = NULL; mm->mmap_cache = NULL; mm->pgdir = NULL; mm->map_count = 0; mm->swap_address = 0; set_mm_count(mm, 0); lock_init(&(mm->mm_lock)); mm->brk_start = mm->brk = 0; } return mm; }
// mm_create - alloc a mm_struct & initialize it. struct mm_struct * mm_create(void) { struct mm_struct *mm = kmalloc(sizeof(struct mm_struct)); if (mm != NULL) { list_init(&(mm->mmap_list)); mm->mmap_cache = NULL; mm->pgdir = NULL; mm->map_count = 0; if (swap_init_ok) swap_init_mm(mm); else mm->sm_priv = NULL; set_mm_count(mm, 0); sem_init(&(mm->mm_sem), 1); } return mm; }
// mm_create - alloc a mm_struct & initialize it. struct mm_struct *mm_create(void) { struct mm_struct *mm = kmalloc(sizeof(struct mm_struct)); if (mm != NULL) { list_init(&(mm->mmap_list)); mm->mmap_tree = NULL; mm->mmap_cache = NULL; mm->pgdir = NULL; mm->map_count = 0; mm->swap_address = 0; set_mm_count(mm, 0); mm->locked_by = 0; mm->brk_start = mm->brk = 0; list_init(&(mm->proc_mm_link)); sem_init(&(mm->mm_sem), 1); mm->cpuid = -1; } return mm; }