xen: add macro to detect if running as Dom0

Approved by: gibbs
Sponsored by: Citrix Systems R&D

xen/xen-os.h:
 - Add macro to detect if running as Dom0.
This commit is contained in:
Roger Pau Monné 2014-03-11 10:07:55 +00:00
parent 1a9cdd373a
commit 6f4246bce1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=263003

View file

@ -82,6 +82,13 @@ xen_hvm_domain(void)
return (xen_domain_type == XEN_HVM_DOMAIN);
}
static inline bool
xen_initial_domain(void)
{
return (xen_domain() && HYPERVISOR_start_info != NULL &&
(HYPERVISOR_start_info->flags & SIF_INITDOMAIN) != 0);
}
#ifndef xen_mb
#define xen_mb() mb()
#endif