summaryrefslogtreecommitdiffstats
path: root/hw/riscv/sifive_plic.c
diff options
context:
space:
mode:
authorMichael Clark2018-04-08 23:25:25 +0200
committerPalmer Dabbelt2018-10-17 22:02:09 +0200
commit85ba724fd6ad51360d61045476fd96d25dc15b9a (patch)
tree5be393f199a93feefd3a5aa2d35bc9e22cf41d45 /hw/riscv/sifive_plic.c
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20181016-... (diff)
downloadqemu-85ba724fd6ad51360d61045476fd96d25dc15b9a.tar.gz
qemu-85ba724fd6ad51360d61045476fd96d25dc15b9a.tar.xz
qemu-85ba724fd6ad51360d61045476fd96d25dc15b9a.zip
RISC-V: Allow setting and clearing multiple irqs
Change the API of riscv_set_local_interrupt to take a write mask and value to allow setting and clearing of multiple local interrupts atomically in a single call. Rename the new function to riscv_cpu_update_mip. Signed-off-by: Michael Clark <mjc@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'hw/riscv/sifive_plic.c')
-rw-r--r--hw/riscv/sifive_plic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c
index f635e6ff67..9cf9a1f986 100644
--- a/hw/riscv/sifive_plic.c
+++ b/hw/riscv/sifive_plic.c
@@ -142,10 +142,10 @@ static void sifive_plic_update(SiFivePLICState *plic)
int level = sifive_plic_irqs_pending(plic, addrid);
switch (mode) {
case PLICMode_M:
- riscv_set_local_interrupt(RISCV_CPU(cpu), MIP_MEIP, level);
+ riscv_cpu_update_mip(RISCV_CPU(cpu), MIP_MEIP, BOOL_TO_MASK(level));
break;
case PLICMode_S:
- riscv_set_local_interrupt(RISCV_CPU(cpu), MIP_SEIP, level);
+ riscv_cpu_update_mip(RISCV_CPU(cpu), MIP_SEIP, BOOL_TO_MASK(level));
break;
default:
break;