From owner-freebsd-current@FreeBSD.ORG Thu Dec 19 18:55:26 2013 Return-Path: Delivered-To: freebsd-current@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 061D6F41; Thu, 19 Dec 2013 18:55:26 +0000 (UTC) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 876ED1D6D; Thu, 19 Dec 2013 18:55:24 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.95,514,1384300800"; d="scan'208";a="84054213" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 19 Dec 2013 18:55:20 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Thu, 19 Dec 2013 13:55:19 -0500 Received: from gateway-cbg.eng.citrite.net ([10.80.16.17] helo=localhost.localdomain) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Vtikh-0006gd-AN; Thu, 19 Dec 2013 18:55:19 +0000 From: Roger Pau Monne To: , , , , , , Subject: [PATCH v7 02/19] xen: add macro to detect if running as Dom0 Date: Thu, 19 Dec 2013 19:54:39 +0100 Message-ID: <1387479296-33389-3-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.7.7.5 (Apple Git-26) In-Reply-To: <1387479296-33389-1-git-send-email-roger.pau@citrix.com> References: <1387479296-33389-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA2 Cc: Roger Pau Monne X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 18:55:26 -0000 --- 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)