Skip to content

Commit

Permalink
Use DEFINE_MACHINE() to register all machines
Browse files Browse the repository at this point in the history
Convert all machines to use DEFINE_MACHINE() instead of QEMUMachine
automatically using a script.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
[AF: Style cleanups, convert imx25_pdk machine]
Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
ehabkost authored and afaerber committed Sep 19, 2015
1 parent f309ae8 commit e264d29
Show file tree
Hide file tree
Showing 57 changed files with 517 additions and 772 deletions.
17 changes: 6 additions & 11 deletions hw/alpha/dp264.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,12 @@ static void clipper_init(MachineState *machine)
}
}

static QEMUMachine clipper_machine = {
.name = "clipper",
.desc = "Alpha DP264/CLIPPER",
.init = clipper_init,
.max_cpus = 4,
.is_default = 1,
};

static void clipper_machine_init(void)
static void clipper_machine_init(MachineClass *mc)
{
qemu_register_machine(&clipper_machine);
mc->desc = "Alpha DP264/CLIPPER";
mc->init = clipper_init;
mc->max_cpus = 4;
mc->is_default = 1;
}

machine_init(clipper_machine_init);
DEFINE_MACHINE("clipper", clipper_machine_init)
13 changes: 4 additions & 9 deletions hw/arm/collie.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ static void collie_init(MachineState *machine)
arm_load_kernel(s->cpu, &collie_binfo);
}

static QEMUMachine collie_machine = {
.name = "collie",
.desc = "Collie PDA (SA-1110)",
.init = collie_init,
};

static void collie_machine_init(void)
static void collie_machine_init(MachineClass *mc)
{
qemu_register_machine(&collie_machine);
mc->desc = "Collie PDA (SA-1110)";
mc->init = collie_init;
}

machine_init(collie_machine_init)
DEFINE_MACHINE("collie", collie_machine_init)
14 changes: 4 additions & 10 deletions hw/arm/cubieboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,10 @@ static void cubieboard_init(MachineState *machine)
arm_load_kernel(&s->a10->cpu, &cubieboard_binfo);
}

static QEMUMachine cubieboard_machine = {
.name = "cubieboard",
.desc = "cubietech cubieboard",
.init = cubieboard_init,
};


static void cubieboard_machine_init(void)
static void cubieboard_machine_init(MachineClass *mc)
{
qemu_register_machine(&cubieboard_machine);
mc->desc = "cubietech cubieboard";
mc->init = cubieboard_init;
}

machine_init(cubieboard_machine_init)
DEFINE_MACHINE("cubieboard", cubieboard_machine_init)
13 changes: 4 additions & 9 deletions hw/arm/digic_boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,10 @@ static void canon_a1100_init(MachineState *machine)
digic4_board_init(&digic4_board_canon_a1100);
}

static QEMUMachine canon_a1100 = {
.name = "canon-a1100",
.desc = "Canon PowerShot A1100 IS",
.init = &canon_a1100_init,
};

static void digic_register_machines(void)
static void canon_a1100_machine_init(MachineClass *mc)
{
qemu_register_machine(&canon_a1100);
mc->desc = "Canon PowerShot A1100 IS";
mc->init = &canon_a1100_init;
}

machine_init(digic_register_machines)
DEFINE_MACHINE("canon-a1100", canon_a1100_machine_init)
28 changes: 12 additions & 16 deletions hw/arm/exynos4_boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,20 @@ static void smdkc210_init(MachineState *machine)
arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo);
}

static QEMUMachine exynos4_machine_nuri = {
.name = "nuri",
.desc = "Samsung NURI board (Exynos4210)",
.init = nuri_init,
.max_cpus = EXYNOS4210_NCPUS,
};
static void exynos4_machine_nuri_machine_init(MachineClass *mc)
{
mc->desc = "Samsung NURI board (Exynos4210)";
mc->init = nuri_init;
mc->max_cpus = EXYNOS4210_NCPUS;
}

static QEMUMachine exynos4_machine_smdkc210 = {
.name = "smdkc210",
.desc = "Samsung SMDKC210 board (Exynos4210)",
.init = smdkc210_init,
.max_cpus = EXYNOS4210_NCPUS,
};
DEFINE_MACHINE("nuri", exynos4_machine_nuri_machine_init)

static void exynos4_machine_init(void)
static void exynos4_machine_smdkc210_machine_init(MachineClass *mc)
{
qemu_register_machine(&exynos4_machine_nuri);
qemu_register_machine(&exynos4_machine_smdkc210);
mc->desc = "Samsung SMDKC210 board (Exynos4210)";
mc->init = smdkc210_init;
mc->max_cpus = EXYNOS4210_NCPUS;
}

