[Midnightbsd-cvs] src [9996] U trunk/sys/i386/linux/syscalls.master: sync linux emulation with freebsd 10

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun May 27 12:34:34 EDT 2018


Revision: 9996
          http://svnweb.midnightbsd.org/src/?rev=9996
Author:   laffer1
Date:     2018-05-27 12:34:34 -0400 (Sun, 27 May 2018)
Log Message:
-----------
sync linux emulation with freebsd 10

Modified Paths:
--------------
    trunk/sys/i386/linux/Makefile
    trunk/sys/i386/linux/imgact_linux.c
    trunk/sys/i386/linux/linux.h
    trunk/sys/i386/linux/linux_dummy.c
    trunk/sys/i386/linux/linux_genassym.c
    trunk/sys/i386/linux/linux_ipc64.h
    trunk/sys/i386/linux/linux_locore.s
    trunk/sys/i386/linux/linux_machdep.c
    trunk/sys/i386/linux/linux_proto.h
    trunk/sys/i386/linux/linux_ptrace.c
    trunk/sys/i386/linux/linux_support.s
    trunk/sys/i386/linux/linux_syscall.h
    trunk/sys/i386/linux/linux_syscalls.c
    trunk/sys/i386/linux/linux_sysent.c
    trunk/sys/i386/linux/linux_systrace_args.c
    trunk/sys/i386/linux/linux_sysvec.c
    trunk/sys/i386/linux/syscalls.conf
    trunk/sys/i386/linux/syscalls.master

Added Paths:
-----------
    trunk/sys/i386/linux/linux_vdso.lds.s

Property Changed:
----------------
    trunk/sys/i386/linux/linux_locore.s
    trunk/sys/i386/linux/linux_support.s
    trunk/sys/i386/linux/syscalls.conf
    trunk/sys/i386/linux/syscalls.master

Modified: trunk/sys/i386/linux/Makefile
===================================================================
--- trunk/sys/i386/linux/Makefile	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/Makefile	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,6 +1,7 @@
+# $MidnightBSD$
 # Makefile for syscall tables
 #
-# $FreeBSD$
+# $FreeBSD: stable/10/sys/i386/linux/Makefile 315063 2017-03-11 08:40:59Z dchagin $
 
 all:
 	@echo "make sysent only"
@@ -9,9 +10,4 @@
 
 linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \
 		../../kern/makesyscalls.sh syscalls.master syscalls.conf
-	-mv -f linux_sysent.c linux_sysent.c.bak
-	-mv -f linux_syscall.h linux_syscall.h.bak
-	-mv -f linux_proto.h linux_proto.h.bak
-	-mv -f linux_syscalls.c linux_syscalls.c.bak
-	-mv -f linux_systrace_args.c linux_systrace_args.c.bak
 	sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf

Modified: trunk/sys/i386/linux/imgact_linux.c
===================================================================
--- trunk/sys/i386/linux/imgact_linux.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/imgact_linux.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 /*-
- * Copyright (c) 1994-1996 S\xF8ren Schmidt
+ * Copyright (c) 1994-1996 Søren Schmidt
  * All rights reserved.
  *
  * Based heavily on /sys/kern/imgact_aout.c which is:
@@ -30,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/i386/linux/imgact_linux.c 255426 2013-09-09 18:11:59Z jhb $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -139,8 +140,8 @@
 	 */
 	vmaddr = virtual_offset;
 	error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
-			    a_out->a_text + a_out->a_data + bss_size, FALSE,
-			    VM_PROT_ALL, VM_PROT_ALL, 0);
+	    a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE,
+	    VM_PROT_ALL, VM_PROT_ALL, 0);
 	if (error)
 	    goto fail;
 
@@ -204,7 +205,7 @@
 	if (bss_size != 0) {
 	    vmaddr = virtual_offset + a_out->a_text + a_out->a_data;
 	    error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
-				bss_size, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0);
+		bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
 	    if (error)
 		goto fail;
 #ifdef DEBUG

Modified: trunk/sys/i386/linux/linux.h
===================================================================
--- trunk/sys/i386/linux/linux.h	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux.h	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 /*-
- * Copyright (c) 1994-1996 S\xF8ren Schmidt
+ * Copyright (c) 1994-1996 Søren Schmidt
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,7 +26,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/i386/linux/linux.h 302964 2016-07-17 15:23:32Z dchagin $
  */
 
 #ifndef _I386_LINUX_H_
@@ -33,6 +34,7 @@
 
 #include <sys/signal.h>	/* for sigval union */
 
+#include <compat/linux/linux.h>
 #include <i386/linux/linux_syscall.h>
 
 /*
@@ -40,14 +42,12 @@
  */
 extern u_char linux_debug_map[];
 #define	ldebug(name)	isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
-#define	ARGS(nm, fmt)	"linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid
-#define	LMSG(fmt)	"linux(%ld): "fmt"\n", (long)td->td_proc->p_pid
+#define	ARGS(nm, fmt)	"linux(%ld/%ld): "#nm"("fmt")\n",			\
+			(long)td->td_proc->p_pid, (long)td->td_tid
+#define	LMSG(fmt)	"linux(%ld/%ld): "fmt"\n",				\
+			(long)td->td_proc->p_pid, (long)td->td_tid
 #define	LINUX_DTRACE	linuxulator
 
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_LINUX);
-#endif
-
 #define	LINUX_SHAREDPAGE	(VM_MAXUSER_ADDRESS - PAGE_SIZE)
 #define	LINUX_USRSTACK		LINUX_SHAREDPAGE
 
@@ -54,6 +54,11 @@
 #define	PTRIN(v)	(void *)(v)
 #define	PTROUT(v)	(l_uintptr_t)(v)
 
+#define	CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
+#define	CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0)
+#define	PTRIN_CP(src,dst,fld) \
+	do { (dst).fld = PTRIN((src).fld); } while (0)
+
 /*
  * Provide a separate set of types for the Linux types.
  */
@@ -86,6 +91,7 @@
 typedef l_ushort	l_uid16_t;
 typedef l_int		l_timer_t;
 typedef l_int		l_mqd_t;
+typedef	l_ulong		l_fd_mask;
 
 typedef struct {
 	l_int		val[2];
@@ -101,12 +107,7 @@
 /*
  * Miscellaneous
  */
-#define	LINUX_NAME_MAX		255
-#define	LINUX_MAX_UTSNAME	65
-
-#define	LINUX_CTL_MAXNAME	10
-
-#define LINUX_AT_COUNT		16	/* Count of used aux entry types.
+#define LINUX_AT_COUNT		20	/* Count of used aux entry types.
 					 * Keep this synchronized with
 					 * elf_linux_fixup() code.
 					 */
@@ -121,11 +122,6 @@
 	l_ulong		__spare[4];
 };
 
-/* Scheduling policies */
-#define	LINUX_SCHED_OTHER	0
-#define	LINUX_SCHED_FIFO	1
-#define	LINUX_SCHED_RR		2
-
 /* Resource limits */
 #define	LINUX_RLIMIT_CPU	0
 #define	LINUX_RLIMIT_FSIZE	1
@@ -145,13 +141,6 @@
 	l_ulong rlim_max;
 };
 
-/* mmap options */
-#define	LINUX_MAP_SHARED	0x0001
-#define	LINUX_MAP_PRIVATE	0x0002
-#define	LINUX_MAP_FIXED		0x0010
-#define	LINUX_MAP_ANON		0x0020
-#define	LINUX_MAP_GROWSDOWN	0x0100
-
 struct l_mmap_argv {
 	l_uintptr_t	addr;
 	l_size_t	len;
@@ -240,57 +229,7 @@
         l_int           f_spare[6];
 };
 
-struct l_new_utsname {
-	char	sysname[LINUX_MAX_UTSNAME];
-	char	nodename[LINUX_MAX_UTSNAME];
-	char	release[LINUX_MAX_UTSNAME];
-	char	version[LINUX_MAX_UTSNAME];
-	char	machine[LINUX_MAX_UTSNAME];
-	char	domainname[LINUX_MAX_UTSNAME];
-};
-
-/*
- * Signalling
- */
-#define	LINUX_SIGHUP		1
-#define	LINUX_SIGINT		2
-#define	LINUX_SIGQUIT		3
-#define	LINUX_SIGILL		4
-#define	LINUX_SIGTRAP		5
-#define	LINUX_SIGABRT		6
-#define	LINUX_SIGIOT		LINUX_SIGABRT
-#define	LINUX_SIGBUS		7
-#define	LINUX_SIGFPE		8
-#define	LINUX_SIGKILL		9
-#define	LINUX_SIGUSR1		10
-#define	LINUX_SIGSEGV		11
-#define	LINUX_SIGUSR2		12
-#define	LINUX_SIGPIPE		13
-#define	LINUX_SIGALRM		14
-#define	LINUX_SIGTERM		15
-#define	LINUX_SIGSTKFLT		16
-#define	LINUX_SIGCHLD		17
-#define	LINUX_SIGCONT		18
-#define	LINUX_SIGSTOP		19
-#define	LINUX_SIGTSTP		20
-#define	LINUX_SIGTTIN		21
-#define	LINUX_SIGTTOU		22
-#define	LINUX_SIGURG		23
-#define	LINUX_SIGXCPU		24
-#define	LINUX_SIGXFSZ		25
-#define	LINUX_SIGVTALRM		26
-#define	LINUX_SIGPROF		27
-#define	LINUX_SIGWINCH		28
-#define	LINUX_SIGIO		29
-#define	LINUX_SIGPOLL		LINUX_SIGIO
-#define	LINUX_SIGPWR		30
-#define	LINUX_SIGSYS		31
-#define	LINUX_SIGRTMIN		32
-
-#define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2
-#define	LINUX_NBPW		32
-#define	LINUX_NSIG		(LINUX_NBPW * LINUX_NSIG_WORDS)
 
 /* sigaction flags */
 #define	LINUX_SA_NOCLDSTOP	0x00000001
@@ -308,27 +247,13 @@
 #define	LINUX_SIG_UNBLOCK	1
 #define	LINUX_SIG_SETMASK	2
 
-/* sigset_t macros */
-#define	LINUX_SIGEMPTYSET(set)		(set).__bits[0] = (set).__bits[1] = 0
-#define	LINUX_SIGISMEMBER(set, sig)	SIGISMEMBER(set, sig)
-#define	LINUX_SIGADDSET(set, sig)	SIGADDSET(set, sig)
-
 /* sigaltstack */
 #define	LINUX_MINSIGSTKSZ	2048
-#define	LINUX_SS_ONSTACK	1
-#define	LINUX_SS_DISABLE	2
 
-int linux_to_bsd_sigaltstack(int lsa);
-int bsd_to_linux_sigaltstack(int bsa);
-
 typedef void	(*l_handler_t)(l_int);
 typedef l_ulong	l_osigset_t;
 
 typedef struct {
-	l_uint	__bits[LINUX_NSIG_WORDS];
-} l_sigset_t;
-
-typedef struct {
 	l_handler_t	lsa_handler;
 	l_osigset_t	lsa_mask;
 	l_ulong		lsa_flags;
@@ -510,128 +435,15 @@
 	l_handler_t 		sf_handler;
 };
 
-extern int bsd_to_linux_signal[];
-extern int linux_to_bsd_signal[];
 extern struct sysentvec linux_sysvec;
-extern struct sysentvec elf_linux_sysvec;
 
 /*
- * Pluggable ioctl handlers
+ * arch specific open/fcntl flags
  */
-struct linux_ioctl_args;
-struct thread;
-
-typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *);
-
-struct linux_ioctl_handler {
-	linux_ioctl_function_t *func;
-	int	low, high;
-};
-
-int	linux_ioctl_register_handler(struct linux_ioctl_handler *h);
-int	linux_ioctl_unregister_handler(struct linux_ioctl_handler *h);
-
-/*
- * open/fcntl flags
- */
-#define	LINUX_O_RDONLY		00000000
-#define	LINUX_O_WRONLY		00000001
-#define	LINUX_O_RDWR		00000002
-#define	LINUX_O_ACCMODE		00000003
-#define	LINUX_O_CREAT		00000100
-#define	LINUX_O_EXCL		00000200
-#define	LINUX_O_NOCTTY		00000400
-#define	LINUX_O_TRUNC		00001000
-#define	LINUX_O_APPEND		00002000
-#define	LINUX_O_NONBLOCK	00004000
-#define	LINUX_O_NDELAY		LINUX_O_NONBLOCK
-#define	LINUX_O_SYNC		00010000
-#define	LINUX_FASYNC		00020000
-#define	LINUX_O_DIRECT		00040000	/* Direct disk access hint */
-#define	LINUX_O_LARGEFILE	00100000
-#define	LINUX_O_DIRECTORY	00200000	/* Must be a directory */
-#define	LINUX_O_NOFOLLOW	00400000	/* Do not follow links */
-#define	LINUX_O_NOATIME		01000000
-#define	LINUX_O_CLOEXEC		02000000
-
-#define	LINUX_F_DUPFD		0
-#define	LINUX_F_GETFD		1
-#define	LINUX_F_SETFD		2
-#define	LINUX_F_GETFL		3
-#define	LINUX_F_SETFL		4
-#define	LINUX_F_GETLK		5
-#define	LINUX_F_SETLK		6
-#define	LINUX_F_SETLKW		7
-#define	LINUX_F_SETOWN		8
-#define	LINUX_F_GETOWN		9
-
 #define	LINUX_F_GETLK64		12
 #define	LINUX_F_SETLK64		13
 #define	LINUX_F_SETLKW64	14
 
-#define	LINUX_F_RDLCK		0
-#define	LINUX_F_WRLCK		1
-#define	LINUX_F_UNLCK		2
-
-/*
- * posix_fadvise advice
- */
-#define	LINUX_POSIX_FADV_NORMAL		0
-#define	LINUX_POSIX_FADV_RANDOM		1
-#define	LINUX_POSIX_FADV_SEQUENTIAL    	2
-#define	LINUX_POSIX_FADV_WILLNEED      	3
-#define	LINUX_POSIX_FADV_DONTNEED      	4
-#define	LINUX_POSIX_FADV_NOREUSE       	5
-
-/*
- * mount flags
- */
-#define	LINUX_MS_RDONLY		0x0001
-#define	LINUX_MS_NOSUID		0x0002
-#define	LINUX_MS_NODEV		0x0004
-#define	LINUX_MS_NOEXEC		0x0008
-#define	LINUX_MS_REMOUNT	0x0020
-
-/*
- * SystemV IPC defines
- */
-#define	LINUX_SEMOP		1
-#define	LINUX_SEMGET		2
-#define	LINUX_SEMCTL		3
-#define	LINUX_MSGSND		11
-#define	LINUX_MSGRCV		12
-#define	LINUX_MSGGET		13
-#define	LINUX_MSGCTL		14
-#define	LINUX_SHMAT		21
-#define	LINUX_SHMDT		22
-#define	LINUX_SHMGET		23
-#define	LINUX_SHMCTL		24
-
-#define	LINUX_IPC_RMID		0
-#define	LINUX_IPC_SET		1
-#define	LINUX_IPC_STAT		2
-#define	LINUX_IPC_INFO		3
-
-#define	LINUX_SHM_LOCK		11
-#define	LINUX_SHM_UNLOCK	12
-#define	LINUX_SHM_STAT		13
-#define	LINUX_SHM_INFO		14
-
-#define	LINUX_SHM_RDONLY	0x1000
-#define	LINUX_SHM_RND		0x2000
-#define	LINUX_SHM_REMAP		0x4000
-
-/* semctl commands */
-#define	LINUX_GETPID		11
-#define	LINUX_GETVAL		12
-#define	LINUX_GETALL		13
-#define	LINUX_GETNCNT		14
-#define	LINUX_GETZCNT		15
-#define	LINUX_SETVAL		16
-#define	LINUX_SETALL		17
-#define	LINUX_SEM_STAT		18
-#define	LINUX_SEM_INFO		19
-
 union l_semun {
 	l_int		val;
 	struct l_semid_ds	*buf;
@@ -640,28 +452,19 @@
 	void		*__pad;
 };
 
+struct l_ipc_perm {
+	l_key_t		key;
+	l_uid16_t	uid;
+	l_gid16_t	gid;
+	l_uid16_t	cuid;
+	l_gid16_t	cgid;
+	l_ushort	mode;
+	l_ushort	seq;
+};
+
 /*
  * Socket defines
  */
-#define	LINUX_SOCKET 		1
-#define	LINUX_BIND		2
-#define	LINUX_CONNECT 		3
-#define	LINUX_LISTEN 		4
-#define	LINUX_ACCEPT 		5
-#define	LINUX_GETSOCKNAME	6
-#define	LINUX_GETPEERNAME	7
-#define	LINUX_SOCKETPAIR	8
-#define	LINUX_SEND		9
-#define	LINUX_RECV		10
-#define	LINUX_SENDTO 		11
-#define	LINUX_RECVFROM 		12
-#define	LINUX_SHUTDOWN 		13
-#define	LINUX_SETSOCKOPT	14
-#define	LINUX_GETSOCKOPT	15
-#define	LINUX_SENDMSG		16
-#define	LINUX_RECVMSG		17
-#define	LINUX_ACCEPT4		18
-
 #define	LINUX_SOL_SOCKET	1
 #define	LINUX_SOL_IP		0
 #define	LINUX_SOL_IPX		256
@@ -690,45 +493,11 @@
 #define	LINUX_SO_TIMESTAMP	29
 #define	LINUX_SO_ACCEPTCONN	30
 
-#define	LINUX_IP_TOS		1
-#define	LINUX_IP_TTL		2
-#define	LINUX_IP_HDRINCL	3
-#define	LINUX_IP_OPTIONS	4
-
-#define	LINUX_IP_MULTICAST_IF		32
-#define	LINUX_IP_MULTICAST_TTL		33
-#define	LINUX_IP_MULTICAST_LOOP		34
-#define	LINUX_IP_ADD_MEMBERSHIP		35
-#define	LINUX_IP_DROP_MEMBERSHIP	36
-
-#define	LINUX_TCP_NODELAY	1
-#define	LINUX_TCP_MAXSEG	2
-#define	LINUX_TCP_KEEPIDLE	4
-#define	LINUX_TCP_KEEPINTVL	5
-#define	LINUX_TCP_KEEPCNT	6
-#define	LINUX_TCP_MD5SIG	14
-
 struct l_sockaddr {
 	l_ushort	sa_family;
 	char		sa_data[14];
 };
 
