Patchwork Make machine->init take QEMUMachine as an argument

login
register
mail settings
Submitter Anthony Liguori
Date June 3, 2010, 2:07 p.m.
Message ID <1275574023-9259-1-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/54485/
State New
Headers show

Comments

Anthony Liguori - June 3, 2010, 2:07 p.m.
This let's machines use container_of() to get at machine specific state.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Patch

diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 7d59c96..7c34013 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -264,7 +264,7 @@  static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
 }
 
 static
-void axisdev88_init (ram_addr_t ram_size,
+void axisdev88_init (QEMUMachine *machine, ram_addr_t ram_size,
                      const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
diff --git a/hw/etraxfs.c b/hw/etraxfs.c
index b88d00a..9ec463f 100644
--- a/hw/etraxfs.c
+++ b/hw/etraxfs.c
@@ -50,7 +50,7 @@  static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
 }
 
 static
-void bareetraxfs_init (ram_addr_t ram_size,
+void bareetraxfs_init (QEMUMachine *machine, ram_addr_t ram_size,
                        const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
diff --git a/hw/mainstone.c b/hw/mainstone.c
index c801a2c..6badf49 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -68,7 +68,7 @@  static struct arm_boot_info mainstone_binfo = {
     .ram_size = 0x04000000,
 };
 
-static void mainstone_common_init(QEMUMachine *machine, ram_addr_t ram_size,
+static void mainstone_common_init(ram_addr_t ram_size,
                 const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, enum mainstone_model_e model, int arm_id)
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index ead3a00..e784b1f 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -300,7 +300,7 @@  void mips_jazz_init (ram_addr_t ram_size,
 }
 
 static
-void mips_magnum_init (ram_addr_t ram_size,
+void mips_magnum_init (QEMUMachine *machine, ram_addr_t ram_size,
                        const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
@@ -309,7 +309,7 @@  void mips_magnum_init (ram_addr_t ram_size,
 }
 
 static
-void mips_pica61_init (ram_addr_t ram_size,
+void mips_pica61_init (QEMUMachine *machine, ram_addr_t ram_size,
                        const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index a8f9d15..48a6d9e 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -773,7 +773,7 @@  static void cpu_request_exit(void *opaque, int irq, int level)
 }
 
 static
-void mips_malta_init (ram_addr_t ram_size,
+void mips_malta_init (QEMUMachine *machine, ram_addr_t ram_size,
                       const char *boot_device,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index a747de5..fd442ec 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -110,7 +110,7 @@  static void main_cpu_reset(void *opaque)
 }
 
 static void
-mips_mipssim_init (ram_addr_t ram_size,
+mips_mipssim_init (QEMUMachine *machine, ram_addr_t ram_size,
                    const char *boot_device,
                    const char *kernel_filename, const char *kernel_cmdline,
                    const char *initrd_filename, const char *cpu_model)
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index f1fcfcd..5ac1615 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -155,7 +155,7 @@  static void main_cpu_reset(void *opaque)
 
 static const int sector_len = 32 * 1024;
 static
-void mips_r4k_init (ram_addr_t ram_size,
+void mips_r4k_init (QEMUMachine *machine, ram_addr_t ram_size,
                     const char *boot_device,
                     const char *kernel_filename, const char *kernel_cmdline,
                     const char *initrd_filename, const char *cpu_model)
diff --git a/hw/nseries.c b/hw/nseries.c
index ae092ca..fa23305 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -1264,7 +1264,7 @@  static int n810_atag_setup(struct arm_boot_info *info, void *p)
     return n8x0_atag_setup(p, 810);
 }
 
-static void n8x0_init(QEMUMachine *machine, ram_addr_t ram_size, const char *boot_device,
+static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
                 const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, struct arm_boot_info *binfo, int model)
diff --git a/hw/omap_sx1.c b/hw/omap_sx1.c
index bc765bf..946a010 100644
--- a/hw/omap_sx1.c
+++ b/hw/omap_sx1.c
@@ -114,7 +114,7 @@  static struct arm_boot_info sx1_binfo = {
     .board_id = 0x265,
 };
 
-static void sx1_init(QEMUMachine *machine, ram_addr_t ram_size,
+static void sx1_init(ram_addr_t ram_size,
                 const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model,
@@ -205,7 +205,7 @@  static void sx1_init(QEMUMachine *machine, ram_addr_t ram_size,
     //~ qemu_console_resize(ds, 640, 480);
 }
 
-static void sx1_init_v1(ram_addr_t ram_size,
+static void sx1_init_v1(QEMUMachine *machine, ram_addr_t ram_size,
                 const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
@@ -214,7 +214,7 @@  static void sx1_init_v1(ram_addr_t ram_size,
                 kernel_cmdline, initrd_filename, cpu_model, 1);
 }
 
-static void sx1_init_v2(ram_addr_t ram_size,
+static void sx1_init_v2(QEMUMachine *machine, ram_addr_t ram_size,
                 const char *boot_device,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 70f563a..94b884d 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -161,7 +161,8 @@  static void pc_init1(ram_addr_t ram_size,
     }
 }
 
-static void pc_init_pci(ram_addr_t ram_size,
+static void pc_init_pci(QEMUMachine *machine,
+                        ram_addr_t ram_size,
                         const char *boot_device,
                         const char *kernel_filename,
                         const char *kernel_cmdline,
@@ -173,7 +174,8 @@  static void pc_init_pci(ram_addr_t ram_size,
              initrd_filename, cpu_model, 1);
 }
 
-static void pc_init_isa(ram_addr_t ram_size,
+static void pc_init_isa(QEMUMachine *machine,
+                        ram_addr_t ram_size,
                         const char *boot_device,
                         const char *kernel_filename,
                         const char *kernel_cmdline,
diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c
index 44c4997..66a3547 100644
--- a/hw/ppc405_boards.c
+++ b/hw/ppc405_boards.c
@@ -168,7 +168,7 @@  static void ref405ep_fpga_init (uint32_t base)
     qemu_register_reset(&ref405ep_fpga_reset, fpga);
 }
 
-static void ref405ep_init (ram_addr_t ram_size,
+static void ref405ep_init (QEMUMachine *machine, ram_addr_t ram_size,
                            const char *boot_device,
                            const char *kernel_filename,
                            const char *kernel_cmdline,
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index d131aa5..5830729 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -121,7 +121,7 @@  static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
 }
 
 /* PowerPC Mac99 hardware initialisation */
-static void ppc_core99_init (ram_addr_t ram_size,
+static void ppc_core99_init (QEMUMachine *machine, ram_addr_t ram_size,
                              const char *boot_device,
                              const char *kernel_filename,
                              const char *kernel_cmdline,
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index 27ddc01..798bf47 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -128,7 +128,7 @@  static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
     return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR;
 }
 
-static void ppc_heathrow_init (ram_addr_t ram_size,
+static void ppc_heathrow_init (QEMUMachine *machine, ram_addr_t ram_size,
                                const char *boot_device,
                                const char *kernel_filename,
                                const char *kernel_cmdline,
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 16c9950..1ea5d5d 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -557,7 +557,7 @@  static void cpu_request_exit(void *opaque, int irq, int level)
 }
 
 /* PowerPC PREP hardware initialisation */
-static void ppc_prep_init (ram_addr_t ram_size,
+static void ppc_prep_init (QEMUMachine *machine, ram_addr_t ram_size,
                            const char *boot_device,
                            const char *kernel_filename,
                            const char *kernel_cmdline,
diff --git a/hw/realview.c b/hw/realview.c
index 827b70b..0e59b57 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -128,7 +128,7 @@  static const int realview_board_id[] = {
     0x76d
 };
 
-static void realview_init(QEMUMachine *machine, ram_addr_t ram_size,
+static void realview_init(ram_addr_t ram_size,
                      const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model,
diff --git a/hw/spitz.c b/hw/spitz.c
index 89756e9..f25e3a8 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -948,7 +948,7 @@  static struct arm_boot_info spitz_binfo = {
     .ram_size = 0x04000000,
 };
 
-static void spitz_common_init(QEMUMachine *machine, ram_addr_t ram_size,
+static void spitz_common_init(ram_addr_t ram_size,
                 const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, enum spitz_model_e model, int arm_id)
diff --git a/hw/sun4m.c b/hw/sun4m.c
index e4ca8f3..036f40b 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -1199,7 +1199,7 @@  static const struct sun4m_hwdef sun4m_hwdefs[] = {
 };
 
 /* SPARCstation 5 hardware initialisation */
-static void ss5_init(ram_addr_t RAM_size,
+static void ss5_init(QEMUMachine *machine, ram_addr_t RAM_size,
                      const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
@@ -1209,7 +1209,7 @@  static void ss5_init(ram_addr_t RAM_size,
 }
 
 /* SPARCstation 10 hardware initialisation */
-static void ss10_init(ram_addr_t RAM_size,
+static void ss10_init(QEMUMachine *machine, ram_addr_t RAM_size,
                       const char *boot_device,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
@@ -1219,7 +1219,7 @@  static void ss10_init(ram_addr_t RAM_size,
 }
 
 /* SPARCserver 600MP hardware initialisation */
-static void ss600mp_init(ram_addr_t RAM_size,
+static void ss600mp_init(QEMUMachine *machine, ram_addr_t RAM_size,
                          const char *boot_device,
                          const char *kernel_filename,
                          const char *kernel_cmdline,
@@ -1230,7 +1230,7 @@  static void ss600mp_init(ram_addr_t RAM_size,
 }
 
 /* SPARCstation 20 hardware initialisation */
-static void ss20_init(ram_addr_t RAM_size,
+static void ss20_init(QEMUMachine *machine, ram_addr_t RAM_size,
                       const char *boot_device,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
@@ -1240,7 +1240,7 @@  static void ss20_init(ram_addr_t RAM_size,
 }
 
 /* SPARCstation Voyager hardware initialisation */
-static void vger_init(ram_addr_t RAM_size,
+static void vger_init(QEMUMachine *machine, ram_addr_t RAM_size,
                       const char *boot_device,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
@@ -1250,7 +1250,7 @@  static void vger_init(ram_addr_t RAM_size,
 }
 
 /* SPARCstation LX hardware initialisation */
-static void ss_lx_init(ram_addr_t RAM_size,
+static void ss_lx_init(QEMUMachine *machine, ram_addr_t RAM_size,
                        const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
@@ -1260,7 +1260,7 @@  static void ss_lx_init(ram_addr_t RAM_size,
 }
 
 /* SPARCstation 4 hardware initialisation */
-static void ss4_init(ram_addr_t RAM_size,
+static void ss4_init(QEMUMachine *machine, ram_addr_t RAM_size,
                      const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
@@ -1270,7 +1270,7 @@  static void ss4_init(ram_addr_t RAM_size,
 }
 
 /* SPARCClassic hardware initialisation */
-static void scls_init(ram_addr_t RAM_size,
+static void scls_init(QEMUMachine *machine, ram_addr_t RAM_size,
                       const char *boot_device,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, const char *cpu_model)
@@ -1280,7 +1280,7 @@  static void scls_init(ram_addr_t RAM_size,
 }
 
 /* SPARCbook hardware initialisation */
-static void sbook_init(ram_addr_t RAM_size,
+static void sbook_init(QEMUMachine *machine, ram_addr_t RAM_size,
                        const char *boot_device,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
@@ -1544,7 +1544,7 @@  static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
 }
 
 /* SPARCserver 1000 hardware initialisation */
-static void ss1000_init(ram_addr_t RAM_size,
+static void ss1000_init(QEMUMachine *machine, ram_addr_t RAM_size,
                         const char *boot_device,
                         const char *kernel_filename, const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model)
@@ -1554,7 +1554,7 @@  static void ss1000_init(ram_addr_t RAM_size,
 }
 
 /* SPARCcenter 2000 hardware initialisation */
-static void ss2000_init(ram_addr_t RAM_size,
+static void ss2000_init(QEMUMachine *machine, ram_addr_t RAM_size,
                         const char *boot_device,
                         const char *kernel_filename, const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model)
@@ -1734,7 +1734,7 @@  static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
 }
 
 /* SPARCstation 2 hardware initialisation */
-static void ss2_init(ram_addr_t RAM_size,
+static void ss2_init(QEMUMachine *machine, ram_addr_t RAM_size,
                      const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 40b5f1f..2a4da8b 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -881,7 +881,7 @@  static const struct hwdef hwdefs[] = {
 };
 
 /* Sun4u hardware initialisation */
-static void sun4u_init(ram_addr_t RAM_size,
+static void sun4u_init(QEMUMachine *machine, ram_addr_t RAM_size,
                        const char *boot_devices,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
@@ -891,7 +891,7 @@  static void sun4u_init(ram_addr_t RAM_size,
 }
 
 /* Sun4v hardware initialisation */
-static void sun4v_init(ram_addr_t RAM_size,
+static void sun4v_init(QEMUMachine *machine, ram_addr_t RAM_size,
                        const char *boot_devices,
                        const char *kernel_filename, const char *kernel_cmdline,
                        const char *initrd_filename, const char *cpu_model)
@@ -901,7 +901,7 @@  static void sun4v_init(ram_addr_t RAM_size,
 }
 
 /* Niagara hardware initialisation */
-static void niagara_init(ram_addr_t RAM_size,
+static void niagara_init(QEMUMachine *machine, ram_addr_t RAM_size,
                          const char *boot_devices,
                          const char *kernel_filename, const char *kernel_cmdline,
                          const char *initrd_filename, const char *cpu_model)
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 9444533..7efe163 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -156,7 +156,7 @@  static int vpb_sic_init(SysBusDevice *dev)
 
 static struct arm_boot_info versatile_binfo;
 
-static void versatile_init(QEMUMachine *machine, ram_addr_t ram_size,
+static void versatile_init(ram_addr_t ram_size,
                      const char *boot_device,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model,
diff --git a/vl.c b/vl.c
index 417554f..9cea992 100644
--- a/vl.c
+++ b/vl.c
@@ -3718,7 +3718,7 @@  int main(int argc, char **argv, char **envp)
     }
     qemu_add_globals();
 
-    machine->init(ram_size, boot_devices,
+    machine->init(machine, ram_size, boot_devices,
                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
 
     cpu_synchronize_all_post_init();