machine_init(exynos4_machine_init);
DEFINE_MACHINE("smdkc210", exynos4_machine_smdkc210_machine_init)
28 changes: 12 additions & 16 deletions hw/arm/gumstix.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,18 @@ static void verdex_init(MachineState *machine)
qdev_get_gpio_in(cpu->gpio, 99));
}

static QEMUMachine connex_machine = {
.name = "connex",
.desc = "Gumstix Connex (PXA255)",
.init = connex_init,
};

static QEMUMachine verdex_machine = {
.name = "verdex",
.desc = "Gumstix Verdex (PXA270)",
.init = verdex_init,
};

static void gumstix_machine_init(void)
static void connex_machine_init(MachineClass *mc)
{
qemu_register_machine(&connex_machine);
qemu_register_machine(&verdex_machine);
mc->desc = "Gumstix Connex (PXA255)";
mc->init = connex_init;
}

machine_init(gumstix_machine_init);
DEFINE_MACHINE("connex", connex_machine_init)

static void verdex_machine_init(MachineClass *mc)
{
mc->desc = "Gumstix Verdex (PXA270)";
mc->init = verdex_init;
}

DEFINE_MACHINE("verdex", verdex_machine_init)
32 changes: 14 additions & 18 deletions hw/arm/highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,26 +391,22 @@ static void midway_init(MachineState *machine)
calxeda_init(machine, CALXEDA_MIDWAY);
}

static QEMUMachine highbank_machine = {
.name = "highbank",
.desc = "Calxeda Highbank (ECX-1000)",
.init = highbank_init,
.block_default_type = IF_SCSI,
.max_cpus = 4,
};
static void highbank_machine_init(MachineClass *mc)
{
mc->desc = "Calxeda Highbank (ECX-1000)";
mc->init = highbank_init;
mc->block_default_type = IF_SCSI;
mc->max_cpus = 4;
}

static QEMUMachine midway_machine = {
.name = "midway",
.desc = "Calxeda Midway (ECX-2000)",
.init = midway_init,
.block_default_type = IF_SCSI,
.max_cpus = 4,
};
DEFINE_MACHINE("highbank", highbank_machine_init)

static void calxeda_machines_init(void)
static void midway_machine_init(MachineClass *mc)
{
qemu_register_machine(&highbank_machine);
qemu_register_machine(&midway_machine);
mc->desc = "Calxeda Midway (ECX-2000)";
mc->init = midway_init;
mc->block_default_type = IF_SCSI;
mc->max_cpus = 4;
}

machine_init(calxeda_machines_init);
DEFINE_MACHINE("midway", midway_machine_init)
13 changes: 4 additions & 9 deletions hw/arm/imx25_pdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,10 @@ static void imx25_pdk_init(MachineState *machine)
}
}

static QEMUMachine imx25_pdk_machine = {
.name = "imx25_pdk",
.desc = "ARM i.MX25 PDK board (ARM926)",
.init = imx25_pdk_init,
};

static void imx25_pdk_machine_init(void)
static void imx25_pdk_machine_init(MachineClass *mc)
{
qemu_register_machine(&imx25_pdk_machine);
mc->desc = "ARM i.MX25 PDK board (ARM926)";
mc->init = imx25_pdk_init;
}

machine_init(imx25_pdk_machine_init)
DEFINE_MACHINE("imx25_pdk", imx25_pdk_machine_init)
13 changes: 4 additions & 9 deletions hw/arm/integratorcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,18 +619,13 @@ static void integratorcp_init(MachineState *machine)
arm_load_kernel(cpu, &integrator_binfo);
}

static QEMUMachine integratorcp_machine = {
.name = "integratorcp",
.desc = "ARM Integrator/CP (ARM926EJ-S)",
.init = integratorcp_init,
};

static void integratorcp_machine_init(void)
static void integratorcp_machine_init(MachineClass *mc)
{
qemu_register_machine(&integratorcp_machine);
mc->desc = "ARM Integrator/CP (ARM926EJ-S)";
mc->init = integratorcp_init;
}

machine_init(integratorcp_machine_init);
DEFINE_MACHINE("integratorcp", integratorcp_machine_init)

static Property core_properties[] = {
DEFINE_PROP_UINT32("memsz", IntegratorCMState, memsz, 0),
Expand Down
13 changes: 4 additions & 9 deletions hw/arm/kzm.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,10 @@ static void kzm_init(MachineState *machine)
}
}

static QEMUMachine kzm_machine = {
.name = "kzm",
.desc = "ARM KZM Emulation Baseboard (ARM1136)",
.init = kzm_init,
};

static void kzm_machine_init(void)
static void kzm_machine_init(MachineClass *mc)
{
qemu_register_machine(&kzm_machine);
mc->desc = "ARM KZM Emulation Baseboard (ARM1136)";
mc->init = kzm_init;
}

