Patchwork [03/22] pc: Convert GSIState::i8259_irq into array

login
register
mail settings
Submitter Jan Kiszka
Date Sept. 28, 2011, 11 a.m.
Message ID <054f407e5d6c97ece6da433e579a4b59855339e8.1317207666.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/116778/
State New
Headers show

Comments

Jan Kiszka - Sept. 28, 2011, 11 a.m.
Will be required when we no longer let i8259_init allocate the PIC IRQs
but convert that chips to qdev.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/pc.h      |    2 +-
 hw/pc_piix.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/pc.h b/hw/pc.h
index 4333898..2870be4 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -76,7 +76,7 @@  void irq_info(Monitor *mon);
 #define GSI_NUM_PINS IOAPIC_NUM_PINS
 
 typedef struct GSIState {
-    qemu_irq *i8259_irq;
+    qemu_irq i8259_irq[ISA_NUM_IRQS];
     qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
 } GSIState;
 
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index e6e280c..c89042f 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -158,7 +158,9 @@  static void pc_init1(MemoryRegion *system_memory,
         i8259 = xen_interrupt_controller_init();
     }
 
-    gsi_state->i8259_irq = i8259;
+    for (i = 0; i < ISA_NUM_IRQS; i++) {
+        gsi_state->i8259_irq[i] = i8259[i];
+    }
     if (pci_enabled) {
         ioapic_init(gsi_state);
     }