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

Re: [Xen-devel] [PATCH 01/10] xen/arm: vgic-v3: Correctly set GICD_TYPER.IDbits



Hi Ian,

On 20/01/15 15:34, Ian Campbell wrote:
> On Mon, 2015-01-19 at 16:29 +0000, Julien Grall wrote:
>> +        unsigned int order;
>> +
>>          if ( dabt.size != DABT_WORD ) goto bad_width;
>>          /* No secure world support for guests. */
>>          *r = (((v->domain->max_vcpus << 5) & GICD_TYPE_CPUS ) |
>>                ((v->domain->arch.vgic.nr_lines / 32) & GICD_TYPE_LINES));
>> +
>> +        /*
>> +         * Calculate number of interrupt identifier bits supported by
>> +         * the GIC Stream Protocol Interface
>> +         */
>> +        irqs--;
>> +        for ( order = 0; irqs; order++ )
>> +            irqs >>= 1;
> 
> This is some variant on fls(). See get_bitmask_order() or
> get_count_order() for an example of use, possibly even one you could
> call.

get_count_order sounds the best function to use. I will give a try.

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.