Add memory clobbers to several asm statements,
[pintos-anon] / src / userprog / pagedir.c
index 7d993755ca2b5e10e3e0fe2cb3d530b560dc60c6..30bdfe263b67f58ee9787b413036de6984c7628b 100644 (file)
@@ -227,7 +227,7 @@ pagedir_activate (uint32_t *pd)
      new page tables immediately.  See [IA32-v2a] "MOV--Move
      to/from Control Registers" and [IA32-v3a] 3.7.5 "Base
      Address of the Page Directory". */
-  asm volatile ("movl %0, %%cr3" :: "r" (vtop (pd)));
+  asm volatile ("movl %0, %%cr3" : : "r" (vtop (pd)) : "memory");
 }
 
 /* Returns the currently active page directory. */