qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH 6/8] PPC: booke: add tlbnps handling


From: Scott Wood
Subject: Re: [Qemu-ppc] [PATCH 6/8] PPC: booke: add tlbnps handling
Date: Mon, 23 Jan 2012 11:29:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 01/20/2012 10:15 PM, Alexander Graf wrote:
> +/* returns bitmap of supported page sizes for a given TLB */
> +static inline uint32_t booke206_tlbnps(CPUState *env, const int tlbn)
> +{
> +    bool mav2 = false;
> +    uint32_t ret = 0;
> +
> +    if (mav2) {
> +        ret = env->spr[SPR_BOOKE_TLB0PS + tlbn];
> +    } else {
> +        uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];
> +        uint32_t min = (tlbncfg & TLBnCFG_MINSIZE) >> TLBnCFG_MINSIZE_SHIFT;
> +        uint32_t max = (tlbncfg & TLBnCFG_MAXSIZE) >> TLBnCFG_MAXSIZE_SHIFT;
> +        int i;
> +        for (i = min; i <= max; i++) {
> +            ret |= (1 << (i << 1));
> +        }
> +    }

For mav1 only the even sizes are supported.

-Scott




reply via email to

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