From: Benjamin Herrenschmidt Date: Mon, 19 Sep 2016 06:29:32 +0000 (+0530) Subject: ppc/xics: An ICS with offset 0 is assumed to be uninitialized X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=15ed653fa49a7ddda2034db5d722fd6c2d439dd8;p=qemu.git ppc/xics: An ICS with offset 0 is assumed to be uninitialized This will make life easier for dealing with dynamically configured ICSes such as PHB3 Signed-off-by: Benjamin Herrenschmidt Reviewed-by: David Gibson Signed-off-by: Nikunj A Dadhania Signed-off-by: David Gibson --- diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 2db9f938d3..5aac67ad89 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -149,7 +149,7 @@ struct ICSState { static inline bool ics_valid_irq(ICSState *ics, uint32_t nr) { - return (nr >= ics->offset) + return (ics->offset != 0) && (nr >= ics->offset) && (nr < (ics->offset + ics->nr_irqs)); }