Use "r" (&uint64) instead of "m" (uint64) as constraints on lidt, lgdt
[pintos-anon] / src / threads / interrupt.c
index 82b7db7d724bed32a60fe5d9c1c004192d2049fd..05280c308c1034368c2c9cf519f39f5f455f6e92 100644 (file)
@@ -111,7 +111,7 @@ intr_init (void)
   /* Load IDT register.
      See [IA32-v2a] "LIDT" and [IA32-v3] 5.10. */
   idtr_operand = make_idtr_operand (sizeof idt - 1, idt);
-  asm volatile ("lidt %0" :: "m" (idtr_operand));
+  asm volatile ("lidt [%0]" :: "r" (&idtr_operand));
 
   /* Initialize intr_names. */
   for (i = 0; i < INTR_CNT; i++)