From c89f1f12b07be43df17cde53a0dcaf4f3a271eba Mon Sep 17 00:00:00 2001 From: Elliott Mitchell Date: Fri, 16 Apr 2021 18:49:25 -0700 Subject: [PATCH] xen/xen-os: move inclusion of machine/xen-os.h later Several of x86 enable/disable functions depend upon the xen*domain() functions. As such the xen*domain() functions need to be declared before machine/xen-os.h. Officially declare direct inclusion of machine/xen/xen-os.h verboten as such will break these functions/macros. Remove one such soon to be broken inclusion. Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D29811 --- sys/x86/include/xen/xen-os.h | 4 ++++ sys/x86/xen/xen_intr.c | 1 - sys/xen/xen-os.h | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/x86/include/xen/xen-os.h b/sys/x86/include/xen/xen-os.h index 78d44ad7c9d7..7ca1075e61f3 100644 --- a/sys/x86/include/xen/xen-os.h +++ b/sys/x86/include/xen/xen-os.h @@ -30,6 +30,10 @@ #ifndef _MACHINE_X86_XEN_XEN_OS_H_ #define _MACHINE_X86_XEN_XEN_OS_H_ +#ifndef _XEN_XEN_OS_H_ +#error "do not #include machine/xen/xen-os.h, #include xen/xen-os.h instead" +#endif + /* Shared memory needs write-back as its cache attribute for coherency. */ #define VM_MEMATTR_XEN VM_MEMATTR_WRITE_BACK diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c index 646c9b4728fc..bab86ccd295a 100644 --- a/sys/x86/xen/xen_intr.c +++ b/sys/x86/xen/xen_intr.c @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index fdec54936b0d..3b963bd20f7a 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -71,12 +71,6 @@ xen_get_console_evtchn(void) return (hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN)); } -#endif - -#include - -/* Everything below this point is not included by assembler (.S) files. */ -#ifndef __ASSEMBLY__ extern shared_info_t *HYPERVISOR_shared_info; @@ -117,6 +111,12 @@ xen_initial_domain(void) return (xen_domain() && (hvm_start_flags & SIF_INITDOMAIN) != 0); } +#endif + +#include + +/* Everything below this point is not included by assembler (.S) files. */ +#ifndef __ASSEMBLY__ /* * Based on ofed/include/linux/bitops.h