On Wed, 23 Oct 2019 at 18:34, Marc-André Lureau
<[email protected]> wrote:
>
> "set_pin_in" property is used to define a callback mechanism where the
> device says "call the callback function, passing it an opaque cookie
> and a 32-bit value". We already have a generic mechanism for doing
> that, which is the qemu_irq. So we should just use that.
>
> Signed-off-by: Marc-AndrĂ© Lureau <[email protected]>
> ---

This is probably a good place to put a comment:

/*
 * This device assumes that the incoming 'level' value on the
 * qemu_irq is the interrupt number, not just a simple 0/1 level.
 */

> -static void leon3_set_pil_in(void *opaque, uint32_t pil_in)
> +static void leon3_set_pil_in(void *opaque, int n, int level)
>  {
> -    CPUSPARCState *env = (CPUSPARCState *)opaque;
> +    CPUSPARCState *env = opaque;
> +    uint32_t pil_in = level;
>      CPUState *cs;
>
>      assert(env != NULL);

Otherwise
Reviewed-by: Peter Maydell <[email protected]>

thanks
-- PMM

Reply via email to