From patchwork Wed Sep 26 03:21:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 186943 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 829202C008F for ; Wed, 26 Sep 2012 13:42:30 +1000 (EST) Received: from localhost ([::1]:59692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGiBY-0001KM-PA for incoming@patchwork.ozlabs.org; Tue, 25 Sep 2012 23:21:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGiAw-000871-DZ for qemu-devel@nongnu.org; Tue, 25 Sep 2012 23:20:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGiAt-0005lO-Md for qemu-devel@nongnu.org; Tue, 25 Sep 2012 23:20:38 -0400 Received: from ozlabs.org ([203.10.76.45]:41452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGiAt-0005k6-CM for qemu-devel@nongnu.org; Tue, 25 Sep 2012 23:20:35 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 644B82C0094; Wed, 26 Sep 2012 13:20:34 +1000 (EST) From: David Gibson To: aliguori@us.ibm.com Date: Wed, 26 Sep 2012 13:21:16 +1000 Message-Id: <1348629678-13182-5-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348629678-13182-1-git-send-email-david@gibson.dropbear.id.au> References: <1348629678-13182-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 203.10.76.45 Cc: qemu-devel@nongnu.org, David Gibson Subject: [Qemu-devel] [PATCH 4/6] savevm: Add VMSTATE_ helpers for target_phys_addr_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The savevm code contains VMSTATE_ helpers for a number of commonly used types, but not for target_phys_addr_t. This patch fixes that deficiency implementing VMSTATE_TPA helpers in terms of VMSTATE_UINT32 or VMSTATE_UINT64 helpers as appropriate. Signed-off-by: David Gibson --- targphys.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/targphys.h b/targphys.h index bd4938f..39c1c63 100644 --- a/targphys.h +++ b/targphys.h @@ -21,6 +21,13 @@ typedef uint32_t target_phys_addr_t; #define TARGET_PRIuPHYS PRIu32 #define TARGET_PRIxPHYS PRIx32 #define TARGET_PRIXPHYS PRIX32 + +#define VMSTATE_TPA_V(_f, _s, _v) \ + VMSTATE_UINT32_V(_f, _s, _v) + +#define VMSTATE_TPA_EQUAL_V(_f, _s, _v) \ + VMSTATE_UINT32_EQUAL_V(_f, _s, _v) + #elif TARGET_PHYS_ADDR_BITS == 64 typedef uint64_t target_phys_addr_t; #define TARGET_PHYS_ADDR_MAX UINT64_MAX @@ -31,7 +38,19 @@ typedef uint64_t target_phys_addr_t; #define TARGET_PRIuPHYS PRIu64 #define TARGET_PRIxPHYS PRIx64 #define TARGET_PRIXPHYS PRIX64 + +#define VMSTATE_TPA_V(_f, _s, _v) \ + VMSTATE_UINT64_V(_f, _s, _v) + +#define VMSTATE_TPA_EQUAL_V(_f, _s, _v) \ + VMSTATE_UINT64_EQUAL_V(_f, _s, _v) + #endif #endif +#define VMSTATE_TPA(_f, _s) \ + VMSTATE_TPA_V(_f, _s, 0) +#define VMSTATE_TPA_EQUAL(_f, _s) \ + VMSTATE_TPA_EQUAL_V(_f, _s, 0) + #endif