-struct l_msghdr {
-	l_uintptr_t	msg_name;
-	l_int		msg_namelen;
-	l_uintptr_t	msg_iov;
-	l_size_t	msg_iovlen;
-	l_uintptr_t	msg_control;
-	l_size_t	msg_controllen;
-	l_uint		msg_flags;
-};
-
-struct l_cmsghdr {
-	l_size_t	cmsg_len;
-	l_int		cmsg_level;
-	l_int		cmsg_type;
-};
-
 struct l_ifmap {
 	l_ulong		mem_start;
 	l_ulong		mem_end;
@@ -867,30 +636,8 @@
 #define	LINUX_GET_USEABLE(desc)		\
 	(((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1)
 
-#define	LINUX_CLOCK_REALTIME		0
-#define	LINUX_CLOCK_MONOTONIC		1
-#define	LINUX_CLOCK_PROCESS_CPUTIME_ID	2
-#define	LINUX_CLOCK_THREAD_CPUTIME_ID	3
-#define	LINUX_CLOCK_REALTIME_HR		4
-#define	LINUX_CLOCK_MONOTONIC_HR	5
+#define	linux_copyout_rusage(r, u)	copyout(r, u, sizeof(*r))
 
-#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_VFORK		0x00004000
-#define	LINUX_CLONE_PARENT		0x00008000
-#define	LINUX_CLONE_THREAD		0x00010000
-#define	LINUX_CLONE_SETTLS		0x00080000
-#define	LINUX_CLONE_PARENT_SETTID	0x00100000
-#define	LINUX_CLONE_CHILD_CLEARTID	0x00200000
-#define	LINUX_CLONE_CHILD_SETTID	0x01000000
-
-#define	LINUX_THREADING_FLAGS					\
-	(LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES |	\
-	LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD)
-
 /* robust futexes */
 struct linux_robust_list {
 	struct linux_robust_list	*next;
@@ -902,7 +649,4 @@
 	struct linux_robust_list	*pending_list;
 };
 
-int linux_set_upcall_kse(struct thread *td, register_t stack);
-int linux_set_cloned_tls(struct thread *td, void *desc);
-
 #endif /* !_I386_LINUX_H_ */

Modified: trunk/sys/i386/linux/linux_dummy.c
===================================================================
--- trunk/sys/i386/linux/linux_dummy.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_dummy.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 /*-
- * Copyright (c) 1994-1995 S\xF8ren Schmidt
+ * Copyright (c) 1994-1995 Søren Schmidt
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/i386/linux/linux_dummy.c 297300 2016-03-27 06:10:51Z dchagin $");
 
 #include "opt_compat.h"
 #include "opt_kdtrace.h"
@@ -65,7 +66,6 @@
 DUMMY(vm86);
 DUMMY(query_module);
 DUMMY(nfsservctl);
-DUMMY(rt_sigqueueinfo);
 DUMMY(sendfile);		/* different semantics */
 DUMMY(setfsuid);
 DUMMY(setfsgid);
@@ -72,16 +72,11 @@
 DUMMY(pivot_root);
 DUMMY(mincore);
 DUMMY(lookup_dcookie);
-DUMMY(epoll_create);
-DUMMY(epoll_ctl);
-DUMMY(epoll_wait);
 DUMMY(remap_file_pages);
-DUMMY(fstatfs64);
 DUMMY(mbind);
 DUMMY(get_mempolicy);
 DUMMY(set_mempolicy);
 DUMMY(kexec_load);
-DUMMY(waitid);
 /* linux 2.6.11: */
 DUMMY(add_key);
 DUMMY(request_key);
@@ -94,8 +89,6 @@
 DUMMY(inotify_rm_watch);
 /* linux 2.6.16: */
 DUMMY(migrate_pages);
-DUMMY(pselect6);
-DUMMY(ppoll);
 DUMMY(unshare);
 /* linux 2.6.17: */
 DUMMY(splice);
@@ -106,22 +99,14 @@
 DUMMY(move_pages);
 /* linux 2.6.19: */
 DUMMY(getcpu);
-DUMMY(epoll_pwait);
 /* linux 2.6.22: */
-DUMMY(utimensat);
 DUMMY(signalfd);
 DUMMY(timerfd_create);
-DUMMY(eventfd);
-/* linux 2.6.23: */
-DUMMY(fallocate);
 /* linux 2.6.25: */
 DUMMY(timerfd_settime);
 DUMMY(timerfd_gettime);
 /* linux 2.6.27: */
 DUMMY(signalfd4);
-DUMMY(eventfd2);
-DUMMY(epoll_create1);
-DUMMY(dup3);
 DUMMY(inotify_init1);
 /* linux 2.6.30: */
 DUMMY(preadv);
@@ -130,17 +115,12 @@
 DUMMY(rt_tsigqueueinfo);
 DUMMY(perf_event_open);
 /* linux 2.6.33: */
-DUMMY(recvmmsg);
 DUMMY(fanotify_init);
 DUMMY(fanotify_mark);
-/* linux 2.6.36: */
-DUMMY(prlimit64);
 /* later: */
 DUMMY(name_to_handle_at);
 DUMMY(open_by_handle_at);
 DUMMY(clock_adjtime);
-DUMMY(syncfs);
-DUMMY(sendmmsg);
 DUMMY(setns);
 DUMMY(process_vm_readv);
 DUMMY(process_vm_writev);

Modified: trunk/sys/i386/linux/linux_genassym.c
===================================================================
--- trunk/sys/i386/linux/linux_genassym.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_genassym.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/i386/linux/linux_genassym.c 293514 2016-01-09 15:44:38Z dchagin $");
 
 #include <sys/param.h>
 #include <sys/assym.h>
@@ -6,6 +7,7 @@
 #include <sys/systm.h>
 
 #include <i386/linux/linux.h>
+#include <compat/linux/linux_mib.h>
 
 ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler));
 ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
@@ -14,3 +16,5 @@
 ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler));
 ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
 ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
+ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp));
+ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);

Modified: trunk/sys/i386/linux/linux_ipc64.h
===================================================================
--- trunk/sys/i386/linux/linux_ipc64.h	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_ipc64.h	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2002 Maxim Sobolev <sobomax at FreeBSD.org>
  * All rights reserved.
@@ -25,7 +26,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/i386/linux/linux_ipc64.h 104893 2002-10-11 11:43:09Z sobomax $
  */
 
 #ifndef _I386_LINUX_LINUX_IPC64_H_

Modified: trunk/sys/i386/linux/linux_locore.s
===================================================================
--- trunk/sys/i386/linux/linux_locore.s	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_locore.s	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,4 +1,5 @@
-/* $FreeBSD$ */
+/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/i386/linux/linux_locore.s 293536 2016-01-09 16:25:30Z dchagin $ */
 
 #include "linux_assym.h"			/* system definitions */
 #include <machine/asmacros.h>			/* miscellaneous asm macros */
@@ -5,33 +6,145 @@
 
 #include <i386/linux/linux_syscall.h>		/* system call numbers */
 
+#include "assym.s"
+
+/*
+ * To avoid excess stack frame the signal trampoline code emulates
+ * the 'call' instruction.
+ */
 NON_GPROF_ENTRY(linux_sigcode)
-	call	*LINUX_SIGF_HANDLER(%esp)
-	leal	LINUX_SIGF_SC(%esp),%ebx	/* linux scp */
-	mov	LINUX_SC_GS(%ebx),%gs
-	movl	%esp, %ebx			/* pass sigframe */
-	push	%eax				/* fake ret addr */
+	movl	%esp, %ebx			/* preserve sigframe */
+	call .getip0
+.getip0:
+	popl	%eax
+	add	$.startsigcode-.getip0, %eax	/* ret address */
+	push	%eax
+	jmp	*LINUX_SIGF_HANDLER(%ebx)
+.startsigcode:
+	popl	%eax				/* gcc unwind code need this */
 	movl	$LINUX_SYS_linux_sigreturn,%eax	/* linux_sigreturn() */
 	int	$0x80				/* enter kernel with args */
+.endsigcode:
 0:	jmp	0b
-	ALIGN_TEXT
-/* XXXXX */
-linux_rt_sigcode:
-	call	*LINUX_RT_SIGF_HANDLER(%esp)
+
+NON_GPROF_ENTRY(linux_rt_sigcode)
 	leal	LINUX_RT_SIGF_UC(%esp),%ebx	/* linux ucp */
 	leal	LINUX_RT_SIGF_SC(%ebx),%ecx	/* linux sigcontext */
-	mov	LINUX_SC_GS(%ecx),%gs
-	push	%eax				/* fake ret addr */
+	movl	%esp, %edi
+	call	.getip1
+.getip1:
+	popl	%eax
+	add	$.startrtsigcode-.getip1, %eax	/* ret address */
+	push	%eax
+	jmp	*LINUX_RT_SIGF_HANDLER(%edi)
+.startrtsigcode:
 	movl	$LINUX_SYS_linux_rt_sigreturn,%eax   /* linux_rt_sigreturn() */
 	int	$0x80				/* enter kernel with args */
+.endrtsigcode:
 0:	jmp	0b
-	ALIGN_TEXT
-/* XXXXX */
-linux_esigcode:
 
-	.data
-	.globl	linux_szsigcode, linux_sznonrtsigcode
-linux_szsigcode:
-	.long	linux_esigcode-linux_sigcode
-linux_sznonrtsigcode:
-	.long	linux_rt_sigcode-linux_sigcode
+NON_GPROF_ENTRY(linux_vsyscall)
+.startvsyscall:
+	int $0x80
+	ret
+.endvsyscall:
+
+#if 0
+	.section .note.Linux, "a", at note
+	.long 2f - 1f		/* namesz */
+	.balign 4
+	.long 4f - 3f		/* descsz */
+	.long 0
+1:
+	.asciz "Linux"
+2:
+	.balign 4
+3:
+	.long LINUX_VERSION_CODE
+4:
+	.balign 4
+	.previous
+#endif
+
+#define do_cfa_expr(offset)                                             \
+	.byte 0x0f;			/* DW_CFA_def_cfa_expression */ \
+	.uleb128 11f-10f;		/*   length */                  \
+10:	.byte 0x74;			/*     DW_OP_breg4 */           \
+	.sleb128 offset;		/*      offset */               \
+	.byte 0x06;			/*     DW_OP_deref */           \
+11:
+
+
+	/* CIE */
+	.section .eh_frame,"a", at progbits
+.LSTARTFRAMEDLSI1:
+	.long .LENDCIEDLSI1-.LSTARTCIEDLSI1
+.LSTARTCIEDLSI1:
+	.long 0					/* CIE ID */
+	.byte 1					/* Version number */
+	.string "zRS"				/* NULL-terminated
+						 * augmentation string
+						 */
+	.uleb128 1				/* Code alignment factor */
+	.sleb128 -4				/* Data alignment factor */
+	.byte 8					/* Return address
+						 * register column
+						 */
+	.uleb128 1				/* Augmentation value length */
+	.byte 0x1b				/* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+	.byte 0					/* DW_CFA_nop */
+	.align 4
+.LENDCIEDLSI1:
+
+	/* FDE */
+	.long .LENDFDEDLSI1-.LSTARTFDEDLSI1	/* Length FDE */
+.LSTARTFDEDLSI1:
+	.long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */
+	.long .startsigcode-.			/* PC-relative start address */
+	.long .endsigcode-.startsigcode
+	.uleb128 0				/* Augmentation */
+	do_cfa_expr(LINUX_SIGF_SC-8)
+	.align 4
+.LENDFDEDLSI1:
+
+	.long .LENDFDEDLSI2-.LSTARTFDEDLSI2	/* Length FDE */
+.LSTARTFDEDLSI2:
+	.long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1	/* CIE pointer */
+	.long .startrtsigcode-.			/* PC-relative start address */
+	.long .endrtsigcode-.startrtsigcode
+	.uleb128 0				/* Augmentation */
+	do_cfa_expr(LINUX_RT_SIGF_SC-4+LINUX_SC_ESP)
+	.align 4
+.LENDFDEDLSI2:
+	.previous
+
+	.section .eh_frame,"a", at progbits
+.LSTARTFRAMEDLSI2:
+	.long .LENDCIEDLSI2-.LSTARTCIEDLSI2
+.LSTARTCIEDLSI2:
+	.long 0					/* CIE ID */
+	.byte 1					/* Version number */
+	.string "zR"				/* NULL-terminated
+						 * augmentation string
+						 */
+	.uleb128 1				/* Code alignment factor */
+	.sleb128 -4				/* Data alignment factor */
+	.byte 8					/* Return address register column */
+	.uleb128 1				/* Augmentation value length */
+	.byte 0x1b				/* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+	.byte 0x0c				/* DW_CFA_def_cfa */
+	.uleb128 4
+	.uleb128 4
+	.byte 0x88				/* DW_CFA_offset, column 0x8 */
+	.uleb128 1
+	.align 4
+.LENDCIEDLSI2:
+	.long .LENDFDEDLSI3-.LSTARTFDEDLSI3 /* Length FDE */
+.LSTARTFDEDLSI3:
+	.long .LSTARTFDEDLSI3-.LSTARTFRAMEDLSI2 /* CIE pointer */
+	.long .startvsyscall-.			/* PC-relative start address */
+	.long .endvsyscall-.startvsyscall
+	.uleb128 0
+	.align 4
+.LENDFDEDLSI3:
+	.previous


Property changes on: trunk/sys/i386/linux/linux_locore.s
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/i386/linux/linux_machdep.c
===================================================================
--- trunk/sys/i386/linux/linux_machdep.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_machdep.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2000 Marcel Moolenaar
  * All rights reserved.
@@ -27,11 +28,11 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/i386/linux/linux_machdep.c 302964 2016-07-17 15:23:32Z dchagin $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/capability.h>
+#include <sys/capsicum.h>
 #include <sys/file.h>
 #include <sys/fcntl.h>
 #include <sys/imgact.h>
@@ -65,6 +66,7 @@
 #include <i386/linux/linux_proto.h>
 #include <compat/linux/linux_ipc.h>
 #include <compat/linux/linux_misc.h>
+#include <compat/linux/linux_mmap.h>
 #include <compat/linux/linux_signal.h>
 #include <compat/linux/linux_util.h>
 #include <compat/linux/linux_emul.h>
@@ -95,40 +97,13 @@
 	struct l_timeval	*timeout;
 };
 
-static int	linux_mmap_common(struct thread *td, l_uintptr_t addr,
-		    l_size_t len, l_int prot, l_int flags, l_int fd,
-		    l_loff_t pos);
 
 int
-linux_to_bsd_sigaltstack(int lsa)
-{
-	int bsa = 0;
-
-	if (lsa & LINUX_SS_DISABLE)
-		bsa |= SS_DISABLE;
-	if (lsa & LINUX_SS_ONSTACK)
-		bsa |= SS_ONSTACK;
-	return (bsa);
-}
-
-int
-bsd_to_linux_sigaltstack(int bsa)
-{
-	int lsa = 0;
-
-	if (bsa & SS_DISABLE)
-		lsa |= LINUX_SS_DISABLE;
-	if (bsa & SS_ONSTACK)
-		lsa |= LINUX_SS_ONSTACK;
-	return (lsa);
-}
-
-int
 linux_execve(struct thread *td, struct linux_execve_args *args)
 {
+	struct image_args eargs;
+	char *newpath;
 	int error;
-	char *newpath;
-	struct image_args eargs;
 
 	LCONVPATHEXIST(td, args->path, &newpath);
 
@@ -141,15 +116,7 @@
 	    args->argp, args->envp);
 	free(newpath, M_TEMP);
 	if (error == 0)
-		error = kern_execve(td, &eargs, NULL);
-	if (error == 0)
-	   	/* linux process can exec fbsd one, dont attempt
-		 * to create emuldata for such process using
-		 * linux_proc_init, this leads to a panic on KASSERT
-		 * because such process has p->p_emuldata == NULL
-		 */
-		if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX)
-   			error = linux_proc_init(td, 0, 0);
+		error = linux_common_execve(td, &eargs);
 	return (error);
 }
 
@@ -360,14 +327,17 @@
 linux_set_upcall_kse(struct thread *td, register_t stack)
 {
 
-	td->td_frame->tf_esp = stack;
+	if (stack)
+		td->td_frame->tf_esp = stack;
 
+	/*
+	 * The newly created Linux thread returns
+	 * to the user space by the same path that a parent do.
+	 */
+	td->td_frame->tf_eax = 0;
 	return (0);
 }
 
-#define STACK_SIZE  (2 * 1024 * 1024)
-#define GUARD_SIZE  (4 * PAGE_SIZE)
-
 int
 linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
 {
@@ -406,184 +376,11 @@
 	    (uint32_t)linux_args.pgoff));
 }
 
