Patchwork [V8,11/18] pc: make pc_init1() not refer ferr_irq directly.

login
register
mail settings
Submitter Isaku Yamahata
Date Dec. 4, 2009, 5:50 a.m.
Message ID <1259905865-25295-12-git-send-email-yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/40299/
State New
Headers show

Comments

Isaku Yamahata - Dec. 4, 2009, 5:50 a.m.
By introducing a registering function, make pc_init1() not refer to
ferr_irq directly in order to make ferr_irq piix independent.
Later pc_init1() will be split out into another file keeping ferr_irq
static.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pc.c |    8 +++++++-
 hw/pc.h |    2 ++
 2 files changed, 9 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index da3c1ac..5584e3b 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -86,6 +86,12 @@  static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 
 /* MSDOS compatibility mode FPU exception support */
 static qemu_irq ferr_irq;
+
+void pc_register_ferr_irq(qemu_irq irq)
+{
+    ferr_irq = irq;
+}
+
 /* XXX: add IGNNE support */
 void cpu_set_ferr(CPUX86State *s)
 {
@@ -1127,7 +1133,7 @@  static void pc_init1(ram_addr_t ram_size,
     }
     isa_bus_irqs(isa_irq);
 
-    ferr_irq = isa_reserve_irq(13);
+    pc_register_ferr_irq(isa_reserve_irq(13));
 
     /* init basic PC hardware */
     register_ioport_write(0x80, 1, 1, ioport80_write, NULL);
diff --git a/hw/pc.h b/hw/pc.h
index c937243..5a2eb5c 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -92,6 +92,8 @@  void cmos_set_s3_resume(void);
 /* pc.c */
 extern int fd_bootchk;
 
+void pc_register_ferr_irq(qemu_irq irq);
+
 void ioport_set_a20(int enable);
 int ioport_get_a20(void);