1s390x_ss = ss.source_set() 2s390x_ss.add(files( 3 'cpu.c', 4 'cpu_features.c', 5 'cpu_models.c', 6 'gdbstub.c', 7 'interrupt.c', 8 'cpu-dump.c', 9)) 10 11s390x_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) 12 13gen_features = executable('gen-features', 'gen-features.c', native: true, 14 build_by_default: false) 15 16gen_features_h = custom_target('gen-features.h', 17 output: 'gen-features.h', 18 capture: true, 19 command: gen_features) 20 21s390x_ss.add(gen_features_h) 22 23s390x_softmmu_ss = ss.source_set() 24s390x_softmmu_ss.add(files( 25 'helper.c', 26 'arch_dump.c', 27 'diag.c', 28 'ioinst.c', 29 'machine.c', 30 'mmu_helper.c', 31 'sigp.c', 32 'cpu-sysemu.c', 33)) 34 35# Newer kernels on s390 check for an S390_PGSTE program header and 36# enable the pgste page table extensions in that case. This makes 37# the vm.allocate_pgste sysctl unnecessary. We enable this program 38# header if 39# - we build on s390x 40# - we build the system emulation for s390x (qemu-system-s390x) 41# - KVM is enabled 42# - the linker supports --s390-pgste 43if host_machine.cpu_family() == 's390x' and cc.has_link_argument('-Wl,--s390-pgste') 44 s390x_softmmu_ss.add(when: 'CONFIG_KVM', 45 if_true: declare_dependency(link_args: ['-Wl,--s390-pgste'])) 46endif 47 48s390x_user_ss = ss.source_set() 49 50subdir('tcg') 51 52target_arch += {'s390x': s390x_ss} 53target_softmmu_arch += {'s390x': s390x_softmmu_ss} 54target_user_arch += {'s390x': s390x_user_ss} 55