-static int
-linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot,
-    l_int flags, l_int fd, l_loff_t pos)
-{
-	struct proc *p = td->td_proc;
-	struct mmap_args /* {
-		caddr_t addr;
-		size_t len;
-		int prot;
-		int flags;
-		int fd;
-		long pad;
-		off_t pos;
-	} */ bsd_args;
-	int error;
-	struct file *fp;
-
-	error = 0;
-	bsd_args.flags = 0;
-	fp = NULL;
-
-	/*
-	 * Linux mmap(2):
-	 * You must specify exactly one of MAP_SHARED and MAP_PRIVATE
-	 */
-	if (!((flags & LINUX_MAP_SHARED) ^ (flags & LINUX_MAP_PRIVATE)))
-		return (EINVAL);
-
-	if (flags & LINUX_MAP_SHARED)
-		bsd_args.flags |= MAP_SHARED;
-	if (flags & LINUX_MAP_PRIVATE)
-		bsd_args.flags |= MAP_PRIVATE;
-	if (flags & LINUX_MAP_FIXED)
-		bsd_args.flags |= MAP_FIXED;
-	if (flags & LINUX_MAP_ANON) {
-		/* Enforce pos to be on page boundary, then ignore. */
-		if ((pos & PAGE_MASK) != 0)
-			return (EINVAL);
-		pos = 0;
-		bsd_args.flags |= MAP_ANON;
-	} else
-		bsd_args.flags |= MAP_NOSYNC;
-	if (flags & LINUX_MAP_GROWSDOWN)
-		bsd_args.flags |= MAP_STACK;
-
-	/*
-	 * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC
-	 * on Linux/i386. We do this to ensure maximum compatibility.
-	 * Linux/ia64 does the same in i386 emulation mode.
-	 */
-	bsd_args.prot = prot;
-	if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
-		bsd_args.prot |= PROT_READ | PROT_EXEC;
-
-	/* Linux does not check file descriptor when MAP_ANONYMOUS is set. */
-	bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd;
-	if (bsd_args.fd != -1) {
-		/*
-		 * Linux follows Solaris mmap(2) description:
-		 * The file descriptor fildes is opened with
-		 * read permission, regardless of the
-		 * protection options specified.
-		 *
-		 * Checking just CAP_MMAP is fine here, since the real work
-		 * is done in the FreeBSD mmap().
-		 */
-
-		if ((error = fget(td, bsd_args.fd, CAP_MMAP, &fp)) != 0)
-			return (error);
-		if (fp->f_type != DTYPE_VNODE) {
-			fdrop(fp, td);
-			return (EINVAL);
-		}
-
-		/* Linux mmap() just fails for O_WRONLY files */
-		if (!(fp->f_flag & FREAD)) {
-			fdrop(fp, td);
-			return (EACCES);
-		}
-
-		fdrop(fp, td);
-	}
-
-	if (flags & LINUX_MAP_GROWSDOWN) {
-		/* 
-		 * The Linux MAP_GROWSDOWN option does not limit auto
-		 * growth of the region.  Linux mmap with this option
-		 * takes as addr the inital BOS, and as len, the initial
-		 * region size.  It can then grow down from addr without
-		 * limit.  However, linux threads has an implicit internal
-		 * limit to stack size of STACK_SIZE.  Its just not
-		 * enforced explicitly in linux.  But, here we impose
-		 * a limit of (STACK_SIZE - GUARD_SIZE) on the stack
-		 * region, since we can do this with our mmap.
-		 *
-		 * Our mmap with MAP_STACK takes addr as the maximum
-		 * downsize limit on BOS, and as len the max size of
-		 * the region.  It them maps the top SGROWSIZ bytes,
-		 * and auto grows the region down, up to the limit
-		 * in addr.
-		 *
-		 * If we don't use the MAP_STACK option, the effect
-		 * of this code is to allocate a stack region of a
-		 * fixed size of (STACK_SIZE - GUARD_SIZE).
-		 */
-
-		if ((caddr_t)PTRIN(addr) + len > p->p_vmspace->vm_maxsaddr) {
-			/* 
-			 * Some linux apps will attempt to mmap
-			 * thread stacks near the top of their
-			 * address space.  If their TOS is greater
-			 * than vm_maxsaddr, vm_map_growstack()
-			 * will confuse the thread stack with the
-			 * process stack and deliver a SEGV if they
-			 * attempt to grow the thread stack past their
-			 * current stacksize rlimit.  To avoid this,
-			 * adjust vm_maxsaddr upwards to reflect
-			 * the current stacksize rlimit rather
-			 * than the maximum possible stacksize.
-			 * It would be better to adjust the
-			 * mmap'ed region, but some apps do not check
-			 * mmap's return value.
-			 */
-			PROC_LOCK(p);
-			p->p_vmspace->vm_maxsaddr = (char *)USRSTACK -
-			    lim_cur(p, RLIMIT_STACK);
-			PROC_UNLOCK(p);
-		}
-
-		/*
-		 * This gives us our maximum stack size and a new BOS.
-		 * If we're using VM_STACK, then mmap will just map
-		 * the top SGROWSIZ bytes, and let the stack grow down
-		 * to the limit at BOS.  If we're not using VM_STACK
-		 * we map the full stack, since we don't have a way
-		 * to autogrow it.
-		 */
-		if (len > STACK_SIZE - GUARD_SIZE) {
-			bsd_args.addr = (caddr_t)PTRIN(addr);
-			bsd_args.len = len;
-		} else {
-			bsd_args.addr = (caddr_t)PTRIN(addr) -
-			    (STACK_SIZE - GUARD_SIZE - len);
-			bsd_args.len = STACK_SIZE - GUARD_SIZE;
-		}
-	} else {
-		bsd_args.addr = (caddr_t)PTRIN(addr);
-		bsd_args.len  = len;
-	}
-	bsd_args.pos = pos;
-
-#ifdef DEBUG
-	if (ldebug(mmap))
-		printf("-> %s(%p, %d, %d, 0x%08x, %d, 0x%x)\n",
-		    __func__,
-		    (void *)bsd_args.addr, bsd_args.len, bsd_args.prot,
-		    bsd_args.flags, bsd_args.fd, (int)bsd_args.pos);
-#endif
-	error = sys_mmap(td, &bsd_args);
-#ifdef DEBUG
-	if (ldebug(mmap))
-		printf("-> %s() return: 0x%x (0x%08x)\n",
-			__func__, error, (u_int)td->td_retval[0]);
-#endif
-	return (error);
-}
-
 int
 linux_mprotect(struct thread *td, struct linux_mprotect_args *uap)
 {
-	struct mprotect_args bsd_args;
 
-	bsd_args.addr = uap->addr;
-	bsd_args.len = uap->len;
-	bsd_args.prot = uap->prot;
-	if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
-		bsd_args.prot |= PROT_READ | PROT_EXEC;
-	return (sys_mprotect(td, &bsd_args));
+	return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot));
 }
 
 int
@@ -699,7 +496,7 @@
 		act.lsa_flags = osa.lsa_flags;
 		act.lsa_restorer = osa.lsa_restorer;
 		LINUX_SIGEMPTYSET(act.lsa_mask);
-		act.lsa_mask.__bits[0] = osa.lsa_mask;
+		act.lsa_mask.__mask = osa.lsa_mask;
 	}
 
 	error = linux_do_sigaction(td, args->sig, args->nsa ? &act : NULL,
@@ -709,7 +506,7 @@
 		osa.lsa_handler = oact.lsa_handler;
 		osa.lsa_flags = oact.lsa_flags;
 		osa.lsa_restorer = oact.lsa_restorer;
-		osa.lsa_mask = oact.lsa_mask.__bits[0];
+		osa.lsa_mask = oact.lsa_mask.__mask;
 		error = copyout(&osa, args->osa, sizeof(l_osigaction_t));
 	}
 
@@ -733,7 +530,7 @@
 #endif
 
 	LINUX_SIGEMPTYSET(mask);
-	mask.__bits[0] = args->mask;
+	mask.__mask = args->mask;
 	linux_to_bsd_sigset(&mask, &sigmask);
 	return (kern_sigsuspend(td, sigmask));
 }
@@ -977,37 +774,6 @@
 	return (0);
 }
 
-/* copied from kern/kern_time.c */
-int
-linux_timer_create(struct thread *td, struct linux_timer_create_args *args)
-{
-   	return sys_ktimer_create(td, (struct ktimer_create_args *) args);
-}
-
-int
-linux_timer_settime(struct thread *td, struct linux_timer_settime_args *args)
-{
-   	return sys_ktimer_settime(td, (struct ktimer_settime_args *) args);
-}
-
-int
-linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *args)
-{
-   	return sys_ktimer_gettime(td, (struct ktimer_gettime_args *) args);
-}
-
-int
-linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *args)
-{
-   	return sys_ktimer_getoverrun(td, (struct ktimer_getoverrun_args *) args);
-}
-
-int
-linux_timer_delete(struct thread *td, struct linux_timer_delete_args *args)
-{
-   	return sys_ktimer_delete(td, (struct ktimer_delete_args *) args);
-}
-
 /* XXX: this wont work with module - convert it */
 int
 linux_mq_open(struct thread *td, struct linux_mq_open_args *args)
@@ -1068,34 +834,3 @@
 	return (ENOSYS);
 #endif
 }
-
-int
-linux_wait4(struct thread *td, struct linux_wait4_args *args)
-{
-	int error, options;
-	struct rusage ru, *rup;
-
-#ifdef DEBUG
-	if (ldebug(wait4))
-		printf(ARGS(wait4, "%d, %p, %d, %p"),
-		    args->pid, (void *)args->status, args->options,
-		    (void *)args->rusage);
-#endif
-
-	options = (args->options & (WNOHANG | WUNTRACED));
-	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
-	if (args->options & __WCLONE)
-		options |= WLINUXCLONE;
-
-	if (args->rusage != NULL)
-		rup = &ru;
-	else
-		rup = NULL;
-	error = linux_common_wait(td, args->pid, args->status, options, rup);
-	if (error)
-		return (error);
-	if (args->rusage != NULL)
-		error = copyout(&ru, args->rusage, sizeof(ru));
-
-	return (error);
-}

Modified: trunk/sys/i386/linux/linux_proto.h
===================================================================
--- trunk/sys/i386/linux/linux_proto.h	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_proto.h	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,9 +1,9 @@
+/* $MidnightBSD$ */
 /*
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $MidnightBSD$
- * created from FreeBSD
+ * $FreeBSD: stable/10/sys/i386/linux/linux_proto.h 318164 2017-05-10 23:09:17Z jhb $
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -12,9 +12,11 @@
 #include <sys/signal.h>
 #include <sys/acl.h>
 #include <sys/cpuset.h>
+#include <sys/_ffcounter.h>
 #include <sys/_semaphore.h>
 #include <sys/ucontext.h>
 #include <sys/wait.h>
+
 #include <bsm/audit_kevents.h>
 
 struct proc;
@@ -33,6 +35,9 @@
 #endif
 
 #define	nosys	linux_nosys
+struct linux_exit_args {
+	char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)];
+};
 struct linux_fork_args {
 	register_t dummy;
 };
@@ -260,7 +265,7 @@
 };
 struct linux_lstat_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-	char up_l_[PADL_(struct ostat *)]; struct ostat * up; char up_r_[PADR_(struct ostat *)];
+	char up_l_[PADL_(struct l_stat *)]; struct l_stat * up; char up_r_[PADR_(struct l_stat *)];
 };
 struct linux_readlink_args {
 	char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)];
@@ -343,7 +348,7 @@
 	register_t dummy;
 };
 struct linux_iopl_args {
-	char level_l_[PADL_(l_ulong)]; l_ulong level; char level_r_[PADR_(l_ulong)];
+	char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)];
 };
 struct linux_vhangup_args {
 	register_t dummy;
@@ -353,9 +358,9 @@
 };
 struct linux_wait4_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
-	char status_l_[PADL_(l_uint *)]; l_uint * status; char status_r_[PADR_(l_uint *)];
+	char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)];
 	char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)];
-	char rusage_l_[PADL_(struct l_rusage *)]; struct l_rusage * rusage; char rusage_r_[PADR_(struct l_rusage *)];
+	char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)];
 };
 struct linux_swapoff_args {
 	register_t dummy;
@@ -430,7 +435,7 @@
 	char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)];
 };
 struct linux_personality_args {
-	char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)];
+	char per_l_[PADL_(l_uint)]; l_uint per; char per_r_[PADR_(l_uint)];
 };
 struct linux_setfsuid16_args {
 	char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)];
@@ -471,10 +476,18 @@
 struct linux_sysctl_args {
 	char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)];
 };
+struct linux_sched_setparam_args {
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)];
+};
+struct linux_sched_getparam_args {
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)];
+};
 struct linux_sched_setscheduler_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
 	char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
-	char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+	char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)];
 };
 struct linux_sched_getscheduler_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
@@ -485,6 +498,10 @@
 struct linux_sched_get_priority_min_args {
 	char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
 };
+struct linux_sched_rr_get_interval_args {
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)];
+};
 struct linux_nanosleep_args {
 	char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)];
 	char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)];
@@ -558,7 +575,9 @@
 	char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
 };
 struct linux_rt_sigqueueinfo_args {
-	register_t dummy;
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
+	char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
 };
 struct linux_rt_sigsuspend_args {
 	char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)];
@@ -624,19 +643,16 @@
 	char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)];
 };
 struct linux_stat64_args {
-	char filename_l_[PADL_(char *)]; char * filename; char filename_r_[PADR_(char *)];
+	char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
 	char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)];
-	char flags_l_[PADL_(l_long)]; l_long flags; char flags_r_[PADR_(l_long)];
 };
 struct linux_lstat64_args {
-	char filename_l_[PADL_(char *)]; char * filename; char filename_r_[PADR_(char *)];
+	char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
 	char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)];
-	char flags_l_[PADL_(l_long)]; l_long flags; char flags_r_[PADR_(l_long)];
 };
 struct linux_fstat64_args {
-	char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
+	char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
 	char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)];
-	char flags_l_[PADL_(l_long)]; l_long flags; char flags_r_[PADR_(l_long)];
 };
 struct linux_lchown_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
@@ -767,13 +783,19 @@
 	register_t dummy;
 };
 struct linux_epoll_create_args {
-	register_t dummy;
+	char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)];
 };
 struct linux_epoll_ctl_args {
-	register_t dummy;
+	char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+	char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)];
+	char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+	char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)];
 };
 struct linux_epoll_wait_args {
-	register_t dummy;
+	char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+	char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+	char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+	char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
 };
 struct linux_remap_file_pages_args {
 	register_t dummy;
@@ -788,6 +810,7 @@
 };
 struct linux_timer_settime_args {
 	char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)];
+	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 	char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)];
 	char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)];
 };
@@ -825,7 +848,9 @@
 	char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)];
 };
 struct linux_fstatfs64_args {
-	register_t dummy;
+	char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+	char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)];
+	char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)];
 };
 struct linux_tgkill_args {
 	char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)];
@@ -887,7 +912,11 @@
 	register_t dummy;
 };
 struct linux_waitid_args {
-	register_t dummy;
+	char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)];
+	char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)];
+	char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
+	char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)];
+	char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)];
 };
 struct linux_add_key_args {
 	register_t dummy;
@@ -967,7 +996,7 @@
 	char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
 	char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)];
 	char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)];
-	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+	char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)];
 };
 struct linux_symlinkat_args {
 	char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
@@ -991,10 +1020,19 @@
 	char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)];
 };
 struct linux_pselect6_args {
-	register_t dummy;
+	char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)];
+	char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)];
+	char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)];
+	char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)];
+	char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+	char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)];
 };
 struct linux_ppoll_args {
-	register_t dummy;
+	char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)];
+	char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)];
+	char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+	char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)];
+	char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)];
 };
 struct linux_unshare_args {
 	register_t dummy;
@@ -1027,10 +1065,17 @@
 	register_t dummy;
 };
 struct linux_epoll_pwait_args {
-	register_t dummy;
+	char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+	char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+	char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+	char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
+	char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)];
 };
 struct linux_utimensat_args {
-	register_t dummy;
+	char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+	char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)];
+	char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)];
+	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 };
 struct linux_signalfd_args {
 	register_t dummy;
@@ -1039,10 +1084,13 @@
 	register_t dummy;
 };
 struct linux_eventfd_args {
-	register_t dummy;
+	char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
 };
 struct linux_fallocate_args {
-	register_t dummy;
+	char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+	char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+	char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+	char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)];
 };
 struct linux_timerfd_settime_args {
 	register_t dummy;
@@ -1054,13 +1102,16 @@
 	register_t dummy;
 };
 struct linux_eventfd2_args {
-	register_t dummy;
+	char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
+	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 };
 struct linux_epoll_create1_args {
-	register_t dummy;
+	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 };
 struct linux_dup3_args {
-	register_t dummy;
+	char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)];
+	char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)];
+	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 };
 struct linux_pipe2_args {
 	char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)];
@@ -1082,7 +1133,11 @@
 	register_t dummy;
 };
 struct linux_recvmmsg_args {
-	register_t dummy;
+	char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+	char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+	char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+	char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
+	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
 };
 struct linux_fanotify_init_args {
 	register_t dummy;
@@ -1091,7 +1146,10 @@
 	register_t dummy;
 };
 struct linux_prlimit64_args {
-	register_t dummy;
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
+	char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)];
+	char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)];
 };
 struct linux_name_to_handle_at_args {
 	register_t dummy;
@@ -1103,10 +1161,13 @@
 	register_t dummy;
 };
 struct linux_syncfs_args {
-	register_t dummy;
+	char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
 };
 struct linux_sendmmsg_args {
-	register_t dummy;
+	char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+	char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+	char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+	char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
 };
 struct linux_setns_args {
 	register_t dummy;
@@ -1118,6 +1179,7 @@
 	register_t dummy;
 };
 #define	nosys	linux_nosys
+int	linux_exit(struct thread *, struct linux_exit_args *);
 int	linux_fork(struct thread *, struct linux_fork_args *);
 int	linux_open(struct thread *, struct linux_open_args *);
 int	linux_waitpid(struct thread *, struct linux_waitpid_args *);
@@ -1229,10 +1291,13 @@
 int	linux_getsid(struct thread *, struct linux_getsid_args *);
 int	linux_fdatasync(struct thread *, struct linux_fdatasync_args *);
 int	linux_sysctl(struct thread *, struct linux_sysctl_args *);
+int	linux_sched_setparam(struct thread *, struct linux_sched_setparam_args *);
+int	linux_sched_getparam(struct thread *, struct linux_sched_getparam_args *);
 int	linux_sched_setscheduler(struct thread *, struct linux_sched_setscheduler_args *);
 int	linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *);
 int	linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *);
 int	linux_sched_get_priority_min(struct thread *, struct linux_sched_get_priority_min_args *);
+int	linux_sched_rr_get_interval(struct thread *, struct linux_sched_rr_get_interval_args *);
 int	linux_nanosleep(struct thread *, struct linux_nanosleep_args *);
 int	linux_mremap(struct thread *, struct linux_mremap_args *);
 int	linux_setresuid16(struct thread *, struct linux_setresuid16_args *);
@@ -1421,6 +1486,7 @@
 
 #endif /* COMPAT_FREEBSD7 */
 
+#define	LINUX_SYS_AUE_linux_exit	AUE_EXIT
 #define	LINUX_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
 #define	LINUX_SYS_AUE_linux_waitpid	AUE_WAIT4
@@ -1532,10 +1598,13 @@
 #define	LINUX_SYS_AUE_linux_getsid	AUE_GETSID
 #define	LINUX_SYS_AUE_linux_fdatasync	AUE_NULL
 #define	LINUX_SYS_AUE_linux_sysctl	AUE_SYSCTL
+#define	LINUX_SYS_AUE_linux_sched_setparam	AUE_SCHED_SETPARAM
+#define	LINUX_SYS_AUE_linux_sched_getparam	AUE_SCHED_GETPARAM
 #define	LINUX_SYS_AUE_linux_sched_setscheduler	AUE_SCHED_SETSCHEDULER
 #define	LINUX_SYS_AUE_linux_sched_getscheduler	AUE_SCHED_GETSCHEDULER
 #define	LINUX_SYS_AUE_linux_sched_get_priority_max	AUE_SCHED_GET_PRIORITY_MAX
 #define	LINUX_SYS_AUE_linux_sched_get_priority_min	AUE_SCHED_GET_PRIORITY_MIN
