From d0b482eb3e8cb699a2090bc773364d3a7d369a25 Mon Sep 17 00:00:00 2001 From: Vladimir Chtchetkine Date: Thu, 29 Sep 2011 15:54:52 -0700 Subject: Fix IRQ allocation for goldfish devices. There were two issues fixed here: 1. IRQ allocation (for a device) has never been checked on going out of bounds. 2. In x86 platform some IRQs were reserved (for kbd, mouse, and exception), but IRQ allocation for goldfish devices didn't check for those reserved IRQs being assigned to a device. Change-Id: I9d48485d973bcc8fd8a3dd1b78fbfa6a05aeea22 --- hw/goldfish_device.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hw/goldfish_device.h') diff --git a/hw/goldfish_device.h b/hw/goldfish_device.h index 19f4b32..a9e3f83 100644 --- a/hw/goldfish_device.h +++ b/hw/goldfish_device.h @@ -55,4 +55,18 @@ void trace_dev_init(); void events_dev_init(uint32_t base, qemu_irq irq); void nand_dev_init(uint32_t base); +#ifdef TARGET_I386 +/* Maximum IRQ number available for a device on x86. */ +#define GFD_MAX_IRQ 16 +/* IRQ reserved for keyboard. */ +#define GFD_KBD_IRQ 1 +/* IRQ reserved for mouse. */ +#define GFD_MOUSE_IRQ 12 +/* IRQ reserved for error (raising an exception in TB code). */ +#define GFD_ERR_IRQ 13 +#else +/* Maximum IRQ number available for a device on ARM. */ +#define GFD_MAX_IRQ 32 #endif + +#endif /* GOLDFISH_DEVICE_H */ -- cgit v1.1