From patchwork Mon Jun 25 12:45:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9599 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 516FE23EE2 for ; Mon, 25 Jun 2012 12:45:25 +0000 (UTC) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by fiordland.canonical.com (Postfix) with ESMTP id 231E7A180B1 for ; Mon, 25 Jun 2012 12:45:25 +0000 (UTC) Received: by yhjj63 with SMTP id j63so3237397yhj.37 for ; Mon, 25 Jun 2012 05:45:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=/Ld0yBC5QfXYbrZMB+kesVGZjN7wv121EHpLzFTCkS4=; b=Qg3GQ1+GCLpazuaXx6tfJsDCFHul/7NLd+75hbOQR/KAWTcC4eW1fGlZS4t8hpv3M4 2v7PwTfJPkv6EhUawUmpVV45rWwlnZj7Y5DvWDqUa0LbQX2V+uhANNTONW09fOgFaeLH DbhAjHdNm9V7fHhceONg61A4PBBqhUcsMyyVI5PI1gJ8J60Z3XBTDNDEXYTAV+wcW3ML Cho7NLDe9ihSJPUlKmuG/KLckbMINpyf1VUHW0Q8WAl83cMLUZ7WX+0IF6SojGMinU++ NpfUx9IXM8P/1cKgt0D4uo4q3GSiN51+twf4dgoqnXTBqtztQDj9e4HxxNbF+2DgdRkJ juUQ== Received: by 10.50.193.196 with SMTP id hq4mr7825758igc.57.1340628324386; Mon, 25 Jun 2012 05:45:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp46001ibb; Mon, 25 Jun 2012 05:45:22 -0700 (PDT) Received: by 10.101.176.35 with SMTP id d35mr3927604anp.59.1340628322187; Mon, 25 Jun 2012 05:45:22 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id j68si11933296yhn.58.2012.06.25.05.45.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 05:45:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Sj8fM-0006q8-K2; Mon, 25 Jun 2012 13:45:16 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH 1/4] targphys.h: Define PRI*PLX format specifier macros Date: Mon, 25 Jun 2012 13:45:13 +0100 Message-Id: <1340628316-26267-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1340628316-26267-1-git-send-email-peter.maydell@linaro.org> References: <1340628316-26267-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmujWBHzwsTLjpMa0cAaO/Lk+nAsVWJ/TuNXlVBwwEG0bFdtn6QOvXSIRoQCR09JmTaNPa+ Define a set of PRI*PLX format specifier macros for working with target_phys_addr_t types. These follow the standard pattern for such macros, and are more flexible than TARGET_FMT_plx, which does not allow specification of field widths. Suggested-by: Andreas Färber Signed-off-by: Peter Maydell --- targphys.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/targphys.h b/targphys.h index 95648d6..d5b5636 100644 --- a/targphys.h +++ b/targphys.h @@ -11,10 +11,26 @@ typedef uint32_t target_phys_addr_t; #define TARGET_PHYS_ADDR_MAX UINT32_MAX #define TARGET_FMT_plx "%08x" +/* Format strings for printing target_phys_addr_t types. + * These are recommended over the less flexible TARGET_FMT_plx, + * which is retained for the benefit of existing code. + */ +#define PRIdPLX PRId32 +#define PRIiPLX PRIi32 +#define PRIoPLX PRIo32 +#define PRIuPLX PRIu32 +#define PRIxPLX PRIx32 +#define PRIXPLX PRIX32 #elif TARGET_PHYS_ADDR_BITS == 64 typedef uint64_t target_phys_addr_t; #define TARGET_PHYS_ADDR_MAX UINT64_MAX #define TARGET_FMT_plx "%016" PRIx64 +#define PRIdPLX PRId64 +#define PRIiPLX PRIi64 +#define PRIoPLX PRIo64 +#define PRIuPLX PRIu64 +#define PRIxPLX PRIx64 +#define PRIXPLX PRIX64 #endif #endif