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

Re: [Xen-devel] [PATCH v2 2/2] vhpet: add support for level triggered interrupts

>>> On 30.03.18 at 14:36, <roger.pau@xxxxxxxxxx> wrote:
> Level triggered interrupts are not an optional feature of HPET, and
> must be implemented in order to comply with the HPET specification.
> Implement them by adding a callback to the timer which sets the
> interrupt bit in the general interrupt status register. Further
> interrupts (in case of periodic mode) will not be injected until the
> bit is cleared.
> In order to reset the interrupts when the status bit is clear Xen must
> also detect accesses to such register.

s/detect/handle/ and s/such/the status/ ?

> --- a/xen/arch/x86/hvm/hpet.c
> +++ b/xen/arch/x86/hvm/hpet.c
> @@ -220,6 +220,17 @@ static void hpet_stop_timer(HPETState *h, unsigned int 
> tn,
>      hpet_get_comparator(h, tn, guest_time);
>  }
> +static void hpet_timer_fired(struct vcpu *v, void *data)

No need for the hpet_ prefix when the function is static.

> +{
> +    unsigned int tn = (unsigned int)data;

Most gcc versions I'm aware of will warn about casts between
pointers and integers of different size - the cast needs to be to
unsigned long (while the variable type can remain as is). Oddly
enough you go through unsigned long when casting in the other

> @@ -360,6 +377,19 @@ static int hpet_write(
>          }
>          break;
> +    case HPET_STATUS:
> +        /* write 1 to clear. */
> +        while (new_val)

Missing blanks.


Xen-devel mailing list



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