Skip to content
Snippets Groups Projects
Commit 8c34667d authored by Fache Charles's avatar Fache Charles
Browse files

4.1: fixed last issues

parent 1e20a7c5
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,11 @@ exec(char *path, char **argv)
begin_op(ROOTDEV);
if((ip = namei(path)) == 0){
acquire(&p->vma_lock);
p->stack_vma = svma;
p->heap_vma = hvma;
p->memory_areas = mem_areas;
release(&p->vma_lock);
end_op(ROOTDEV);
return -1;
}
......@@ -95,13 +100,11 @@ exec(char *path, char **argv)
uint64 oldsz = p->sz;
// Allocate two pages at the next page boundary.
// Use the second as the stack.
// Use the second as the user stack.
sz = PGROUNDUP(sz);
// Add VMA for stack and save it in process
// acquire(&p->vma_lock);
p->stack_vma = add_memory_area(p, sz + PGSIZE, sz + 2 * PGSIZE);
if((sz = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0){
// release(&p->vma_lock);
printf("exec: uvmalloc failed for the stack\n");
goto bad;
}
......@@ -111,7 +114,6 @@ exec(char *path, char **argv)
// Add VMA for heap and save it in process
p->heap_vma = add_memory_area(p, sz, sz);
// release(&p->vma_lock);
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment