Fix asm constraints to avoid SI, DI for byte and word access.
[pintos-anon] / src / userprog / gdt.c
index 0e393ec6bf2800cbeebb9599e5a566adbc55aa62..e866037e2a24dc412da2f2068d4fe69476260756 100644 (file)
@@ -1,8 +1,8 @@
 #include "userprog/gdt.h"
 #include <debug.h>
 #include "userprog/tss.h"
-#include "threads/mmu.h"
 #include "threads/palloc.h"
+#include "threads/vaddr.h"
 
 /* The Global Descriptor Table (GDT).
 
@@ -49,8 +49,8 @@ gdt_init (void)
      Table Register (GDTR)", 2.4.4 "Task Register (TR)", and
      6.2.4 "Task Register".  */
   gdtr_operand = make_gdtr_operand (sizeof gdt - 1, gdt);
-  asm volatile ("lgdt %0" :: "m" (gdtr_operand));
-  asm volatile ("ltr %w0" :: "r" (SEL_TSS));
+  asm volatile ("lgdt %0" : : "m" (gdtr_operand));
+  asm volatile ("ltr %w0" : : "q" (SEL_TSS));
 }
 \f
 /* System segment or code/data segment? */