Commit f80f9ec9 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Convert machine registration to use module init functions



This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent f92f8afe
......@@ -84,8 +84,15 @@ static void an5206_init(ram_addr_t ram_size,
env->pc = entry;
}
QEMUMachine an5206_machine = {
static QEMUMachine an5206_machine = {
.name = "an5206",
.desc = "Arnewsh 5206",
.init = an5206_init,
};
static void an5206_machine_init(void)
{
qemu_register_machine(&an5206_machine);
}
machine_init(an5206_machine_init);
......@@ -372,8 +372,15 @@ void axisdev88_init (ram_addr_t ram_size,
printf ("ram size =%ld\n", ram_size);
}
QEMUMachine axisdev88_machine = {
static QEMUMachine axisdev88_machine = {
.name = "axis-dev88",
.desc = "AXIS devboard 88",
.init = axisdev88_init,
};
static void axisdev88_machine_init(void)
{
qemu_register_machine(&axisdev88_machine);
}
machine_init(axisdev88_machine_init);
......@@ -24,111 +24,4 @@ void register_machines(void);
extern QEMUMachine *current_machine;
/* Axis ETRAX. */
extern QEMUMachine bareetraxfs_machine;
extern QEMUMachine axisdev88_machine;
/* pc.c */
extern QEMUMachine pc_machine;
extern QEMUMachine isapc_machine;
/* xen_machine.c */
extern QEMUMachine xenpv_machine;
/* ppc.c */
extern QEMUMachine prep_machine;
extern QEMUMachine core99_machine;
extern QEMUMachine heathrow_machine;
extern QEMUMachine ref405ep_machine;
extern QEMUMachine taihu_machine;
extern QEMUMachine bamboo_machine;
extern QEMUMachine mpc8544ds_machine;
/* mips_r4k.c */
extern QEMUMachine mips_machine;
/* mips_jazz.c */
extern QEMUMachine mips_magnum_machine;
extern QEMUMachine mips_pica61_machine;
/* mips_malta.c */
extern QEMUMachine mips_malta_machine;
/* mips_mipssim.c */
extern QEMUMachine mips_mipssim_machine;
/* shix.c */
extern QEMUMachine shix_machine;
/* r2d.c */
extern QEMUMachine r2d_machine;
/* sun4m.c */
extern QEMUMachine ss5_machine, ss10_machine, ss600mp_machine, ss20_machine;
extern QEMUMachine voyager_machine, ss_lx_machine, ss4_machine, scls_machine;
extern QEMUMachine sbook_machine;
extern QEMUMachine ss2_machine;
extern QEMUMachine ss1000_machine, ss2000_machine;
/* sun4u.c */
extern QEMUMachine sun4u_machine;
extern QEMUMachine sun4v_machine;
extern QEMUMachine niagara_machine;
/* integratorcp.c */
extern QEMUMachine integratorcp_machine;
/* versatilepb.c */
extern QEMUMachine versatilepb_machine;
extern QEMUMachine versatileab_machine;
/* realview.c */
extern QEMUMachine realview_machine;
/* spitz.c */
extern QEMUMachine akitapda_machine;
extern QEMUMachine spitzpda_machine;
extern QEMUMachine borzoipda_machine;
extern QEMUMachine terrierpda_machine;
/* omap_sx1.c */
extern QEMUMachine sx1_machine_v1;
extern QEMUMachine sx1_machine_v2;
/* palm.c */
extern QEMUMachine palmte_machine;
/* nseries.c */
extern QEMUMachine n800_machine;
extern QEMUMachine n810_machine;
/* gumstix.c */
extern QEMUMachine connex_machine;
extern QEMUMachine verdex_machine;
/* stellaris.c */
extern QEMUMachine lm3s811evb_machine;
extern QEMUMachine lm3s6965evb_machine;
/* an5206.c */
extern QEMUMachine an5206_machine;
/* mcf5208.c */
extern QEMUMachine mcf5208evb_machine;
/* dummy_m68k.c */
extern QEMUMachine dummy_m68k_machine;
/* mainstone.c */
extern QEMUMachine mainstone2_machine;
/* musicpal.c */
extern QEMUMachine musicpal_machine;
/* tosa.c */
extern QEMUMachine tosapda_machine;
/* syborg.c */
extern QEMUMachine syborg_machine;
#endif
......@@ -63,8 +63,15 @@ static void dummy_m68k_init(ram_addr_t ram_size,
env->pc = entry;
}
QEMUMachine dummy_m68k_machine = {
static QEMUMachine dummy_m68k_machine = {
.name = "dummy",
.desc = "Dummy board",
.init = dummy_m68k_init,
};
static void dummy_m68k_machine_init(void)
{
qemu_register_machine(&dummy_m68k_machine);
}
machine_init(dummy_m68k_machine_init);
......@@ -158,8 +158,15 @@ void bareetraxfs_init (ram_addr_t ram_size,
printf ("ram size =%ld\n", ram_size);
}
QEMUMachine bareetraxfs_machine = {
static QEMUMachine bareetraxfs_machine = {
.name = "bareetraxfs",
.desc = "Bare ETRAX FS board",
.init = bareetraxfs_init,
};
static void bareetraxfs_machine_init(void)
{
qemu_register_machine(&bareetraxfs_machine);
}
machine_init(bareetraxfs_machine_init);
......@@ -109,14 +109,22 @@ static void verdex_init(ram_addr_t ram_size,
pxa2xx_gpio_in_get(cpu->gpio)[99]);
}
QEMUMachine connex_machine = {
static QEMUMachine connex_machine = {
.name = "connex",
.desc = "Gumstix Connex (PXA255)",
.init = connex_init,
};
QEMUMachine verdex_machine = {
static QEMUMachine verdex_machine = {
.name = "verdex",
.desc = "Gumstix Verdex (PXA270)",
.init = verdex_init,
};
static void gumstix_machine_init(void)
{
qemu_register_machine(&connex_machine);
qemu_register_machine(&verdex_machine);
}
machine_init(gumstix_machine_init);
......@@ -508,12 +508,19 @@ static void integratorcp_init(ram_addr_t ram_size,
arm_load_kernel(env, &integrator_binfo);
}
QEMUMachine integratorcp_machine = {
static QEMUMachine integratorcp_machine = {
.name = "integratorcp",
.desc = "ARM Integrator/CP (ARM926EJ-S)",
.init = integratorcp_init,
};
static void integratorcp_machine_init(void)
{
qemu_register_machine(&integratorcp_machine);
}
machine_init(integratorcp_machine_init);
static void integratorcp_register_devices(void)
{
sysbus_register_dev("integrator_pic", sizeof(icp_pic_state), icp_pic_init);
......
......@@ -135,8 +135,15 @@ static void mainstone_init(ram_addr_t ram_size,
kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196);
}
QEMUMachine mainstone2_machine = {
static QEMUMachine mainstone2_machine = {
.name = "mainstone",
.desc = "Mainstone II (PXA27x)",
.init = mainstone_init,
};
static void mainstone_machine_init(void)
{
qemu_register_machine(&mainstone2_machine);
}
machine_init(mainstone_machine_init);
......@@ -286,8 +286,15 @@ static void mcf5208evb_init(ram_addr_t ram_size,
env->pc = entry;
}
QEMUMachine mcf5208evb_machine = {
static QEMUMachine mcf5208evb_machine = {
.name = "mcf5208evb",
.desc = "MCF5206EVB",
.init = mcf5208evb_init,
};
static void mcf5208evb_machine_init(void)
{
qemu_register_machine(&mcf5208evb_machine);
}
machine_init(mcf5208evb_machine_init);
......@@ -286,16 +286,24 @@ void mips_pica61_init (ram_addr_t ram_size,
mips_jazz_init(ram_size, cpu_model, JAZZ_PICA61);
}
QEMUMachine mips_magnum_machine = {
static QEMUMachine mips_magnum_machine = {
.name = "magnum",
.desc = "MIPS Magnum",
.init = mips_magnum_init,
.use_scsi = 1,
};
QEMUMachine mips_pica61_machine = {
static QEMUMachine mips_pica61_machine = {
.name = "pica61",
.desc = "Acer Pica 61",
.init = mips_pica61_init,
.use_scsi = 1,
};
static void mips_jazz_machine_init(void)
{
qemu_register_machine(&mips_magnum_machine);
qemu_register_machine(&mips_pica61_machine);
}
machine_init(mips_jazz_machine_init);
......@@ -949,8 +949,15 @@ void mips_malta_init (ram_addr_t ram_size,
}
}
QEMUMachine mips_malta_machine = {
static QEMUMachine mips_malta_machine = {
.name = "malta",
.desc = "MIPS Malta Core LV",
.init = mips_malta_init,
};
static void mips_malta_machine_init(void)
{
qemu_register_machine(&mips_malta_machine);
}
machine_init(mips_malta_machine_init);
......@@ -178,8 +178,15 @@ mips_mipssim_init (ram_addr_t ram_size,
mipsnet_init(0x4200, env->irq[2], &nd_table[0]);
}
QEMUMachine mips_mipssim_machine = {
static QEMUMachine mips_mipssim_machine = {
.name = "mipssim",
.desc = "MIPS MIPSsim platform",
.init = mips_mipssim_init,
};
static void mips_mipssim_machine_init(void)
{
qemu_register_machine(&mips_mipssim_machine);
}
machine_init(mips_mipssim_machine_init);
......@@ -275,8 +275,15 @@ void mips_r4k_init (ram_addr_t ram_size,
i8042_init(i8259[1], i8259[12], 0x60);
}
QEMUMachine mips_machine = {
static QEMUMachine mips_machine = {
.name = "mips",
.desc = "mips r4k platform",
.init = mips_r4k_init,
};
static void mips_machine_init(void)
{
qemu_register_machine(&mips_machine);
}
machine_init(mips_machine_init);
......@@ -1596,12 +1596,19 @@ static void musicpal_init(ram_addr_t ram_size,
arm_load_kernel(env, &musicpal_binfo);
}
QEMUMachine musicpal_machine = {
static QEMUMachine musicpal_machine = {
.name = "musicpal",
.desc = "Marvell 88w8618 / MusicPal (ARM926EJ-S)",
.init = musicpal_init,
};
static void musicpal_machine_init(void)
{
qemu_register_machine(&musicpal_machine);
}
machine_init(musicpal_machine_init);
static void musicpal_register_devices(void)
{
sysbus_register_dev("mv88w8618_pic", sizeof(mv88w8618_pic_state),
......
......@@ -1403,14 +1403,22 @@ static void n810_init(ram_addr_t ram_size,
cpu_model, &n810_binfo, 810);
}
QEMUMachine n800_machine = {
static QEMUMachine n800_machine = {
.name = "n800",
.desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)",
.init = n800_init,
};
QEMUMachine n810_machine = {
static QEMUMachine n810_machine = {
.name = "n810",
.desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)",
.init = n810_init,
};
static void nseries_machine_init(void)
{
qemu_register_machine(&n800_machine);
qemu_register_machine(&n810_machine);
}
machine_init(nseries_machine_init);
......@@ -223,14 +223,22 @@ static void sx1_init_v2(ram_addr_t ram_size,
kernel_cmdline, initrd_filename, cpu_model, 2);
}
QEMUMachine sx1_machine_v2 = {
static QEMUMachine sx1_machine_v2 = {
.name = "sx1",
.desc = "Siemens SX1 (OMAP310) V2",
.init = sx1_init_v2,
};
QEMUMachine sx1_machine_v1 = {
static QEMUMachine sx1_machine_v1 = {
.name = "sx1-v1",
.desc = "Siemens SX1 (OMAP310) V1",
.init = sx1_init_v1,
};
static void sx1_machine_init(void)
{
qemu_register_machine(&sx1_machine_v2);
qemu_register_machine(&sx1_machine_v1);
}
machine_init(sx1_machine_init);
......@@ -275,8 +275,15 @@ static void palmte_init(ram_addr_t ram_size,
dpy_resize(ds);
}
QEMUMachine palmte_machine = {
static QEMUMachine palmte_machine = {
.name = "cheetah",
.desc = "Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
.init = palmte_init,
};
static void palmte_machine_init(void)
{
qemu_register_machine(&palmte_machine);
}
machine_init(palmte_machine_init);
......@@ -1184,16 +1184,24 @@ void cmos_set_s3_resume(void)
rtc_set_memory(rtc_state, 0xF, 0xFE);
}
QEMUMachine pc_machine = {
static QEMUMachine pc_machine = {
.name = "pc",
.desc = "Standard PC",
.init = pc_init_pci,
.max_cpus = 255,
};
QEMUMachine isapc_machine = {
static QEMUMachine isapc_machine = {
.name = "isapc",
.desc = "ISA-only PC",
.init = pc_init_isa,
.max_cpus = 1,
};
static void pc_machine_init(void)
{
qemu_register_machine(&pc_machine);
qemu_register_machine(&isapc_machine);
}
machine_init(pc_machine_init);
......@@ -344,7 +344,7 @@ static void ref405ep_init (ram_addr_t ram_size,
printf("bdloc %016lx\n", (unsigned long)bdloc);
}
QEMUMachine ref405ep_machine = {
static QEMUMachine ref405ep_machine = {
.name = "ref405ep",
.desc = "ref405ep",
.init = ref405ep_init,
......@@ -624,8 +624,16 @@ static void taihu_405ep_init(ram_addr_t ram_size,
#endif
}
QEMUMachine taihu_machine = {
static QEMUMachine taihu_machine = {
.name = "taihu",
.desc = "taihu",
.init = taihu_405ep_init,
};
static void ppc405_machine_init(void)
{
qemu_register_machine(&ref405ep_machine);
qemu_register_machine(&taihu_machine);
}
machine_init(ppc405_machine_init);
......@@ -185,8 +185,15 @@ static void bamboo_init(ram_addr_t ram_size,
kvmppc_init();
}
QEMUMachine bamboo_machine = {
static QEMUMachine bamboo_machine = {
.name = "bamboo",
.desc = "bamboo",
.init = bamboo_init,
};
static void bamboo_machine_init(void)
{
qemu_register_machine(&bamboo_machine);
}
machine_init(bamboo_machine_init);
......@@ -351,9 +351,16 @@ static void ppc_core99_init (ram_addr_t ram_size,
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
}
QEMUMachine core99_machine = {
static QEMUMachine core99_machine = {
.name = "mac99",
.desc = "Mac99 based PowerMAC",
.init = ppc_core99_init,
.max_cpus = MAX_CPUS,
};
static void core99_machine_init(void)
{
qemu_register_machine(&core99_machine);
}
machine_init(core99_machine_init);
......@@ -381,9 +381,16 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
}
QEMUMachine heathrow_machine = {
static QEMUMachine heathrow_machine = {
.name = "g3beige",
.desc = "Heathrow based PowerMAC",
.init = ppc_heathrow_init,
.max_cpus = MAX_CPUS,
};
static void heathrow_machine_init(void)
{
qemu_register_machine(&heathrow_machine);
}
machine_init(heathrow_machine_init);
......@@ -756,9 +756,16 @@ static void ppc_prep_init (ram_addr_t ram_size,
register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
}
QEMUMachine prep_machine = {
static QEMUMachine prep_machine = {
.name = "prep",
.desc = "PowerPC PREP platform",
.init = ppc_prep_init,
.max_cpus = MAX_CPUS,
};
static void prep_machine_init(void)
{
qemu_register_machine(&prep_machine);
}
machine_init(prep_machine_init);
......@@ -281,8 +281,15 @@ static void mpc8544ds_init(ram_addr_t ram_size,
return;
}
QEMUMachine mpc8544ds_machine = {
static QEMUMachine mpc8544ds_machine = {
.name = "mpc8544ds",
.desc = "mpc8544ds",
.init = mpc8544ds_init,
};
static void mpc8544ds_machine_init(void)
{
qemu_register_machine(&mpc8544ds_machine);
}
machine_init(mpc8544ds_machine_init);
......@@ -258,8 +258,15 @@ static void r2d_init(ram_addr_t ram_size,
}
}
QEMUMachine r2d_machine = {
static QEMUMachine r2d_machine = {
.name = "r2d",
.desc = "r2d-plus board",
.init = r2d_init,
};
static void r2d_machine_init(void)
{
qemu_register_machine(&r2d_machine);
}
machine_init(r2d_machine_init);
......@@ -202,3 +202,10 @@ QEMUMachine realview_machine = {
.init = realview_init,
.use_scsi = 1,
};
static void realview_machine_init(void)
{
qemu_register_machine(&realview_machine);
}
machine_init(realview_machine_init);
......@@ -88,8 +88,15 @@ static void shix_init(ram_addr_t ram_size,
fprintf(stderr, "initialization terminated\n");
}
QEMUMachine shix_machine = {
static QEMUMachine shix_machine = {
.name = "shix",
.desc = "shix card",
.init = shix_init,
};
static void shix_machine_init(void)