]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
xen: don't include asm/hypercall.h from C sources
authorJuergen Gross <jgross@suse.com>
Tue, 29 Mar 2022 13:43:31 +0000 (15:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Mar 2022 13:43:31 +0000 (15:43 +0200)
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
16 files changed:
xen/arch/arm/hvm.c
xen/arch/arm/include/asm/hypercall.h
xen/arch/arm/platform_hypercall.c
xen/arch/x86/cpu/vpmu.c
xen/arch/x86/include/asm/hypercall.h
xen/arch/x86/mm.c
xen/arch/x86/platform_hypercall.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/pv/iret.c
xen/arch/x86/traps.c
xen/arch/x86/x86_64/compat/mm.c
xen/arch/x86/x86_64/mm.c
xen/common/compat/grant_table.c
xen/common/event_channel.c
xen/common/grant_table.c
xen/common/multicall.c

index 8951b3408651aabf77168b44d959f99d2222d125..fc1a52767df31981e0976146bd4d557f65080dcb 100644 (file)
@@ -20,6 +20,7 @@
 #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>
 
@@ -29,8 +30,6 @@
 #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 )
index 39d2e7889da666a3bea94a17c846a365fd706697..a6fdfed8de597c81eae923ec2dc9c505847205d5 100644 (file)
@@ -1,3 +1,7 @@
+#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__
 
index 8efac7ee602a7886c3dc94d55cf03e85f853488b..403cc84324f4b7f9d9201ec587da6bb0ecd29b9c 100644 (file)
@@ -9,6 +9,7 @@
 #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>
index 4fedc7c57012ed86c2e698af84377657e5fcac72..51d171615f75b8ab9275d49a86402a34d9f90be5 100644 (file)
@@ -22,6 +22,7 @@
 #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>
index 61bf897147e0231a2e5394fdff076e0fb86cd665..401e77d1e9eb5b23f70b77d244da9daf1f20b387 100644 (file)
@@ -2,6 +2,10 @@
  * 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__
 
index 2befd0c191ae0080b0a7db05971940dc9788a58d..6cc73187aca58ffe7b94f7a24ad5e2c390fc3e86 100644 (file)
 #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>
index b91ccff589007358dbadde6d9e2a3d3ea47e270c..eeb4f7a20e6c9afdc3423b723eb284754fef90e8 100644 (file)
@@ -17,6 +17,7 @@
 #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>
index 22b10dec2a6ef5d0afcc3c87dc0d635c55100364..5da00e24e4ff15a9ef61c10002a3e511fced799c 100644 (file)
 #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>
index dd2965d8f08ddc3f6d81ce8a85acfe58e3509003..797a427ffac59020ab2ef2ab9a8009414b09ba06 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
 
index 86595479707af7a55c11af3bfb81b009663798b6..4c38f6c0153983265357da7b4816ae49fec96dca 100644 (file)
@@ -29,6 +29,7 @@
 #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>
@@ -70,7 +71,6 @@
 #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>
index b3da8fafbb0cdd2826ebfe00ac1a12d129f61a7c..70b08a832ad90b2c52b8401df22584199e62f892 100644 (file)
@@ -1,4 +1,5 @@
 #include <xen/event.h>
+#include <xen/hypercall.h>
 #include <xen/mem_access.h>
 #include <xen/multicall.h>
 #include <compat/memory.h>
index 4f225da81e9f5ab86b23a29362e0e9076934a0e5..3510a5affe42574e2b15b918cb59f3dbc60caf86 100644 (file)
@@ -25,14 +25,12 @@ EMIT_FILE;
 #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>
index c6199e89188df72081401f9c3508bce03f06e732..d5787e37198929cb6eb9a74e8185f52fba51fa12 100644 (file)
@@ -3,6 +3,7 @@
  *
  */
 
+#include <xen/hypercall.h>
 #include <compat/grant_table.h>
 
 #define xen_grant_entry_v1 grant_entry_v1
index ffb042a241a6f4325cf1af1acd3d76395a8a3e27..0a82eb3ac29a902ebc18ff41c1c09911aff87200 100644 (file)
@@ -24,6 +24,7 @@
 #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>
 
index 1e0762b064d768afb6948fbf8dd3dfa539fb0494..febbe12eab981156d1dc3ea0b217f9ef2a2d39ba 100644 (file)
@@ -33,6 +33,7 @@
 #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>
index e48f46dbe01140738eed762891261a6e9e7bbaa7..9db49092b4f2e3effbd3f2c465f645da0b7bada0 100644 (file)
@@ -9,6 +9,7 @@
 #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>