Convert machine registration to use module init functions

This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2009-05-20 18:38:09 -05:00
parent f92f8afebe
commit f80f9ec9a6
45 changed files with 321 additions and 263 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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),

View File

@ -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);

View File

@ -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);

View File

@ -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);

12
hw/pc.c
View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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)
{
qemu_register_machine(&shix_machine);
}
machine_init(shix_machine_init);

View File

@ -1050,24 +1050,34 @@ QEMUMachine akitapda_machine = {
.init = akita_init,
};
QEMUMachine spitzpda_machine = {
static QEMUMachine spitzpda_machine = {
.name = "spitz",
.desc = "Spitz PDA (PXA270)",
.init = spitz_init,
};
QEMUMachine borzoipda_machine = {
static QEMUMachine borzoipda_machine = {
.name = "borzoi",
.desc = "Borzoi PDA (PXA270)",
.init = borzoi_init,
};
QEMUMachine terrierpda_machine = {
static QEMUMachine terrierpda_machine = {
.name = "terrier",
.desc = "Terrier PDA (PXA270)",
.init = terrier_init,
};
static void spitz_machine_init(void)
{
qemu_register_machine(&akitapda_machine);
qemu_register_machine(&spitzpda_machine);
qemu_register_machine(&borzoipda_machine);
qemu_register_machine(&terrierpda_machine);
}
machine_init(spitz_machine_init);
static SSISlaveInfo corgi_ssp_info = {
.init = corgi_ssp_init,
.transfer = corgi_ssp_transfer

View File

@ -1396,18 +1396,26 @@ static void lm3s6965evb_init(ram_addr_t ram_size,
stellaris_init(kernel_filename, cpu_model, &stellaris_boards[1]);
}
QEMUMachine lm3s811evb_machine = {
static QEMUMachine lm3s811evb_machine = {
.name = "lm3s811evb",
.desc = "Stellaris LM3S811EVB",
.init = lm3s811evb_init,
};
QEMUMachine lm3s6965evb_machine = {
static QEMUMachine lm3s6965evb_machine = {
.name = "lm3s6965evb",
.desc = "Stellaris LM3S6965EVB",
.init = lm3s6965evb_init,
};
static void stellaris_machine_init(void)
{
qemu_register_machine(&lm3s811evb_machine);
qemu_register_machine(&lm3s6965evb_machine);
}
machine_init(stellaris_machine_init);
static SSISlaveInfo stellaris_ssi_bus_info = {
.init = stellaris_ssi_bus_init,
.transfer = stellaris_ssi_bus_transfer

View File

@ -1032,14 +1032,14 @@ static void sbook_init(ram_addr_t RAM_size,
kernel_cmdline, initrd_filename, cpu_model);
}
QEMUMachine ss5_machine = {
static QEMUMachine ss5_machine = {
.name = "SS-5",
.desc = "Sun4m platform, SPARCstation 5",
.init = ss5_init,
.use_scsi = 1,
};
QEMUMachine ss10_machine = {
static QEMUMachine ss10_machine = {
.name = "SS-10",
.desc = "Sun4m platform, SPARCstation 10",
.init = ss10_init,
@ -1047,7 +1047,7 @@ QEMUMachine ss10_machine = {
.max_cpus = 4,
};
QEMUMachine ss600mp_machine = {
static QEMUMachine ss600mp_machine = {
.name = "SS-600MP",
.desc = "Sun4m platform, SPARCserver 600MP",
.init = ss600mp_init,
@ -1055,7 +1055,7 @@ QEMUMachine ss600mp_machine = {
.max_cpus = 4,
};
QEMUMachine ss20_machine = {
static QEMUMachine ss20_machine = {
.name = "SS-20",
.desc = "Sun4m platform, SPARCstation 20",
.init = ss20_init,
@ -1063,35 +1063,35 @@ QEMUMachine ss20_machine = {
.max_cpus = 4,
};
QEMUMachine voyager_machine = {
static QEMUMachine voyager_machine = {
.name = "Voyager",
.desc = "Sun4m platform, SPARCstation Voyager",
.init = vger_init,
.use_scsi = 1,
};
QEMUMachine ss_lx_machine = {
static QEMUMachine ss_lx_machine = {
.name = "LX",
.desc = "Sun4m platform, SPARCstation LX",
.init = ss_lx_init,
.use_scsi = 1,
};
QEMUMachine ss4_machine = {
static QEMUMachine ss4_machine = {
.name = "SS-4",
.desc = "Sun4m platform, SPARCstation 4",
.init = ss4_init,
.use_scsi = 1,
};
QEMUMachine scls_machine = {
static QEMUMachine scls_machine = {
.name = "SPARCClassic",
.desc = "Sun4m platform, SPARCClassic",
.init = scls_init,
.use_scsi = 1,
};
QEMUMachine sbook_machine = {
static QEMUMachine sbook_machine = {
.name = "SPARCbook",
.desc = "Sun4m platform, SPARCbook",
.init = sbook_init,
@ -1335,7 +1335,7 @@ static void ss2000_init(ram_addr_t RAM_size,
kernel_cmdline, initrd_filename, cpu_model);
}
QEMUMachine ss1000_machine = {
static QEMUMachine ss1000_machine = {
.name = "SS-1000",
.desc = "Sun4d platform, SPARCserver 1000",
.init = ss1000_init,
@ -1343,7 +1343,7 @@ QEMUMachine ss1000_machine = {
.max_cpus = 8,
};
QEMUMachine ss2000_machine = {
static QEMUMachine ss2000_machine = {
.name = "SS-2000",
.desc = "Sun4d platform, SPARCcenter 2000",
.init = ss2000_init,
@ -1543,9 +1543,27 @@ static void ss2_init(ram_addr_t RAM_size,
kernel_cmdline, initrd_filename, cpu_model);
}
QEMUMachine ss2_machine = {
static QEMUMachine ss2_machine = {
.name = "SS-2",
.desc = "Sun4c platform, SPARCstation 2",
.init = ss2_init,
.use_scsi = 1,
};
static void ss2_machine_init(void)
{
qemu_register_machine(&ss5_machine);
qemu_register_machine(&ss10_machine);
qemu_register_machine(&ss600mp_machine);
qemu_register_machine(&ss20_machine);
qemu_register_machine(&voyager_machine);
qemu_register_machine(&ss_lx_machine);
qemu_register_machine(&ss4_machine);
qemu_register_machine(&scls_machine);
qemu_register_machine(&sbook_machine);
qemu_register_machine(&ss1000_machine);
qemu_register_machine(&ss2000_machine);
qemu_register_machine(&ss2_machine);
}
machine_init(ss2_machine_init);

View File

@ -589,23 +589,32 @@ static void niagara_init(ram_addr_t RAM_size,
kernel_cmdline, initrd_filename, cpu_model, &hwdefs[2]);
}
QEMUMachine sun4u_machine = {
static QEMUMachine sun4u_machine = {
.name = "sun4u",
.desc = "Sun4u platform",
.init = sun4u_init,
.max_cpus = 1, // XXX for now
};
QEMUMachine sun4v_machine = {
static QEMUMachine sun4v_machine = {
.name = "sun4v",
.desc = "Sun4v platform",
.init = sun4v_init,
.max_cpus = 1, // XXX for now
};
QEMUMachine niagara_machine = {
static QEMUMachine niagara_machine = {
.name = "Niagara",
.desc = "Sun4v platform, Niagara",
.init = niagara_init,
.max_cpus = 1, // XXX for now
};
static void sun4u_machine_init(void)
{
qemu_register_machine(&sun4u_machine);
qemu_register_machine(&sun4v_machine);
qemu_register_machine(&niagara_machine);
}
machine_init(sun4u_machine_init);

View File

@ -98,8 +98,15 @@ static void syborg_init(ram_addr_t ram_size,
arm_load_kernel(env, &syborg_binfo);
}
QEMUMachine syborg_machine = {
static QEMUMachine syborg_machine = {
.name = "syborg",
.desc = "Syborg (Symbian Virtual Platform)",
.init = syborg_init,
};
static void syborg_machine_init(void)
{
qemu_register_machine(&syborg_machine);
}
machine_init(syborg_machine_init);

View File

@ -238,12 +238,19 @@ static void tosa_init(ram_addr_t ram_size,
sl_bootparam_write(SL_PXA_PARAM_BASE);
}
QEMUMachine tosapda_machine = {
static QEMUMachine tosapda_machine = {
.name = "tosa",
.desc = "Tosa PDA (PXA255)",
.init = tosa_init,
};
static void tosapda_machine_init(void)
{
qemu_register_machine(&tosapda_machine);
}
machine_init(tosapda_machine_init);
static I2CSlaveInfo tosa_dac_info = {
.init = tosa_dac_init,
.event = tosa_dac_event,

View File

@ -309,20 +309,28 @@ static void vab_init(ram_addr_t ram_size,
initrd_filename, cpu_model, 0x25e);
}
QEMUMachine versatilepb_machine = {
static QEMUMachine versatilepb_machine = {
.name = "versatilepb",
.desc = "ARM Versatile/PB (ARM926EJ-S)",
.init = vpb_init,
.use_scsi = 1,
};
QEMUMachine versatileab_machine = {
static QEMUMachine versatileab_machine = {
.name = "versatileab",
.desc = "ARM Versatile/AB (ARM926EJ-S)",
.init = vab_init,
.use_scsi = 1,
};
static void versatile_machine_init(void)
{
qemu_register_machine(&versatilepb_machine);
qemu_register_machine(&versatileab_machine);
}
machine_init(versatile_machine_init);
static void versatilepb_register_devices(void)
{
sysbus_register_dev("versatilepb_sic", sizeof(vpb_sic_state),

View File

@ -110,9 +110,16 @@ static void xen_init_pv(ram_addr_t ram_size, int vga_ram_size,
xen_init_display(xen_domid);
}
QEMUMachine xenpv_machine = {
static QEMUMachine xenpv_machine = {
.name = "xenpv",
.desc = "Xen Para-virtualized PC",
.init = xen_init_pv,
.max_cpus = 1,
};
static void xenpv_machine_init(void)
{
qemu_register_machine(&xenpv_machine);
}
machine_init(xenpv_machine_init);

View File

@ -23,11 +23,13 @@ static void __attribute__((constructor)) do_qemu_init_ ## function(void) { \
typedef enum {
MODULE_INIT_BLOCK,
MODULE_INIT_DEVICE,
MODULE_INIT_MACHINE,
MODULE_INIT_MAX
} module_init_type;
#define block_init(function) module_init(function, MODULE_INIT_BLOCK)
#define device_init(function) module_init(function, MODULE_INIT_DEVICE)
#define machine_init(function) module_init(function, MODULE_INIT_MACHINE)
void register_module_init(void (*fn)(void), module_init_type type);

View File

@ -1,31 +1,6 @@
#include "hw/hw.h"
#include "hw/boards.h"
void register_machines(void)
{
qemu_register_machine(&integratorcp_machine);
qemu_register_machine(&versatilepb_machine);
qemu_register_machine(&versatileab_machine);
qemu_register_machine(&realview_machine);
qemu_register_machine(&akitapda_machine);
qemu_register_machine(&spitzpda_machine);
qemu_register_machine(&borzoipda_machine);
qemu_register_machine(&terrierpda_machine);
qemu_register_machine(&sx1_machine_v1);
qemu_register_machine(&sx1_machine_v2);
qemu_register_machine(&palmte_machine);
qemu_register_machine(&n800_machine);
qemu_register_machine(&n810_machine);
qemu_register_machine(&lm3s811evb_machine);
qemu_register_machine(&lm3s6965evb_machine);
qemu_register_machine(&connex_machine);
qemu_register_machine(&verdex_machine);
qemu_register_machine(&mainstone2_machine);
qemu_register_machine(&musicpal_machine);
qemu_register_machine(&tosapda_machine);
qemu_register_machine(&syborg_machine);
}
void cpu_save(QEMUFile *f, void *opaque)
{
int i;

View File

@ -1,12 +1,6 @@
#include "hw/hw.h"
#include "hw/boards.h"
void register_machines(void)
{
qemu_register_machine(&bareetraxfs_machine);
qemu_register_machine(&axisdev88_machine);
}
void cpu_save(QEMUFile *f, void *opaque)
{
CPUCRISState *env = opaque;

View File

@ -5,15 +5,6 @@
#include "exec-all.h"
void register_machines(void)
{
qemu_register_machine(&pc_machine);
qemu_register_machine(&isapc_machine);
#ifdef CONFIG_XEN
qemu_register_machine(&xenpv_machine);
#endif
}
static void cpu_put_seg(QEMUFile *f, SegmentCache *dt)
{
qemu_put_be32(f, dt->selector);

View File

@ -1,9 +0,0 @@
#include "hw/hw.h"
#include "hw/boards.h"
void register_machines(void)
{
qemu_register_machine(&mcf5208evb_machine);
qemu_register_machine(&an5206_machine);
qemu_register_machine(&dummy_m68k_machine);
}

View File

@ -3,15 +3,6 @@
#include "exec-all.h"
void register_machines(void)
{
qemu_register_machine(&mips_malta_machine);
qemu_register_machine(&mips_magnum_machine);
qemu_register_machine(&mips_pica61_machine);
qemu_register_machine(&mips_mipssim_machine);
qemu_register_machine(&mips_machine);
}
static void save_tc(QEMUFile *f, TCState *tc)
{
int i;

View File

@ -1,17 +1,6 @@
#include "hw/hw.h"
#include "hw/boards.h"
void register_machines(void)
{
qemu_register_machine(&heathrow_machine);
qemu_register_machine(&core99_machine);
qemu_register_machine(&prep_machine);
qemu_register_machine(&ref405ep_machine);
qemu_register_machine(&taihu_machine);
qemu_register_machine(&bamboo_machine);
qemu_register_machine(&mpc8544ds_machine);
}
void cpu_save(QEMUFile *f, void *opaque)
{
CPUState *env = (CPUState *)opaque;

View File

@ -1,8 +0,0 @@
#include "hw/hw.h"
#include "hw/boards.h"
void register_machines(void)
{
qemu_register_machine(&shix_machine);
qemu_register_machine(&r2d_machine);
}

View File

@ -4,28 +4,6 @@
#include "exec-all.h"
void register_machines(void)
{
#ifdef TARGET_SPARC64
qemu_register_machine(&sun4u_machine);
qemu_register_machine(&sun4v_machine);
qemu_register_machine(&niagara_machine);
#else
qemu_register_machine(&ss5_machine);
qemu_register_machine(&ss10_machine);
qemu_register_machine(&ss600mp_machine);
qemu_register_machine(&ss20_machine);
qemu_register_machine(&ss2_machine);
qemu_register_machine(&voyager_machine);
qemu_register_machine(&ss_lx_machine);
qemu_register_machine(&ss4_machine);
qemu_register_machine(&scls_machine);
qemu_register_machine(&sbook_machine);
qemu_register_machine(&ss1000_machine);
qemu_register_machine(&ss2000_machine);
#endif
}
void cpu_save(QEMUFile *f, void *opaque)
{
CPUState *env = opaque;

2
vl.c
View File

@ -4876,7 +4876,7 @@ int main(int argc, char **argv, char **envp)
}
#endif
register_machines();
module_call_init(MODULE_INIT_MACHINE);
machine = first_machine;
cpu_model = NULL;
initrd_filename = NULL;