From patchwork Wed Jan 6 02:39:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V12,11/27] pc: introduce a function to allocate cpu irq. Date: Tue, 05 Jan 2010 16:39:35 -0000 From: Isaku Yamahata X-Patchwork-Id: 42252 Message-Id: <1262745591-28697-12-git-send-email-yamahata@valinux.co.jp> To: qemu-devel@nongnu.org, kraxel@redhat.com, aurelien@aurel32.net Cc: yamahata@valinux.co.jp 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 Acked-by: Gerd Hoffmann --- hw/pc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 3ad9bbb..fc603bc 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -987,6 +987,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, @@ -1119,7 +1124,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;