blob: 24f9a039485043bed0e300e6890601f82df9f1b8 [file] [log] [blame]
Andrew Geissleraaf90cd2021-02-12 15:29:51 -06001# possible arch values are:
2# aarch64 arm armeb alpha cris i386 x86_64 m68k microblaze
3# mips mipsel mips64 mips64el ppc ppc64 ppc64abi32 ppcemb
4# riscv32 riscv64 sparc sparc32 sparc32plus
5
6def get_qemu_target_list(d):
7 import bb
8 archs = d.getVar('QEMU_TARGETS').split()
9 tos = d.getVar('HOST_OS')
10 softmmuonly = ""
11 for arch in ['ppcemb', 'lm32']:
12 if arch in archs:
13 softmmuonly += arch + "-softmmu,"
14 archs.remove(arch)
15 linuxuseronly = ""
16 for arch in ['armeb', 'alpha', 'ppc64abi32', 'ppc64le', 'sparc32plus', 'aarch64_be']:
17 if arch in archs:
18 linuxuseronly += arch + "-linux-user,"
19 archs.remove(arch)
20 if 'linux' not in tos:
21 return softmmuonly + ''.join([arch + "-softmmu" + "," for arch in archs]).rstrip(',')
22 return softmmuonly + linuxuseronly + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
23
24def get_qemu_usermode_target_list(d):
25 return ",".join(filter(lambda i: "-linux-user" in i, get_qemu_target_list(d).split(',')))
26
27def get_qemu_system_target_list(d):
28 return ",".join(filter(lambda i: "-linux-user" not in i, get_qemu_target_list(d).split(',')))