From patchwork Mon Jun 25 15:52:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9606 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 2D8BD23F2E for ; Mon, 25 Jun 2012 15:52:34 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id F0DA1A18341 for ; Mon, 25 Jun 2012 15:52:33 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so3202384ggn.11 for ; Mon, 25 Jun 2012 08:52:33 -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=iLnjQy5L2EYnmvwPlZdJWe+8GhvcvFxcKUbAzs3Agbc=; b=NYJYORzyAqFilPDTxpGFY8k1EZMvUBS3ijPQ+GEREzGP3bYlb7y4/7NFkrI0shT6Dq ri6fq7kOm+ryYDKiV8gb7Qp2LMSthsA9fHKl1aU0LlCUUIHwfaueEkLwfEMxvlpdAPbU 7fssOxcLHJ+h99rMiEedpkK59F5KrDI6SwOydpRKGUKmnoNld0PvMUdvrE8Nnv7tmclB jOUfdRLBp8UNHkzqCiAYmqmc8TVjyJCyqgGQC1pl70Ebb2fvf+r0Awx+UzSt6weIjnbP RJeDXBXIwm8vRGHIaNmgg4DT4dafRY5DCZSvjIdJTbBRK0slWU07YEsumFVOEYevY06j Y2mQ== Received: by 10.50.87.227 with SMTP id bb3mr8412471igb.57.1340639553568; Mon, 25 Jun 2012 08:52:33 -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 v20csp51990ibb; Mon, 25 Jun 2012 08:52:31 -0700 (PDT) Received: by 10.205.126.8 with SMTP id gu8mr4200378bkc.61.1340639550674; Mon, 25 Jun 2012 08:52:30 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id gu6si11308480bkc.95.2012.06.25.08.52.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 08:52:30 -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 1SjBaS-0006uD-9h; Mon, 25 Jun 2012 16:52:24 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Eric Blake Subject: [PATCH v2 1/4] targphys.h: Define TARGET_PRI*PHYS format specifier macros Date: Mon, 25 Jun 2012 16:52:21 +0100 Message-Id: <1340639544-26520-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1340639544-26520-1-git-send-email-peter.maydell@linaro.org> References: <1340639544-26520-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmeG5PykieX3Ya5suPI2cKBCpaV7Fed0YLFRNsbPWWT54n+JNUPYeJ4i7NswH03Pm3+A4z3 Define a set of TARGET_PRI*PHYS 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 Acked-by: Andreas Färber --- targphys.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/targphys.h b/targphys.h index 95648d6..bd4938f 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 TARGET_PRIdPHYS PRId32 +#define TARGET_PRIiPHYS PRIi32 +#define TARGET_PRIoPHYS PRIo32 +#define TARGET_PRIuPHYS PRIu32 +#define TARGET_PRIxPHYS PRIx32 +#define TARGET_PRIXPHYS 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 TARGET_PRIdPHYS PRId64 +#define TARGET_PRIiPHYS PRIi64 +#define TARGET_PRIoPHYS PRIo64 +#define TARGET_PRIuPHYS PRIu64 +#define TARGET_PRIxPHYS PRIx64 +#define TARGET_PRIXPHYS PRIX64 #endif #endif