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

4.5 do_allocate functional

parent 15fa2207
No related branches found
Tags tp2-act-4-5
No related merge requests found
......@@ -377,6 +377,14 @@ int load_from_file(char* file,
}
int do_allocate(pagetable_t pagetable, struct proc* p, uint64 addr){
pte_t* pte = walk(pagetable, addr, 0);
if(pte == 0 || !(*pte & PTE_V)){
return ENOMEM;
}
if(!(*pte & PTE_U)){
return EBADPERM;
}
return 0;
}
......
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