summaryrefslogtreecommitdiffstats
path: root/hw/pc.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2010-05-14 16:29:08 +0900
committerBlue Swirl <blauwirbel@gmail.com>2010-05-15 15:41:50 +0000
commit6f09e686f807611aa03a91e37e9fb5cfc5283703 (patch)
treed6f83924c2634cb41d9d6f3acf2c4c7c7ab95855 /hw/pc.c
parentec2654fb299306941e80c4907b7a9798cb6c6f05 (diff)
downloadhqemu-6f09e686f807611aa03a91e37e9fb5cfc5283703.zip
hqemu-6f09e686f807611aa03a91e37e9fb5cfc5283703.tar.gz
pc: introduce a function to allocate cpu irq.
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irq in order to make pic_irq_request() piix independent. Later piix code will be split out to another file keeping pic_irq_request() static. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/pc.c b/hw/pc.c
index c88158c..fa11477 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -805,6 +805,11 @@ static CPUState *pc_new_cpu(const char *cpu_model)
return env;
}
+static qemu_irq *pc_allocate_cpu_irq(void)
+{
+ return qemu_allocate_irqs(pic_irq_request, NULL, 1);
+}
+
/* PC hardware initialisation */
static void pc_init1(ram_addr_t ram_size,
const char *boot_device,
@@ -928,7 +933,7 @@ static void pc_init1(ram_addr_t ram_size,
rom_add_option(option_rom[i]);
}
- cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1);
+ cpu_irq = pc_allocate_cpu_irq();
i8259 = i8259_init(cpu_irq[0]);
isa_irq_state = qemu_mallocz(sizeof(*isa_irq_state));
isa_irq_state->i8259 = i8259;
OpenPOWER on IntegriCloud