From: Andrew Cooper Date: Thu, 10 Dec 2015 16:45:04 +0000 (+0000) Subject: Reduce the quantity of token concatenation with hypercall declarations X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9c5a2a9f2bccbd267ccdc934fd30148ecf5260fc;p=people%2Froyger%2Fxen-test-framework.git Reduce the quantity of token concatenation with hypercall declarations Allows better indexing from tools such as cscope Signed-off-by: Andrew Cooper --- diff --git a/include/arch/x86/x86_32/hypercall-x86_32.h b/include/arch/x86/x86_32/hypercall-x86_32.h index b31ef4a..e6e38dc 100644 --- a/include/arch/x86/x86_32/hypercall-x86_32.h +++ b/include/arch/x86/x86_32/hypercall-x86_32.h @@ -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; \ diff --git a/include/arch/x86/x86_64/hypercall-x86_64.h b/include/arch/x86/x86_64/hypercall-x86_64.h index 3982a9b..4a6233b 100644 --- a/include/arch/x86/x86_64/hypercall-x86_64.h +++ b/include/arch/x86/x86_64/hypercall-x86_64.h @@ -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; \ diff --git a/include/xtf/hypercall.h b/include/xtf/hypercall.h index 3fc705f..9e1fe60 100644 --- a/include/xtf/hypercall.h +++ b/include/xtf/hypercall.h @@ -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)