Skip to content
Snippets Groups Projects
Commit d3ecf3eb authored by Austin Clements's avatar Austin Clements
Browse files

Slight simplification of copyuvm. We could simplify other things now that...

Slight simplification of copyuvm.  We could simplify other things now that processes are contiguous, but we'd have to think harder about the error paths.
parent b1d41d67
No related branches found
No related tags found
No related merge requests found
......@@ -310,14 +310,14 @@ copyuvm(pde_t *pgdir, uint sz)
for(i = 0; i < sz; i += PGSIZE){
if(!(pte = walkpgdir(pgdir, (void *)i, 0)))
panic("copyuvm: pte should exist\n");
if(*pte & PTE_P){
pa = PTE_ADDR(*pte);
if(!(mem = kalloc()))
goto bad;
memmove(mem, (char *)pa, PGSIZE);
if(!mappages(d, (void *)i, PGSIZE, PADDR(mem), PTE_W|PTE_U))
goto bad;
}
if(!(*pte & PTE_P))
panic("copyuvm: page not present\n");
pa = PTE_ADDR(*pte);
if(!(mem = kalloc()))
goto bad;
memmove(mem, (char *)pa, PGSIZE);
if(!mappages(d, (void *)i, PGSIZE, PADDR(mem), PTE_W|PTE_U))
goto bad;
}
return d;
......
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