blob: 8184ef5781f58c2a1137fccc13a068f2d1b3fa31 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001# 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
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
6def get_qemu_target_list(d):
7 import bb
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008 archs = d.getVar('QEMU_TARGETS').split()
9 tos = d.getVar('HOST_OS')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010 softmmuonly = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011 for arch in ['ppcemb', 'lm32']:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012 if arch in archs:
13 softmmuonly += arch + "-softmmu,"
14 archs.remove(arch)
15 linuxuseronly = ""
Brad Bishopc68388fc2019-08-26 01:33:31 -040016 for arch in ['armeb', 'alpha', 'ppc64abi32', 'sparc32plus', 'aarch64_be']:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017 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
Brad Bishop19323692019-04-05 15:28:33 -040024def 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(',')))