summaryrefslogtreecommitdiffstats
path: root/cpu.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2022-03-14 15:01:08 +0100
committerThomas Huth2022-03-16 08:43:10 +0100
commit377bf6f37da11d14641a0e973c4ed272259cca9c (patch)
treef7c029e8be6f0f884203b16e2dc1cda28f431a03 /cpu.c
parentaccel/tcg: Fix cpu_ldq_be_mmu typo (diff)
downloadqemu-377bf6f37da11d14641a0e973c4ed272259cca9c.tar.gz
qemu-377bf6f37da11d14641a0e973c4ed272259cca9c.tar.xz
qemu-377bf6f37da11d14641a0e973c4ed272259cca9c.zip
softmmu: List CPU types again
Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Move list_cpus() declaration to "exec/cpu-common.h" because this function is not softmmu-specific and can also be used by user-mode, along with moving its implementation to cpu.c, which is compiled per target. Fixes: e0220bb5b2 ("softmmu: Build target-agnostic objects once") Reported-by: Max Filippov <jcmvbkbc@gmail.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220314140108.26222-1-philippe.mathieu.daude@gmail.com> Tested-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cpu.c b/cpu.c
index d564886149..be1f8b074c 100644
--- a/cpu.c
+++ b/cpu.c
@@ -35,6 +35,7 @@
#include "sysemu/tcg.h"
#include "sysemu/kvm.h"
#include "sysemu/replay.h"
+#include "exec/cpu-common.h"
#include "exec/exec-all.h"
#include "exec/translate-all.h"
#include "exec/log.h"
@@ -266,6 +267,14 @@ const char *parse_cpu_option(const char *cpu_option)
return cpu_type;
}
+void list_cpus(const char *optarg)
+{
+ /* XXX: implement xxx_cpu_list for targets that still miss it */
+#if defined(cpu_list)
+ cpu_list();
+#endif
+}
+
#if defined(CONFIG_USER_ONLY)
void tb_invalidate_phys_addr(target_ulong addr)
{