aboutsummaryrefslogtreecommitdiffstats
path: root/hw/pc.c
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-09-29 15:54:52 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-09-29 15:59:16 -0700
commitd0b482eb3e8cb699a2090bc773364d3a7d369a25 (patch)
tree1cf7d757ec81b83c463d489b087f3436940b9e92 /hw/pc.c
parent6e93697bf74fe127356e98bceabf67597c0e1084 (diff)
downloadexternal_qemu-d0b482eb3e8cb699a2090bc773364d3a7d369a25.zip
external_qemu-d0b482eb3e8cb699a2090bc773364d3a7d369a25.tar.gz
external_qemu-d0b482eb3e8cb699a2090bc773364d3a7d369a25.tar.bz2
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
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 7a83b4c..f44c44e 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1033,7 +1033,7 @@ static void pc_init1(ram_addr_t ram_size,
cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1);
i8259 = i8259_init(cpu_irq[0]);
- ferr_irq = i8259[13];
+ ferr_irq = i8259[GFD_ERR_IRQ];
#define IRQ_PDEV_BUS 4
goldfish_device_init(i8259, 0xff010000, 0x7f0000, 5, 5);
@@ -1177,7 +1177,7 @@ static void pc_init1(ram_addr_t ram_size,
}
#endif
- i8042_init(i8259[1], i8259[12], 0x60);
+ i8042_init(i8259[GFD_KBD_IRQ], i8259[GFD_MOUSE_IRQ], 0x60);
DMA_init(0);
goldfish_fb_init(0);