Let xtensa_cpu_list() enumerate CPU classes alphabetically.
Signed-off-by: Andreas Färber<afaer...@suse.de>
---
With this patch applied qemu aborts on unit tests with the following message:
qemu-system-xtensa -M sim -cpu dc232b -nographic -semihosting -kernel
./test_b.tst
**
ERROR:/home/dumb/ws/m/awt/emu/xtensa/qemu/qom/object.c:156:type_get_parent:
assertion failed: (type->parent_type != NULL)
make: *** [run-test_b.tst] Aborted
(gdb) bt
#0 0x00007ffff5f57285 in raise () from /lib64/libc.so.6
#1 0x00007ffff5f58b9b in abort () from /lib64/libc.so.6
#2 0x00007ffff771641d in g_assertion_message () from /lib64/libglib-2.0.so.0
#3 0x00007ffff7716942 in g_assertion_message_expr () from
/lib64/libglib-2.0.so.0
#4 0x000055555565f23e in type_get_parent (type=0x55555625c8b0) at
/home/dumb/ws/m/awt/emu/xtensa/qemu/qom/object.c:156
#5 0x000055555565f4ec in type_initialize (ti=0x55555625c8b0) at
/home/dumb/ws/m/awt/emu/xtensa/qemu/qom/object.c:225
#6 0x00005555556602f4 in object_class_by_name (typename=0x7fffffffdc15 "dc232b") at
/home/dumb/ws/m/awt/emu/xtensa/qemu/qom/object.c:543
#7 0x00005555556dd27b in cpu_xtensa_init (cpu_model=0x7fffffffdc15 "dc232b") at
/home/dumb/ws/m/awt/emu/xtensa/qemu/target-xtensa/helper.c:85
#8 0x0000555555716703 in sim_init (ram_size=134217728, boot_device=0x7fffffffd6d0 "cad", kernel_filename=0x555556256060
"./test_b.tst", kernel_cmdline=0x55555572aeb2 "", initrd_filename=0x0, cpu_model=
0x7fffffffdc15 "dc232b") at
/home/dumb/ws/m/awt/emu/xtensa/qemu/hw/xtensa_sim.c:55
#9 0x00005555557168e5 in xtensa_sim_init (ram_size=134217728, boot_device=0x7fffffffd6d0 "cad",
kernel_filename=0x555556256060 "./test_b.tst", kernel_cmdline=0x55555572aeb2 "", initrd_filename=0x0, cpu_model=
0x7fffffffdc15 "dc232b") at
/home/dumb/ws/m/awt/emu/xtensa/qemu/hw/xtensa_sim.c:102
#10 0x000055555561f0bb in main (argc=9, argv=0x7fffffffd7f8, envp=0x7fffffffd848) at
/home/dumb/ws/m/awt/emu/xtensa/qemu/vl.c:3496
(gdb) frame 4
#4 0x000055555565f23e in type_get_parent (type=0x55555625c8b0) at
/home/dumb/ws/m/awt/emu/xtensa/qemu/qom/object.c:156
156 g_assert(type->parent_type != NULL);
(gdb) p *type
$6 = {name = 0x555556255fa0 "dc232b", class_size = 7848, instance_size = 75232, class_init = 0x5555556b4a6c
<core_class_init>, class_finalize = 0, class_data = 0x0, instance_init = 0, instance_finalize = 0, abstract =
false, parent = 0x555556255fc0 "xtensa-cpu", parent_type = 0x0, class = 0x555556264a90, num_interfaces = 0,
interfaces = {{parent = 0x0, interface_initfn = 0, type = 0x0} <repeats 32 times>}}
--
Thanks.
-- Max