#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"
#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"
# 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
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(
# 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
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(