X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=solutions%2Fp3.patch;h=69393dfdb28f1459ed8f43564df9277db067b4dc;hb=dc45c59d642cb3b2c1ade22900685fc9ea9b5398;hp=754d8688810e89db26a0215443cfcb96f30e7dd3;hpb=f01fbd4ae4d7a17238f4e65e61427343e1ec25c3;p=pintos-anon diff --git a/solutions/p3.patch b/solutions/p3.patch index 754d868..69393df 100644 --- a/solutions/p3.patch +++ b/solutions/p3.patch @@ -329,13 +329,13 @@ diff -u src/userprog/pagedir.c~ src/userprog/pagedir.c @@ -35,15 +35,7 @@ pagedir_destroy (uint32_t *pd) ASSERT (pd != base_page_dir); for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++) - if (*pde & PG_P) + if (*pde & PTE_P) - { - uint32_t *pt = pde_get_pt (*pde); - uint32_t *pte; - - for (pte = pt; pte < pt + PGSIZE / sizeof *pte; pte++) -- if (*pte & PG_P) +- if (*pte & PTE_P) - palloc_free_page (pte_get_page (*pte)); - palloc_free_page (pt); - } @@ -350,10 +350,10 @@ diff -u src/userprog/process.c~ src/userprog/process.c @@ -15,11 +15,25 @@ #include "threads/init.h" #include "threads/interrupt.h" - #include "threads/mmu.h" +#include "threads/malloc.h" #include "threads/palloc.h" #include "threads/thread.h" + #include "threads/vaddr.h" +#include "vm/page.h" +#include "vm/frame.h" @@ -823,9 +823,9 @@ diff -u src/userprog/syscall.c~ src/userprog/syscall.c +#include "threads/init.h" #include "threads/interrupt.h" +#include "threads/malloc.h" -+#include "threads/mmu.h" +#include "threads/palloc.h" #include "threads/thread.h" ++#include "threads/vaddr.h" - +#include "vm/page.h" + @@ -1393,9 +1393,9 @@ diff -u src/vm/frame.c~ src/vm/frame.c +#include "devices/timer.h" +#include "threads/init.h" +#include "threads/malloc.h" -+#include "threads/mmu.h" +#include "threads/palloc.h" +#include "threads/synch.h" ++#include "threads/vaddr.h" + +static struct frame *frames; +static size_t frame_cnt; @@ -1589,9 +1589,9 @@ diff -u src/vm/page.c~ src/vm/page.c +#include "vm/swap.h" +#include "filesys/file.h" +#include "threads/malloc.h" -+#include "threads/mmu.h" +#include "threads/thread.h" +#include "userprog/pagedir.h" ++#include "threads/vaddr.h" + +/* Maximum size of process stack, in bytes. */ +#define STACK_MAX (1024 * 1024) @@ -1942,8 +1942,8 @@ diff -u src/vm/swap.c~ src/vm/swap.c +#include "vm/frame.h" +#include "vm/page.h" +#include "devices/disk.h" -+#include "threads/mmu.h" +#include "threads/synch.h" ++#include "threads/vaddr.h" + +/* The swap disk. */ +static struct disk *swap_disk;