Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2013 19:54:39 +0100
From:      Roger Pau Monne <roger.pau@citrix.com>
To:        <freebsd-xen@freebsd.org>, <freebsd-current@freebsd.org>, <xen-devel@lists.xen.org>, <gibbs@freebsd.org>, <jhb@freebsd.org>, <kib@freebsd.org>, <julien.grall@citrix.com>
Cc:        Roger Pau Monne <roger.pau@citrix.com>
Subject:   [PATCH v7 02/19] xen: add macro to detect if running as Dom0
Message-ID:  <1387479296-33389-3-git-send-email-roger.pau@citrix.com>
In-Reply-To: <1387479296-33389-1-git-send-email-roger.pau@citrix.com>
References:  <1387479296-33389-1-git-send-email-roger.pau@citrix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
---
 sys/xen/xen-os.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h
index c7474d8..e8a5a99 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 int
+xen_initial_domain(void)
+{
+	return (xen_domain() && HYPERVISOR_start_info &&
+	        HYPERVISOR_start_info->flags & SIF_INITDOMAIN);
+}
+
 #ifndef xen_mb
 #define xen_mb() mb()
 #endif
-- 
1.7.7.5 (Apple Git-26)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1387479296-33389-3-git-send-email-roger.pau>