hw/core/generic-loader: Compile only once, not for each target
authorThomas Huth <thuth@redhat.com>
Fri, 5 Oct 2018 12:53:38 +0000 (14:53 +0200)
committerThomas Huth <thuth@redhat.com>
Wed, 17 Oct 2018 06:45:37 +0000 (08:45 +0200)
The generic-loader is currently compiled target specific due to one
single "#ifdef TARGET_WORDS_BIGENDIAN" in the file. We have already a
function called target_words_bigendian() for this instead, so we can
put the generic-loader into common-obj to save some compilation time.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/core/Makefile.objs
hw/core/generic-loader.c

index eb88ca979e4cfc9b1fd238a6f3e6fae9c9e29b21..b736ce223a6b5d41650318348ec7f9391ae125f0 100644 (file)
@@ -20,6 +20,6 @@ common-obj-$(CONFIG_SOFTMMU) += register.o
 common-obj-$(CONFIG_SOFTMMU) += or-irq.o
 common-obj-$(CONFIG_SOFTMMU) += split-irq.o
 common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o
+common-obj-$(CONFIG_SOFTMMU) += generic-loader.o
 
-obj-$(CONFIG_SOFTMMU) += generic-loader.o
 obj-$(CONFIG_SOFTMMU) += null-machine.o
index be29ae12b82bce4afd05e3f5159c99c21b884d12..fbae05fb3b6474a59ef8320f930b857cb15d962f 100644 (file)
@@ -130,11 +130,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
         s->cpu = first_cpu;
     }
 
-#ifdef TARGET_WORDS_BIGENDIAN
-    big_endian = 1;
-#else
-    big_endian = 0;
-#endif
+    big_endian = target_words_bigendian();
 
     if (s->file) {
         AddressSpace *as = s->cpu ? s->cpu->as :  NULL;