machine_init(kzm_machine_init)
DEFINE_MACHINE("kzm", kzm_machine_init)
13 changes: 4 additions & 9 deletions hw/arm/mainstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,10 @@ static void mainstone_init(MachineState *machine)
mainstone_common_init(get_system_memory(), machine, mainstone, 0x196);
}

static QEMUMachine mainstone2_machine = {
.name = "mainstone",
.desc = "Mainstone II (PXA27x)",
.init = mainstone_init,
};

static void mainstone_machine_init(void)
static void mainstone2_machine_init(MachineClass *mc)
{
qemu_register_machine(&mainstone2_machine);
mc->desc = "Mainstone II (PXA27x)";
mc->init = mainstone_init;
}

machine_init(mainstone_machine_init);
DEFINE_MACHINE("mainstone", mainstone2_machine_init)
13 changes: 4 additions & 9 deletions hw/arm/musicpal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,18 +1709,13 @@ static void musicpal_init(MachineState *machine)
arm_load_kernel(cpu, &musicpal_binfo);
}

static QEMUMachine musicpal_machine = {
.name = "musicpal",
.desc = "Marvell 88w8618 / MusicPal (ARM926EJ-S)",
.init = musicpal_init,
};

static void musicpal_machine_init(void)
static void musicpal_machine_init(MachineClass *mc)
{
qemu_register_machine(&musicpal_machine);
mc->desc = "Marvell 88w8618 / MusicPal (ARM926EJ-S)";
mc->init = musicpal_init;
}

machine_init(musicpal_machine_init);
DEFINE_MACHINE("musicpal", musicpal_machine_init)

static void mv88w8618_wlan_class_init(ObjectClass *klass, void *data)
{
Expand Down
13 changes: 4 additions & 9 deletions hw/arm/netduino2.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,10 @@ static void netduino2_init(MachineState *machine)
}
}

static QEMUMachine netduino2_machine = {
.name = "netduino2",
.desc = "Netduino 2 Machine",
.init = netduino2_init,
};

static void netduino2_machine_init(void)
static void netduino2_machine_init(MachineClass *mc)
{
qemu_register_machine(&netduino2_machine);
mc->desc = "Netduino 2 Machine";
mc->init = netduino2_init;
}

machine_init(netduino2_machine_init);
DEFINE_MACHINE("netduino2", netduino2_machine_init)
28 changes: 12 additions & 16 deletions hw/arm/nseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,24 +1413,20 @@ static void n810_init(MachineState *machine)
n8x0_init(machine, &n810_binfo, 810);
}

static QEMUMachine n800_machine = {
.name = "n800",
.desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)",
.init = n800_init,
.default_boot_order = "",
};
static void n800_machine_init(MachineClass *mc)
{
mc->desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)";
mc->init = n800_init;
mc->default_boot_order = "";
}

static QEMUMachine n810_machine = {
.name = "n810",
.desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)",
.init = n810_init,
.default_boot_order = "",
};
DEFINE_MACHINE("n800", n800_machine_init)

static void nseries_machine_init(void)
static void n810_machine_init(MachineClass *mc)
{
qemu_register_machine(&n800_machine);
qemu_register_machine(&n810_machine);
mc->desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)";
mc->init = n810_init;
mc->default_boot_order = "";
}

machine_init(nseries_machine_init);
DEFINE_MACHINE("n810", n810_machine_init)
24 changes: 10 additions & 14 deletions hw/arm/omap_sx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,18 @@ static void sx1_init_v2(MachineState *machine)
sx1_init(machine, 2);
}

static QEMUMachine sx1_machine_v2 = {
.name = "sx1",
.desc = "Siemens SX1 (OMAP310) V2",
.init = sx1_init_v2,
};
static void sx1_machine_v2_machine_init(MachineClass *mc)
{
mc->desc = "Siemens SX1 (OMAP310) V2";
mc->init = sx1_init_v2;
}

static QEMUMachine sx1_machine_v1 = {
.name = "sx1-v1",
.desc = "Siemens SX1 (OMAP310) V1",
.init = sx1_init_v1,
};
DEFINE_MACHINE("sx1", sx1_machine_v2_machine_init)

static void sx1_machine_init(void)
static void sx1_machine_v1_machine_init(MachineClass *mc)
{
qemu_register_machine(&sx1_machine_v2);
qemu_register_machine(&sx1_machine_v1);
mc->desc = "Siemens SX1 (OMAP310) V1";
mc->init = sx1_init_v1;
}

machine_init(sx1_machine_init);
DEFINE_MACHINE("sx1-v1", sx1_machine_v1_machine_init)
Loading

0 comments on commit e264d29

Please sign in to comment.