@@ -2366,6 +2366,7 @@ block_ss = ss.source_set()
bsd_user_ss = ss.source_set()
chardev_ss = ss.source_set()
common_ss = ss.source_set()
+common_user_ss = ss.source_set()
crypto_ss = ss.source_set()
hwcore_ss = ss.source_set()
io_ss = ss.source_set()
@@ -2610,15 +2611,30 @@ subdir('tcg')
subdir('fpu')
subdir('accel')
subdir('plugins')
+subdir('ebpf')
+
+common_user_inc = []
+
+subdir('common-user')
subdir('bsd-user')
subdir('linux-user')
-subdir('ebpf')
specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
linux_user_ss.add(files('thunk.c'))
specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
+common_user_ss = common_user_ss.apply(config_all, strict: false)
+common_user = static_library('common-user',
+ sources: common_user_ss.sources(),
+ dependencies: common_user_ss.dependencies(),
+ include_directories: common_user_inc,
+ name_suffix: 'fa',
+ build_by_default: false)
+common_user = declare_dependency(link_with: common_user)
+
+user_ss.add(common_user)
+
# needed for fuzzing binaries
subdir('tests/qtest/libqos')
subdir('tests/qtest/fuzz')
similarity index 100%
rename from linux-user/safe-syscall.h
rename to include/user/safe-syscall.h
similarity index 95%
rename from linux-user/safe-syscall-error.c
rename to common-user/safe-syscall-error.c
@@ -10,7 +10,7 @@
*/
#include "qemu/osdep.h"
-#include "safe-syscall.h"
+#include "user/safe-syscall.h"
/*
* This is intended to be invoked via tail-call on the error path
@@ -31,7 +31,7 @@
#include "trace.h"
#include "signal-common.h"
#include "host-signal.h"
-#include "safe-syscall.h"
+#include "user/safe-syscall.h"
static struct target_sigaction sigact_table[TARGET_NSIG];
@@ -132,7 +132,7 @@
#include "signal-common.h"
#include "loader.h"
#include "user-mmap.h"
-#include "safe-syscall.h"
+#include "user/safe-syscall.h"
#include "qemu/guest-random.h"
#include "qemu/selfmap.h"
#include "user/syscall-trace.h"
@@ -3078,6 +3078,8 @@ M: Riku Voipio <riku.voipio@iki.fi>
S: Maintained
F: thunk.c
F: accel/tcg/user-exec*.c
+F: include/user/
+F: common-user/
BSD user
M: Warner Losh <imp@bsdimp.com>
@@ -2,6 +2,8 @@ if not have_bsd_user
subdir_done()
endif
+common_user_inc += include_directories('.')
+
bsd_user_ss.add(files(
'bsdload.c',
'elfload.c',
similarity index 97%
rename from linux-user/host/aarch64/safe-syscall.inc.S
rename to common-user/host/aarch64/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.
similarity index 98%
rename from linux-user/host/arm/safe-syscall.inc.S
rename to common-user/host/arm/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.
similarity index 98%
rename from linux-user/host/i386/safe-syscall.inc.S
rename to common-user/host/i386/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.
similarity index 98%
rename from linux-user/host/mips/safe-syscall.inc.S
rename to common-user/host/mips/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <richard.henderson@linaro.org>
* Copyright (C) 2021 Linaro, Inc.
similarity index 98%
rename from linux-user/host/ppc64/safe-syscall.inc.S
rename to common-user/host/ppc64/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.
similarity index 97%
rename from linux-user/host/riscv/safe-syscall.inc.S
rename to common-user/host/riscv/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2018 Linaro, Inc.
similarity index 98%
rename from linux-user/host/s390x/safe-syscall.inc.S
rename to common-user/host/s390x/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.
similarity index 97%
rename from linux-user/host/sparc64/safe-syscall.inc.S
rename to common-user/host/sparc64/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <richard.henderson@linaro.org>
* Copyright (C) 2021 Red Hat, Inc.
similarity index 98%
rename from linux-user/host/x86_64/safe-syscall.inc.S
rename to common-user/host/x86_64/safe-syscall.inc.S
@@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
- * This is intended to be included by linux-user/safe-syscall.S
+ * This is intended to be included by common-user/safe-syscall.S
*
* Copyright (C) 2015 Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
*
new file mode 100644
@@ -0,0 +1,6 @@
+common_user_inc += include_directories('host/' / config_host['ARCH'])
+
+common_user_ss.add(files(
+ 'safe-syscall.S',
+ 'safe-syscall-error.c',
+))
similarity index 100%
rename from linux-user/safe-syscall.S
rename to common-user/safe-syscall.S
@@ -2,6 +2,9 @@ if not have_linux_user
subdir_done()
endif
+common_user_inc += include_directories('host/' / config_host['ARCH'])
+common_user_inc += include_directories('.')
+
linux_user_ss.add(files(
'elfload.c',
'exit.c',
@@ -9,8 +12,6 @@ linux_user_ss.add(files(
'linuxload.c',
'main.c',
'mmap.c',
- 'safe-syscall.S',
- 'safe-syscall-error.c',
'signal.c',
'strace.c',
'syscall.c',