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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to