+/* Adds a mapping from user virtual address UPAGE to kernel
+ virtual address KPAGE to T's page tables. Fails if UPAGE is
+ already mapped or if memory allocation fails. */
+static bool
+install_page (struct thread *t, void *upage, void *kpage)
+{
+ /* Verify that there's not already a page at that virtual
+ address, then map our page there. */
+ return (pagedir_get_page (t->pagedir, upage) == NULL
+ && pagedir_set_page (t->pagedir, upage, kpage, true));
+}