From: Ben Pfaff Date: Tue, 19 Jul 2005 03:41:46 +0000 (+0000) Subject: Use "r" (&uint64) instead of "m" (uint64) as constraints on lidt, lgdt X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8986e1729370576db361326023de72df746f848;p=pintos-anon Use "r" (&uint64) instead of "m" (uint64) as constraints on lidt, lgdt because newer gas gives an error on the latter. --- diff --git a/src/threads/interrupt.c b/src/threads/interrupt.c index 82b7db7..05280c3 100644 --- a/src/threads/interrupt.c +++ b/src/threads/interrupt.c @@ -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++) diff --git a/src/userprog/gdt.c b/src/userprog/gdt.c index 42cad61..34e2c05 100644 --- a/src/userprog/gdt.c +++ b/src/userprog/gdt.c @@ -46,7 +46,7 @@ gdt_init (void) /* Load GDTR, TR. See [IA32-v3] 2.4.1, 2.4.4, 6.2.3. */ gdtr_operand = make_gdtr_operand (sizeof gdt - 1, gdt); - asm volatile ("lgdt %0" :: "m" (gdtr_operand)); + asm volatile ("lgdt [%0]" :: "r" (&gdtr_operand)); asm volatile ("ltr %w0" :: "r" (SEL_TSS)); }