+#define	LINUX_SYS_AUE_linux_sched_rr_get_interval	AUE_SCHED_RR_GET_INTERVAL
 #define	LINUX_SYS_AUE_linux_nanosleep	AUE_NULL
 #define	LINUX_SYS_AUE_linux_mremap	AUE_NULL
 #define	LINUX_SYS_AUE_linux_setresuid16	AUE_SETRESUID
@@ -1632,7 +1701,7 @@
 #define	LINUX_SYS_AUE_linux_mq_notify	AUE_NULL
 #define	LINUX_SYS_AUE_linux_mq_getsetattr	AUE_NULL
 #define	LINUX_SYS_AUE_linux_kexec_load	AUE_NULL
-#define	LINUX_SYS_AUE_linux_waitid	AUE_NULL
+#define	LINUX_SYS_AUE_linux_waitid	AUE_WAIT6
 #define	LINUX_SYS_AUE_linux_add_key	AUE_NULL
 #define	LINUX_SYS_AUE_linux_request_key	AUE_NULL
 #define	LINUX_SYS_AUE_linux_keyctl	AUE_NULL
@@ -1655,8 +1724,8 @@
 #define	LINUX_SYS_AUE_linux_readlinkat	AUE_READLINKAT
 #define	LINUX_SYS_AUE_linux_fchmodat	AUE_FCHMODAT
 #define	LINUX_SYS_AUE_linux_faccessat	AUE_FACCESSAT
-#define	LINUX_SYS_AUE_linux_pselect6	AUE_NULL
-#define	LINUX_SYS_AUE_linux_ppoll	AUE_NULL
+#define	LINUX_SYS_AUE_linux_pselect6	AUE_SELECT
+#define	LINUX_SYS_AUE_linux_ppoll	AUE_POLL
 #define	LINUX_SYS_AUE_linux_unshare	AUE_NULL
 #define	LINUX_SYS_AUE_linux_set_robust_list	AUE_NULL
 #define	LINUX_SYS_AUE_linux_get_robust_list	AUE_NULL
@@ -1667,7 +1736,7 @@
 #define	LINUX_SYS_AUE_linux_move_pages	AUE_NULL
 #define	LINUX_SYS_AUE_linux_getcpu	AUE_NULL
 #define	LINUX_SYS_AUE_linux_epoll_pwait	AUE_NULL
-#define	LINUX_SYS_AUE_linux_utimensat	AUE_NULL
+#define	LINUX_SYS_AUE_linux_utimensat	AUE_FUTIMESAT
 #define	LINUX_SYS_AUE_linux_signalfd	AUE_NULL
 #define	LINUX_SYS_AUE_linux_timerfd_create	AUE_NULL
 #define	LINUX_SYS_AUE_linux_eventfd	AUE_NULL
@@ -1691,7 +1760,7 @@
 #define	LINUX_SYS_AUE_linux_name_to_handle_at	AUE_NULL
 #define	LINUX_SYS_AUE_linux_open_by_handle_at	AUE_NULL
 #define	LINUX_SYS_AUE_linux_clock_adjtime	AUE_NULL
-#define	LINUX_SYS_AUE_linux_syncfs	AUE_NULL
+#define	LINUX_SYS_AUE_linux_syncfs	AUE_SYNC
 #define	LINUX_SYS_AUE_linux_sendmmsg	AUE_NULL
 #define	LINUX_SYS_AUE_linux_setns	AUE_NULL
 #define	LINUX_SYS_AUE_linux_process_vm_readv	AUE_NULL

Modified: trunk/sys/i386/linux/linux_ptrace.c
===================================================================
--- trunk/sys/i386/linux/linux_ptrace.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_ptrace.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2001 Alexander Kabaev
  * All rights reserved.
@@ -27,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/i386/linux/linux_ptrace.c 304188 2016-08-15 21:10:41Z jhb $");
 
 #include "opt_cpu.h"
 
@@ -45,6 +46,7 @@
 
 #include <i386/linux/linux.h>
 #include <i386/linux/linux_proto.h>
+#include <compat/linux/linux_signal.h>
 
 #if !defined(CPU_DISABLE_SSE) && defined(I686_CPU)
 #define CPU_ENABLE_SSE
@@ -68,7 +70,7 @@
 #define PTRACE_ATTACH		16
 #define PTRACE_DETACH		17
 
-#define	PTRACE_SYSCALL		24
+#define	LINUX_PTRACE_SYSCALL	24
 
 #define PTRACE_GETREGS		12
 #define PTRACE_SETREGS		13
@@ -90,8 +92,7 @@
 map_signum(int signum)
 {
 
-	if (signum > 0 && signum <= LINUX_SIGTBLSZ)
-		signum = linux_to_bsd_signal[_SIG_IDX(signum)];
+	signum = linux_to_bsd_signal(signum);
 	return ((signum == SIGSTOP)? 0 : signum);
 }
 
@@ -224,7 +225,7 @@
 	PROC_LOCK_ASSERT(td->td_proc, MA_OWNED);
 	if (cpu_fxsr == 0 || (td->td_proc->p_flag & P_INMEM) == 0)
 		return (EIO);
-	bcopy(&td->td_pcb->pcb_user_save.sv_xmm, fpxregs, sizeof(*fpxregs));
+	bcopy(&get_pcb_user_save_td(td)->sv_xmm, fpxregs, sizeof(*fpxregs));
 	return (0);
 }
 
@@ -235,7 +236,7 @@
 	PROC_LOCK_ASSERT(td->td_proc, MA_OWNED);
 	if (cpu_fxsr == 0 || (td->td_proc->p_flag & P_INMEM) == 0)
 		return (EIO);
-	bcopy(fpxregs, &td->td_pcb->pcb_user_save.sv_xmm, sizeof(*fpxregs));
+	bcopy(fpxregs, &get_pcb_user_save_td(td)->sv_xmm, sizeof(*fpxregs));
 	return (0);
 }
 #endif
@@ -473,7 +474,7 @@
 
 		break;
 	}
