[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86: usercopy assembly constraints



Besides only being correct this way, this helps work around a gcc 4.3
issue.
At the same time, add some white space, re-order the inputs, and remove
a bogus cast.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2007-11-13/xen/arch/x86/usercopy.c
===================================================================
--- 2007-11-13.orig/xen/arch/x86/usercopy.c     2007-11-13 15:36:25.000000000 
+0100
+++ 2007-11-13/xen/arch/x86/usercopy.c  2007-11-13 15:37:36.000000000 +0100
@@ -41,10 +41,10 @@ unsigned long __copy_to_user_ll(void __u
                "       "__FIXUP_WORD" 0b,3b\n"
                "       "__FIXUP_WORD" 1b,2b\n"
                ".previous"
-               : "=&c"(__n), "=&D" (__d0), "=&S" (__d1), "=r"(__d2)
-               : "3"(__n), "0"(__n), "1"(to), "2"(from)
+               : "=&c" (__n), "=&D" (__d0), "=&S" (__d1), "=&r" (__d2)
+               : "0" (__n), "1" (to), "2" (from), "3" (__n)
                : "memory");
-       return (unsigned)__n;
+       return __n;
 }
 
 unsigned long
@@ -85,10 +85,10 @@ __copy_from_user_ll(void *to, const void
                "       "__FIXUP_WORD" 0b,3b\n"
                "       "__FIXUP_WORD" 1b,6b\n"
                ".previous"
-               : "=&c"(__n), "=&D" (__d0), "=&S" (__d1), "=r"(__d2)
-               : "3"(__n), "0"(__n), "1"(to), "2"(from)
+               : "=&c" (__n), "=&D" (__d0), "=&S" (__d1), "=&r" (__d2)
+               : "0" (__n), "1" (to), "2" (from), "3" (__n)
                : "memory");
-       return (unsigned)__n;
+       return __n;
 }
 
 /**




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.