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