[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 20/21] softmmu: Add qemu_init_arch_modules()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 20/21] softmmu: Add qemu_init_arch_modules() |
Date: |
Mon, 7 Feb 2022 08:54:25 +0100 |
module_allow_arch() is the single target-specific call in the
whole vl.c file. Move the module initialization out to arch_init.c,
that way we'll be able to build vl.o once for all targets (the
next commit).
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/sysemu/arch_init.h | 2 ++
softmmu/arch_init.c | 9 +++++++++
softmmu/vl.c | 5 +----
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 70c579560a..79c2591425 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -28,4 +28,6 @@ enum {
extern const uint32_t arch_type;
+void qemu_init_arch_modules(void);
+
#endif
diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c
index 8919405c7b..79716f959b 100644
--- a/softmmu/arch_init.c
+++ b/softmmu/arch_init.c
@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
+#include "qemu/module.h"
#include "sysemu/arch_init.h"
#ifdef TARGET_SPARC
@@ -39,3 +40,11 @@ int graphic_depth = 32;
#endif
const uint32_t arch_type = QEMU_ARCH;
+
+void qemu_init_arch_modules(void)
+{
+#ifdef CONFIG_MODULES
+ module_init_info(qemu_modinfo);
+ module_allow_arch(TARGET_NAME);
+#endif
+}
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 5e1b35ba48..08ff97f4e0 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2814,10 +2814,7 @@ void qemu_init(int argc, char **argv, char **envp)
error_init(argv[0]);
qemu_init_exec_dir(argv[0]);
-#ifdef CONFIG_MODULES
- module_init_info(qemu_modinfo);
- module_allow_arch(TARGET_NAME);
-#endif
+ qemu_init_arch_modules();
qemu_init_subsystems();
--
2.34.1
- [PATCH v3 04/21] exec: Make cpu_memory_rw_debug() target agnostic, (continued)
- [PATCH v3 04/21] exec: Make cpu_memory_rw_debug() target agnostic, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 02/21] accel/meson: Only build hw virtualization with system emulation, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 07/21] accel/kvm: Simplify user-mode #ifdef'ry, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 08/21] accel/hax: Introduce CONFIG_HAX_IS_POSSIBLE, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 10/21] accel: Introduce AccelOpsClass::cpu_thread_is_idle(), Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 15/21] softmmu/cpu-timers: Remove unused 'exec/exec-all.h' header, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 21/21] softmmu: Build target-agnostic objects once, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 13/21] softmmu/runstate: Clean headers, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 16/21] misc: Remove unnecessary "sysemu/cpu-timers.h" include, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 17/21] misc: Add missing "sysemu/cpu-timers.h" include, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 20/21] softmmu: Add qemu_init_arch_modules(),
Philippe Mathieu-Daudé <=
- [PATCH v3 09/21] softmmu/cpus: Code movement, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 18/21] exec/gdbstub: Make gdb_exit() / gdb_set_stop_cpu() target agnostic, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 05/21] sysemu/memory_mapping: Become target-agnostic, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 14/21] softmmu/physmem: Remove unnecessary include, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 12/21] softmmu/globals: Remove unused 'hw/i386/*' headers, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 19/21] exec/cpu: Make address_space_init/reloading_memory_map target agnostic, Philippe Mathieu-Daudé, 2022/02/07
- [PATCH v3 11/21] accel: Introduce AccelOpsClass::cpus_are_resettable(), Philippe Mathieu-Daudé, 2022/02/07