Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2014 10:07:55 +0000 (UTC)
From:      Roger Pau Monné <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263003 - head/sys/xen
Message-ID:  <201403111007.s2BA7tji014978@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Tue Mar 11 10:07:55 2014
New Revision: 263003
URL: http://svnweb.freebsd.org/changeset/base/263003

Log:
  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.

Modified:
  head/sys/xen/xen-os.h

Modified: head/sys/xen/xen-os.h
==============================================================================
--- head/sys/xen/xen-os.h	Tue Mar 11 10:07:01 2014	(r263002)
+++ head/sys/xen/xen-os.h	Tue Mar 11 10:07:55 2014	(r263003)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403111007.s2BA7tji014978>