Skip to contentSkip to conversation

hw/core: Move null-machine into the common-obj list

PATCH In review Thomas Huth 2 participants 2 messages Oct 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/core: Move null-machine into the common-obj list

The null-machine code used to be target specific since it used the target-specific cpu_init() function in the past. But in the recent commit 2278b93941d42c30e2950 ("Use cpu_create(type) instead of cpu_init(cpu_model)") this has been change, so that the code now uses the common cpu_create() function instead. Thus we can put the null-machine into the common-obj list so that it is compiled only once for all targets, to save some compilation time.

---
 hw/core/Makefile.objs  | 3 +--
 hw/core/null-machine.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
hw/core/Makefile.objs +1 -2
index b736ce2..a799c83 100644
@@ -21,5 +21,4 @@ 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) += null-machine.o
+common-obj-$(CONFIG_SOFTMMU) += null-machine.o
hw/core/null-machine.c +1 -1
index cde4d3e..76d3f8e 100644
@@ -18,7 +18,7 @@
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
-#include "cpu.h"
+#include "qom/cpu.h"
 
 static void machine_none_init(MachineState *mch)
 {
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Thomas Huth

The null-machine code used to be target specific since it used the target-specific cpu_init() function in the past. But in the recent commit 2278b93941d42c30e2950 ("Use cpu_create(type) instead of cpu_init(cpu_model)") this has been change, so that the code now uses the common cpu_create() function instead. Thus we can put the null-machine into the common-obj list so that it is compiled only once for all targets, to save some compilation time.

Quoted 30 lines
---
 hw/core/Makefile.objs  | 3 +--
 hw/core/null-machine.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
hw/core/Makefile.objs +1 -2
index b736ce2..a799c83 100644
@@ -21,5 +21,4 @@ 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) += null-machine.o
+common-obj-$(CONFIG_SOFTMMU) += null-machine.o
hw/core/null-machine.c +1 -1
index cde4d3e..76d3f8e 100644
@@ -18,7 +18,7 @@
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
-#include "cpu.h"
+#include "qom/cpu.h"
 
 static void machine_none_init(MachineState *mch)
 {