Correctly initialize the esp0 pointer in the TSS for the initial
[pintos-anon] / src / userprog / process.c
index 6c6003cbf0f798262e53802beae7ab02084dc093..c0e521553f994dcc2f01004a3b4c28bedc2accb7 100644 (file)
@@ -117,7 +117,8 @@ process_exit (void)
 }
 
 /* Sets up the CPU for running user code in the current
-   thread. */
+   thread.
+   This function is called on every context switch. */
 void
 process_activate (void)
 {
@@ -128,7 +129,7 @@ process_activate (void)
 
   /* Set thread's kernel stack for use in processing
      interrupts. */
-  tss_set_esp0 ((uint8_t *) t + PGSIZE);
+  tss_update ();
 }
 \f
 /* We load ELF binaries.  The following definitions are taken