qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 3/7] target-arm: Add helper macros and define


From: Alistair Francis
Subject: Re: [Qemu-devel] [PATCH v1 3/7] target-arm: Add helper macros and defines for CCNT register
Date: Wed, 25 Jun 2014 08:42:36 +1000

On Wed, Jun 25, 2014 at 1:56 AM, Peter Maydell <address@hidden> wrote:
> On 24 June 2014 02:12, Alistair Francis <address@hidden> wrote:
>> +    /* 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
>> +     * 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
>
> This really should be a function, not a macro. (And it probably
> ought to live in internals.h.)
>
> Can you write the check so that it won't blow up and need
> fixing when arm_current_pl() returns 2 or 3 in the future?

Ok, I can move it to a function and it shouldn't be too hard to allow
it to work with EL 2 or 3 (from memory there isn't a specific check for EL2,
just the secure/non-secure stuff)

>
> thanks
> -- PMM
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]