-	case PTRACE_SYSCALL:
+	case LINUX_PTRACE_SYSCALL:
 		/* fall through */
 	default:
 		printf("linux: ptrace(%u, ...) not implemented\n",

Modified: trunk/sys/i386/linux/linux_support.s
===================================================================
--- trunk/sys/i386/linux/linux_support.s	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_support.s	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006,2007 Konstantin Belousov
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/i386/linux/linux_support.s 169895 2007-05-23 08:33:06Z kib $
  */
 
 #include "linux_assym.h"		/* system definitions */


Property changes on: trunk/sys/i386/linux/linux_support.s
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/i386/linux/linux_syscall.h
===================================================================
--- trunk/sys/i386/linux/linux_syscall.h	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_syscall.h	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,12 +1,12 @@
+/* $MidnightBSD$ */
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $MidnightBSD$
- * created from FreeBSD
+ * $FreeBSD: stable/10/sys/i386/linux/linux_syscall.h 318164 2017-05-10 23:09:17Z jhb $
  */
 
-#define	LINUX_SYS_exit	1
+#define	LINUX_SYS_linux_exit	1
 #define	LINUX_SYS_linux_fork	2
 #define	LINUX_SYS_read	3
 #define	LINUX_SYS_write	4
@@ -148,14 +148,14 @@
 #define	LINUX_SYS_munlock	151
 #define	LINUX_SYS_mlockall	152
 #define	LINUX_SYS_munlockall	153
-#define	LINUX_SYS_sched_setparam	154
-#define	LINUX_SYS_sched_getparam	155
+#define	LINUX_SYS_linux_sched_setparam	154
+#define	LINUX_SYS_linux_sched_getparam	155
 #define	LINUX_SYS_linux_sched_setscheduler	156
 #define	LINUX_SYS_linux_sched_getscheduler	157
 #define	LINUX_SYS_sched_yield	158
 #define	LINUX_SYS_linux_sched_get_priority_max	159
 #define	LINUX_SYS_linux_sched_get_priority_min	160
-#define	LINUX_SYS_sched_rr_get_interval	161
+#define	LINUX_SYS_linux_sched_rr_get_interval	161
 #define	LINUX_SYS_linux_nanosleep	162
 #define	LINUX_SYS_linux_mremap	163
 #define	LINUX_SYS_linux_setresuid16	164
@@ -328,4 +328,4 @@
 #define	LINUX_SYS_linux_setns	346
 #define	LINUX_SYS_linux_process_vm_readv	347
 #define	LINUX_SYS_linux_process_vm_writev	348
-#define	LINUX_SYS_MAXSYSCALL	349
+#define	LINUX_SYS_MAXSYSCALL	350

Modified: trunk/sys/i386/linux/linux_syscalls.c
===================================================================
--- trunk/sys/i386/linux/linux_syscalls.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_syscalls.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,15 +1,15 @@
+/* $MidnightBSD$ */
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $MidnightBSD$
- * created from FreeBSD
+ * $FreeBSD: stable/10/sys/i386/linux/linux_syscalls.c 318164 2017-05-10 23:09:17Z jhb $
  */
 
 const char *linux_syscallnames[] = {
 #define	nosys	linux_nosys
 	"#0",			/* 0 = setup */
-	"exit",			/* 1 = exit */
+	"linux_exit",			/* 1 = linux_exit */
 	"linux_fork",			/* 2 = linux_fork */
 	"read",			/* 3 = read */
 	"write",			/* 4 = write */
@@ -162,14 +162,14 @@
 	"munlock",			/* 151 = munlock */
 	"mlockall",			/* 152 = mlockall */
 	"munlockall",			/* 153 = munlockall */
-	"sched_setparam",			/* 154 = sched_setparam */
-	"sched_getparam",			/* 155 = sched_getparam */
+	"linux_sched_setparam",			/* 154 = linux_sched_setparam */
+	"linux_sched_getparam",			/* 155 = linux_sched_getparam */
 	"linux_sched_setscheduler",			/* 156 = linux_sched_setscheduler */
 	"linux_sched_getscheduler",			/* 157 = linux_sched_getscheduler */
 	"sched_yield",			/* 158 = sched_yield */
 	"linux_sched_get_priority_max",			/* 159 = linux_sched_get_priority_max */
 	"linux_sched_get_priority_min",			/* 160 = linux_sched_get_priority_min */
-	"sched_rr_get_interval",			/* 161 = sched_rr_get_interval */
+	"linux_sched_rr_get_interval",			/* 161 = linux_sched_rr_get_interval */
 	"linux_nanosleep",			/* 162 = linux_nanosleep */
 	"linux_mremap",			/* 163 = linux_mremap */
 	"linux_setresuid16",			/* 164 = linux_setresuid16 */
@@ -357,4 +357,5 @@
 	"linux_setns",			/* 346 = linux_setns */
 	"linux_process_vm_readv",			/* 347 = linux_process_vm_readv */
 	"linux_process_vm_writev",			/* 348 = linux_process_vm_writev */
+	"#349",			/* 349 = nosys */
 };

Modified: trunk/sys/i386/linux/linux_sysent.c
===================================================================
--- trunk/sys/i386/linux/linux_sysent.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_sysent.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,9 +1,9 @@
+/* $MidnightBSD$ */
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $MidnightBSD$
- * created from FreeBSD
+ * $FreeBSD: stable/10/sys/i386/linux/linux_sysent.c 318164 2017-05-10 23:09:17Z jhb $
  */
 
 #include <sys/param.h>
@@ -19,7 +19,7 @@
 struct sysent linux_sysent[] = {
 #define	nosys	linux_nosys
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 0 = setup */
-	{ AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 1 = exit */
+	{ AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 1 = linux_exit */
 	{ 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC },	/* 2 = linux_fork */
 	{ AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 3 = read */
 	{ AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 4 = write */
@@ -172,14 +172,14 @@
 	{ AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC },	/* 151 = munlock */
 	{ AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 152 = mlockall */
 	{ 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 153 = munlockall */
-	{ AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC },	/* 154 = sched_setparam */
-	{ AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC },	/* 155 = sched_getparam */
+	{ AS(linux_sched_setparam_args), (sy_call_t *)linux_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC },	/* 154 = linux_sched_setparam */
+	{ AS(linux_sched_getparam_args), (sy_call_t *)linux_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC },	/* 155 = linux_sched_getparam */
 	{ AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC },	/* 156 = linux_sched_setscheduler */
 	{ AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC },	/* 157 = linux_sched_getscheduler */
 	{ 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 158 = sched_yield */
 	{ AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0, 0, SY_THR_STATIC },	/* 159 = linux_sched_get_priority_max */
 	{ AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0, 0, SY_THR_STATIC },	/* 160 = linux_sched_get_priority_min */
-	{ AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 161 = sched_rr_get_interval */
+	{ AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 161 = linux_sched_rr_get_interval */
 	{ AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 162 = linux_nanosleep */
 	{ AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 163 = linux_mremap */
 	{ AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC },	/* 164 = linux_setresuid16 */
@@ -196,7 +196,7 @@
 	{ AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 175 = linux_rt_sigprocmask */
 	{ AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 176 = linux_rt_sigpending */
 	{ AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 177 = linux_rt_sigtimedwait */
-	{ 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 178 = linux_rt_sigqueueinfo */
+	{ AS(linux_rt_sigqueueinfo_args), (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 178 = linux_rt_sigqueueinfo */
 	{ AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 179 = linux_rt_sigsuspend */
 	{ AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC },	/* 180 = linux_pread */
 	{ AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC },	/* 181 = linux_pwrite */
@@ -272,9 +272,9 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 251 =  */
 	{ AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 252 = linux_exit_group */
 	{ 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 253 = linux_lookup_dcookie */
-	{ 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 254 = linux_epoll_create */
-	{ 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 255 = linux_epoll_ctl */
-	{ 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 256 = linux_epoll_wait */
+	{ AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 254 = linux_epoll_create */
+	{ AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 255 = linux_epoll_ctl */
+	{ AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 256 = linux_epoll_wait */
 	{ 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 257 = linux_remap_file_pages */
 	{ AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 258 = linux_set_tid_address */
 	{ AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 259 = linux_timer_create */
@@ -287,7 +287,7 @@
 	{ AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 266 = linux_clock_getres */
 	{ AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 267 = linux_clock_nanosleep */
 	{ AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC },	/* 268 = linux_statfs64 */
-	{ 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC },	/* 269 = linux_fstatfs64 */
+	{ AS(linux_fstatfs64_args), (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC },	/* 269 = linux_fstatfs64 */
 	{ AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 270 = linux_tgkill */
 	{ AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC },	/* 271 = linux_utimes */
 	{ AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 272 = linux_fadvise64_64 */
@@ -302,7 +302,7 @@
 	{ AS(linux_mq_notify_args), (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 281 = linux_mq_notify */
 	{ AS(linux_mq_getsetattr_args), (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 282 = linux_mq_getsetattr */
 	{ 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 283 = linux_kexec_load */
-	{ 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 284 = linux_waitid */
+	{ AS(linux_waitid_args), (sy_call_t *)linux_waitid, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC },	/* 284 = linux_waitid */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 285 =  */
 	{ 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 286 = linux_add_key */
 	{ 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 287 = linux_request_key */
@@ -326,8 +326,8 @@
 	{ AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 305 = linux_readlinkat */
 	{ AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 306 = linux_fchmodat */
 	{ AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 307 = linux_faccessat */
-	{ 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 308 = linux_pselect6 */
-	{ 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 309 = linux_ppoll */
+	{ AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 308 = linux_pselect6 */
+	{ AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 309 = linux_ppoll */
 	{ 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 310 = linux_unshare */
 	{ AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 311 = linux_set_robust_list */
 	{ AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 312 = linux_get_robust_list */
@@ -337,18 +337,18 @@
 	{ 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 316 = linux_vmsplice */
 	{ 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 317 = linux_move_pages */
 	{ 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 318 = linux_getcpu */
-	{ 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 319 = linux_epoll_pwait */
-	{ 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 320 = linux_utimensat */
+	{ AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 319 = linux_epoll_pwait */
+	{ AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 320 = linux_utimensat */
 	{ 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 321 = linux_signalfd */
 	{ 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 322 = linux_timerfd_create */
-	{ 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 323 = linux_eventfd */
-	{ 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 324 = linux_fallocate */
+	{ AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 323 = linux_eventfd */
+	{ AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 324 = linux_fallocate */
 	{ 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 325 = linux_timerfd_settime */
 	{ 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 326 = linux_timerfd_gettime */
 	{ 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 327 = linux_signalfd4 */
-	{ 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 328 = linux_eventfd2 */
-	{ 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 329 = linux_epoll_create1 */
-	{ 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 330 = linux_dup3 */
+	{ AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 328 = linux_eventfd2 */
+	{ AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 329 = linux_epoll_create1 */
+	{ AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 330 = linux_dup3 */
 	{ AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 331 = linux_pipe2 */
 	{ 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 332 = linux_inotify_init1 */
 	{ 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 333 = linux_preadv */
@@ -355,16 +355,17 @@
 	{ 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 334 = linux_pwritev */
 	{ 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 335 = linux_rt_tsigqueueinfo */
 	{ 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 336 = linux_perf_event_open */
-	{ 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 337 = linux_recvmmsg */
+	{ AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 337 = linux_recvmmsg */
 	{ 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 338 = linux_fanotify_init */
 	{ 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 339 = linux_fanotify_mark */
-	{ 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 340 = linux_prlimit64 */
+	{ AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 340 = linux_prlimit64 */
 	{ 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 341 = linux_name_to_handle_at */
 	{ 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 342 = linux_open_by_handle_at */
 	{ 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 343 = linux_clock_adjtime */
-	{ 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 344 = linux_syncfs */
-	{ 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 345 = linux_sendmmsg */
+	{ AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC },	/* 344 = linux_syncfs */
+	{ AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 345 = linux_sendmmsg */
 	{ 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 346 = linux_setns */
 	{ 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 347 = linux_process_vm_readv */
 	{ 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 348 = linux_process_vm_writev */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 349 = nosys */
 };

Modified: trunk/sys/i386/linux/linux_systrace_args.c
===================================================================
--- trunk/sys/i386/linux/linux_systrace_args.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_systrace_args.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,8 +1,9 @@
+/* $MidnightBSD$ */
 /*
  * System call argument to DTrace register array converstion.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/i386/linux/linux_systrace_args.c 302963 2016-07-17 15:11:23Z dchagin $
  * This file is part of the DTrace syscall provider.
  */
 
@@ -12,9 +13,9 @@
 	int64_t *iarg  = (int64_t *) uarg;
 	switch (sysnum) {
 #define	nosys	linux_nosys
-	/* sys_exit */
+	/* linux_exit */
 	case 1: {
-		struct sys_exit_args *p = params;
+		struct linux_exit_args *p = params;
 		iarg[0] = p->rval; /* int */
 		*n_args = 1;
 		break;
@@ -570,7 +571,7 @@
 	case 84: {
 		struct linux_lstat_args *p = params;
 		uarg[0] = (intptr_t) p->path; /* char * */
-		uarg[1] = (intptr_t) p->up; /* struct ostat * */
+		uarg[1] = (intptr_t) p->up; /* struct l_stat * */
 		*n_args = 2;
 		break;
 	}
@@ -772,7 +773,7 @@
 	/* linux_iopl */
 	case 110: {
 		struct linux_iopl_args *p = params;
-		iarg[0] = p->level; /* l_ulong */
+		iarg[0] = p->level; /* l_int */
 		*n_args = 1;
 		break;
 	}
@@ -790,9 +791,9 @@
 	case 114: {
 		struct linux_wait4_args *p = params;
 		iarg[0] = p->pid; /* l_pid_t */
-		uarg[1] = (intptr_t) p->status; /* l_uint * */
+		uarg[1] = (intptr_t) p->status; /* l_int * */
 		iarg[2] = p->options; /* l_int */
-		uarg[3] = (intptr_t) p->rusage; /* struct l_rusage * */
+		uarg[3] = (intptr_t) p->rusage; /* void * */
 		*n_args = 4;
 		break;
 	}
@@ -948,7 +949,7 @@
 	/* linux_personality */
 	case 136: {
 		struct linux_personality_args *p = params;
-		iarg[0] = p->per; /* l_ulong */
+		iarg[0] = p->per; /* l_uint */
 		*n_args = 1;
 		break;
 	}
@@ -1081,18 +1082,18 @@
 		*n_args = 0;
 		break;
 	}
-	/* sched_setparam */
+	/* linux_sched_setparam */
 	case 154: {
-		struct sched_setparam_args *p = params;
-		iarg[0] = p->pid; /* pid_t */
-		uarg[1] = (intptr_t) p->param; /* const struct sched_param * */
+		struct linux_sched_setparam_args *p = params;
+		iarg[0] = p->pid; /* l_pid_t */
+		uarg[1] = (intptr_t) p->param; /* struct sched_param * */
 		*n_args = 2;
 		break;
 	}
-	/* sched_getparam */
+	/* linux_sched_getparam */
 	case 155: {
-		struct sched_getparam_args *p = params;
-		iarg[0] = p->pid; /* pid_t */
+		struct linux_sched_getparam_args *p = params;
+		iarg[0] = p->pid; /* l_pid_t */
 		uarg[1] = (intptr_t) p->param; /* struct sched_param * */
 		*n_args = 2;
 		break;
@@ -1102,7 +1103,7 @@
 		struct linux_sched_setscheduler_args *p = params;
 		iarg[0] = p->pid; /* l_pid_t */
 		iarg[1] = p->policy; /* l_int */
-		uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */
+		uarg[2] = (intptr_t) p->param; /* struct sched_param * */
 		*n_args = 3;
 		break;
 	}
@@ -1132,9 +1133,9 @@
 		*n_args = 1;
 		break;
 	}
-	/* sched_rr_get_interval */
+	/* linux_sched_rr_get_interval */
 	case 161: {
-		struct sched_rr_get_interval_args *p = params;
+		struct linux_sched_rr_get_interval_args *p = params;
 		iarg[0] = p->pid; /* l_pid_t */
 		uarg[1] = (intptr_t) p->interval; /* struct l_timespec * */
 		*n_args = 2;
@@ -1277,7 +1278,11 @@
 	}
 	/* linux_rt_sigqueueinfo */
 	case 178: {
-		*n_args = 0;
+		struct linux_rt_sigqueueinfo_args *p = params;
+		iarg[0] = p->pid; /* l_pid_t */
+		iarg[1] = p->sig; /* l_int */
+		uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+		*n_args = 3;
 		break;
 	}
 	/* linux_rt_sigsuspend */
@@ -1398,28 +1403,25 @@
 	/* linux_stat64 */
 	case 195: {
 		struct linux_stat64_args *p = params;
-		uarg[0] = (intptr_t) p->filename; /* char * */
+		uarg[0] = (intptr_t) p->filename; /* const char * */
 		uarg[1] = (intptr_t) p->statbuf; /* struct l_stat64 * */
-		iarg[2] = p->flags; /* l_long */
-		*n_args = 3;
+		*n_args = 2;
 		break;
 	}
 	/* linux_lstat64 */
 	case 196: {
 		struct linux_lstat64_args *p = params;
-		uarg[0] = (intptr_t) p->filename; /* char * */
+		uarg[0] = (intptr_t) p->filename; /* const char * */
 		uarg[1] = (intptr_t) p->statbuf; /* struct l_stat64 * */
-		iarg[2] = p->flags; /* l_long */
-		*n_args = 3;
+		*n_args = 2;
 		break;
 	}
 	/* linux_fstat64 */
 	case 197: {
 		struct linux_fstat64_args *p = params;
-		iarg[0] = p->fd; /* l_ulong */
+		iarg[0] = p->fd; /* l_int */
 		uarg[1] = (intptr_t) p->statbuf; /* struct l_stat64 * */
-		iarg[2] = p->flags; /* l_long */
-		*n_args = 3;
+		*n_args = 2;
 		break;
 	}
 	/* linux_lchown */
@@ -1746,17 +1748,29 @@
 	}
 	/* linux_epoll_create */
 	case 254: {
-		*n_args = 0;
+		struct linux_epoll_create_args *p = params;
+		iarg[0] = p->size; /* l_int */
+		*n_args = 1;
 		break;
 	}
 	/* linux_epoll_ctl */
 	case 255: {
-		*n_args = 0;
+		struct linux_epoll_ctl_args *p = params;
+		iarg[0] = p->epfd; /* l_int */
+		iarg[1] = p->op; /* l_int */
+		iarg[2] = p->fd; /* l_int */
+		uarg[3] = (intptr_t) p->event; /* struct epoll_event * */
+		*n_args = 4;
 		break;
 	}
 	/* linux_epoll_wait */
 	case 256: {
-		*n_args = 0;
+		struct linux_epoll_wait_args *p = params;
+		iarg[0] = p->epfd; /* l_int */
+		uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+		iarg[2] = p->maxevents; /* l_int */
+		iarg[3] = p->timeout; /* l_int */
+		*n_args = 4;
 		break;
 	}
 	/* linux_remap_file_pages */
@@ -1784,9 +1798,10 @@
 	case 260: {
 		struct linux_timer_settime_args *p = params;
 		iarg[0] = p->timerid; /* l_timer_t */
-		uarg[1] = (intptr_t) p->new; /* const struct itimerspec * */
-		uarg[2] = (intptr_t) p->old; /* struct itimerspec * */
-		*n_args = 3;
+		iarg[1] = p->flags; /* l_int */
+		uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */
+		uarg[3] = (intptr_t) p->old; /* struct itimerspec * */
+		*n_args = 4;
 		break;
 	}
 	/* linux_timer_gettime */
@@ -1856,7 +1871,11 @@
 	}
 	/* linux_fstatfs64 */
 	case 269: {
-		*n_args = 0;
+		struct linux_fstatfs64_args *p = params;
+		iarg[0] = p->fd; /* l_uint */
+		uarg[1] = p->bufsize; /* size_t */
+		uarg[2] = (intptr_t) p->buf; /* struct l_statfs64_buf * */
+		*n_args = 3;
 		break;
 	}
 	/* linux_tgkill */
@@ -1964,7 +1983,13 @@
 	}
 	/* linux_waitid */
 	case 284: {
-		*n_args = 0;
+		struct linux_waitid_args *p = params;
+		iarg[0] = p->idtype; /* int */
+		iarg[1] = p->id; /* l_pid_t */
+		uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+		iarg[3] = p->options; /* int */
+		uarg[4] = (intptr_t) p->rusage; /* void * */
+		*n_args = 5;
 		break;
 	}
 	/* linux_add_key */
@@ -2097,7 +2122,7 @@
 		uarg[1] = (intptr_t) p->oldname; /* const char * */
 		iarg[2] = p->newdfd; /* l_int */
 		uarg[3] = (intptr_t) p->newname; /* const char * */
-		iarg[4] = p->flags; /* l_int */
+		iarg[4] = p->flag; /* l_int */
 		*n_args = 5;
 		break;
 	}
@@ -2140,12 +2165,25 @@
 	}
 	/* linux_pselect6 */
 	case 308: {
-		*n_args = 0;
+		struct linux_pselect6_args *p = params;
+		iarg[0] = p->nfds; /* l_int */
+		uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */
+		uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */
+		uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */
+		uarg[4] = (intptr_t) p->tsp; /* struct l_timespec * */
+		uarg[5] = (intptr_t) p->sig; /* l_uintptr_t * */
+		*n_args = 6;
 		break;
 	}
 	/* linux_ppoll */
 	case 309: {
-		*n_args = 0;
+		struct linux_ppoll_args *p = params;
+		uarg[0] = (intptr_t) p->fds; /* struct pollfd * */
+		uarg[1] = p->nfds; /* uint32_t */
+		uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */
+		uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */
+		iarg[4] = p->ssize; /* l_size_t */
+		*n_args = 5;
 		break;
 	}
 	/* linux_unshare */
@@ -2202,12 +2240,23 @@
 	}
 	/* linux_epoll_pwait */
 	case 319: {
-		*n_args = 0;
+		struct linux_epoll_pwait_args *p = params;
+		iarg[0] = p->epfd; /* l_int */
+		uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+		iarg[2] = p->maxevents; /* l_int */
+		iarg[3] = p->timeout; /* l_int */
+		uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */
+		*n_args = 5;
 		break;
 	}
 	/* linux_utimensat */
 	case 320: {
-		*n_args = 0;
+		struct linux_utimensat_args *p = params;
+		iarg[0] = p->dfd; /* l_int */
+		uarg[1] = (intptr_t) p->pathname; /* const char * */
+		uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */
+		iarg[3] = p->flags; /* l_int */
+		*n_args = 4;
 		break;
 	}
 	/* linux_signalfd */
@@ -2222,12 +2271,19 @@
 	}
 	/* linux_eventfd */
 	case 323: {
-		*n_args = 0;
+		struct linux_eventfd_args *p = params;
+		iarg[0] = p->initval; /* l_uint */
+		*n_args = 1;
 		break;
 	}
 	/* linux_fallocate */
 	case 324: {
-		*n_args = 0;
+		struct linux_fallocate_args *p = params;
+		iarg[0] = p->fd; /* l_int */
+		iarg[1] = p->mode; /* l_int */
+		iarg[2] = p->offset; /* l_loff_t */
+		iarg[3] = p->len; /* l_loff_t */
+		*n_args = 4;
 		break;
 	}
 	/* linux_timerfd_settime */
@@ -2247,17 +2303,26 @@
 	}
 	/* linux_eventfd2 */
 	case 328: {
-		*n_args = 0;
+		struct linux_eventfd2_args *p = params;
+		iarg[0] = p->initval; /* l_uint */
+		iarg[1] = p->flags; /* l_int */
+		*n_args = 2;
 		break;
 	}
 	/* linux_epoll_create1 */
 	case 329: {
-		*n_args = 0;
+		struct linux_epoll_create1_args *p = params;
+		iarg[0] = p->flags; /* l_int */
+		*n_args = 1;
 		break;
 	}
 	/* linux_dup3 */
 	case 330: {
-		*n_args = 0;
+		struct linux_dup3_args *p = params;
+		iarg[0] = p->oldfd; /* l_int */
+		iarg[1] = p->newfd; /* l_int */
+		iarg[2] = p->flags; /* l_int */
+		*n_args = 3;
 		break;
 	}
 	/* linux_pipe2 */
@@ -2295,7 +2360,13 @@
 	}
 	/* linux_recvmmsg */
 	case 337: {
-		*n_args = 0;
+		struct linux_recvmmsg_args *p = params;
+		iarg[0] = p->s; /* l_int */
+		uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+		iarg[2] = p->vlen; /* l_uint */
+		iarg[3] = p->flags; /* l_uint */
+		uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */
+		*n_args = 5;
 		break;
 	}
 	/* linux_fanotify_init */
@@ -2310,7 +2381,12 @@
 	}
 	/* linux_prlimit64 */
 	case 340: {
-		*n_args = 0;
+		struct linux_prlimit64_args *p = params;
+		iarg[0] = p->pid; /* l_pid_t */
+		iarg[1] = p->resource; /* l_uint */
+		uarg[2] = (intptr_t) p->new; /* struct rlimit * */
+		uarg[3] = (intptr_t) p->old; /* struct rlimit * */
+		*n_args = 4;
 		break;
 	}
 	/* linux_name_to_handle_at */
@@ -2330,12 +2406,19 @@
 	}
 	/* linux_syncfs */
 	case 344: {
-		*n_args = 0;
+		struct linux_syncfs_args *p = params;
+		iarg[0] = p->fd; /* l_int */
+		*n_args = 1;
 		break;
 	}
 	/* linux_sendmmsg */
 	case 345: {
-		*n_args = 0;
+		struct linux_sendmmsg_args *p = params;
+		iarg[0] = p->s; /* l_int */
+		uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+		iarg[2] = p->vlen; /* l_uint */
+		iarg[3] = p->flags; /* l_uint */
+		*n_args = 4;
 		break;
 	}
 	/* linux_setns */
@@ -2359,12 +2442,12 @@
 	};
 }
 static void
-systrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
+systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 {
 	const char *p = NULL;
 	switch (sysnum) {
 #define	nosys	linux_nosys
-	/* sys_exit */
+	/* linux_exit */
 	case 1:
 		switch(ndx) {
 		case 0:
@@ -3194,7 +3277,7 @@
 			p = "char *";
 			break;
 		case 1:
-			p = "struct ostat *";
+			p = "struct l_stat *";
 			break;
 		default:
 			break;
@@ -3524,7 +3607,7 @@
 	case 110:
 		switch(ndx) {
 		case 0:
-			p = "l_ulong";
+			p = "l_int";
 			break;
 		default:
 			break;
@@ -3543,13 +3626,13 @@
 			p = "l_pid_t";
 			break;
 		case 1:
-			p = "l_uint *";
+			p = "l_int *";
 			break;
 		case 2:
 			p = "l_int";
 			break;
 		case 3:
-			p = "struct l_rusage *";
+			p = "void *";
 			break;
 		default:
 			break;
@@ -3767,7 +3850,7 @@
 	case 136:
 		switch(ndx) {
 		case 0:
-			p = "l_ulong";
+			p = "l_uint";
 			break;
 		default:
 			break;
@@ -3983,24 +4066,24 @@
 	/* munlockall */
 	case 153:
 		break;
-	/* sched_setparam */
+	/* linux_sched_setparam */
 	case 154:
 		switch(ndx) {
 		case 0:
-			p = "pid_t";
+			p = "l_pid_t";
 			break;
 		case 1:
-			p = "const struct sched_param *";
+			p = "struct sched_param *";
 			break;
 		default:
 			break;
 		};
 		break;
-	/* sched_getparam */
+	/* linux_sched_getparam */
 	case 155:
 		switch(ndx) {
 		case 0:
-			p = "pid_t";
+			p = "l_pid_t";
 			break;
 		case 1:
 			p = "struct sched_param *";
@@ -4019,7 +4102,7 @@
 			p = "l_int";
 			break;
 		case 2:
-			p = "struct l_sched_param *";
+			p = "struct sched_param *";
 			break;
 		default:
 			break;
@@ -4058,7 +4141,7 @@
 			break;
 		};
 		break;
-	/* sched_rr_get_interval */
+	/* linux_sched_rr_get_interval */
 	case 161:
 		switch(ndx) {
 		case 0:
@@ -4299,6 +4382,19 @@
 		break;
 	/* linux_rt_sigqueueinfo */
 	case 178:
+		switch(ndx) {
+		case 0:
+			p = "l_pid_t";
+			break;
+		case 1:
+			p = "l_int";
+			break;
+		case 2:
+			p = "l_siginfo_t *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_rt_sigsuspend */
 	case 179:
@@ -4493,14 +4589,11 @@
 	case 195:
 		switch(ndx) {
 		case 0:
-			p = "char *";
+			p = "const char *";
 			break;
 		case 1:
 			p = "struct l_stat64 *";
 			break;
-		case 2:
-			p = "l_long";
-			break;
 		default:
 			break;
 		};
@@ -4509,14 +4602,11 @@
 	case 196:
 		switch(ndx) {
 		case 0:
-			p = "char *";
+			p = "const char *";
 			break;
 		case 1:
 			p = "struct l_stat64 *";
 			break;
-		case 2:
-			p = "l_long";
-			break;
 		default:
 			break;
 		};
@@ -4525,14 +4615,11 @@
 	case 197:
 		switch(ndx) {
 		case 0:
-			p = "l_ulong";
+			p = "l_int";
 			break;
 		case 1:
 			p = "struct l_stat64 *";
 			break;
-		case 2:
-			p = "l_long";
-			break;
 		default:
 			break;
 		};
@@ -4980,12 +5067,51 @@
 		break;
 	/* linux_epoll_create */
 	case 254:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_epoll_ctl */
 	case 255:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "l_int";
+			break;
+		case 2:
+			p = "l_int";
+			break;
+		case 3:
+			p = "struct epoll_event *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_epoll_wait */
 	case 256:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "struct epoll_event *";
+			break;
+		case 2:
+			p = "l_int";
+			break;
+		case 3:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_remap_file_pages */
 	case 257:
@@ -5023,9 +5149,12 @@
 			p = "l_timer_t";
 			break;
 		case 1:
+			p = "l_int";
+			break;
+		case 2:
 			p = "const struct itimerspec *";
 			break;
-		case 2:
+		case 3:
 			p = "struct itimerspec *";
 			break;
 		default:
@@ -5141,6 +5270,19 @@
 		break;
 	/* linux_fstatfs64 */
 	case 269:
+		switch(ndx) {
+		case 0:
+			p = "l_uint";
+			break;
+		case 1:
+			p = "size_t";
+			break;
+		case 2:
+			p = "struct l_statfs64_buf *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_tgkill */
 	case 270:
@@ -5306,6 +5448,25 @@
 		break;
 	/* linux_waitid */
 	case 284:
+		switch(ndx) {
+		case 0:
+			p = "int";
+			break;
+		case 1:
+			p = "l_pid_t";
+			break;
+		case 2:
+			p = "l_siginfo_t *";
+			break;
+		case 3:
+			p = "int";
+			break;
+		case 4:
+			p = "void *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_add_key */
 	case 286:
@@ -5571,9 +5732,50 @@
 		break;
 	/* linux_pselect6 */
 	case 308:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "l_fd_set *";
+			break;
+		case 2:
+			p = "l_fd_set *";
+			break;
+		case 3:
+			p = "l_fd_set *";
+			break;
+		case 4:
+			p = "struct l_timespec *";
+			break;
+		case 5:
+			p = "l_uintptr_t *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_ppoll */
 	case 309:
+		switch(ndx) {
+		case 0:
+			p = "struct pollfd *";
+			break;
+		case 1:
+			p = "uint32_t";
+			break;
+		case 2:
+			p = "struct l_timespec *";
+			break;
+		case 3:
+			p = "l_sigset_t *";
+			break;
+		case 4:
+			p = "l_size_t";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_unshare */
 	case 310:
@@ -5627,9 +5829,44 @@
 		break;
 	/* linux_epoll_pwait */
 	case 319:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "struct epoll_event *";
+			break;
+		case 2:
+			p = "l_int";
+			break;
+		case 3:
+			p = "l_int";
+			break;
+		case 4:
+			p = "l_sigset_t *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_utimensat */
 	case 320:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "const char *";
+			break;
+		case 2:
+			p = "const struct l_timespec *";
+			break;
+		case 3:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_signalfd */
 	case 321:
@@ -5639,9 +5876,32 @@
 		break;
 	/* linux_eventfd */
 	case 323:
+		switch(ndx) {
+		case 0:
+			p = "l_uint";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_fallocate */
 	case 324:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "l_int";
+			break;
+		case 2:
+			p = "l_loff_t";
+			break;
+		case 3:
+			p = "l_loff_t";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_timerfd_settime */
 	case 325:
@@ -5654,12 +5914,42 @@
 		break;
 	/* linux_eventfd2 */
 	case 328:
+		switch(ndx) {
+		case 0:
+			p = "l_uint";
+			break;
+		case 1:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_epoll_create1 */
 	case 329:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_dup3 */
 	case 330:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "l_int";
+			break;
+		case 2:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_pipe2 */
 	case 331:
@@ -5691,6 +5981,25 @@
 		break;
 	/* linux_recvmmsg */
 	case 337:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "struct l_mmsghdr *";
+			break;
+		case 2:
+			p = "l_uint";
+			break;
+		case 3:
+			p = "l_uint";
+			break;
+		case 4:
+			p = "struct l_timespec *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_fanotify_init */
 	case 338:
@@ -5700,6 +6009,22 @@
 		break;
 	/* linux_prlimit64 */
 	case 340:
+		switch(ndx) {
+		case 0:
+			p = "l_pid_t";
+			break;
+		case 1:
+			p = "l_uint";
+			break;
+		case 2:
+			p = "struct rlimit *";
+			break;
+		case 3:
+			p = "struct rlimit *";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_name_to_handle_at */
 	case 341:
@@ -5712,9 +6037,32 @@
 		break;
 	/* linux_syncfs */
 	case 344:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_sendmmsg */
 	case 345:
+		switch(ndx) {
+		case 0:
+			p = "l_int";
+			break;
+		case 1:
+			p = "struct l_mmsghdr *";
+			break;
+		case 2:
+			p = "l_uint";
+			break;
+		case 3:
+			p = "l_uint";
+			break;
+		default:
+			break;
+		};
 		break;
 	/* linux_setns */
 	case 346:
@@ -5731,3 +6079,1360 @@
 	if (p != NULL)
 		strlcpy(desc, p, descsz);
 }
+static void
+systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
+{
+	const char *p = NULL;
+	switch (sysnum) {
+#define	nosys	linux_nosys
+	/* linux_exit */
+	case 1:
+		if (ndx == 0 || ndx == 1)
+			p = "void";
+		break;
+	/* linux_fork */
+	case 2:
+	/* read */
+	case 3:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* write */
+	case 4:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_open */
+	case 5:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* close */
+	case 6:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_waitpid */
+	case 7:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_creat */
+	case 8:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_link */
+	case 9:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_unlink */
+	case 10:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_execve */
+	case 11:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_chdir */
+	case 12:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_time */
+	case 13:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mknod */
+	case 14:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_chmod */
+	case 15:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_lchown16 */
+	case 16:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_stat */
+	case 18:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_lseek */
+	case 19:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getpid */
+	case 20:
+	/* linux_mount */
+	case 21:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_oldumount */
+	case 22:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setuid16 */
+	case 23:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getuid16 */
+	case 24:
+	/* linux_stime */
+	case 25:
+	/* linux_ptrace */
+	case 26:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_alarm */
+	case 27:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fstat */
+	case 28:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pause */
+	case 29:
+	/* linux_utime */
+	case 30:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_access */
+	case 33:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_nice */
+	case 34:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* sync */
+	case 36:
+	/* linux_kill */
+	case 37:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rename */
+	case 38:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mkdir */
+	case 39:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rmdir */
+	case 40:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* dup */
+	case 41:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pipe */
+	case 42:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_times */
+	case 43:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_brk */
+	case 45:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setgid16 */
+	case 46:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getgid16 */
+	case 47:
+	/* linux_signal */
+	case 48:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_geteuid16 */
+	case 49:
+	/* linux_getegid16 */
+	case 50:
+	/* acct */
+	case 51:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_umount */
+	case 52:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ioctl */
+	case 54:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fcntl */
+	case 55:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* setpgid */
+	case 57:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_olduname */
+	case 59:
+	/* umask */
+	case 60:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* chroot */
+	case 61:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ustat */
+	case 62:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* dup2 */
+	case 63:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getppid */
+	case 64:
+	/* getpgrp */
+	case 65:
+	/* setsid */
+	case 66:
+	/* linux_sigaction */
+	case 67:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sgetmask */
+	case 68:
+	/* linux_ssetmask */
+	case 69:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setreuid16 */
+	case 70:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setregid16 */
+	case 71:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sigsuspend */
+	case 72:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sigpending */
+	case 73:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sethostname */
+	case 74:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setrlimit */
+	case 75:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_old_getrlimit */
+	case 76:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* getrusage */
+	case 77:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* gettimeofday */
+	case 78:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* settimeofday */
+	case 79:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getgroups16 */
+	case 80:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setgroups16 */
+	case 81:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_old_select */
+	case 82:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_symlink */
+	case 83:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_lstat */
+	case 84:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_readlink */
+	case 85:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_uselib */
+	case 86:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* swapon */
+	case 87:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_reboot */
+	case 88:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_readdir */
+	case 89:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mmap */
+	case 90:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* munmap */
+	case 91:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_truncate */
+	case 92:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ftruncate */
+	case 93:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* fchmod */
+	case 94:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* fchown */
+	case 95:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getpriority */
+	case 96:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* setpriority */
+	case 97:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_statfs */
+	case 99:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fstatfs */
+	case 100:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ioperm */
+	case 101:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_socketcall */
+	case 102:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_syslog */
+	case 103:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setitimer */
+	case 104:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getitimer */
+	case 105:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_newstat */
+	case 106:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_newlstat */
+	case 107:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_newfstat */
+	case 108:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_uname */
+	case 109:
+	/* linux_iopl */
+	case 110:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_vhangup */
+	case 111:
+	/* linux_vm86old */
+	case 113:
+	/* linux_wait4 */
+	case 114:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_swapoff */
+	case 115:
+	/* linux_sysinfo */
+	case 116:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ipc */
+	case 117:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* fsync */
+	case 118:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sigreturn */
+	case 119:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_clone */
+	case 120:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setdomainname */
+	case 121:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_newuname */
+	case 122:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_modify_ldt */
+	case 123:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_adjtimex */
+	case 124:
+	/* linux_mprotect */
+	case 125:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sigprocmask */
+	case 126:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_create_module */
+	case 127:
+	/* linux_init_module */
+	case 128:
+	/* linux_delete_module */
+	case 129:
+	/* linux_get_kernel_syms */
+	case 130:
+	/* linux_quotactl */
+	case 131:
+	/* getpgid */
+	case 132:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* fchdir */
+	case 133:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_bdflush */
+	case 134:
+	/* linux_sysfs */
+	case 135:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_personality */
+	case 136:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setfsuid16 */
+	case 138:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setfsgid16 */
+	case 139:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_llseek */
+	case 140:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getdents */
+	case 141:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_select */
+	case 142:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* flock */
+	case 143:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_msync */
+	case 144:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* readv */
+	case 145:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* writev */
+	case 146:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getsid */
+	case 147:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fdatasync */
+	case 148:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sysctl */
+	case 149:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* mlock */
+	case 150:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* munlock */
+	case 151:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* mlockall */
+	case 152:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* munlockall */
+	case 153:
+	/* linux_sched_setparam */
+	case 154:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_getparam */
+	case 155:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_setscheduler */
+	case 156:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_getscheduler */
+	case 157:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* sched_yield */
+	case 158:
+	/* linux_sched_get_priority_max */
+	case 159:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_get_priority_min */
+	case 160:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_rr_get_interval */
+	case 161:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_nanosleep */
+	case 162:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mremap */
+	case 163:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setresuid16 */
+	case 164:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getresuid16 */
+	case 165:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_vm86 */
+	case 166:
+	/* linux_query_module */
+	case 167:
+	/* poll */
+	case 168:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_nfsservctl */
+	case 169:
+	/* linux_setresgid16 */
+	case 170:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getresgid16 */
+	case 171:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_prctl */
+	case 172:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigreturn */
+	case 173:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigaction */
+	case 174:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigprocmask */
+	case 175:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigpending */
+	case 176:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigtimedwait */
+	case 177:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigqueueinfo */
+	case 178:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_rt_sigsuspend */
+	case 179:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pread */
+	case 180:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pwrite */
+	case 181:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_chown16 */
+	case 182:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getcwd */
+	case 183:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_capget */
+	case 184:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_capset */
+	case 185:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sigaltstack */
+	case 186:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sendfile */
+	case 187:
+	/* linux_vfork */
+	case 190:
+	/* linux_getrlimit */
+	case 191:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mmap2 */
+	case 192:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_truncate64 */
+	case 193:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ftruncate64 */
+	case 194:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_stat64 */
+	case 195:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_lstat64 */
+	case 196:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fstat64 */
+	case 197:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_lchown */
+	case 198:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getuid */
+	case 199:
+	/* linux_getgid */
+	case 200:
+	/* geteuid */
+	case 201:
+	/* getegid */
+	case 202:
+	/* setreuid */
+	case 203:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* setregid */
+	case 204:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getgroups */
+	case 205:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setgroups */
+	case 206:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* fchown */
+	case 207:
+	/* setresuid */
+	case 208:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* getresuid */
+	case 209:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* setresgid */
+	case 210:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* getresgid */
+	case 211:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_chown */
+	case 212:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* setuid */
+	case 213:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* setgid */
+	case 214:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setfsuid */
+	case 215:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setfsgid */
+	case 216:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pivot_root */
+	case 217:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mincore */
+	case 218:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* madvise */
+	case 219:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_getdents64 */
+	case 220:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fcntl64 */
+	case 221:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_gettid */
+	case 224:
+	/* linux_setxattr */
+	case 226:
+	/* linux_lsetxattr */
+	case 227:
+	/* linux_fsetxattr */
+	case 228:
+	/* linux_getxattr */
+	case 229:
+	/* linux_lgetxattr */
+	case 230:
+	/* linux_fgetxattr */
+	case 231:
+	/* linux_listxattr */
+	case 232:
+	/* linux_llistxattr */
+	case 233:
+	/* linux_flistxattr */
+	case 234:
+	/* linux_removexattr */
+	case 235:
+	/* linux_lremovexattr */
+	case 236:
+	/* linux_fremovexattr */
+	case 237:
+	/* linux_tkill */
+	case 238:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sys_futex */
+	case 240:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_setaffinity */
+	case 241:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sched_getaffinity */
+	case 242:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_set_thread_area */
+	case 243:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_get_thread_area */
+	case 244:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fadvise64 */
+	case 250:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_exit_group */
+	case 252:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_lookup_dcookie */
+	case 253:
+	/* linux_epoll_create */
+	case 254:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_epoll_ctl */
+	case 255:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_epoll_wait */
+	case 256:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_remap_file_pages */
+	case 257:
+	/* linux_set_tid_address */
+	case 258:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_timer_create */
+	case 259:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_timer_settime */
+	case 260:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_timer_gettime */
+	case 261:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_timer_getoverrun */
+	case 262:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_timer_delete */
+	case 263:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_clock_settime */
+	case 264:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_clock_gettime */
+	case 265:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_clock_getres */
+	case 266:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_clock_nanosleep */
+	case 267:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_statfs64 */
+	case 268:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fstatfs64 */
+	case 269:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_tgkill */
+	case 270:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_utimes */
+	case 271:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fadvise64_64 */
+	case 272:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mbind */
+	case 274:
+	/* linux_get_mempolicy */
+	case 275:
+	/* linux_set_mempolicy */
+	case 276:
+	/* linux_mq_open */
+	case 277:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mq_unlink */
+	case 278:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mq_timedsend */
+	case 279:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mq_timedreceive */
+	case 280:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mq_notify */
+	case 281:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mq_getsetattr */
+	case 282:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_kexec_load */
+	case 283:
+	/* linux_waitid */
+	case 284:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_add_key */
+	case 286:
+	/* linux_request_key */
+	case 287:
+	/* linux_keyctl */
+	case 288:
+	/* linux_ioprio_set */
+	case 289:
+	/* linux_ioprio_get */
+	case 290:
+	/* linux_inotify_init */
+	case 291:
+	/* linux_inotify_add_watch */
+	case 292:
+	/* linux_inotify_rm_watch */
+	case 293:
+	/* linux_migrate_pages */
+	case 294:
+	/* linux_openat */
+	case 295:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mkdirat */
+	case 296:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_mknodat */
+	case 297:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fchownat */
+	case 298:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_futimesat */
+	case 299:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fstatat64 */
+	case 300:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_unlinkat */
+	case 301:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_renameat */
+	case 302:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_linkat */
+	case 303:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_symlinkat */
+	case 304:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_readlinkat */
+	case 305:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fchmodat */
+	case 306:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_faccessat */
+	case 307:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pselect6 */
+	case 308:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_ppoll */
+	case 309:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_unshare */
+	case 310:
+	/* linux_set_robust_list */
+	case 311:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_get_robust_list */
+	case 312:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_splice */
+	case 313:
+	/* linux_sync_file_range */
+	case 314:
+	/* linux_tee */
+	case 315:
+	/* linux_vmsplice */
+	case 316:
+	/* linux_move_pages */
+	case 317:
+	/* linux_getcpu */
+	case 318:
+	/* linux_epoll_pwait */
+	case 319:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_utimensat */
+	case 320:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_signalfd */
+	case 321:
+	/* linux_timerfd_create */
+	case 322:
+	/* linux_eventfd */
+	case 323:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fallocate */
+	case 324:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_timerfd_settime */
+	case 325:
+	/* linux_timerfd_gettime */
+	case 326:
+	/* linux_signalfd4 */
+	case 327:
+	/* linux_eventfd2 */
+	case 328:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_epoll_create1 */
+	case 329:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_dup3 */
+	case 330:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_pipe2 */
+	case 331:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_inotify_init1 */
+	case 332:
+	/* linux_preadv */
+	case 333:
+	/* linux_pwritev */
+	case 334:
+	/* linux_rt_tsigqueueinfo */
+	case 335:
+	/* linux_perf_event_open */
+	case 336:
+	/* linux_recvmmsg */
+	case 337:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_fanotify_init */
+	case 338:
+	/* linux_fanotify_mark */
+	case 339:
+	/* linux_prlimit64 */
+	case 340:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_name_to_handle_at */
+	case 341:
+	/* linux_open_by_handle_at */
+	case 342:
+	/* linux_clock_adjtime */
+	case 343:
+	/* linux_syncfs */
+	case 344:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_sendmmsg */
+	case 345:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
+	/* linux_setns */
+	case 346:
+	/* linux_process_vm_readv */
+	case 347:
+	/* linux_process_vm_writev */
+	case 348:
+	default:
+		break;
+	};
+	if (p != NULL)
+		strlcpy(desc, p, descsz);
+}

Modified: trunk/sys/i386/linux/linux_sysvec.c
===================================================================
--- trunk/sys/i386/linux/linux_sysvec.c	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/linux_sysvec.c	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 /*-
- * Copyright (c) 1994-1996 S\xF8ren Schmidt
+ * Copyright (c) 1994-1996 Søren Schmidt
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/i386/linux/linux_sysvec.c 326814 2017-12-12 22:10:12Z pfg $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -44,6 +45,7 @@
 #include <sys/proc.h>
 #include <sys/signalvar.h>
 #include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
 #include <sys/sysent.h>
 #include <sys/sysproto.h>
 #include <sys/vnode.h>
@@ -66,15 +68,15 @@
 #include <i386/linux/linux_proto.h>
 #include <compat/linux/linux_emul.h>
 #include <compat/linux/linux_futex.h>
+#include <compat/linux/linux_ioctl.h>
 #include <compat/linux/linux_mib.h>
 #include <compat/linux/linux_misc.h>
 #include <compat/linux/linux_signal.h>
 #include <compat/linux/linux_util.h>
+#include <compat/linux/linux_vdso.h>
 
 MODULE_VERSION(linux, 1);
 
-MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
-
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define SHELLMAGIC      0x2123 /* #! */
 #else
@@ -81,6 +83,13 @@
 #define SHELLMAGIC      0x2321
 #endif
 
+#if defined(DEBUG)
+SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
+            CTLTYPE_STRING | CTLFLAG_RW,
+            0, 0, linux_sysctl_debug, "A",
+            "Linux debugging control");
+#endif
+
 /*
  * Allow the sendsig functions to use the ldebug() facility
  * even though they are not syscalls themselves. Map them
@@ -92,13 +101,15 @@
 
 #define	LINUX_PS_STRINGS	(LINUX_USRSTACK - sizeof(struct ps_strings))
 
-extern char linux_sigcode[];
-extern int linux_szsigcode;
+static int linux_szsigcode;
+static vm_object_t linux_shared_page_obj;
+static char *linux_shared_page_mapping;
+extern char _binary_linux_locore_o_start;
+extern char _binary_linux_locore_o_end;
 
 extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
 
 SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
-SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
 
 static int	linux_fixup(register_t **stack_base,
 		    struct image_params *iparams);
@@ -109,12 +120,15 @@
 		    struct image_params *imgp, u_long stack);
 static register_t *linux_copyout_strings(struct image_params *imgp);
 static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
+static void	linux_vdso_install(void *param);
+static void	linux_vdso_deinstall(void *param);
 
 static int linux_szplatform;
-const char *linux_platform;
+const char *linux_kplatform;
 
 static eventhandler_tag linux_exit_tag;
 static eventhandler_tag linux_exec_tag;
+static eventhandler_tag linux_thread_dtor_tag;
 
 /*
  * Linux syscalls return negative errno's, we do positive and map them
@@ -132,32 +146,10 @@
 	-100,-101,-102,-103,-104,-105,-106,-107,-108,-109,
 	-110,-111, -40, -36,-112,-113, -39, -11, -87,-122,
 	-116, -66,  -6,  -6,  -6,  -6,  -6, -37, -38,  -9,
-	  -6,  -6, -43, -42, -75,-125, -84, -95, -16, -74,
+	  -6,  -6, -43, -42, -75,-125, -84, -61, -16, -74,
 	 -72, -67, -71
 };
 
-int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
-	LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
-	LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
-	LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
-	LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
-	LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
-	LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
-	LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
-	0, LINUX_SIGUSR1, LINUX_SIGUSR2
-};
-
-int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
-	SIGHUP, SIGINT, SIGQUIT, SIGILL,
-	SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
-	SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
-	SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
-	SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
-	SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
-	SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
-	SIGIO, SIGURG, SIGSYS
-};
-
 #define LINUX_T_UNKNOWN  255
 static int _bsd_to_linux_trapcode[] = {
 	LINUX_T_UNKNOWN,	/* 0 */
@@ -197,6 +189,10 @@
      _bsd_to_linux_trapcode[(code)]: \
      LINUX_T_UNKNOWN)
 
+LINUX_VDSO_SYM_INTPTR(linux_sigcode);
+LINUX_VDSO_SYM_INTPTR(linux_rt_sigcode);
+LINUX_VDSO_SYM_INTPTR(linux_vsyscall);
+
 /*
  * If FreeBSD & Linux have a difference of opinion about what a trap
  * means, deal with it here.
@@ -207,15 +203,15 @@
 translate_traps(int signal, int trap_code)
 {
 	if (signal != SIGBUS)
-		return signal;
+		return (signal);
 	switch (trap_code) {
 	case T_PROTFLT:
 	case T_TSSFLT:
 	case T_DOUBLEFLT:
 	case T_PAGEFLT:
-		return SIGSEGV;
+		return (SIGSEGV);
 	default:
-		return signal;
+		return (signal);
 	}
 }
 
@@ -255,6 +251,9 @@
 	args = (Elf32_Auxargs *)imgp->auxargs;
 	pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2);
 
+	AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR,
+	    imgp->proc->p_sysent->sv_shared_page_base);
+	AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO, linux_vsyscall);
 	AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature);
 
 	/*
@@ -280,6 +279,9 @@
 	AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
 	AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
 	AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(uplatform));
+	AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+	if (imgp->execpathp != 0)
+		AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
 	if (args->execfd != -1)
 		AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
 	AUXARGS_ENTRY(pos, AT_NULL, 0);
@@ -303,24 +305,46 @@
 	char *stringp, *destp;
 	register_t *stack_base;
 	struct ps_strings *arginfo;
+	char canary[LINUX_AT_RANDOM_LEN];
+	size_t execpath_len;
 	struct proc *p;
 
 	/*
 	 * Calculate string base and vector table pointers.
-	 * Also deal with signal trampoline code for this exec type.
 	 */
 	p = imgp->proc;
+	if (imgp->execpath != NULL && imgp->auxargs != NULL)
+		execpath_len = strlen(imgp->execpath) + 1;
+	else
+		execpath_len = 0;
 	arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
 	destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform -
-	    roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
+	    roundup(sizeof(canary), sizeof(char *)) -
+	    roundup(execpath_len, sizeof(char *)) -
+	    roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *));
 
 	/*
 	 * install LINUX_PLATFORM
 	 */
-	copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform),
+	copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform),
 	    linux_szplatform);
 
+	if (execpath_len != 0) {
+		imgp->execpathp = (uintptr_t)arginfo -
+		linux_szplatform - execpath_len;
+		copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
+	}
+
 	/*
+	 * Prepare the canary for SSP.
+	 */
+	arc4rand(canary, sizeof(canary), 0);
+	imgp->canary = (uintptr_t)arginfo - linux_szplatform -
+	    roundup(execpath_len, sizeof(char *)) -
+	    roundup(sizeof(canary), sizeof(char *));
+	copyout(canary, (void *)imgp->canary, sizeof(canary));
+
+	/*
 	 * If we have a valid auxargs ptr, prepare some room
 	 * on the stack.
 	 */
@@ -399,11 +423,6 @@
 	return (stack_base);
 }
 
-
-
-extern int _ucodesel, _udatasel;
-extern unsigned long linux_sznonrtsigcode;
-
 static void
 linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 {
@@ -442,9 +461,7 @@
 	/*
 	 * Build the argument list for the signal handler.
 	 */
-	if (p->p_sysent->sv_sigtbl)
-		if (sig <= p->p_sysent->sv_sigsize)
-			sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+	sig = bsd_to_linux_signal(sig);
 
 	bzero(&frame, sizeof(frame));
 
@@ -470,7 +487,7 @@
 
 	bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
 
-	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__bits[0];
+	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__mask;
 	frame.sf_sc.uc_mcontext.sc_gs     = rgs();
 	frame.sf_sc.uc_mcontext.sc_fs     = regs->tf_fs;
 	frame.sf_sc.uc_mcontext.sc_es     = regs->tf_es;
@@ -479,6 +496,7 @@
 	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_esi;
 	frame.sf_sc.uc_mcontext.sc_ebp    = regs->tf_ebp;
 	frame.sf_sc.uc_mcontext.sc_ebx    = regs->tf_ebx;
+	frame.sf_sc.uc_mcontext.sc_esp    = regs->tf_esp;
 	frame.sf_sc.uc_mcontext.sc_edx    = regs->tf_edx;
 	frame.sf_sc.uc_mcontext.sc_ecx    = regs->tf_ecx;
 	frame.sf_sc.uc_mcontext.sc_eax    = regs->tf_eax;
@@ -516,7 +534,7 @@
 	 * Build context to run handler in.
 	 */
 	regs->tf_esp = (int)fp;
-	regs->tf_eip = p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode;
+	regs->tf_eip = linux_rt_sigcode;
 	regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
 	regs->tf_cs = _ucodesel;
 	regs->tf_ds = _udatasel;
@@ -548,7 +566,7 @@
 	struct l_sigframe *fp, frame;
 	l_sigset_t lmask;
 	int sig, code;
-	int oonstack, i;
+	int oonstack;
 
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	psp = p->p_sigacts;
@@ -584,9 +602,7 @@
 	/*
 	 * Build the argument list for the signal handler.
 	 */
-	if (p->p_sysent->sv_sigtbl)
-		if (sig <= p->p_sysent->sv_sigsize)
-			sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+	sig = bsd_to_linux_signal(sig);
 
 	bzero(&frame, sizeof(frame));
 
@@ -598,7 +614,7 @@
 	/*
 	 * Build the signal context to be used by sigreturn.
 	 */
-	frame.sf_sc.sc_mask   = lmask.__bits[0];
+	frame.sf_sc.sc_mask   = lmask.__mask;
 	frame.sf_sc.sc_gs     = rgs();
 	frame.sf_sc.sc_fs     = regs->tf_fs;
 	frame.sf_sc.sc_es     = regs->tf_es;
@@ -607,6 +623,7 @@
 	frame.sf_sc.sc_esi    = regs->tf_esi;
 	frame.sf_sc.sc_ebp    = regs->tf_ebp;
 	frame.sf_sc.sc_ebx    = regs->tf_ebx;
+	frame.sf_sc.sc_esp    = regs->tf_esp;
 	frame.sf_sc.sc_edx    = regs->tf_edx;
 	frame.sf_sc.sc_ecx    = regs->tf_ecx;
 	frame.sf_sc.sc_eax    = regs->tf_eax;
@@ -619,8 +636,7 @@
 	frame.sf_sc.sc_cr2    = (register_t)ksi->ksi_addr;
 	frame.sf_sc.sc_trapno = bsd_to_linux_trapcode(ksi->ksi_trapno);
 
-	for (i = 0; i < (LINUX_NSIG_WORDS-1); i++)
-		frame.sf_extramask[i] = lmask.__bits[i+1];
+	frame.sf_extramask[0] = lmask.__mask;
 
 	if (copyout(&frame, fp, sizeof(frame)) != 0) {
 		/*
@@ -635,7 +651,7 @@
 	 * Build context to run handler in.
 	 */
 	regs->tf_esp = (int)fp;
-	regs->tf_eip = p->p_sysent->sv_sigcode_base;
+	regs->tf_eip = linux_sigcode;
 	regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
 	regs->tf_cs = _ucodesel;
 	regs->tf_ds = _udatasel;
@@ -663,7 +679,7 @@
 	struct trapframe *regs;
 	l_sigset_t lmask;
 	sigset_t bmask;
-	int eflags, i;
+	int eflags;
 	ksiginfo_t ksi;
 
 	regs = td->td_frame;
@@ -685,18 +701,8 @@
 	 */
 #define	EFLAGS_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 	eflags = frame.sf_sc.sc_eflags;
-	/*
-	 * XXX do allow users to change the privileged flag PSL_RF.  The
-	 * cpu sets PSL_RF in tf_eflags for faults.  Debuggers should
-	 * sometimes set it there too.  tf_eflags is kept in the signal
-	 * context during signal handling and there is no other place
-	 * to remember it, so the PSL_RF bit may be corrupted by the
-	 * signal handler without us knowing.  Corruption of the PSL_RF
-	 * bit at worst causes one more or one less debugger trap, so
-	 * allowing it is fairly harmless.
-	 */
-	if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF))
-		return(EINVAL);
+	if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
+		return (EINVAL);
 
 	/*
 	 * Don't allow users to load a valid privileged %cs.  Let the
@@ -711,12 +717,10 @@
 		ksi.ksi_trapno = T_PROTFLT;
 		ksi.ksi_addr = (void *)regs->tf_eip;
 		trapsignal(td, &ksi);
-		return(EINVAL);
+		return (EINVAL);
 	}
 
-	lmask.__bits[0] = frame.sf_sc.sc_mask;
-	for (i = 0; i < (LINUX_NSIG_WORDS-1); i++)
-		lmask.__bits[i+1] = frame.sf_extramask[i];
+	lmask.__mask = frame.sf_sc.sc_mask;
 	linux_to_bsd_sigset(&lmask, &bmask);
 	kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0);
 
@@ -786,18 +790,8 @@
 	 */
 #define	EFLAGS_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 	eflags = context->sc_eflags;
-	/*
-	 * XXX do allow users to change the privileged flag PSL_RF.  The
-	 * cpu sets PSL_RF in tf_eflags for faults.  Debuggers should
-	 * sometimes set it there too.  tf_eflags is kept in the signal
-	 * context during signal handling and there is no other place
-	 * to remember it, so the PSL_RF bit may be corrupted by the
-	 * signal handler without us knowing.  Corruption of the PSL_RF
-	 * bit at worst causes one more or one less debugger trap, so
-	 * allowing it is fairly harmless.
-	 */
-	if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF))
-		return(EINVAL);
+	if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
+		return (EINVAL);
 
 	/*
 	 * Don't allow users to load a valid privileged %cs.  Let the
@@ -812,7 +806,7 @@
 		ksi.ksi_trapno = T_PROTFLT;
 		ksi.ksi_addr = (void *)regs->tf_eip;
 		trapsignal(td, &ksi);
-		return(EINVAL);
+		return (EINVAL);
 	}
 
 	linux_to_bsd_sigset(&uc.uc_sigmask, &bmask);
@@ -874,7 +868,8 @@
 	sa->args[5] = frame->tf_ebp;	/* Unconfirmed */
 
 	if (sa->code >= p->p_sysent->sv_size)
-		sa->callp = &p->p_sysent->sv_table[0];
+		/* nosys */
+		sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
  	else
  		sa->callp = &p->p_sysent->sv_table[sa->code];
 	sa->narg = sa->callp->sy_narg;
@@ -964,14 +959,14 @@
 	.sv_size	= LINUX_SYS_MAXSYSCALL,
 	.sv_table	= linux_sysent,
 	.sv_mask	= 0,
-	.sv_sigsize	= LINUX_SIGTBLSZ,
-	.sv_sigtbl	= bsd_to_linux_signal,
+	.sv_sigsize	= 0,
+	.sv_sigtbl	= NULL,
 	.sv_errsize	= ELAST + 1,
 	.sv_errtbl	= bsd_to_linux_errno,
 	.sv_transtrap	= translate_traps,
 	.sv_fixup	= linux_fixup,
 	.sv_sendsig	= linux_sendsig,
-	.sv_sigcode	= linux_sigcode,
+	.sv_sigcode	= &_binary_linux_locore_o_start,
 	.sv_szsigcode	= &linux_szsigcode,
 	.sv_prepsyscall	= NULL,
 	.sv_name	= "Linux a.out",
@@ -995,6 +990,8 @@
 	.sv_shared_page_base = LINUX_SHAREDPAGE,
 	.sv_shared_page_len = PAGE_SIZE,
 	.sv_schedtail	= linux_schedtail,
+	.sv_thread_detach = linux_thread_detach,
+	.sv_trap	= NULL,
 };
 INIT_SYSENTVEC(aout_sysvec, &linux_sysvec);
 
@@ -1002,14 +999,14 @@
 	.sv_size	= LINUX_SYS_MAXSYSCALL,
 	.sv_table	= linux_sysent,
 	.sv_mask	= 0,
-	.sv_sigsize	= LINUX_SIGTBLSZ,
-	.sv_sigtbl	= bsd_to_linux_signal,
+	.sv_sigsize	= 0,
+	.sv_sigtbl	= NULL,
 	.sv_errsize	= ELAST + 1,
 	.sv_errtbl	= bsd_to_linux_errno,
 	.sv_transtrap	= translate_traps,
 	.sv_fixup	= elf_linux_fixup,
 	.sv_sendsig	= linux_sendsig,
-	.sv_sigcode	= linux_sigcode,
+	.sv_sigcode	= &_binary_linux_locore_o_start,
 	.sv_szsigcode	= &linux_szsigcode,
 	.sv_prepsyscall	= NULL,
 	.sv_name	= "Linux ELF",
@@ -1033,9 +1030,43 @@
 	.sv_shared_page_base = LINUX_SHAREDPAGE,
 	.sv_shared_page_len = PAGE_SIZE,
 	.sv_schedtail	= linux_schedtail,
+	.sv_thread_detach = linux_thread_detach,
+	.sv_trap	= NULL,
 };
-INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec);
 
+static void
+linux_vdso_install(void *param)
+{
+
+	linux_szsigcode = (&_binary_linux_locore_o_end - 
+	    &_binary_linux_locore_o_start);
+
+	if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len)
+		panic("Linux invalid vdso size\n");
+
+	__elfN(linux_vdso_fixup)(&elf_linux_sysvec);
+
+	linux_shared_page_obj = __elfN(linux_shared_page_init)
+	    (&linux_shared_page_mapping);
+
+	__elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX_SHAREDPAGE);
+
+	bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping,
+	    linux_szsigcode);
+	elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj;
+}
+SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY,
+    (sysinit_cfunc_t)linux_vdso_install, NULL);
+
+static void
+linux_vdso_deinstall(void *param)
+{
+
+	__elfN(linux_shared_page_fini)(linux_shared_page_obj);
+};
+SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST,
+    (sysinit_cfunc_t)linux_vdso_deinstall, NULL);
+
 static char GNU_ABI_VENDOR[] = "GNU";
 static int GNULINUX_ABI_DESC = 0;
 
@@ -1106,7 +1137,6 @@
 	Elf32_Brandinfo **brandinfo;
 	int error;
 	struct linux_ioctl_handler **lihp;
-	struct linux_device_handler **ldhp;
 
 	error = 0;
 
@@ -1119,10 +1149,6 @@
 		if (error == 0) {
 			SET_FOREACH(lihp, linux_ioctl_handler_set)
 				linux_ioctl_register_handler(*lihp);
-			SET_FOREACH(ldhp, linux_device_handler_set)
-				linux_device_register_handler(*ldhp);
-			mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
-			sx_init(&emul_shared_lock, "emuldata->shared lock");
 			LIST_INIT(&futex_list);
 			mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF);
 			linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit,
@@ -1129,8 +1155,10 @@
 			      NULL, 1000);
 			linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec,
 			      NULL, 1000);
-			linux_get_machine(&linux_platform);
-			linux_szplatform = roundup(strlen(linux_platform) + 1,
+			linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
+			    linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
+			linux_get_machine(&linux_kplatform);
+			linux_szplatform = roundup(strlen(linux_kplatform) + 1,
 			    sizeof(char *));
 			linux_osd_jail_register();
 			stclohz = (stathz ? stathz : hz);
@@ -1153,13 +1181,10 @@
 		if (error == 0) {
 			SET_FOREACH(lihp, linux_ioctl_handler_set)
 				linux_ioctl_unregister_handler(*lihp);
-			SET_FOREACH(ldhp, linux_device_handler_set)
-				linux_device_unregister_handler(*ldhp);
-			mtx_destroy(&emul_lock);
-			sx_destroy(&emul_shared_lock);
 			mtx_destroy(&futex_mtx);
 			EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
 			EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag);
+			EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag);
 			linux_osd_jail_deregister();
 			if (bootverbose)
 				printf("Linux ELF exec handler removed\n");
@@ -1167,9 +1192,9 @@
 			printf("Could not deinstall ELF interpreter entry\n");
 		break;
 	default:
-		return EOPNOTSUPP;
+		return (EOPNOTSUPP);
 	}
-	return error;
+	return (error);
 }
 
 static moduledata_t linux_elf_mod = {
@@ -1179,3 +1204,4 @@
 };
 
 DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+FEATURE(linux, "Linux 32bit support");

Added: trunk/sys/i386/linux/linux_vdso.lds.s
===================================================================
--- trunk/sys/i386/linux/linux_vdso.lds.s	                        (rev 0)
+++ trunk/sys/i386/linux/linux_vdso.lds.s	2018-05-27 16:34:34 UTC (rev 9996)
@@ -0,0 +1,66 @@
+/* $MidnightBSD$ */
+/*
+ * Linker script for 32-bit vDSO.
+ * Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S
+ * and arch/x86/vdso/vdso32/vdso32.lds.S
+ *
+ * $FreeBSD: stable/10/sys/i386/linux/linux_vdso.lds.s 293514 2016-01-09 15:44:38Z dchagin $
+ */
+
+SECTIONS
+{
+	. = . + SIZEOF_HEADERS;
+
+	.hash		: { *(.hash) }			:text
+	.gnu.hash	: { *(.gnu.hash) }
+	.dynsym		: { *(.dynsym) }
+	.dynstr		: { *(.dynstr) }
+	.gnu.version	: { *(.gnu.version) }
+	.gnu.version_d	: { *(.gnu.version_d) }
+	.gnu.version_r	: { *(.gnu.version_r) }
+
+	.note		: { *(.note.*) }		:text	:note
+
+	.eh_frame_hdr	: { *(.eh_frame_hdr) }		:text	:eh_frame_hdr
+	.eh_frame	: { KEEP (*(.eh_frame)) }	:text
+
+	.dynamic	: { *(.dynamic) }		:text	:dynamic
+
+	.rodata		: { *(.rodata*) }		:text
+	.data		: {
+	      *(.data*)
+	      *(.sdata*)
+	      *(.got.plt) *(.got)
+	      *(.gnu.linkonce.d.*)
+	      *(.bss*)
+	      *(.dynbss*)
+	      *(.gnu.linkonce.b.*)
+	}
+
+	.altinstructions	: { *(.altinstructions) }
+	.altinstr_replacement	: { *(.altinstr_replacement) }
+
+	. = ALIGN(0x100);
+	.text		: { *(.text*) }			:text	=0x90909090
+}
+
+PHDRS
+{
+	text		PT_LOAD		FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
+	dynamic		PT_DYNAMIC	FLAGS(4);		/* PF_R */
+	note		PT_NOTE		FLAGS(4);		/* PF_R */
+	eh_frame_hdr	PT_GNU_EH_FRAME;
+}
+
+ENTRY(linux_vsyscall);
+
+VERSION
+{
+	LINUX_2.5 {
+	global:
+		linux_vsyscall;
+		linux_sigcode;
+		linux_rt_sigcode;
+	local: *;
+	};
+}


Property changes on: trunk/sys/i386/linux/linux_vdso.lds.s
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/i386/linux/syscalls.conf
===================================================================
--- trunk/sys/i386/linux/syscalls.conf	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/syscalls.conf	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,4 +1,5 @@
-# $FreeBSD$
+# $MidnightBSD$
+# $FreeBSD: stable/10/sys/i386/linux/syscalls.conf 219559 2011-03-12 08:51:43Z avg $
 sysnames="linux_syscalls.c"
 sysproto="linux_proto.h"
 sysproto_h=_LINUX_SYSPROTO_H_


Property changes on: trunk/sys/i386/linux/syscalls.conf
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/i386/linux/syscalls.master
===================================================================
--- trunk/sys/i386/linux/syscalls.master	2018-05-26 22:17:54 UTC (rev 9995)
+++ trunk/sys/i386/linux/syscalls.master	2018-05-27 16:34:34 UTC (rev 9996)
@@ -1,4 +1,5 @@
- $FreeBSD$
+ $MidnightBSD$
+ $FreeBSD: stable/10/sys/i386/linux/syscalls.master 302962 2016-07-17 15:07:33Z dchagin $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 ; System call name/number master file (or rather, slave, from LINUX).
@@ -37,8 +38,7 @@
 ; #ifdef's, etc. may be included, and are copied to the output files.
 
 0	AUE_NULL	UNIMPL	setup
-1	AUE_EXIT	NOPROTO	{ void sys_exit(int rval); } exit \
-				    sys_exit_args void
+1	AUE_EXIT	STD	{ void linux_exit(int rval); }
 2	AUE_FORK	STD	{ int linux_fork(void); }
 3	AUE_NULL	NOPROTO	{ int read(int fd, char *buf, \
 				    u_int nbyte); }
@@ -158,7 +158,7 @@
 				    struct l_old_select_argv *ptr); }
 83	AUE_SYMLINK	STD	{ int linux_symlink(char *path, char *to); }
 ; 84: oldlstat
-84	AUE_LSTAT	STD	{ int linux_lstat(char *path, struct ostat *up); }
+84	AUE_LSTAT	STD	{ int linux_lstat(char *path, struct l_stat *up); }
 85	AUE_READLINK	STD	{ int linux_readlink(char *name, char *buf, \
 				    l_int count); }
 86	AUE_USELIB	STD	{ int linux_uselib(char *library); }
@@ -203,13 +203,13 @@
 				    struct l_newstat *buf); }
 ; 109: olduname
 109	AUE_NULL	STD	{ int linux_uname(void); }
-110	AUE_NULL	STD	{ int linux_iopl(l_ulong level); }
+110	AUE_NULL	STD	{ int linux_iopl(l_int level); }
 111	AUE_NULL	STD	{ int linux_vhangup(void); }
 112	AUE_NULL	UNIMPL	idle
 113	AUE_NULL	STD	{ int linux_vm86old(void); }
 114	AUE_WAIT4	STD	{ int linux_wait4(l_pid_t pid, \
-				    l_uint *status, l_int options, \
-				    struct l_rusage *rusage); }
+				    l_int *status, l_int options, \
+				    void *rusage); }
 115	AUE_SWAPOFF	STD	{ int linux_swapoff(void); }
 116	AUE_NULL	STD	{ int linux_sysinfo(struct l_sysinfo *info); }
 117	AUE_NULL	STD	{ int linux_ipc(l_uint what, l_int arg1, \
@@ -241,7 +241,7 @@
 134	AUE_BDFLUSH	STD	{ int linux_bdflush(void); }
 135	AUE_NULL	STD	{ int linux_sysfs(l_int option, \
 				    l_ulong arg1, l_ulong arg2); }
-136	AUE_PERSONALITY	STD	{ int linux_personality(l_ulong per); }
+136	AUE_PERSONALITY	STD	{ int linux_personality(l_uint per); }
 137	AUE_NULL	UNIMPL	afs_syscall
 138	AUE_SETFSUID	STD	{ int linux_setfsuid16(l_uid16_t uid); }
 139	AUE_SETFSGID	STD	{ int linux_setfsgid16(l_gid16_t gid); }
@@ -270,13 +270,13 @@
 151	AUE_MUNLOCK	NOPROTO	{ int munlock(const void *addr, size_t len); }
 152	AUE_MLOCKALL	NOPROTO	{ int mlockall(int how); }
 153	AUE_MUNLOCKALL	NOPROTO	{ int munlockall(void); }
-154	AUE_SCHED_SETPARAM	NOPROTO	{ int sched_setparam(pid_t pid, \
-				    const struct sched_param *param); }
-155	AUE_SCHED_GETPARAM	NOPROTO	{ int sched_getparam(pid_t pid, \
+154	AUE_SCHED_SETPARAM	STD	{ int linux_sched_setparam(l_pid_t pid, \
 				    struct sched_param *param); }
+155	AUE_SCHED_GETPARAM	STD	{ int linux_sched_getparam(l_pid_t pid, \
+				    struct sched_param *param); }
 156	AUE_SCHED_SETSCHEDULER	STD { int linux_sched_setscheduler( \
 				    l_pid_t pid, l_int policy, \
-				    struct l_sched_param *param); }
+				    struct sched_param *param); }
 157	AUE_SCHED_GETSCHEDULER	STD { int linux_sched_getscheduler( \
 				    l_pid_t pid); }
 158	AUE_NULL	NOPROTO	{ int sched_yield(void); }
@@ -284,8 +284,8 @@
 				    l_int policy); }
 160	AUE_SCHED_GET_PRIORITY_MIN	STD { int linux_sched_get_priority_min( \
 				    l_int policy); }
-161	AUE_SCHED_RR_GET_INTERVAL	NOPROTO	{ int sched_rr_get_interval(l_pid_t pid, \
-				    struct l_timespec *interval); }
+161	AUE_SCHED_RR_GET_INTERVAL	STD	{ int linux_sched_rr_get_interval( \
+				    l_pid_t pid, struct l_timespec *interval); }
 162	AUE_NULL	STD	{ int linux_nanosleep( \
 				    const struct l_timespec *rqtp, \
 				    struct l_timespec *rmtp); }
@@ -321,7 +321,8 @@
 				    l_siginfo_t *ptr, \
 				    struct l_timeval *timeout, \
 				    l_size_t sigsetsize); }
-178	AUE_NULL	STD	{ int linux_rt_sigqueueinfo(void); }
+178	AUE_NULL	STD	{ int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \
+				    l_siginfo_t *info); }
 179	AUE_NULL	STD	{ int linux_rt_sigsuspend( \
 				    l_sigset_t *newset, \
 				    l_size_t sigsetsize); }
@@ -353,12 +354,12 @@
 				    l_loff_t length); }
 194	AUE_FTRUNCATE	STD	{ int linux_ftruncate64(l_uint fd, \
 				    l_loff_t length); }
-195	AUE_STAT	STD	{ int linux_stat64(char *filename, \
-				    struct l_stat64 *statbuf, l_long flags); }
-196	AUE_LSTAT	STD	{ int linux_lstat64(char *filename, \
-				    struct l_stat64 *statbuf, l_long flags); }
-197	AUE_FSTAT	STD	{ int linux_fstat64(l_ulong fd, \
-				    struct l_stat64 *statbuf, l_long flags); }
+195	AUE_STAT	STD	{ int linux_stat64(const char *filename, \
+				    struct l_stat64 *statbuf); }
+196	AUE_LSTAT	STD	{ int linux_lstat64(const char *filename, \
+				    struct l_stat64 *statbuf); }
+197	AUE_FSTAT	STD	{ int linux_fstat64(l_int fd, \
+				    struct l_stat64 *statbuf); }
 198	AUE_LCHOWN	STD	{ int linux_lchown(char *path, l_uid_t uid, \
 				    l_gid_t gid); }
 199	AUE_GETUID	STD	{ int linux_getuid(void); }
@@ -432,14 +433,16 @@
 251	AUE_NULL	UNIMPL
 252	AUE_EXIT	STD	{ int linux_exit_group(int error_code); }
 253	AUE_NULL	STD	{ int linux_lookup_dcookie(void); }
-254	AUE_NULL	STD	{ int linux_epoll_create(void); }
-255	AUE_NULL	STD	{ int linux_epoll_ctl(void); }
-256	AUE_NULL	STD	{ int linux_epoll_wait(void); }
+254	AUE_NULL	STD	{ int linux_epoll_create(l_int size); }
+255	AUE_NULL	STD	{ int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \
+					struct epoll_event *event); }
+256	AUE_NULL	STD	{ int linux_epoll_wait(l_int epfd, struct epoll_event *events, \
+					l_int maxevents, l_int timeout); }
 257	AUE_NULL	STD	{ int linux_remap_file_pages(void); }
 258	AUE_NULL	STD	{ int linux_set_tid_address(int *tidptr); }
 259	AUE_NULL	STD	{ int linux_timer_create(clockid_t clock_id, \
 					struct sigevent *evp, l_timer_t *timerid); }
-260	AUE_NULL	STD	{ int linux_timer_settime(l_timer_t timerid, \
+260	AUE_NULL	STD	{ int linux_timer_settime(l_timer_t timerid, l_int flags, \
 					const struct itimerspec *new, struct itimerspec *old); }
 261	AUE_NULL	STD	{ int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); }
 262	AUE_NULL	STD	{ int linux_timer_getoverrun(l_timer_t timerid); }
@@ -450,7 +453,7 @@
 267	AUE_NULL	STD	{ int linux_clock_nanosleep(clockid_t which, int flags, \
 					struct l_timespec *rqtp, struct l_timespec *rmtp); }
 268	AUE_STATFS	STD	{ int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); }
-269	AUE_FSTATFS	STD	{ int linux_fstatfs64(void); }
+269	AUE_FSTATFS	STD	{ int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); }
 270	AUE_NULL	STD	{ int linux_tgkill(int tgid, int pid, int sig); }
 271	AUE_UTIMES	STD	{ int linux_utimes(char *fname, \
 					struct l_timeval *tptr); }
@@ -475,7 +478,9 @@
 282	AUE_NULL	STD	{ int linux_mq_getsetattr(l_mqd_t mqd, const struct mq_attr *attr, \
 					struct mq_attr *oattr); }
 283	AUE_NULL	STD	{ int linux_kexec_load(void); }
-284	AUE_NULL	STD	{ int linux_waitid(void); }
+284	AUE_WAIT6	STD	{ int linux_waitid(int idtype, l_pid_t id, \
+				    l_siginfo_t *info, int options, \
+				    void *rusage); }
 285	AUE_NULL	UNIMPL
 ; linux 2.6.11:
 286	AUE_NULL	STD	{ int linux_add_key(void); }
@@ -506,7 +511,7 @@
 302	AUE_RENAMEAT	STD	{ int linux_renameat(l_int olddfd, const char *oldname, \
 					l_int newdfd, const char *newname); }
 303	AUE_LINKAT	STD	{ int linux_linkat(l_int olddfd, const char *oldname, \
-					l_int newdfd, const char *newname, l_int flags); }
+					l_int newdfd, const char *newname, l_int flag); }
 304	AUE_SYMLINKAT	STD	{ int linux_symlinkat(const char *oldname, l_int newdfd, \
 					const char *newname); }
 305	AUE_READLINKAT	STD	{ int linux_readlinkat(l_int dfd, const char *path, \
@@ -513,9 +518,13 @@
 					char *buf, l_int bufsiz); }
 306	AUE_FCHMODAT	STD	{ int linux_fchmodat(l_int dfd, const char *filename, \
 					l_mode_t mode); }
-307	AUE_FACCESSAT	STD	{ int linux_faccessat(l_int dfd, const char *filename, l_int amode); }
-308	AUE_NULL	STD	{ int linux_pselect6(void); }
-309	AUE_NULL	STD	{ int linux_ppoll(void); }
+307	AUE_FACCESSAT	STD	{ int linux_faccessat(l_int dfd, const char *filename, \
+					l_int amode); }
+308	AUE_SELECT	STD	{ int linux_pselect6(l_int nfds, l_fd_set *readfds,	\
+					l_fd_set *writefds, l_fd_set *exceptfds,	\
+					struct l_timespec *tsp, l_uintptr_t *sig); }
+309	AUE_POLL	STD	{ int linux_ppoll(struct pollfd *fds, uint32_t nfds,	\
+				    struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); }
 310	AUE_NULL	STD	{ int linux_unshare(void); }
 ; linux 2.6.17:
 311	AUE_NULL	STD	{ int linux_set_robust_list(struct linux_robust_list_head *head, \
@@ -530,22 +539,26 @@
 317	AUE_NULL	STD	{ int linux_move_pages(void); }
 ; linux 2.6.19:
 318	AUE_NULL	STD	{ int linux_getcpu(void); }
-319	AUE_NULL	STD	{ int linux_epoll_pwait(void); }
+319	AUE_NULL	STD	{ int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
+					l_int maxevents, l_int timeout, l_sigset_t *mask); }
 ; linux 2.6.22:
-320	AUE_NULL	STD	{ int linux_utimensat(void); }
+320	AUE_FUTIMESAT	STD	{ int linux_utimensat(l_int dfd, const char *pathname, \
+					const struct l_timespec *times, l_int flags); }
 321	AUE_NULL	STD	{ int linux_signalfd(void); }
 322	AUE_NULL	STD	{ int linux_timerfd_create(void); }
-323	AUE_NULL	STD	{ int linux_eventfd(void); }
+323	AUE_NULL	STD	{ int linux_eventfd(l_uint initval); }
 ; linux 2.6.23:
-324	AUE_NULL	STD	{ int linux_fallocate(void); }
+324	AUE_NULL	STD	{ int linux_fallocate(l_int fd, l_int mode, \
+				    l_loff_t offset, l_loff_t len); }
 ; linux 2.6.25:
 325	AUE_NULL	STD	{ int linux_timerfd_settime(void); }
 326	AUE_NULL	STD	{ int linux_timerfd_gettime(void); }
 ; linux 2.6.27:
 327	AUE_NULL	STD	{ int linux_signalfd4(void); }
-328	AUE_NULL	STD	{ int linux_eventfd2(void); }
-329	AUE_NULL	STD	{ int linux_epoll_create1(void); }
-330	AUE_NULL	STD	{ int linux_dup3(void); }
+328	AUE_NULL	STD	{ int linux_eventfd2(l_uint initval, l_int flags); }
+329	AUE_NULL	STD	{ int linux_epoll_create1(l_int flags); }
+330	AUE_NULL	STD	{ int linux_dup3(l_int oldfd,		\
+					l_int newfd, l_int flags); }
 331	AUE_NULL	STD	{ int linux_pipe2(l_int *pipefds, l_int flags); }
 332	AUE_NULL	STD	{ int linux_inotify_init1(void); }
 ; linux 2.6.30:
@@ -555,17 +568,26 @@
 335	AUE_NULL	STD	{ int linux_rt_tsigqueueinfo(void); }
 336	AUE_NULL	STD	{ int linux_perf_event_open(void); }
 ; linux 2.6.33:
-337	AUE_NULL	STD	{ int linux_recvmmsg(void); }
+337	AUE_NULL	STD	{ int linux_recvmmsg(l_int s,			\
+				    struct l_mmsghdr *msg, l_uint vlen,		\
+				    l_uint flags, struct l_timespec *timeout); }
 338	AUE_NULL	STD	{ int linux_fanotify_init(void); }
 339	AUE_NULL	STD	{ int linux_fanotify_mark(void); }
 ; linux 2.6.36:
-340	AUE_NULL	STD	{ int linux_prlimit64(void); }
+340	AUE_NULL	STD	{ int linux_prlimit64(l_pid_t pid,	\
+				    l_uint resource,			\
+				    struct rlimit *new,			\
+				    struct rlimit *old); }
 ; later:
 341	AUE_NULL	STD	{ int linux_name_to_handle_at(void); }
 342	AUE_NULL	STD	{ int linux_open_by_handle_at(void); }
 343	AUE_NULL	STD	{ int linux_clock_adjtime(void); }
-344	AUE_NULL	STD	{ int linux_syncfs(void); }
-345	AUE_NULL	STD	{ int linux_sendmmsg(void); }
+344	AUE_SYNC	STD	{ int linux_syncfs(l_int fd); }
+345	AUE_NULL	STD	{ int linux_sendmmsg(l_int s,			\
+				    struct l_mmsghdr *msg, l_uint vlen,		\
+				    l_uint flags); }
 346	AUE_NULL	STD	{ int linux_setns(void); }
 347	AUE_NULL	STD	{ int linux_process_vm_readv(void); }
 348	AUE_NULL	STD	{ int linux_process_vm_writev(void); }
+; please, keep this line at the end.
+349	AUE_NULL	UNIMPL	nosys


Property changes on: trunk/sys/i386/linux/syscalls.master
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list