summary refs log tree commit diff stats
path: root/bsd-user/main.c
diff options
context:
space:
mode:
authorGavin Shan <gshan@redhat.com>2023-11-15 09:56:03 +1000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-01-05 16:20:14 +0100
commitdfa4753131a77e628e0951bdf294b48c145d3dd6 (patch)
tree684c93d27d6c09b21c0c1c27d2251ee523907b75 /bsd-user/main.c
parent445946f4dd144c40153f112a5285fe23223e71f8 (diff)
downloadfocaccia-qemu-dfa4753131a77e628e0951bdf294b48c145d3dd6.tar.gz
focaccia-qemu-dfa4753131a77e628e0951bdf294b48c145d3dd6.zip
cpu: Add generic cpu_list()
Add generic cpu_list() to replace the individual target's implementation
in the subsequent commits. Currently, there are 3 targets with no cpu_list()
implementation: microblaze and nios2. With this applied, those two targets
switch to the generic cpu_list().

[gshan@gshan q]$ ./build/qemu-system-microblaze -cpu ?
Available CPUs:
  microblaze-cpu

[gshan@gshan q]$ ./build/qemu-system-nios2 -cpu ?
Available CPUs:
  nios2-cpu

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231114235628.534334-7-gshan@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'bsd-user/main.c')
-rw-r--r--bsd-user/main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index e6014f517e..4de226d211 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -378,10 +378,7 @@ int main(int argc, char **argv)
         } else if (!strcmp(r, "cpu")) {
             cpu_model = argv[optind++];
             if (is_help_option(cpu_model)) {
-                /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list)
-                cpu_list();
-#endif
+                list_cpus();
                 exit(1);
             }
         } else if (!strcmp(r, "B")) {