aboutsummaryrefslogtreecommitdiff
path: root/hw/sd
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-09-03 18:48:36 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-21 13:19:02 +0200
commit2bd9ae7e3087a5b853d67ddbedca1b94f88229cf (patch)
tree542f86fc77925e8149b610aceccae417decb9c3c /hw/sd
parent45e5dc43b3dab096bedf0d537e9b99ee169d0784 (diff)
downloadqemu-2bd9ae7e3087a5b853d67ddbedca1b94f88229cf.zip
qemu-2bd9ae7e3087a5b853d67ddbedca1b94f88229cf.tar.gz
qemu-2bd9ae7e3087a5b853d67ddbedca1b94f88229cf.tar.bz2
hw/sd/sdhci: Let sdhci_update_irq() return if IRQ was delivered
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Alexander Bulekov <alxndr@bu.edu> Message-Id: <20200903172806.489710-4-f4bug@amsat.org>
Diffstat (limited to 'hw/sd')
-rw-r--r--hw/sd/sdhci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 4db77de..b93ecef 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -218,9 +218,14 @@ static uint8_t sdhci_slotint(SDHCIState *s)
((s->norintsts & SDHC_NIS_REMOVE) && (s->wakcon & SDHC_WKUP_ON_RMV));
}
-static inline void sdhci_update_irq(SDHCIState *s)
+/* Return true if IRQ was pending and delivered */
+static bool sdhci_update_irq(SDHCIState *s)
{
- qemu_set_irq(s->irq, sdhci_slotint(s));
+ bool pending = sdhci_slotint(s);
+
+ qemu_set_irq(s->irq, pending);
+
+ return pending;
}
static void sdhci_raise_insertion_irq(void *opaque)