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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to