From: Ben Pfaff Date: Sat, 2 Aug 2008 11:30:43 +0000 (+0000) Subject: Fix asm constraints to avoid SI, DI for byte and word access. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e587ab7ffa2d548029189e540d5716f880932cb1;p=pintos-anon Fix asm constraints to avoid SI, DI for byte and word access. Thanks to Ed Lyle Karrels for reporting the problem. --- diff --git a/doc/userprog.texi b/doc/userprog.texi index 5bd0bb2..612bb81 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -443,7 +443,7 @@ put_user (uint8_t *udst, uint8_t byte) { int error_code; asm ("movl $1f, %0; movb %b2, %1; 1:" - : "=&a" (error_code), "=m" (*udst) : "r" (byte)); + : "=&a" (error_code), "=m" (*udst) : "q" (byte)); return error_code != -1; } @end verbatim diff --git a/src/userprog/gdt.c b/src/userprog/gdt.c index a7423b7..e866037 100644 --- a/src/userprog/gdt.c +++ b/src/userprog/gdt.c @@ -50,7 +50,7 @@ gdt_init (void) 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 ("ltr %w0" : : "q" (SEL_TSS)); } /* System segment or code/data segment? */