]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
Reduce the quantity of token concatenation with hypercall declarations
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 10 Dec 2015 16:45:04 +0000 (16:45 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 10 Dec 2015 16:45:04 +0000 (16:45 +0000)
Allows better indexing from tools such as cscope

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
include/arch/x86/x86_32/hypercall-x86_32.h
include/arch/x86/x86_64/hypercall-x86_64.h
include/xtf/hypercall.h

index b31ef4a5f1703f29d6f840a0242317ab4f1b0ebd..e6e38dc043113c585ee6b926fd8a13730b43b337 100644 (file)
@@ -7,25 +7,25 @@
  * Inputs: %ebx, %ecx, %edx, %esi, %edi, %ebp (arguments 1-6)
  */
 
-#define _hypercall32_2(type, name, a1, a2)                              \
+#define _hypercall32_2(type, hcall, a1, a2)                             \
     ({                                                                  \
         long __res, __ign1, __ign2;                                     \
         asm volatile (                                                  \
             "call hypercall_page + %c[offset]"                          \
             : "=a" (__res), "=b" (__ign1), "=c" (__ign2)                \
-            : [offset] "i" (__HYPERVISOR_##name * 32),                  \
+            : [offset] "i" (hcall * 32),                                \
               "1" ((long)(a1)), "2" ((long)(a2))                        \
             : "memory" );                                               \
         (type)__res;                                                    \
     })
 
-#define _hypercall32_3(type, name, a1, a2, a3)                          \
+#define _hypercall32_3(type, hcall, a1, a2, a3)                         \
     ({                                                                  \
         long __res, __ign1, __ign2, __ign3;                             \
         asm volatile (                                                  \
             "call hypercall_page + %c[offset]"                          \
             : "=a" (__res), "=b" (__ign1), "=c" (__ign2), "=d" (__ign3) \
-            : [offset] "i" (__HYPERVISOR_##name * 32),                  \
+            : [offset] "i" (hcall * 32),                                \
               "1" ((long)(a1)), "2" ((long)(a2)), "3" ((long)(a3))      \
             : "memory" );                                               \
         (type)__res;                                                    \
index 3982a9be60bcd0c798f715eaab07eaaea513dd98..4a6233b79e97dcafff161ca816f540efd5d83190 100644 (file)
@@ -7,25 +7,25 @@
  * Inputs: %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
  */
 
-#define _hypercall64_2(type, name, a1, a2)                              \
+#define _hypercall64_2(type, hcall, a1, a2)                             \
     ({                                                                  \
         long __res, __ign1, __ign2;                                     \
         asm volatile (                                                  \
             "call hypercall_page + %c[offset]"                          \
             : "=a" (__res), "=D" (__ign1), "=S" (__ign2)                \
-            : [offset] "i" (__HYPERVISOR_##name * 32),                  \
+            : [offset] "i" (hcall * 32),                                \
               "1" ((long)(a1)), "2" ((long)(a2))                        \
             : "memory" );                                               \
         (type)__res;                                                    \
     })
 
-#define _hypercall64_3(type, name, a1, a2, a3)                          \
+#define _hypercall64_3(type, hcall, a1, a2, a3)                         \
     ({                                                                  \
         long __res, __ign1, __ign2, __ign3;                             \
         asm volatile (                                                  \
             "call hypercall_page + %c[offset]"                          \
             : "=a" (__res), "=D" (__ign1), "=S" (__ign2), "=d" (__ign3) \
-            : [offset] "i" (__HYPERVISOR_##name * 32),                  \
+            : [offset] "i" (hcall * 32),                                \
               "1" ((long)(a1)), "2" ((long)(a2)), "3" ((long)(a3))      \
             : "memory" );                                               \
         (type)__res;                                                    \
index 3fc705f60bd3064d36cc1f49ed59f3fd274835f4..9e1fe60cde29886225f76101abd8799690d5ef3d 100644 (file)
@@ -34,17 +34,17 @@ extern uint8_t hypercall_page[PAGE_SIZE];
  */
 static inline long hypercall_sched_op(unsigned int cmd, void *arg)
 {
-    return HYPERCALL2(long, sched_op, cmd, arg);
+    return HYPERCALL2(long, __HYPERVISOR_sched_op, cmd, arg);
 }
 
 static inline long hypercall_event_channel_op(unsigned int cmd, void *arg)
 {
-    return HYPERCALL2(long, event_channel_op, cmd, arg);
+    return HYPERCALL2(long, __HYPERVISOR_event_channel_op, cmd, arg);
 }
 
 static inline long hypercall_hvm_op(unsigned int cmd, void *arg)
 {
-    return HYPERCALL2(long, hvm_op, cmd, arg);
+    return HYPERCALL2(long, __HYPERVISOR_hvm_op, cmd, arg);
 }
 
 /*
@@ -52,7 +52,7 @@ static inline long hypercall_hvm_op(unsigned int cmd, void *arg)
  */
 static inline void hypercall_console_write(const char *buf, unsigned long count)
 {
-    (void)HYPERCALL3(long, console_io, CONSOLEIO_write, count, buf);
+    (void)HYPERCALL3(long, __HYPERVISOR_console_io, CONSOLEIO_write, count, buf);
 }
 
 static inline long hypercall_shutdown(unsigned int reason)