Fixes gcc 4.6.1 incompatibility with old x86 asm
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 15 Dec 2011 21:05:36 +0000 (13:05 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 15 Dec 2011 21:05:36 +0000 (13:05 -0800)
4.6.1 didn't like the old version (couldn't handle the possibility of
"m", perhaps rightfully so).

Did anyone actually build the kernel on x86 with the new compiler, or
was it just my system that couldn't handle it?

kern/arch/i686/trap.h

index de60f35..fc6a287 100644 (file)
@@ -105,7 +105,7 @@ static inline void save_kernel_tf(struct trapframe *tf)
                     "popl %%esp;            " /* restore esp */
                     "1:                     " /* where this tf will restart */
                     : 
-                    : "g"(&tf->tf_esp), "g"(&tf->tf_eip), "g"(tf)
+                    : "r"(&tf->tf_esp), "r"(&tf->tf_eip), "g"(tf)
                     : "eax", "memory", "cc");
 }