]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux/x86-64: don't use explicit moves in 4- and 5-argument hypercall macros
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jan 2008 11:53:10 +0000 (11:53 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jan 2008 11:53:10 +0000 (11:53 +0000)
.., allowing the compiler to schedule the moves earlier or even avoid
an extra move.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
include/asm-x86_64/mach-xen/asm/hypercall.h

index e9c8abfbf45a0647f2a74b851ca2016bfb0f8dd5..2df0a88ea41ace9c055e61f6cfd5b3d5af2e279d 100644 (file)
 #define _hypercall4(type, name, a1, a2, a3, a4)                        \
 ({                                                             \
        long __res, __ign1, __ign2, __ign3;                     \
+       register long __arg4 asm("r10") = (long)(a4);           \
        asm volatile (                                          \
-               "movq %7,%%r10; "                               \
                HYPERCALL_STR(name)                             \
                : "=a" (__res), "=D" (__ign1), "=S" (__ign2),   \
-               "=d" (__ign3)                                   \
+                 "=d" (__ign3), "+r" (__arg4)                  \
                : "1" ((long)(a1)), "2" ((long)(a2)),           \
-               "3" ((long)(a3)), "g" ((long)(a4))              \
-               : "memory", "r10" );                            \
+                 "3" ((long)(a3))                              \
+               : "memory" );                                   \
        (type)__res;                                            \
 })
 
 #define _hypercall5(type, name, a1, a2, a3, a4, a5)            \
 ({                                                             \
        long __res, __ign1, __ign2, __ign3;                     \
+       register long __arg4 asm("r10") = (long)(a4);           \
+       register long __arg5 asm("r8") = (long)(a5);            \
        asm volatile (                                          \
-               "movq %7,%%r10; movq %8,%%r8; "                 \
                HYPERCALL_STR(name)                             \
                : "=a" (__res), "=D" (__ign1), "=S" (__ign2),   \
-               "=d" (__ign3)                                   \
+                 "=d" (__ign3), "+r" (__arg4), "+r" (__arg5)   \
                : "1" ((long)(a1)), "2" ((long)(a2)),           \
-               "3" ((long)(a3)), "g" ((long)(a4)),             \
-               "g" ((long)(a5))                                \
-               : "memory", "r10", "r8" );                      \
+                 "3" ((long)(a3))                              \
+               : "memory" );                                   \
        (type)__res;                                            \
 })