mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
meson: linux-user
The most interesting or most complicated part here is the syscall_nr.h generators. In order to keep the generation logic all in meson.build, I am adding to config_target the name of the .tbl file, and making the generated file syscall<SUFFIX>_nr.h for input file syscall<SUFFIX>.tbl. For architectures where the input file is not named syscall_nr.tbl, syscall_nr.h has to be a source file; it's just a forwarder for x86 (i386/x86_64), while for MIPS64 it chooses between N32 and N64 ABIs. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1a82878a08
commit
3a30446aed
41 changed files with 166 additions and 132 deletions
|
@ -1,25 +0,0 @@
|
|||
obj-y = main.o syscall.o strace.o mmap.o signal.o \
|
||||
elfload.o linuxload.o uaccess.o uname.o \
|
||||
safe-syscall.o $(TARGET_ABI_DIR)/signal.o \
|
||||
$(TARGET_ABI_DIR)/cpu_loop.o exit.o fd-trans.o
|
||||
|
||||
obj-$(TARGET_HAS_BFLT) += flatload.o
|
||||
obj-$(TARGET_I386) += vm86.o
|
||||
obj-$(TARGET_AARCH64) += arm/semihost.o
|
||||
|
||||
obj-$(TARGET_ALPHA) += alpha/
|
||||
obj-$(TARGET_ARM) += arm/
|
||||
obj-$(TARGET_HPPA) += hppa/
|
||||
obj-$(TARGET_I386) += i386/
|
||||
obj-$(TARGET_M68K) += m68k/
|
||||
obj-$(TARGET_MICROBLAZE) += microblaze/
|
||||
obj-$(TARGET_MIPS) += mips/
|
||||
obj-$(TARGET_MIPS64) += mips64/
|
||||
obj-$(TARGET_PPC) += ppc/
|
||||
obj-$(TARGET_PPC64) += ppc/
|
||||
obj-$(TARGET_S390X) += s390x/
|
||||
obj-$(TARGET_SH4) += sh4/
|
||||
obj-$(TARGET_SPARC) += sparc/
|
||||
obj-$(TARGET_SPARC64) += $(TARGET_ABI_DIR)/
|
||||
obj-$(TARGET_X86_64) += x86_64/
|
||||
obj-$(TARGET_XTENSA) += xtensa/
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/alpha/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/alpha/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/alpha/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/alpha/meson.build
Normal file
5
linux-user/alpha/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'alpha': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
obj-$(TARGET_ARM) += nwfpe/
|
||||
obj-$(TARGET_ARM) += semihost.o
|
||||
|
||||
generated-files-y += linux-user/arm/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/arm/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/arm/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
10
linux-user/arm/meson.build
Normal file
10
linux-user/arm/meson.build
Normal file
|
@ -0,0 +1,10 @@
|
|||
linux_user_ss.add(when: 'TARGET_AARCH64', if_true: files('semihost.c'))
|
||||
linux_user_ss.add(when: 'TARGET_ARM', if_true: files('semihost.c'))
|
||||
|
||||
subdir('nwfpe')
|
||||
|
||||
syscall_nr_generators += {
|
||||
'arm': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
|
||||
obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
|
10
linux-user/arm/nwfpe/meson.build
Normal file
10
linux-user/arm/nwfpe/meson.build
Normal file
|
@ -0,0 +1,10 @@
|
|||
linux_user_ss.add(when: 'TARGET_ARM', if_true: files(
|
||||
'double_cpdo.c',
|
||||
'extended_cpdo.c',
|
||||
'fpa11.c',
|
||||
'fpa11_cpdo.c',
|
||||
'fpa11_cpdt.c',
|
||||
'fpa11_cprt.c',
|
||||
'fpopcode.c',
|
||||
'single_cpdo.c',
|
||||
))
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/hppa/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/hppa/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/hppa/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/hppa/meson.build
Normal file
5
linux-user/hppa/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'hppa': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/i386/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/i386/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/i386/syscall_32.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/i386/meson.build
Normal file
5
linux-user/i386/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'i386': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
1
linux-user/i386/syscall_nr.h
Normal file
1
linux-user/i386/syscall_nr.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include "syscall_32_nr.h"
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/m68k/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/m68k/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/m68k/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/m68k/meson.build
Normal file
5
linux-user/m68k/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'm68k': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
37
linux-user/meson.build
Normal file
37
linux-user/meson.build
Normal file
|
@ -0,0 +1,37 @@
|
|||
linux_user_ss.add(files(
|
||||
'elfload.c',
|
||||
'exit.c',
|
||||
'fd-trans.c',
|
||||
'linuxload.c',
|
||||
'main.c',
|
||||
'mmap.c',
|
||||
'safe-syscall.S',
|
||||
'signal.c',
|
||||
'strace.c',
|
||||
'syscall.c',
|
||||
'uaccess.c',
|
||||
'uname.c',
|
||||
))
|
||||
linux_user_ss.add(rt)
|
||||
|
||||
linux_user_ss.add(when: 'TARGET_HAS_BFLT', if_true: files('flatload.c'))
|
||||
linux_user_ss.add(when: 'TARGET_I386', if_true: files('vm86.c'))
|
||||
|
||||
|
||||
syscall_nr_generators = {}
|
||||
|
||||
subdir('alpha')
|
||||
subdir('arm')
|
||||
subdir('hppa')
|
||||
subdir('i386')
|
||||
subdir('m68k')
|
||||
subdir('microblaze')
|
||||
subdir('mips64')
|
||||
subdir('mips')
|
||||
subdir('ppc')
|
||||
subdir('s390x')
|
||||
subdir('sh4')
|
||||
subdir('sparc64')
|
||||
subdir('sparc')
|
||||
subdir('x86_64')
|
||||
subdir('xtensa')
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/microblaze/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/microblaze/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/microblaze/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/microblaze/meson.build
Normal file
5
linux-user/microblaze/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'microblaze': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/mips/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/mips/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/mips/syscall_o32.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI) "" 4000,"GEN","$@")
|
6
linux-user/mips/meson.build
Normal file
6
linux-user/mips/meson.build
Normal file
|
@ -0,0 +1,6 @@
|
|||
syscall_nr_generators += {
|
||||
'mips': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@',
|
||||
'', '4000' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
1
linux-user/mips/syscall_nr.h
Normal file
1
linux-user/mips/syscall_nr.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include "syscall_o32_nr.h"
|
|
@ -1,12 +0,0 @@
|
|||
generated-files-y += linux-user/$(TARGET_ABI_DIR)/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscallhdr.sh
|
||||
|
||||
ifeq ($(TARGET_SYSTBL_ABI),n32)
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall_n32.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ n32 "" 6000,"GEN","$@")
|
||||
endif
|
||||
ifeq ($(TARGET_SYSTBL_ABI),n64)
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall_n64.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ n64 "" 5000,"GEN","$@")
|
||||
endif
|
6
linux-user/mips64/meson.build
Normal file
6
linux-user/mips64/meson.build
Normal file
|
@ -0,0 +1,6 @@
|
|||
syscall_nr_generators += {
|
||||
'mips64': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@',
|
||||
'', 'TARGET_SYSCALL_OFFSET' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
7
linux-user/mips64/syscall_nr.h
Normal file
7
linux-user/mips64/syscall_nr.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifdef TARGET_ABI_MIPSN32
|
||||
#define TARGET_SYSCALL_OFFSET 6000
|
||||
#include "syscall_n32_nr.h"
|
||||
#else
|
||||
#define TARGET_SYSCALL_OFFSET 5000
|
||||
#include "syscall_n64_nr.h"
|
||||
#endif
|
|
@ -1,6 +0,0 @@
|
|||
generated-files-y += linux-user/$(TARGET_ABI_DIR)/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscallhdr.sh
|
||||
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/ppc/meson.build
Normal file
5
linux-user/ppc/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'ppc': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/s390x/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/s390x/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/s390x/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/s390x/meson.build
Normal file
5
linux-user/s390x/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
's390x': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/sh4/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/sh4/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/sh4/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/sh4/meson.build
Normal file
5
linux-user/sh4/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'sh4': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/sparc/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/sparc/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/sparc/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/sparc/meson.build
Normal file
5
linux-user/sparc/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'sparc': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/sparc64/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/sparc64/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/sparc/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/sparc64/meson.build
Normal file
5
linux-user/sparc64/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'sparc64': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/x86_64/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/x86_64/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/x86_64/syscall_64.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/x86_64/meson.build
Normal file
5
linux-user/x86_64/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'x86_64': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
1
linux-user/x86_64/syscall_nr.h
Normal file
1
linux-user/x86_64/syscall_nr.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include "syscall_64_nr.h"
|
|
@ -1,5 +0,0 @@
|
|||
generated-files-y += linux-user/xtensa/syscall_nr.h
|
||||
|
||||
syshdr := $(SRC_PATH)/linux-user/xtensa/syscallhdr.sh
|
||||
%/syscall_nr.h: $(SRC_PATH)/linux-user/xtensa/syscall.tbl $(syshdr)
|
||||
$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")
|
5
linux-user/xtensa/meson.build
Normal file
5
linux-user/xtensa/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
|||
syscall_nr_generators += {
|
||||
'xtensa': generator(sh,
|
||||
arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ],
|
||||
output: '@BASENAME@_nr.h')
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue