mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/i386: convert 'i440fx' machine definitions to use new macros
This changes the DEFINE_I440FX_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number thrice in three different formats in the calls to DEFINE_I440FX_MACHINE. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240620165742.1711389-7-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
1d32d1d136
commit
a0220c65c4
2 changed files with 122 additions and 123 deletions
|
@ -317,4 +317,30 @@ extern const size_t pc_compat_2_3_len;
|
|||
} \
|
||||
type_init(pc_machine_init_##suffix)
|
||||
|
||||
#define DEFINE_PC_VER_MACHINE(namesym, namestr, initfn, ...) \
|
||||
static void MACHINE_VER_SYM(init, namesym, __VA_ARGS__)( \
|
||||
MachineState *machine) \
|
||||
{ \
|
||||
initfn(machine); \
|
||||
} \
|
||||
static void MACHINE_VER_SYM(class_init, namesym, __VA_ARGS__)( \
|
||||
ObjectClass *oc, \
|
||||
void *data) \
|
||||
{ \
|
||||
MachineClass *mc = MACHINE_CLASS(oc); \
|
||||
MACHINE_VER_SYM(options, namesym, __VA_ARGS__)(mc); \
|
||||
mc->init = MACHINE_VER_SYM(init, namesym, __VA_ARGS__); \
|
||||
} \
|
||||
static const TypeInfo MACHINE_VER_SYM(info, namesym, __VA_ARGS__) = \
|
||||
{ \
|
||||
.name = MACHINE_VER_TYPE_NAME(namestr, __VA_ARGS__), \
|
||||
.parent = TYPE_PC_MACHINE, \
|
||||
.class_init = MACHINE_VER_SYM(class_init, namesym, __VA_ARGS__), \
|
||||
}; \
|
||||
static void MACHINE_VER_SYM(register, namesym, __VA_ARGS__)(void) \
|
||||
{ \
|
||||
type_register(&MACHINE_VER_SYM(info, namesym, __VA_ARGS__)); \
|
||||
} \
|
||||
type_init(MACHINE_VER_SYM(register, namesym, __VA_ARGS__));
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue