From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:07:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA6722E8; Tue, 11 Mar 2014 10:07:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97655E3E; Tue, 11 Mar 2014 10:07:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BA7tdm014979; Tue, 11 Mar 2014 10:07:55 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BA7tji014978; Tue, 11 Mar 2014 10:07:55 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111007.s2BA7tji014978@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263003 - head/sys/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:07:55 -0000 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