diff --git a/src/userprog/process.c b/src/userprog/process.c index 49b9bd5..c9f6339 100644 --- a/src/userprog/process.c +++ b/src/userprog/process.c @@ -14,6 +14,7 @@ #include "threads/flags.h" #include "threads/init.h" #include "threads/interrupt.h" +#include "threads/synch.h" #include "threads/palloc.h" #include "threads/thread.h" #include "threads/vaddr.h" @@ -88,7 +89,8 @@ start_process (void *file_name_) int process_wait (tid_t child_tid UNUSED) { - return -1; + for (;;) + barrier (); } /* Free the current process's resources. */ @@ -451,7 +453,7 @@ setup_stack (void **esp) { success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage, true); if (success) - *esp = PHYS_BASE; + *esp = PHYS_BASE - 12; else palloc_free_page (kpage); }