From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzSgq-0001FD-RO for qemu-devel@nongnu.org; Tue, 24 Jun 2014 11:31:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzSgk-0006RK-JV for qemu-devel@nongnu.org; Tue, 24 Jun 2014 11:31:20 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:56275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzSgk-0006R8-DR for qemu-devel@nongnu.org; Tue, 24 Jun 2014 11:31:14 -0400 Message-ID: <53A999BC.80806@codeaurora.org> Date: Tue, 24 Jun 2014 11:31:08 -0400 From: Christopher Covington MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 3/7] target-arm: Add helper macros and defines for CCNT register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, qemu-devel@nongnu.org Hi Alistair, On 06/23/2014 09:12 PM, Alistair Francis wrote: > Include a helper function to determine if the CCNT counter > is enabled as well as the constants used to mask the pmccfiltr_el0 > register. > > Signed-off-by: Alistair Francis > --- > > target-arm/cpu.h | 19 +++++++++++++++++++ > 1 files changed, 19 insertions(+), 0 deletions(-) > > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index 6a2efd8..31aa09c 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -111,6 +111,25 @@ typedef struct ARMGenericTimer { > #define GTIMER_VIRT 1 > #define NUM_GTIMERS 2 > > +#ifndef CONFIG_USER_ONLY > + /* Definitions for the PMCCFILTR_EL0 and PMXEVTYPER registers */ > + #define PMCP 0x80000000 > + #define PMCU 0x40000000 These names are very similar to what one might use for the PMCR, which has its P bit somewhere completely different. A prefix derived from PMXEVTYPER might be clearer. > + /* This implements the PMCCFILTR_EL0:P and U bits; the PMXEVTYPER:P and U > + * bits and the c9_pmcr:E bit. > + * > + * It does not suppor the secure/non-secure componenets of the Nit: support, components > + * PMCCFILTR_EL0 register > + */ > + #define CCNT_ENABLED(env) \ > + ((env->cp15.c9_pmcr & PMCRE) && \ > + !(env->cp15.pmccfiltr_el0 & PMCP && arm_current_pl(env) == 1) && \ > + !(env->cp15.pmccfiltr_el0 & PMCU && arm_current_pl(env) == 0) && \ > + !(env->cp15.c9_pmxevtyper & PMCP && arm_current_pl(env) == 1) && \ > + !(env->cp15.c9_pmxevtyper & PMCU && arm_current_pl(env) == 0)) > +#endif > + > typedef struct CPUARMState { > /* Regs for current mode. */ > uint32_t regs[16]; > Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation.