From patchwork Fri Aug 29 14:37:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 36289 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ED67E2054E for ; Fri, 29 Aug 2014 14:38:49 +0000 (UTC) Received: by mail-oi0-f70.google.com with SMTP id u20sf13953951oif.9 for ; Fri, 29 Aug 2014 07:38:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=XqtjrfJmJt8fpX1GAinMbkwWiv9hRhE537TpnbiEke0=; b=GF26EK78PA4d0tIf8issC8T/MQd7187Z3KQfFhup6RMPN3feljbY4PHVifhULK2mpV Z199C2MCsobLrAFRAj9iefsw3XbJkA1KTBD+Sba/JT6I30PJ2TcCm9AB3sNxdiyesxw3 /EHcqT08FD3ycel7E/tDGGA1P4UzjL3Ph5LVcAZGz9WtaxXM4BcDnSXCvk8HtRet8xp9 +roX4GfKyBv8CrAxwtOzsiHdaAWErHGtO6rm/uBoUUuO09e5lJHueIsqZTyVF8Dan8o+ rGV9HBqB0KAvIlV/3KIY1b4t/OBCmQjTCN4QXZcym5pChp1xKDHZl20A6YxbDduVhasl hiIQ== X-Gm-Message-State: ALoCoQm7TIOpmBwwj9Vr/SNjTUzCUxDclMh1z6XrdOX31hzXB7WofEDXjzcxOWphDve3gDpobjSA X-Received: by 10.182.131.226 with SMTP id op2mr5709154obb.17.1409323129589; Fri, 29 Aug 2014 07:38:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.230 with SMTP id j93ls994532qgf.31.gmail; Fri, 29 Aug 2014 07:38:49 -0700 (PDT) X-Received: by 10.220.5.1 with SMTP id 1mr242875vct.73.1409323129426; Fri, 29 Aug 2014 07:38:49 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id b5si194911vdi.91.2014.08.29.07.38.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 07:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so2548077vcb.2 for ; Fri, 29 Aug 2014 07:38:49 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr8173516vcy.45.1409323129358; Fri, 29 Aug 2014 07:38:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp26728vcb; Fri, 29 Aug 2014 07:38:48 -0700 (PDT) X-Received: by 10.140.97.131 with SMTP id m3mr16984511qge.80.1409323128372; Fri, 29 Aug 2014 07:38:48 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e5si401147qga.20.2014.08.29.07.38.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 Aug 2014 07:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:42331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNKB-0008I1-I8 for patch@linaro.org; Fri, 29 Aug 2014 10:38:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNJ1-00077R-Su for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:37:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNNIx-000818-Dn for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:37:35 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:46762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNIx-000805-7c for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:37:31 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XNNIv-000524-OK for qemu-devel@nongnu.org; Fri, 29 Aug 2014 15:37:29 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 Aug 2014 15:37:25 +0100 Message-Id: <1409323049-19255-14-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409323049-19255-1-git-send-email-peter.maydell@linaro.org> References: <1409323049-19255-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 81.2.115.146 Subject: [Qemu-devel] [PULL 13/16] target-arm: Add arm_ccnt_enabled function 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Alistair Francis Include a helper function to determine if the CCNT counter is enabled. Signed-off-by: Alistair Francis Signed-off-by: Peter Crosthwaite Message-id: e1a64f17a756e06c8bda8238ad4826d705049f7a.1409025949.git.peter.crosthwaite@xilinx.com [ PC changes * Remove EL based checks ] Signed-off-by: Peter Crosthwaite Signed-off-by: Peter Maydell --- target-arm/helper.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index 13507f7..e6c82ab 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -548,6 +548,18 @@ static CPAccessResult pmreg_access(CPUARMState *env, const ARMCPRegInfo *ri) } #ifndef CONFIG_USER_ONLY + +static inline bool arm_ccnt_enabled(CPUARMState *env) +{ + /* This does not support checking PMCCFILTR_EL0 register */ + + if (!(env->cp15.c9_pmcr & PMCRE)) { + return false; + } + + return true; +} + static void pmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) {