|
From: | Richard Henderson |
Subject: | Re: [PATCH v1 2/5] hw/intc: sifive_clint: Use RISC-V CPU GPIO lines |
Date: | Fri, 9 Jul 2021 08:36:26 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 7/8/21 8:30 PM, Alistair Francis wrote:
+typedef struct sifive_clint_callback { + SiFiveCLINTState *s; + int num; +} sifive_clint_callback;
Perhaps better to put "num", perhaps with a more descriptive name (hartid?), into SiFiveCLINTState itself?
It would avoid some amount of double-indirection, and some awkward memory allocation in sifive_clint_create.
} else if ((addr & 0x3) == 0) { - riscv_cpu_update_mip(RISCV_CPU(cpu), MIP_MSIP, BOOL_TO_MASK(value)); + if (value) { + qemu_irq_raise(clint->soft_irqs[hartid]); + } else { + qemu_irq_lower(clint->soft_irqs[hartid]); + }
You should use qemu_irq_set here. r~
[Prev in Thread] | Current Thread | [Next in Thread] |