]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux/x86: clean up hypercall headers
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 18 Jan 2008 16:35:24 +0000 (16:35 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 18 Jan 2008 16:35:24 +0000 (16:35 +0000)
- don't define HYPERVISOR_hvm_op() for pv guests (requiring to not
  include
  include/xen/hvm.h in non-pv-driver builds)
- remove the custome __STR/STR macros
- remove stringification where not necessary
- reduce instruction size for pv-driver case on x86-64

Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenbus/xenbus_probe_backend.c
include/asm-i386/mach-xen/asm/hypercall.h
include/asm-x86_64/mach-xen/asm/hypercall.h

index 3c7139aca66bec50be4818208c631c0a46ac5582..56d917c9cc8824c060745c7e941fd700d812979b 100644 (file)
@@ -54,7 +54,9 @@
 #include <xen/xen_proc.h>
 #include <xen/evtchn.h>
 #include <xen/features.h>
+#ifdef MODULE
 #include <xen/hvm.h>
+#endif
 
 #include "xenbus_comms.h"
 #include "xenbus_probe.h"
index b8e768339c2cadb61574784af840241dc75533be..6a32d0c9b2bc9ee5ccae2b58ad3ea0ccb9a78b11 100644 (file)
@@ -52,7 +52,6 @@
 #include <xen/xen_proc.h>
 #include <xen/evtchn.h>
 #include <xen/features.h>
-#include <xen/hvm.h>
 
 #include "xenbus_comms.h"
 #include "xenbus_probe.h"
index b2a2cc76efa591b94dcbcd579fc68c50c3b66ef1..6891ac240839c88b00c311301cb7b74a7b6dcc60 100644 (file)
 # error "please don't include this file directly"
 #endif
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #ifdef CONFIG_XEN
 #define HYPERCALL_STR(name)                                    \
-       "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
+       "call hypercall_page + ("__stringify(__HYPERVISOR_##name)" * 32)"
 #else
 #define HYPERCALL_STR(name)                                    \
-       "mov "__stringify(hypercall_stubs)",%%eax; "            \
-       "add $("STR(__HYPERVISOR_##name)" * 32),%%eax; "        \
+       "mov hypercall_stubs,%%eax; "                           \
+       "add $("__stringify(__HYPERVISOR_##name)" * 32),%%eax; "\
        "call *%%eax"
 #endif
 
@@ -375,12 +372,14 @@ HYPERVISOR_nmi_op(
        return _hypercall2(int, nmi_op, op, arg);
 }
 
+#ifndef CONFIG_XEN
 static inline unsigned long
 HYPERVISOR_hvm_op(
     int op, void *arg)
 {
     return _hypercall2(unsigned long, hvm_op, op, arg);
 }
+#endif
 
 static inline int
 HYPERVISOR_callback_op(
index 799a3e6a9b9122564a5785b2b6526972422f7b58..4d5f2b1681b371b47b49b2db181c3bcd962c0408 100644 (file)
 # error "please don't include this file directly"
 #endif
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #ifdef CONFIG_XEN
 #define HYPERCALL_STR(name)                                    \
-       "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
+       "call hypercall_page + ("__stringify(__HYPERVISOR_##name)" * 32)"
 #else
 #define HYPERCALL_STR(name)                                    \
-       "mov "__stringify(hypercall_stubs)",%%rax; "            \
-       "add $("STR(__HYPERVISOR_##name)" * 32),%%rax; "        \
+       "mov $("__stringify(__HYPERVISOR_##name)" * 32),%%eax; "\
+       "add hypercall_stubs(%%rip),%%rax; "                    \
        "call *%%rax"
 #endif
 
@@ -376,12 +373,14 @@ HYPERVISOR_nmi_op(
        return _hypercall2(int, nmi_op, op, arg);
 }
 
+#ifndef CONFIG_XEN
 static inline unsigned long
 HYPERVISOR_hvm_op(
     int op, void *arg)
 {
     return _hypercall2(unsigned long, hvm_op, op, arg);
 }
+#endif
 
 static inline int
 HYPERVISOR_callback_op(