git: c89f1f12b07b - main - xen/xen-os: move inclusion of machine/xen-os.h later

Roger Pau Monné royger at FreeBSD.org
Wed Jul 28 15:27:56 UTC 2021


The branch main has been updated by royger:

URL: https://cgit.FreeBSD.org/src/commit/?id=c89f1f12b07be43df17cde53a0dcaf4f3a271eba

commit c89f1f12b07be43df17cde53a0dcaf4f3a271eba
Author:     Elliott Mitchell <ehem+freebsd at m5p.com>
AuthorDate: 2021-04-17 01:49:25 +0000
Commit:     Roger Pau Monné <royger at FreeBSD.org>
CommitDate: 2021-07-28 15:27:04 +0000

    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 <machine/stdarg.h>
 
 #include <machine/xen/synch_bitops.h>
-#include <machine/xen/xen-os.h>
 
 #include <xen/xen-os.h>
 #include <xen/hvm.h>
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 <machine/xen/xen-os.h>
-
-/* 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 <machine/xen/xen-os.h>
+
+/* Everything below this point is not included by assembler (.S) files. */
+#ifndef __ASSEMBLY__
 
 /*
  * Based on ofed/include/linux/bitops.h


More information about the dev-commits-src-main mailing list