From nobody Fri Jun 17 19:38:01 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 54B7885AE3C; Fri, 17 Jun 2022 19:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq894bmmz3QBM; Fri, 17 Jun 2022 19:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DVOPpOf48y95JzYvqTHcDV3erKnkmEo+OY5DA7N5iTA=; b=Lhl+aRwGgBnoFLkv3rF45Y1ZR5IIdbGsIRoyAbZcYRcNJzpyq2mdf1vq2IE9h2wf0hqfZq qvZm3ZTEMvoSEB8km0kbOoPNVJunqGx/PkaBcI7zOVXm3HjVhN006JwWhgA1V24ksdsoT+ YVgJxIKqCTuO94pUQO37H8vpBskTDVzPy3im8wtZzM99l4qjQ/wxiHGT2vsPs2vNbf1G+H WCfdizymhPt1kfviTJ9hprXSTVdilaccAbuFmmNBzNa8R9LYag7+qgL31e0ZkUJxt5+K7z de/0DPrywQq/4dvxkuYlDaEIKPn6K6jlGJGfq66fvrWACkvJLIFStMohhbBLlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15F3125679; Fri, 17 Jun 2022 19:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJc1qX014116; Fri, 17 Jun 2022 19:38:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJc18r014115; Fri, 17 Jun 2022 19:38:01 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:01 GMT Message-Id: <202206171938.25HJc18r014115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 8fb3f959dcaa - stable/13 - linux(4): Add struct clone_args for future clone3 system call. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8fb3f959dcaab8b254eadaadbacc3fa416ce69e4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DVOPpOf48y95JzYvqTHcDV3erKnkmEo+OY5DA7N5iTA=; b=K0hNV7WfpUu5ZqcB8+CDdbXeiotq47e7ecMl+iTd+jFKb1ZplHlha+g7saJioAutYeNLyG MDx+s2kZyqkE9TeskWHL1NvXnCx5wBF7ThDqd5AOavJyjVvnGdU842f5MnA74indVQPVj3 mwidA4X8GfPZbn2ZbGsCk0BNWzxUGUgdu8GLdjUVPqiUBby6CjxVK98zJedTB7sZwu45Hv BrnR+cKAvu92/X0vk4HFaHYhbiiVE9coCoof4l5RD84ehBlT9xQd9AlrK0VwXuqzf0atxM tffs5hBmpJrJYmoXrAY/hh5rLpdXUE53h2pf/ztBnLrjvyXL2XIQ5WSqh7JDzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494681; a=rsa-sha256; cv=none; b=g9WzpB7SYSA4VAixXA75TDhLP+dnZXuoSKqwAy17i+jQiuZPaGzTIwTdPqYIeHltoRNAD5 cnzPOD7X6x2rKAZPi1GlfNndH48sKuQ/Rg0HewysX1DOG7/bDEUjNUJIkNXmQ52TK+pqsf wGST3cwwsd+T/7Mimikdy1JU4x2dz6TZuQdZYTMPYvH/ez4ildJNKzlhYkpqGyRdTWJNIg S8uFYQZMIxQ2I/oNbL8ZT2A3IGFxFfrE56X7KbA35oWNtiKNVNURs9klNGxLcmjIOF8o+2 Q6gETQNgbKPusG60Dm8R3ML7MIURUso+0DKBYfOartPNIxi3OWRf4g6ksgMr/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=8fb3f959dcaab8b254eadaadbacc3fa416ce69e4 commit 8fb3f959dcaab8b254eadaadbacc3fa416ce69e4 Author: Dmitry Chagin AuthorDate: 2021-08-12 08:49:01 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:30 +0000 linux(4): Add struct clone_args for future clone3 system call. In preparation for clone3 system call add struct clone_args and use it in clone implementation. Move all of clone related bits to the newly created linux_fork.h header. Differential revision: https://reviews.freebsd.org/D31474 MFC after: 2 weeks (cherry picked from commit 0a4b664ae8582b7596858317b53d84eb4f8bbf9a) --- sys/amd64/linux/linux_machdep.c | 1 + sys/amd64/linux/linux_sysvec.c | 1 + sys/amd64/linux32/linux32_machdep.c | 1 + sys/amd64/linux32/linux32_sysvec.c | 1 + sys/arm64/linux/linux_machdep.c | 1 + sys/arm64/linux/linux_sysvec.c | 1 + sys/compat/linux/linux.h | 2 + sys/compat/linux/linux_emul.c | 10 ++-- sys/compat/linux/linux_emul.h | 3 +- sys/compat/linux/linux_fork.c | 53 ++++++++++++--------- sys/compat/linux/linux_fork.h | 92 +++++++++++++++++++++++++++++++++++++ sys/compat/linux/linux_misc.h | 27 ----------- sys/i386/linux/linux_machdep.c | 1 + sys/i386/linux/linux_sysvec.c | 1 + 14 files changed, 140 insertions(+), 55 deletions(-) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 5de27a7ee7d3..dc6b6140f60c 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index f9ab19a40ef2..b008b4b49c1c 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 926c69c9ebac..5801fac7f126 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 42b40ee3094a..7905b8587192 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index eff084eb9f96..055e9374424c 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 63438cb62ec4..dfbc12ee4b42 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 0b405b692796..f73a0484cf55 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -259,4 +259,6 @@ struct l_statx { uint64_t __spare2[13]; }; +#define lower_32_bits(n) ((uint32_t)((n) & 0xffffffff)) + #endif /* _LINUX_MI_H_ */ diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index fbfe9080cac7..86688d50c8a8 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -139,7 +139,7 @@ linux_set_default_stacksize(struct thread *td, struct proc *p) } void -linux_proc_init(struct thread *td, struct thread *newtd, int flags) +linux_proc_init(struct thread *td, struct thread *newtd, bool init_thread) { struct linux_emuldata *em; struct linux_pemuldata *pem; @@ -150,7 +150,7 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) /* non-exec call */ em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); - if (flags & LINUX_CLONE_THREAD) { + if (init_thread) { LINUX_CTR1(proc_init, "thread newtd(%d)", newtd->td_tid); @@ -312,12 +312,12 @@ linux_on_exec(struct proc *p, struct image_params *imgp) * before exec. Update emuldata to reflect * single-threaded cleaned state after exec. */ - linux_proc_init(td, NULL, 0); + linux_proc_init(td, NULL, false); } else { /* * We are switching the process to Linux emulator. */ - linux_proc_init(td, td, 0); + linux_proc_init(td, td, false); /* * Create a transient td_emuldata for all suspended @@ -328,7 +328,7 @@ linux_on_exec(struct proc *p, struct image_params *imgp) FOREACH_THREAD_IN_PROC(td->td_proc, othertd) { if (othertd == td) continue; - linux_proc_init(td, othertd, LINUX_CLONE_THREAD); + linux_proc_init(td, othertd, true); } } #if defined(__amd64__) diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index ed5332b2c96c..70646cc93847 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -55,12 +55,11 @@ struct linux_emuldata { struct linux_emuldata *em_find(struct thread *); int linux_exec_imgact_try(struct image_params *); -void linux_proc_init(struct thread *, struct thread *, int); +void linux_proc_init(struct thread *, struct thread *, bool); void linux_on_exit(struct proc *); void linux_schedtail(struct thread *); void linux_on_exec(struct proc *, struct image_params *); void linux_thread_dtor(struct thread *); -void linux_thread_detach(struct thread *); int linux_common_execve(struct thread *, struct image_args *); void linux32_prepare_notes(struct thread *, struct note_info_list *, size_t *); void linux64_prepare_notes(struct thread *, struct note_info_list *, size_t *); diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index 955e9e512bd1..97f5b7d89de4 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include +#include #include #include #include @@ -82,7 +84,7 @@ linux_fork(struct thread *td, struct linux_fork_args *args) td2 = FIRST_THREAD_IN_PROC(p2); - linux_proc_init(td, td2, 0); + linux_proc_init(td, td2, false); td->td_retval[0] = p2->p_pid; @@ -112,7 +114,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args) td2 = FIRST_THREAD_IN_PROC(p2); - linux_proc_init(td, td2, 0); + linux_proc_init(td, td2, false); td->td_retval[0] = p2->p_pid; @@ -128,7 +130,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args) #endif static int -linux_clone_proc(struct thread *td, struct linux_clone_args *args) +linux_clone_proc(struct thread *td, struct l_clone_args *args) { struct fork_req fr; int error, ff = RFPROC | RFSTOPPED, f2; @@ -138,11 +140,12 @@ linux_clone_proc(struct thread *td, struct linux_clone_args *args) struct linux_emuldata *em; f2 = 0; - exit_signal = args->flags & 0x000000ff; - if (LINUX_SIG_VALID(exit_signal)) { - exit_signal = linux_to_bsd_signal(exit_signal); - } else if (exit_signal != 0) + if (LINUX_SIG_VALID(args->exit_signal)) { + exit_signal = linux_to_bsd_signal(args->exit_signal); + } else if (args->exit_signal != 0) return (EINVAL); + else + exit_signal = 0; if (args->flags & LINUX_CLONE_VM) ff |= RFMEM; @@ -158,7 +161,7 @@ linux_clone_proc(struct thread *td, struct linux_clone_args *args) } if (args->flags & LINUX_CLONE_PARENT_SETTID) - if (args->parent_tidptr == NULL) + if (args->parent_tid == NULL) return (EINVAL); if (args->flags & LINUX_CLONE_VFORK) @@ -175,23 +178,23 @@ linux_clone_proc(struct thread *td, struct linux_clone_args *args) td2 = FIRST_THREAD_IN_PROC(p2); /* create the emuldata */ - linux_proc_init(td, td2, args->flags); + linux_proc_init(td, td2, false); em = em_find(td2); KASSERT(em != NULL, ("clone_proc: emuldata not found.\n")); if (args->flags & LINUX_CLONE_CHILD_SETTID) - em->child_set_tid = args->child_tidptr; + em->child_set_tid = args->child_tid; else em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) - em->child_clear_tid = args->child_tidptr; + em->child_clear_tid = args->child_tid; else em->child_clear_tid = NULL; if (args->flags & LINUX_CLONE_PARENT_SETTID) { - error = copyout(&p2->p_pid, args->parent_tidptr, + error = copyout(&p2->p_pid, args->parent_tid, sizeof(p2->p_pid)); if (error) linux_msg(td, "copyout p_pid failed!"); @@ -235,7 +238,7 @@ linux_clone_proc(struct thread *td, struct linux_clone_args *args) } static int -linux_clone_thread(struct thread *td, struct linux_clone_args *args) +linux_clone_thread(struct thread *td, struct l_clone_args *args) { struct linux_emuldata *em; struct thread *newtd; @@ -244,12 +247,12 @@ linux_clone_thread(struct thread *td, struct linux_clone_args *args) LINUX_CTR4(clone_thread, "thread(%d) flags %x ptid %p ctid %p", td->td_tid, (unsigned)args->flags, - args->parent_tidptr, args->child_tidptr); + args->parent_tid, args->child_tid); if ((args->flags & LINUX_CLONE_PARENT) != 0) return (EINVAL); if (args->flags & LINUX_CLONE_PARENT_SETTID) - if (args->parent_tidptr == NULL) + if (args->parent_tid == NULL) return (EINVAL); /* Threads should be created with own stack */ @@ -284,7 +287,7 @@ linux_clone_thread(struct thread *td, struct linux_clone_args *args) thread_cow_get(newtd, td); /* create the emuldata */ - linux_proc_init(td, newtd, args->flags); + linux_proc_init(td, newtd, true); em = em_find(newtd); KASSERT(em != NULL, ("clone_thread: emuldata not found.\n")); @@ -293,12 +296,12 @@ linux_clone_thread(struct thread *td, struct linux_clone_args *args) linux_set_cloned_tls(newtd, PTRIN(args->tls)); if (args->flags & LINUX_CLONE_CHILD_SETTID) - em->child_set_tid = args->child_tidptr; + em->child_set_tid = args->child_tid; else em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) - em->child_clear_tid = args->child_tidptr; + em->child_clear_tid = args->child_tid; else em->child_clear_tid = NULL; @@ -328,7 +331,7 @@ linux_clone_thread(struct thread *td, struct linux_clone_args *args) td->td_tid, newtd->td_tid); if (args->flags & LINUX_CLONE_PARENT_SETTID) { - error = copyout(&newtd->td_tid, args->parent_tidptr, + error = copyout(&newtd->td_tid, args->parent_tid, sizeof(newtd->td_tid)); if (error) linux_msg(td, "clone_thread: copyout td_tid failed!"); @@ -359,11 +362,19 @@ fail: int linux_clone(struct thread *td, struct linux_clone_args *args) { + struct l_clone_args ca = { + .flags = (lower_32_bits(args->flags) & ~LINUX_CSIGNAL), + .child_tid = args->child_tidptr, + .parent_tid = args->parent_tidptr, + .exit_signal = (lower_32_bits(args->flags) & LINUX_CSIGNAL), + .stack = args->stack, + .tls = args->tls, + }; if (args->flags & LINUX_CLONE_THREAD) - return (linux_clone_thread(td, args)); + return (linux_clone_thread(td, &ca)); else - return (linux_clone_proc(td, args)); + return (linux_clone_proc(td, &ca)); } int diff --git a/sys/compat/linux/linux_fork.h b/sys/compat/linux/linux_fork.h new file mode 100644 index 000000000000..04dfb8ac8a70 --- /dev/null +++ b/sys/compat/linux/linux_fork.h @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 2021 Dmitry Chagin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_FORK_H_ +#define _LINUX_FORK_H_ + +#define LINUX_CLONE_VM 0x00000100 +#define LINUX_CLONE_FS 0x00000200 +#define LINUX_CLONE_FILES 0x00000400 +#define LINUX_CLONE_SIGHAND 0x00000800 +#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ +#define LINUX_CLONE_PTRACE 0x00002000 +#define LINUX_CLONE_VFORK 0x00004000 +#define LINUX_CLONE_PARENT 0x00008000 +#define LINUX_CLONE_THREAD 0x00010000 +#define LINUX_CLONE_NEWNS 0x00020000 /* New mount NS */ +#define LINUX_CLONE_SYSVSEM 0x00040000 +#define LINUX_CLONE_SETTLS 0x00080000 +#define LINUX_CLONE_PARENT_SETTID 0x00100000 +#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 +#define LINUX_CLONE_DETACHED 0x00400000 /* Unused */ +#define LINUX_CLONE_UNTRACED 0x00800000 +#define LINUX_CLONE_CHILD_SETTID 0x01000000 +#define LINUX_CLONE_NEWCGROUP 0x02000000 /* New cgroup NS */ +#define LINUX_CLONE_NEWUTS 0x04000000 +#define LINUX_CLONE_NEWIPC 0x08000000 +#define LINUX_CLONE_NEWUSER 0x10000000 +#define LINUX_CLONE_NEWPID 0x20000000 +#define LINUX_CLONE_NEWNET 0x40000000 +#define LINUX_CLONE_IO 0x80000000 + +#define LINUX_CSIGNAL 0x000000ff + +/* + * User-space clone3 args layout. + */ +struct l_user_clone_args { + uint64_t flags; + uint64_t pidfd; + uint64_t child_tid; + uint64_t parent_tid; + uint64_t exit_signal; + uint64_t stack; + uint64_t stack_size; + uint64_t tls; + uint64_t set_tid; + uint64_t set_tid_size; + uint64_t cgroup; +}; + +/* + * Kernel clone3 args layout. + */ +struct l_clone_args { + uint64_t flags; + l_int *child_tid; + l_int *parent_tid; + l_int exit_signal; + l_ulong stack; + l_ulong stack_size; + l_ulong tls; +}; + +int linux_set_upcall(struct thread *, register_t); +int linux_set_cloned_tls(struct thread *, void *); +void linux_thread_detach(struct thread *); + +#endif /* _LINUX_FORK_H_ */ diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index dc17ed430014..80f6b8a58e81 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -98,31 +98,6 @@ #define __LINUX_NPXCW__ 0x37f #endif -#define LINUX_CLONE_VM 0x00000100 -#define LINUX_CLONE_FS 0x00000200 -#define LINUX_CLONE_FILES 0x00000400 -#define LINUX_CLONE_SIGHAND 0x00000800 -#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ -#define LINUX_CLONE_PTRACE 0x00002000 -#define LINUX_CLONE_VFORK 0x00004000 -#define LINUX_CLONE_PARENT 0x00008000 -#define LINUX_CLONE_THREAD 0x00010000 -#define LINUX_CLONE_NEWNS 0x00020000 /* New mount NS */ -#define LINUX_CLONE_SYSVSEM 0x00040000 -#define LINUX_CLONE_SETTLS 0x00080000 -#define LINUX_CLONE_PARENT_SETTID 0x00100000 -#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 -#define LINUX_CLONE_DETACHED 0x00400000 /* Unused */ -#define LINUX_CLONE_UNTRACED 0x00800000 -#define LINUX_CLONE_CHILD_SETTID 0x01000000 -#define LINUX_CLONE_NEWCGROUP 0x02000000 /* New cgroup NS */ -#define LINUX_CLONE_NEWUTS 0x04000000 -#define LINUX_CLONE_NEWIPC 0x08000000 -#define LINUX_CLONE_NEWUSER 0x10000000 -#define LINUX_CLONE_NEWPID 0x20000000 -#define LINUX_CLONE_NEWNET 0x40000000 -#define LINUX_CLONE_IO 0x80000000 - /* Scheduling policies */ #define LINUX_SCHED_OTHER 0 #define LINUX_SCHED_FIFO 1 @@ -180,8 +155,6 @@ extern int stclohz; int linux_ptrace_status(struct thread *td, int pid, int status); #endif void linux_to_bsd_waitopts(int options, int *bsdopts); -int linux_set_upcall(struct thread *td, register_t stack); -int linux_set_cloned_tls(struct thread *td, void *desc); struct thread *linux_tdfind(struct thread *, lwpid_t, pid_t); #endif /* _LINUX_MISC_H_ */ diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 1a51b7954063..c81bf1b4e2e5 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 6805a29204c5..8968a491ce95 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include