Skip to content

Commit

Permalink
softmmu: Add qemu_init_arch_modules()
Browse files Browse the repository at this point in the history
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>
Message-Id: <20220207075426.81934-21-f4bug@amsat.org>
  • Loading branch information
philmd committed Mar 6, 2022
1 parent 1f649fe commit c80cafa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions include/sysemu/arch_init.h
Expand Up @@ -28,4 +28,6 @@ enum {

extern const uint32_t arch_type;

void qemu_init_arch_modules(void);

#endif
9 changes: 9 additions & 0 deletions softmmu/arch_init.c
Expand Up @@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include "qemu/module.h"
#include "sysemu/arch_init.h"

#ifdef TARGET_SPARC
Expand All @@ -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
}
5 changes: 1 addition & 4 deletions softmmu/vl.c
Expand Up @@ -2815,10 +2815,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();

Expand Down

0 comments on commit c80cafa

Please sign in to comment.