From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy7Df-0002WV-PI for qemu-devel@nongnu.org; Fri, 29 Sep 2017 22:09:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dy7De-0005G2-V1 for qemu-devel@nongnu.org; Fri, 29 Sep 2017 22:09:31 -0400 From: Aaron Lindsay Date: Fri, 29 Sep 2017 22:08:25 -0400 Message-Id: <1506737310-21880-9-git-send-email-alindsay@codeaurora.org> In-Reply-To: <1506737310-21880-1-git-send-email-alindsay@codeaurora.org> References: <1506737310-21880-1-git-send-email-alindsay@codeaurora.org> Subject: [Qemu-devel] [PATCH 08/13] target/arm: Split arm_ccnt_enabled into generic pmu_counter_enabled List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-arm@nongnu.org, Peter Maydell , Alistair Francis , Peter Crosthwaite , Wei Huang Cc: qemu-devel@nongnu.org, Michael Spradling , Aaron Lindsay , Digant Desai List-ID: Signed-off-by: Aaron Lindsay --- target/arm/helper.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 3932ac0..c0ef367 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -975,17 +975,22 @@ static CPAccessResult pmreg_access_ccntr(CPUARMState *env, return pmreg_access(env, ri, isread); } -static inline bool arm_ccnt_enabled(CPUARMState *env) +static inline bool pmu_counter_enabled(CPUARMState *env, uint8_t counter) { /* Does not check PMCCFILTR_EL0, which is handled by pmu_counter_filtered */ - - if (!(env->cp15.c9_pmcr & PMCRE) || !(env->cp15.c9_pmcnten & (1 << 31))) { + if (!(env->cp15.c9_pmcr & PMCRE) || + !(env->cp15.c9_pmcnten & (1 << counter))) { return false; } return true; } +static inline bool arm_ccnt_enabled(CPUARMState *env) +{ + return pmu_counter_enabled(env, 31); +} + /* Returns true if the counter corresponding to the passed-in pmevtyper or * pmccfiltr value is filtered using the current state */ static inline bool pmu_counter_filtered(CPUARMState *env, uint64_t pmxevtyper) -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.\nQualcomm Technologies, Inc. is a member of the\nCode Aurora Forum, a Linux Foundation Collaborative Project.