From 96338fefc19a143abdc91f6c44f37683274b08d4 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Thu, 5 Nov 2020 18:32:19 -0800 Subject: hw/intc/ibex_plic: Clear the claim register when read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After claiming the interrupt by reading the claim register we want to clear the register to make sure the interrupt doesn't appear at the next read. This matches the documentation for the claim register as when an interrupt is claimed by a target the relevant bit of IP is cleared (which we already do): https://docs.opentitan.org/hw/ip/rv_plic/doc/index.html This also matches the current hardware. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-id: 68d4575deef2559b7a747f3bda193fcf43af4558.1604629928.git.alistair.francis@wdc.com --- hw/intc/ibex_plic.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw') diff --git a/hw/intc/ibex_plic.c b/hw/intc/ibex_plic.c index f49fa67..235e6b8 100644 --- a/hw/intc/ibex_plic.c +++ b/hw/intc/ibex_plic.c @@ -139,6 +139,9 @@ static uint64_t ibex_plic_read(void *opaque, hwaddr addr, /* Return the current claimed interrupt */ ret = s->claim; + /* Clear the claimed interrupt */ + s->claim = 0x00000000; + /* Update the interrupt status after the claim */ ibex_plic_update(s); } -- cgit v1.1