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

Re: [Xen-devel] [PATCH 02/18] xen: allow global VIRQ handlers to be delegated to other domains



On 01/13/2012 03:03 AM, Jan Beulich wrote:
>>>> On 13.01.12 at 00:35, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:
>> +int set_global_virq_handler(struct domain *d, uint32_t virq)
>> +{
>> +    struct domain *old;
>> +
>> +    if (virq >= NR_VIRQS)
>> +        return -EINVAL;
>> +    if (!virq_is_global(virq))
>> +        return -EINVAL;
>> +
>> +    if (global_virq_handlers[virq] == d)
>> +        return 0;
>> +
>> +    if (unlikely(!get_domain(d)))
>> +        return -EINVAL;
>> +
>> +    spin_lock(&global_virq_handlers_lock);
>> +    old = global_virq_handlers[virq];
>> +    global_virq_handlers[virq] = d;
>> +    spin_unlock(&global_virq_handlers_lock);
>> +
>> +    if (old != NULL)
>> +        put_domain(old);
>> +
>> +    return 0;
>> +}
>> +
>> +static void clear_global_virq_handlers(struct domain *d)
>> +{
>> +    uint32_t virq;
>> +    int put_count = 0;
>> +
>> +    spin_lock(&global_virq_handlers_lock);
>> +
>> +    for (virq = 0; virq < NR_VIRQS; virq++) {
>> +        if (global_virq_handlers[virq] == d) {
>> +            global_virq_handlers[virq] = NULL;
>> +            put_count++;
>> +        }
>> +    }
>> +
>> +    spin_unlock(&global_virq_handlers_lock);
>> +
>> +    while (put_count) {
>> +        put_domain(d);
>> +        put_count--;
>> +    }
>> +}
> 
> Formatting in this entire hunk should be changed to match that of the
> rest of the file.
> 
>> --- a/xen/include/xsm/xsm.h
>> +++ b/xen/include/xsm/xsm.h
>> @@ -64,6 +64,7 @@ struct xsm_operations {
>>      int (*domain_settime) (struct domain *d);
>>      int (*set_target) (struct domain *d, struct domain *e);
>>      int (*domctl) (struct domain *d, int cmd);
>> +    int (*set_virq_handler) (struct domain *d, int virq);
> 
> Here and further down, the 'int' still survived.
> 
> Jan
> 

Much of the existing code handling virqs uses int; should I also change
these instances to uint32_t?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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