X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=solutions%2Fp4.patch;h=82a51e17a4e8811bf1ef322cee0c2ce3e145b9e4;hb=31d20882fdd5111d14b4e04a9b43da88d009b13c;hp=febbcaa829770c840e137b60ba96c589fc913659;hpb=e482d5037939113b0e4e51acbf1ec8e0c4989a62;p=pintos-anon diff --git a/solutions/p4.patch b/solutions/p4.patch index febbcaa..82a51e1 100644 --- a/solutions/p4.patch +++ b/solutions/p4.patch @@ -2566,7 +2566,7 @@ diff -u src/userprog/process.c~ src/userprog/process.c ASSERT (file != NULL); ASSERT (phdr != NULL); -@@ -332,69 +458,129 @@ load_segment (struct file *file, const s +@@ -332,73 +458,129 @@ load_segment (struct file *file, const s || start == 0) return false; @@ -2709,8 +2709,12 @@ diff -u src/userprog/process.c~ src/userprog/process.c } -/* Adds a mapping from user virtual address UPAGE to kernel -- virtual address KPAGE to the page table. Fails if UPAGE is -- already mapped or if memory allocation fails. */ +- virtual address KPAGE to the page table. +- UPAGE must not already be mapped. +- KPAGE should probably be a page obtained from the user pool +- with palloc_get_page(). +- Returns true on success, false if UPAGE is already mapped or +- if memory allocation fails. */ +/* Create a minimal stack for T by mapping a page at the + top of user virtual memory. Fills in the page using CMD_LINE + and sets *ESP to the stack pointer. */