@samitouri / QOSamiQemu / commits / 72a7238f3e

target/avr: Avoid target-specific migration headers in machine.c

machine.c doesn't use any target-specific macro defined by the "migration/cpu.h" header. Use the minimum headers required: "migration/qemu-file-types.h" and "migration/vmstate.h", which are not target-specific. This allows to build this file as common object. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20260325211728.89204-2-philmd@linaro.org>

Philippe Mathieu-Daudé committed Feb 7, 2024 at 21:45 UTC 72a7238f3e9b1de618024b44a9f465758606f1ff
2 files changed +3 -3
target/avr/machine.c
+2 -1
@@ -20,7 +20,8 @@
20
21 #include "qemu/osdep.h"
22 #include "cpu.h"
23 -#include "migration/cpu.h"
23 +#include "migration/qemu-file-types.h"
24 +#include "migration/vmstate.h"
25
26 static int get_sreg(QEMUFile *f, void *opaque, size_t size,
27 const VMStateField *field)
target/avr/meson.build
+1 -2
@@ -15,8 +15,7 @@ avr_ss.add(files(
15
16 avr_common_system_ss = ss.source_set()
17 avr_common_system_ss.add(files('gdbstub.c'))
18 -
19 -avr_system_ss.add(files('machine.c'))
18 +avr_common_system_ss.add(files('machine.c'))
19
20 target_arch += {'avr': avr_ss}
21 target_system_arch += {'avr': avr_system_ss}