mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 05:45:36 +00:00
Revert use of DEFINE_MACHINE() for registrations of multiple machines
The script used for converting from QEMUMachine had used one DEFINE_MACHINE() per machine registered. In cases where multiple machines are registered from one source file, avoid the excessive generation of module init functions by reverting this unrolling. Backports commit 8a661aea0e7f6e776c6ebc9abe339a85b34fea1d from qemu
This commit is contained in:
parent
a7f59d7771
commit
048aaf05ca
|
@ -51,12 +51,34 @@ static int sun4u_init(struct uc_struct *uc, MachineState *machine)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sun4u_machine_init(struct uc_struct *uc, MachineClass *mc)
|
static void sun4u_class_init(struct uc_struct *uc, ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
|
MachineClass *mc = MACHINE_CLASS(uc, oc);
|
||||||
|
|
||||||
mc->init = sun4u_init;
|
mc->init = sun4u_init;
|
||||||
mc->max_cpus = 1; /* XXX for now */
|
mc->max_cpus = 1; /* XXX for now */
|
||||||
mc->is_default = 1;
|
mc->is_default = 1;
|
||||||
mc->arch = UC_ARCH_SPARC;
|
mc->arch = UC_ARCH_SPARC;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_MACHINE("sun4u", sun4u_machine_init)
|
static const TypeInfo sun4u_type = {
|
||||||
|
MACHINE_TYPE_NAME("sun4u"),
|
||||||
|
TYPE_MACHINE,
|
||||||
|
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
|
||||||
|
NULL,
|
||||||
|
|
||||||
|
sun4u_class_init,
|
||||||
|
};
|
||||||
|
|
||||||
|
void sun4u_machine_init(struct uc_struct *uc)
|
||||||
|
{
|
||||||
|
type_register_static(uc, &sun4u_type);
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
void sparc_cpu_register_types(void *opaque);
|
void sparc_cpu_register_types(void *opaque);
|
||||||
void leon3_generic_machine_init_register_types(struct uc_struct *uc);
|
void leon3_generic_machine_init_register_types(struct uc_struct *uc);
|
||||||
void sun4u_machine_init_register_types(struct uc_struct *uc);
|
void sun4u_machine_init(struct uc_struct *uc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -110,7 +110,7 @@ void sparc64_uc_init(struct uc_struct* uc)
|
||||||
{
|
{
|
||||||
register_accel_types(uc);
|
register_accel_types(uc);
|
||||||
sparc_cpu_register_types(uc);
|
sparc_cpu_register_types(uc);
|
||||||
sun4u_machine_init_register_types(uc);
|
sun4u_machine_init(uc);
|
||||||
uc->reg_read = sparc_reg_read;
|
uc->reg_read = sparc_reg_read;
|
||||||
uc->reg_write = sparc_reg_write;
|
uc->reg_write = sparc_reg_write;
|
||||||
uc->reg_reset = sparc_reg_reset;
|
uc->reg_reset = sparc_reg_reset;
|
||||||
|
|
Loading…
Reference in a new issue