From patchwork Sun Aug 23 09:34:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731455 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5483915E4 for ; Sun, 23 Aug 2020 09:36:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3ADF62075B for ; Sun, 23 Aug 2020 09:36:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ADF62075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ7-0005WJ-6c; Sun, 23 Aug 2020 09:36:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ5-0004sy-G0 for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:09 +0000 X-Inumbo-ID: 8cad8ddb-6128-4a5c-974f-c19f0f7a7083 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8cad8ddb-6128-4a5c-974f-c19f0f7a7083; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 460EBAE1C; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 15/38] tools/misc: don't include xg_save_restore.h from xen-mfndump.c Date: Sun, 23 Aug 2020 11:34:56 +0200 Message-Id: <20200823093519.18386-16-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" xen-mfndump.c is including the libxc private header xg_save_restore.h. Avoid that by moving the definition of is_mapped() to xen-mfndump.c (it is used there only) and by duplicating the definition of M2P_SIZE() in xen-mfndump.c. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/xg_save_restore.h | 4 ---- tools/misc/xen-mfndump.c | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h index 303081df0d..b904296997 100644 --- a/tools/libxc/xg_save_restore.h +++ b/tools/libxc/xg_save_restore.h @@ -109,10 +109,6 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom, #define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT) #define M2P_CHUNKS(_m) (M2P_SIZE((_m)) >> M2P_SHIFT) -/* Returns TRUE if the PFN is currently mapped */ -#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL)) - - #define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f)) #define SET_FIELD(_p, _f, _v, _w) do { \ diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index 858bd0e26b..cb15d08c7e 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -5,7 +5,10 @@ #include #include -#include "xg_save_restore.h" +#include + +#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), 21) +#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL)) static xc_interface *xch;