diff options
| author | Daniel P. Berrangé <berrange@redhat.com> | 2024-06-20 17:57:34 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-07-02 06:58:21 +0200 |
| commit | a0220c65c4037349031ca8ff3f50e312b9bb9286 (patch) | |
| tree | 39ee14b8c32f714251cb7b7b21dfe5c7bbfd9a48 /include/hw/i386/pc.h | |
| parent | 1d32d1d136c8bbc5a3e1760220a8585eeaea0287 (diff) | |
| download | focaccia-qemu-a0220c65c4037349031ca8ff3f50e312b9bb9286.tar.gz focaccia-qemu-a0220c65c4037349031ca8ff3f50e312b9bb9286.zip | |
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>
Diffstat (limited to 'include/hw/i386/pc.h')
| -rw-r--r-- | include/hw/i386/pc.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 46bc411063..027c6f29f7 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -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 |