diff --git a/src/vm/page.h b/src/vm/page.h index 7b45d9d..9aa98fb 100644 --- a/src/vm/page.h +++ b/src/vm/page.h @@ -9,7 +9,6 @@ enum page_type { PAGE_FILE, PAGE_MMAP, - PAGE_EMPTY, PAGE_SHARED }; @@ -35,13 +34,18 @@ struct page_entry struct shared_file_page { - struct file *file; - void *upage; - void *frame; - size_t swap_slot; - int ref_count; + struct file *file; /* The shared file page's source file, used for indexing + the table. */ + void *upage; /* The shared page's upage which is the same across all process + using it. Used for indexing the table. */ + void *frame; /* Set to the frame address of the page when it is in memory. + Set to NULL when the page is in swap. */ + size_t swap_slot; /* Set to the swap_slot of the shared paged if it is + currently in swap. Should not be used when frame is not + NULL.*/ + int ref_count; /* Number of processes that are using this shared page. */ - struct hash_elem elem; + struct hash_elem elem; /* AN elem for the hash table. */ }; bool init_pages (struct hash *pages);