Instead of including asm/hypercall.h always use xen/hypercall.h.
Additionally include xen/hypercall.h from all sources containing a
hypercall handler.
This prepares for generating the handlers' prototypes at build time.
Add a guard in asm/hypercall.h to catch direct inclusion.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com> # arm
#include <xen/lib.h>
#include <xen/errno.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/sched.h>
#include <xen/monitor.h>
#include <public/hvm/params.h>
#include <public/hvm/hvm_op.h>
-#include <asm/hypercall.h>
-
static int hvm_allow_set_param(const struct domain *d, unsigned int param)
{
switch ( param )
+#ifndef __XEN_HYPERCALL_H__
+#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
+#endif
+
#ifndef __ASM_ARM_HYPERCALL_H__
#define __ASM_ARM_HYPERCALL_H__
#include <xen/types.h>
#include <xen/sched.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/spinlock.h>
#include <public/platform.h>
#include <xsm/xsm.h>
#include <xen/param.h>
#include <xen/event.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/sched.h>
#include <asm/regs.h>
#include <asm/types.h>
* asm-x86/hypercall.h
*/
+#ifndef __XEN_HYPERCALL_H__
+#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
+#endif
+
#ifndef __ASM_X86_HYPERCALL_H__
#define __ASM_X86_HYPERCALL_H__
#include <asm/ldt.h>
#include <asm/x86_emulate.h>
#include <asm/e820.h>
-#include <asm/hypercall.h>
#include <asm/shared.h>
#include <asm/mem_sharing.h>
#include <public/memory.h>
#include <xen/console.h>
#include <xen/iocap.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/acpi.h>
#include <xen/efi.h>
#include <xen/cpu.h>
#include <xen/domain_page.h>
#include <xen/event.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/iocap.h>
#include <asm/amd.h>
#include <asm/debugreg.h>
#include <asm/endbr.h>
#include <asm/hpet.h>
-#include <asm/hypercall.h>
#include <asm/mc146818rtc.h>
#include <asm/pv/domain.h>
#include <asm/pv/trace.h>
*/
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/lib.h>
#include <xen/sched.h>
#include <xen/lib.h>
#include <xen/err.h>
#include <xen/errno.h>
+#include <xen/hypercall.h>
#include <xen/mm.h>
#include <xen/param.h>
#include <xen/console.h>
#include <asm/x86_emulate.h>
#include <asm/traps.h>
#include <asm/hvm/vpt.h>
-#include <asm/hypercall.h>
#include <asm/mce.h>
#include <asm/apic.h>
#include <asm/mc146818rtc.h>
#include <xen/event.h>
+#include <xen/hypercall.h>
#include <xen/mem_access.h>
#include <xen/multicall.h>
#include <compat/memory.h>
#include <xen/numa.h>
#include <xen/nodemask.h>
#include <xen/guest_access.h>
-#include <xen/hypercall.h>
#include <xen/mem_access.h>
#include <asm/current.h>
#include <asm/asm_defns.h>
#include <asm/page.h>
#include <asm/flushtlb.h>
#include <asm/fixmap.h>
-#include <asm/hypercall.h>
#include <asm/msr.h>
#include <asm/pv/domain.h>
#include <asm/setup.h>
*
*/
+#include <xen/hypercall.h>
#include <compat/grant_table.h>
#define xen_grant_entry_v1 grant_entry_v1
#include <xen/iocap.h>
#include <xen/compat.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/keyhandler.h>
#include <asm/current.h>
#include <xen/trace.h>
#include <xen/grant_table.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/domain_page.h>
#include <xen/iommu.h>
#include <xen/paging.h>
#include <xen/event.h>
#include <xen/multicall.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/perfc.h>
#include <xen/trace.h>
#include <asm/current.h>