]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
common-user: Move safe-syscall.* from linux-user
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 17 Nov 2021 15:14:00 +0000 (16:14 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 20 Dec 2021 18:12:24 +0000 (10:12 -0800)
Move linux-user safe-syscall.S and safe-syscall-error.c to common-user
so that bsd-user can also use it.  Also move safe-syscall.h to
include/user/.  Since there is nothing here that is related to the guest,
as opposed to the host, build it once.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
19 files changed:
MAINTAINERS
bsd-user/meson.build
common-user/host/aarch64/safe-syscall.inc.S [moved from linux-user/host/aarch64/safe-syscall.inc.S with 97% similarity]
common-user/host/arm/safe-syscall.inc.S [moved from linux-user/host/arm/safe-syscall.inc.S with 98% similarity]
common-user/host/i386/safe-syscall.inc.S [moved from linux-user/host/i386/safe-syscall.inc.S with 98% similarity]
common-user/host/mips/safe-syscall.inc.S [moved from linux-user/host/mips/safe-syscall.inc.S with 98% similarity]
common-user/host/ppc64/safe-syscall.inc.S [moved from linux-user/host/ppc64/safe-syscall.inc.S with 98% similarity]
common-user/host/riscv/safe-syscall.inc.S [moved from linux-user/host/riscv/safe-syscall.inc.S with 97% similarity]
common-user/host/s390x/safe-syscall.inc.S [moved from linux-user/host/s390x/safe-syscall.inc.S with 98% similarity]
common-user/host/sparc64/safe-syscall.inc.S [moved from linux-user/host/sparc64/safe-syscall.inc.S with 97% similarity]
common-user/host/x86_64/safe-syscall.inc.S [moved from linux-user/host/x86_64/safe-syscall.inc.S with 98% similarity]
common-user/meson.build [new file with mode: 0644]
common-user/safe-syscall-error.c [moved from linux-user/safe-syscall-error.c with 95% similarity]
common-user/safe-syscall.S [moved from linux-user/safe-syscall.S with 100% similarity]
include/user/safe-syscall.h [moved from linux-user/safe-syscall.h with 100% similarity]
linux-user/meson.build
linux-user/signal.c
linux-user/syscall.c
meson.build

index 9a8d1bdf727d9610509683baf3160806226270d6..be8fc575388c2858845cbbba6c6d88aec4e1fa36 100644 (file)
@@ -3079,6 +3079,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>
index 87885d91edc08596388c8e111a09ad4210b89757..25c3976eade21c3096feb41fb633d01923d0be1e 100644 (file)
@@ -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
index 87c9580faa9468d94e6da87dd27f6631ea8e6fdf..73a04b73b39d60f32a1f5d3adbab5e14f2dc31e2 100644 (file)
@@ -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
index f1a6aabfd35f6bc2bfb3f54ade43e5053709ba67..66176a902c16a50663536e2497c2633af6461747 100644 (file)
@@ -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
index 1fb031d2281b5f6a4665125cb5a600390f011ab4..aced8c5141f6053e6b51f22d8f3551b1043c02a3 100644 (file)
@@ -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
index e9362e774d09d626d929e280cb27170fc7104e41..fc75a337d1620431ca385f9da1f43feacfa27d6e 100644 (file)
@@ -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
index 69d3c7009436f373464d2a815a26f955b622b481..947a850dfd04fbdcbab1b3211a730d7b00634753 100644 (file)
@@ -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
index ca456d8a464d7e929b42a704d455c77fad5f916c..dfe83c300ebeafb753cc027f4333bc550cef2da6 100644 (file)
@@ -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
index 66f84385a295e60b3417fd5d470e8880e1bac35c..2ccbaa2402e038702d92b86de08f01a927bd618d 100644 (file)
@@ -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
index f4b3c0f9ae60f7913239a6efa8359c5b7fc5b061..a2f2b9c9674ea3ed36bc3f00edf1e0d4ceb67c27 100644 (file)
@@ -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/x86_64/safe-syscall.inc.S
rename to common-user/host/x86_64/safe-syscall.inc.S
index f88cbe1347eefba4bcab63841c4ce9fd2e3aa3ce..84fed206f903662d9f7ff0384235e467487f09c3 100644 (file)
@@ -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>
  *
diff --git a/common-user/meson.build b/common-user/meson.build
new file mode 100644 (file)
index 0000000..5cb42bc
--- /dev/null
@@ -0,0 +1,6 @@
+common_user_inc += include_directories('host/' / host_arch)
+
+common_user_ss.add(files(
+  'safe-syscall.S',
+  'safe-syscall-error.c',
+))
similarity index 95%
rename from linux-user/safe-syscall-error.c
rename to common-user/safe-syscall-error.c
index 55d95ac39a050f0062ab8a8f999b5cb33f87b404..cf74b504f870223c6cdebc34366333e64f88d3f6 100644 (file)
@@ -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
index 94ac3c58ce963d482f112fd36d7702f65d2ebaed..eef1dd68bd3652b2f344d7540fbc69c7d068f946 100644 (file)
@@ -2,6 +2,9 @@ if not have_linux_user
    subdir_done()
 endif
 
+common_user_inc += include_directories('host/' / 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',
index 12b170528763c1474e791bdaa008a7839b96b34a..510db73c3424954971088f4e071a042442f43b6f 100644 (file)
@@ -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];
 
index f5bf6d155cd8ddea66db2fd6a15050deb75fc8c2..56a3e1718370e35fe5d8bf3e6f2d2a05e158e7af 100644 (file)
 #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"
index 2495360fd05d2408fa15d801c201124228821cb4..4e0a8033f703516af3fec28fc463cd968f8a5793 100644 (file)
@@ -2378,6 +2378,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()
@@ -2622,15 +2623,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')