summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-13 17:56:30 -0200
committerRenato Botelho <renato@netgate.com>2016-01-13 17:56:30 -0200
commit3e0bf52f358eb969d165c4b1e54942ee94cf2c8d (patch)
tree440bb9907871a5bc578d65b32f0c4aa339096175 /sys/i386
parent4b4ac714f11471e43f18410bcc86da8f9dc3b88c (diff)
parente357bdb742b2696dcb81404917b6247f9e840232 (diff)
downloadFreeBSD-src-3e0bf52f358eb969d165c4b1e54942ee94cf2c8d.zip
FreeBSD-src-3e0bf52f358eb969d165c4b1e54942ee94cf2c8d.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/elf_machdep.c1
-rw-r--r--sys/i386/i386/machdep.c8
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c1
-rw-r--r--sys/i386/linux/linux.h135
-rw-r--r--sys/i386/linux/linux_dummy.c20
-rw-r--r--sys/i386/linux/linux_genassym.c3
-rw-r--r--sys/i386/linux/linux_locore.s154
-rw-r--r--sys/i386/linux/linux_machdep.c86
-rw-r--r--sys/i386/linux/linux_proto.h118
-rw-r--r--sys/i386/linux/linux_ptrace.c3
-rw-r--r--sys/i386/linux/linux_syscall.h12
-rw-r--r--sys/i386/linux/linux_syscalls.c11
-rw-r--r--sys/i386/linux/linux_sysent.c47
-rw-r--r--sys/i386/linux/linux_systrace_args.c486
-rw-r--r--sys/i386/linux/linux_sysvec.c200
-rw-r--r--sys/i386/linux/linux_vdso.lds.s65
-rw-r--r--sys/i386/linux/syscalls.master77
17 files changed, 970 insertions, 457 deletions
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index 6acd32a..81d6e35 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -88,6 +88,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_shared_page_base = SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index b3dae26..36aeca5 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -400,10 +400,6 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
} else
fp = (struct osigframe *)regs->tf_esp - 1;
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc;
@@ -551,10 +547,6 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
} else
sfp = (struct sigframe4 *)regs->tf_esp - 1;
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_ucontext = (register_t)&sfp->sf_uc;
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index 5d007c7..16507ee 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -89,6 +89,7 @@ struct sysentvec ibcs2_svr3_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
static int
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index 27eff32..36b2084 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -33,6 +33,7 @@
#include <sys/signal.h> /* for sigval union */
+#include <compat/linux/linux.h>
#include <i386/linux/linux_syscall.h>
/*
@@ -40,14 +41,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
@@ -91,6 +90,7 @@ typedef l_uint l_uid_t;
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];
@@ -106,7 +106,7 @@ typedef struct {
/*
* Miscellaneous
*/
-#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.
*/
@@ -235,48 +235,7 @@ struct l_statfs64 {
l_int f_spare[6];
};
-/*
- * 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
@@ -294,27 +253,13 @@ struct l_statfs64 {
#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;
@@ -497,50 +442,14 @@ struct l_rt_sigframe {
};
extern struct sysentvec linux_sysvec;
-extern struct sysentvec elf_linux_sysvec;
/*
- * open/fcntl flags
+ * arch specific 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
-
union l_semun {
l_int val;
struct l_semid_ds *buf;
@@ -549,6 +458,16 @@ union l_semun {
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
*/
@@ -585,22 +504,6 @@ struct l_sockaddr {
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;
@@ -739,6 +642,8 @@ struct l_desc_struct {
#define LINUX_GET_USEABLE(desc) \
(((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1)
+#define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r))
+
/* robust futexes */
struct linux_robust_list {
struct linux_robust_list *next;
diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c
index ab77790..8c42f89 100644
--- a/sys/i386/linux/linux_dummy.c
+++ b/sys/i386/linux/linux_dummy.c
@@ -65,23 +65,18 @@ DUMMY(sysfs);
DUMMY(vm86);
DUMMY(query_module);
DUMMY(nfsservctl);
-DUMMY(rt_sigqueueinfo);
DUMMY(sendfile); /* different semantics */
DUMMY(setfsuid);
DUMMY(setfsgid);
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_add_watch);
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(vmsplice);
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(pwritev);
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);
diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c
index 1e84572..9735110 100644
--- a/sys/i386/linux/linux_genassym.c
+++ b/sys/i386/linux/linux_genassym.c
@@ -6,6 +6,7 @@ __FBSDID("$FreeBSD$");
#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 +15,5 @@ ASSYM(LINUX_SC_EFLAGS, offsetof(struct l_sigcontext, sc_eflags));
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);
diff --git a/sys/i386/linux/linux_locore.s b/sys/i386/linux/linux_locore.s
index a3e0e7dc..6c4d19c 100644
--- a/sys/i386/linux/linux_locore.s
+++ b/sys/i386/linux/linux_locore.s
@@ -5,33 +5,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",@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",@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",@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
diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c
index effc32a..c9f969b 100644
--- a/sys/i386/linux/linux_machdep.c
+++ b/sys/i386/linux/linux_machdep.c
@@ -99,35 +99,11 @@ 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;
- struct vmspace *oldvmspace;
char *newpath;
int error;
@@ -138,26 +114,11 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
printf(ARGS(execve, "%s"), newpath);
#endif
- error = pre_execve(td, &oldvmspace);
- if (error != 0) {
- free(newpath, M_TEMP);
- return (error);
- }
error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE,
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);
- }
- post_execve(td, error, oldvmspace);
+ error = linux_common_execve(td, &eargs);
return (error);
}
@@ -368,8 +329,14 @@ int
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);
}
@@ -710,7 +677,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
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,
@@ -720,7 +687,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
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));
}
@@ -744,7 +711,7 @@ linux_sigsuspend(struct thread *td, struct linux_sigsuspend_args *args)
#endif
LINUX_SIGEMPTYSET(mask);
- mask.__bits[0] = args->mask;
+ mask.__mask = args->mask;
linux_to_bsd_sigset(&mask, &sigmask);
return (kern_sigsuspend(td, sigmask));
}
@@ -1048,34 +1015,3 @@ linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args)
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);
-}
diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h
index 862cd2d..62dc2ae 100644
--- a/sys/i386/linux/linux_proto.h
+++ b/sys/i386/linux/linux_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin
+ * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
*/
#ifndef _LINUX_SYSPROTO_H_
@@ -35,6 +35,9 @@ struct thread;
#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;
};
@@ -357,7 +360,7 @@ 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_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;
@@ -473,6 +476,14 @@ struct linux_fdatasync_args {
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 l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_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 l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_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)];
@@ -487,6 +498,10 @@ struct linux_sched_get_priority_max_args {
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 *)];
@@ -560,7 +575,9 @@ struct linux_rt_sigtimedwait_args {
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 *)];
@@ -766,13 +783,19 @@ struct linux_lookup_dcookie_args {
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;
@@ -887,7 +910,11 @@ struct linux_kexec_load_args {
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;
@@ -989,13 +1016,21 @@ struct linux_faccessat_args {
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)];
- char flag_l_[PADL_(l_int)]; l_int flag; char flag_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;
@@ -1028,10 +1063,17 @@ struct linux_getcpu_args {
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;
@@ -1040,10 +1082,13 @@ struct linux_timerfd_create_args {
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;
@@ -1055,13 +1100,16 @@ struct linux_signalfd4_args {
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 *)];
@@ -1083,7 +1131,11 @@ struct linux_perf_event_open_args {
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;
@@ -1092,7 +1144,10 @@ struct linux_fanotify_mark_args {
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;
@@ -1104,10 +1159,13 @@ struct linux_clock_adjtime_args {
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;
@@ -1119,6 +1177,7 @@ struct linux_process_vm_writev_args {
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 *);
@@ -1230,10 +1289,13 @@ int linux_msync(struct thread *, struct linux_msync_args *);
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 *);
@@ -1422,6 +1484,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#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
@@ -1533,10 +1596,13 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#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
@@ -1633,7 +1699,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#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
@@ -1656,8 +1722,8 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#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
@@ -1668,7 +1734,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#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
@@ -1692,7 +1758,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#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
diff --git a/sys/i386/linux/linux_ptrace.c b/sys/i386/linux/linux_ptrace.c
index 46a1169..2925e6b 100644
--- a/sys/i386/linux/linux_ptrace.c
+++ b/sys/i386/linux/linux_ptrace.c
@@ -91,8 +91,7 @@ static __inline int
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);
}
diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h
index b7f9d76..170c1cc 100644
--- a/sys/i386/linux/linux_syscall.h
+++ b/sys/i386/linux/linux_syscall.h
@@ -3,10 +3,10 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin
+ * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
*/
-#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
diff --git a/sys/i386/linux/linux_syscalls.c b/sys/i386/linux/linux_syscalls.c
index 725abf0..20b4032 100644
--- a/sys/i386/linux/linux_syscalls.c
+++ b/sys/i386/linux/linux_syscalls.c
@@ -3,13 +3,13 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin
+ * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
*/
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 @@ const char *linux_syscallnames[] = {
"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 @@ const char *linux_syscallnames[] = {
"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 */
};
diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c
index 880ad65..465a9d3 100644
--- a/sys/i386/linux/linux_sysent.c
+++ b/sys/i386/linux/linux_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin
+ * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
*/
#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 @@ struct sysent linux_sysent[] = {
{ 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 @@ struct sysent linux_sysent[] = {
{ 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 @@ struct sysent linux_sysent[] = {
{ 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 */
@@ -302,7 +302,7 @@ struct sysent linux_sysent[] = {
{ 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 @@ struct sysent linux_sysent[] = {
{ 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,34 +337,35 @@ struct sysent linux_sysent[] = {
{ 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 */
{ 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 */
};
diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c
index 3564fda..85fc9ca 100644
--- a/sys/i386/linux/linux_systrace_args.c
+++ b/sys/i386/linux/linux_systrace_args.c
@@ -12,9 +12,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
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;
@@ -792,7 +792,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->pid; /* l_pid_t */
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;
}
@@ -1081,19 +1081,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*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 l_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 */
- uarg[1] = (intptr_t) p->param; /* struct sched_param * */
+ struct linux_sched_getparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
*n_args = 2;
break;
}
@@ -1132,9 +1132,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*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 +1277,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -1743,17 +1747,29 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -1962,7 +1978,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2133,18 +2155,30 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->dfd; /* l_int */
uarg[1] = (intptr_t) p->filename; /* const char * */
iarg[2] = p->amode; /* l_int */
- iarg[3] = p->flag; /* l_int */
- *n_args = 4;
+ *n_args = 3;
break;
}
/* 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 */
@@ -2201,12 +2235,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2221,12 +2266,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2246,17 +2298,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2294,7 +2355,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2309,7 +2376,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2329,12 +2401,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* 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 */
@@ -2363,7 +2442,7 @@ 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:
@@ -3548,7 +3627,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
p = "l_int";
break;
case 3:
- p = "struct l_rusage *";
+ p = "void *";
break;
default:
break;
@@ -3982,27 +4061,27 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
/* 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 l_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 *";
+ p = "struct l_sched_param *";
break;
default:
break;
@@ -4057,7 +4136,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
- /* sched_rr_get_interval */
+ /* linux_sched_rr_get_interval */
case 161:
switch(ndx) {
case 0:
@@ -4298,6 +4377,19 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -4970,12 +5062,51 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5299,6 +5430,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5558,18 +5708,56 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 2:
p = "l_int";
break;
- case 3:
- p = "l_int";
- break;
default:
break;
};
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:
@@ -5623,9 +5811,44 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5635,9 +5858,32 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5650,12 +5896,42 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5687,6 +5963,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5696,6 +5991,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5708,9 +6019,32 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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:
@@ -5733,7 +6067,7 @@ systrace_return_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:
if (ndx == 0 || ndx == 1)
p = "void";
@@ -6365,12 +6699,12 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* munlockall */
case 153:
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154:
if (ndx == 0 || ndx == 1)
p = "int";
break;
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155:
if (ndx == 0 || ndx == 1)
p = "int";
@@ -6397,7 +6731,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "int";
break;
- /* sched_rr_get_interval */
+ /* linux_sched_rr_get_interval */
case 161:
if (ndx == 0 || ndx == 1)
p = "int";
@@ -6475,6 +6809,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_rt_sigqueueinfo */
case 178:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_rt_sigsuspend */
case 179:
if (ndx == 0 || ndx == 1)
@@ -6729,10 +7066,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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 */
@@ -6847,6 +7193,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 283:
/* linux_waitid */
case 284:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_add_key */
case 286:
/* linux_request_key */
@@ -6932,8 +7281,14 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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 */
@@ -6960,16 +7315,28 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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 */
@@ -6978,10 +7345,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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)
@@ -6999,12 +7375,18 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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 */
@@ -7013,8 +7395,14 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
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 */
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 67d5056..7c980ce 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#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>
@@ -71,17 +72,23 @@ __FBSDID("$FreeBSD$");
#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
#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
@@ -93,13 +100,15 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
#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);
@@ -110,12 +119,15 @@ static void exec_linux_setregs(struct thread *td,
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
@@ -137,28 +149,6 @@ static int bsd_to_linux_errno[ELAST + 1] = {
-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 */
@@ -198,6 +188,10 @@ static int _bsd_to_linux_trapcode[] = {
_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.
@@ -208,15 +202,15 @@ static int
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);
}
}
@@ -254,6 +248,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
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);
/*
@@ -279,6 +276,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
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);
@@ -302,23 +302,45 @@ linux_copyout_strings(struct image_params *imgp)
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(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.
@@ -398,10 +420,6 @@ linux_copyout_strings(struct image_params *imgp)
return (stack_base);
}
-
-
-extern unsigned long linux_sznonrtsigcode;
-
static void
linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
{
@@ -440,9 +458,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* 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));
@@ -468,7 +484,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
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;
@@ -477,6 +493,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
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;
@@ -514,7 +531,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* 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;
@@ -546,7 +563,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
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;
@@ -582,9 +599,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* 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));
@@ -596,7 +611,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* 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;
@@ -605,6 +620,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
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;
@@ -617,8 +633,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
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) {
/*
@@ -633,7 +648,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* 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;
@@ -661,7 +676,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
struct trapframe *regs;
l_sigset_t lmask;
sigset_t bmask;
- int eflags, i;
+ int eflags;
ksiginfo_t ksi;
regs = td->td_frame;
@@ -684,7 +699,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
#define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
eflags = frame.sf_sc.sc_eflags;
if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
- return(EINVAL);
+ return (EINVAL);
/*
* Don't allow users to load a valid privileged %cs. Let the
@@ -699,12 +714,10 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
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);
@@ -775,7 +788,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
#define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
eflags = context->sc_eflags;
if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
- return(EINVAL);
+ return (EINVAL);
/*
* Don't allow users to load a valid privileged %cs. Let the
@@ -790,7 +803,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
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);
@@ -852,7 +865,8 @@ linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
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;
@@ -942,14 +956,14 @@ struct sysentvec linux_sysvec = {
.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",
@@ -973,6 +987,7 @@ struct sysentvec linux_sysvec = {
.sv_shared_page_base = LINUX_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
+ .sv_thread_detach = linux_thread_detach,
};
INIT_SYSENTVEC(aout_sysvec, &linux_sysvec);
@@ -980,14 +995,14 @@ struct sysentvec elf_linux_sysvec = {
.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",
@@ -1011,8 +1026,41 @@ struct sysentvec elf_linux_sysvec = {
.sv_shared_page_base = LINUX_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
+ .sv_thread_detach = linux_thread_detach,
+};
+
+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);
};
-INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec);
+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;
@@ -1084,7 +1132,6 @@ linux_elf_modevent(module_t mod, int type, void *data)
Elf32_Brandinfo **brandinfo;
int error;
struct linux_ioctl_handler **lihp;
- struct linux_device_handler **ldhp;
error = 0;
@@ -1097,18 +1144,16 @@ linux_elf_modevent(module_t mod, int type, void *data)
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,
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);
@@ -1131,13 +1176,10 @@ linux_elf_modevent(module_t mod, int type, void *data)
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");
@@ -1145,9 +1187,9 @@ linux_elf_modevent(module_t mod, int type, void *data)
printf("Could not deinstall ELF interpreter entry\n");
break;
default:
- return EOPNOTSUPP;
+ return (EOPNOTSUPP);
}
- return error;
+ return (error);
}
static moduledata_t linux_elf_mod = {
diff --git a/sys/i386/linux/linux_vdso.lds.s b/sys/i386/linux/linux_vdso.lds.s
new file mode 100644
index 0000000..dcb61cf
--- /dev/null
+++ b/sys/i386/linux/linux_vdso.lds.s
@@ -0,0 +1,65 @@
+/*
+ * 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$
+ */
+
+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: *;
+ };
+}
diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master
index 5b4f3a6..e6609a9 100644
--- a/sys/i386/linux/syscalls.master
+++ b/sys/i386/linux/syscalls.master
@@ -37,8 +37,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); }
@@ -209,7 +208,7 @@
113 AUE_NULL STD { int linux_vm86old(void); }
114 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \
l_int *status, l_int options, \
- struct l_rusage *rusage); }
+ 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, \
@@ -270,10 +269,10 @@
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, \
- struct sched_param *param); }
+154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \
+ struct l_sched_param *param); }
+155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \
+ struct l_sched_param *param); }
156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \
l_pid_t pid, l_int policy, \
struct l_sched_param *param); }
@@ -284,8 +283,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 +320,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); }
@@ -432,9 +432,11 @@
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, \
@@ -475,7 +477,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); }
@@ -513,9 +517,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, l_int flag); }
-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 +538,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 +567,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
OpenPOWER on IntegriCloud