From 57a42c756398e8543cdfb5f911e9e1a9a54145ec Mon Sep 17 00:00:00 2001 From: royger Date: Tue, 11 Mar 2014 10:07:55 +0000 Subject: 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. --- sys/xen/xen-os.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/xen') diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index c7474d8..62b5bf6 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -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 -- cgit v1.1