From patchwork Sun Sep 23 19:03:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 186267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id F10D92C009E for ; Mon, 24 Sep 2012 05:04:29 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TFrRM-00037j-50; Sun, 23 Sep 2012 19:02:04 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TFrRB-00036A-0X for fwts-devel@lists.ubuntu.com; Sun, 23 Sep 2012 19:01:53 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TFrTV-0004Qx-Gr; Sun, 23 Sep 2012 19:04:17 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com, colin.king@canonical.com Subject: [PATCH 13/18] cpu: msr: print format using inttypes Date: Sun, 23 Sep 2012 20:03:56 +0100 Message-Id: <1348427041-4913-14-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348427041-4913-1-git-send-email-colin.king@canonical.com> References: <1348427041-4913-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/cpu/msr/msr.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/cpu/msr/msr.c b/src/cpu/msr/msr.c index edb0aee..0b3f6b0 100644 --- a/src/cpu/msr/msr.c +++ b/src/cpu/msr/msr.c @@ -18,6 +18,7 @@ */ #include "fwts.h" +#include #ifdef FWTS_ARCH_INTEL @@ -139,20 +140,21 @@ static int msr_consistent_check(fwts_framework *fw, if (inconsistent_count > 0) { fwts_failed(fw, level, "MSRCPUsInconsistent", - "MSR %s (0x%x) has %d inconsistent values across %d CPUs for (shift: %d mask: 0x%llx).", - msr_name, (int)msr, - inconsistent_count, ncpus, shift, - (unsigned long long)mask); + "MSR %s (0x%" PRIx32 ") has %d inconsistent values across " + "%d CPUs for (shift: %d mask: 0x%" PRIx64 ").", + msr_name, msr, inconsistent_count, + ncpus, shift, mask); for (cpu=1; cpu 0x%llx vs CPU %d -> 0x%llx", - (unsigned long long)vals[0], cpu, - (unsigned long long)vals[cpu]); + fwts_log_info(fw, "MSR CPU 0 -> 0x%" PRIx64 + " vs CPU %d -> 0x%" PRIx64, + vals[0], cpu, vals[cpu]); } } else { - fwts_passed(fw, "MSR %s (0x%x) (mask:%llx) was consistent across %d CPUs.", - msr_name, (int)msr, (unsigned long long)mask, ncpus); + fwts_passed(fw, "MSR %s (0x%" PRIx32 ") (mask:%" PRIx64 ") " + "was consistent across %d CPUs.", + msr_name, msr, mask, ncpus); if (callback) callback(fw, vals[0]); } @@ -215,10 +217,11 @@ static int msr_smrr(fwts_framework *fw) uint64_t type = val & 7; if ((physbase & 0x7fffff) != 0) fwts_failed(fw, LOG_LEVEL_HIGH, "MSRSMRR_PHYSBASE8MBBoundary", - "SMRR: SMRR_PHYSBASE is NOT on an 8MB boundary: %llx.", (unsigned long long)physbase); + "SMRR: SMRR_PHYSBASE is NOT on an 8MB boundary: %" PRIx64 ".", + physbase); if (type != 6) fwts_failed(fw, LOG_LEVEL_HIGH, "MSRSMRR_TYPE", - "SMRR: SMRR_TYPE is 0x%x, should be 0x6 (Write-Back).", (int)type); + "SMRR: SMRR_TYPE is 0x%" PRIx64 ", should be 0x6 (Write-Back).", type); } if (fwts_cpu_readmsr(0, 0x1f3, &val) == FWTS_OK) { uint64_t physmask = val & 0xfffff000; @@ -226,8 +229,9 @@ static int msr_smrr(fwts_framework *fw) if (physmask < 0x80000) { fwts_failed(fw, LOG_LEVEL_HIGH, "MSRSMRRRegion", - "SMRR: region needs to be at least 8MB, SMRR_PHYSMASK = %llx.", - (unsigned long long) physmask); + "SMRR: region needs to be at least 8MB, " + "SMRR_PHYSMASK = %" PRIx64 ".", + physmask); } if (!valid) fwts_failed(fw, LOG_LEVEL_HIGH, "MSRSMRRValidBit",