[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



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.

Ian.


_______________________________________________
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®.