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
This commit is contained in:
Elliott Mitchell 2021-04-16 18:49:25 -07:00 committed by Roger Pau Monné
parent e627e25d76
commit c89f1f12b0
3 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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>

View File

@ -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