diff options
Diffstat (limited to 'vm/mmap.c')
| -rw-r--r-- | vm/mmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -1,11 +1,11 @@ | |||
| 1 | #include <string.h> | 1 | #include <string.h> |
| 2 | #include "userprog/pagedir.h" | ||
| 3 | #include "userprog/process.h" | ||
| 4 | #include "filesys/file.h" | 2 | #include "filesys/file.h" |
| 5 | #include "threads/thread.h" | 3 | #include "threads/thread.h" |
| 6 | #include "threads/vaddr.h" | 4 | #include "threads/vaddr.h" |
| 7 | #include "threads/malloc.h" | 5 | #include "threads/malloc.h" |
| 8 | #include "threads/palloc.h" | 6 | #include "threads/palloc.h" |
| 7 | #include "userprog/pagedir.h" | ||
| 8 | #include "userprog/process.h" | ||
| 9 | #include "vm/mmap.h" | 9 | #include "vm/mmap.h" |
| 10 | #include "vm/page.h" | 10 | #include "vm/page.h" |
| 11 | 11 | ||
| @@ -128,8 +128,12 @@ mmap_table_remove (struct mmap_table *table, mapid_t mapid) | |||
| 128 | process_unlock_filesys (); | 128 | process_unlock_filesys (); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | /* free page and page table entry */ | ||
| 131 | if (pte != NULL) | 132 | if (pte != NULL) |
| 133 | { | ||
| 134 | pagedir_clear_page (thread->pagedir, pte->upage); | ||
| 132 | free (pte); | 135 | free (pte); |
| 136 | } | ||
| 133 | 137 | ||
| 134 | ofs += PGSIZE; | 138 | ofs += PGSIZE; |
| 135 | } | 139 | } |
