Fri Nov 18 04:08:56 2011 UTC ()
add sigtimedwait support


(christos)
diff -r0 -r1.1 src/sys/compat/linux32/arch/amd64/linux32_siginfo.h
diff -r1.2 -r1.3 src/sys/compat/linux32/arch/amd64/linux32_signal.h
diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_syscall.h
diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h
diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_syscalls.c
diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_sysent.c
diff -r1.59 -r1.60 src/sys/compat/linux32/arch/amd64/syscalls.master
diff -r1.21 -r1.22 src/sys/compat/linux32/common/linux32_misc.c
diff -r0 -r1.1 src/sys/compat/linux32/common/linux32_sched.h
diff -r0 -r1.1 src/sys/compat/linux32/common/linux32_siginfo.h
diff -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_signal.c
diff -r1.2 -r1.3 src/sys/compat/linux32/common/linux32_signal.h
diff -r1.35 -r1.36 src/sys/compat/linux32/common/linux32_time.c
diff -r1.14 -r1.15 src/sys/compat/linux32/common/linux32_types.h

File Added: src/sys/compat/linux32/arch/amd64/linux32_siginfo.h
/*	$NetBSD: linux32_siginfo.h,v 1.1 2011/11/18 04:08:56 christos Exp $	*/

/*-
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Eric Haszlakiewicz.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _AMD64_LINUX32_SIGINFO_H
#define _AMD64_LINUX32_SIGINFO_H

typedef union linux32_sigval {
	int	sival_int;
	netbsd32_voidp	sival_ptr;
} linux32_sigval_t;

#define SI_MAX_SIZE	128
#define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 3)

typedef struct linux32_siginfo {
	int	lsi_signo;
	int	lsi_errno;
	int	lsi_code;
	union {
		int _pad[SI_PAD_SIZE];

		/* kill() */
		struct {
			linux32_pid_t	_pid;
			linux32_uid_t	_uid;
		} _kill;

		/* POSIX.1b signals */
		struct {
			linux32_pid_t	_pid;
			linux32_uid_t	_uid;
			linux32_sigval_t	_sigval;
		} _rt;

		/* POSIX.1b timers */
		struct {
			unsigned int	_timer1;
			unsigned int	_timer2;
		} _timer;

		/* SIGCHLD */
		struct {
			linux32_pid_t	_pid;
			linux32_uid_t	_uid;
			int		_status;
			linux32_clock_t	_utime;
			linux32_clock_t	_stime;
		} _sigchld;

		/* SIGPOLL */
		struct {
			int _band;
			int _fd;
		} _sigpoll;

		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
		struct {
			netbsd32_voidp _addr;
		} _sigfault;
	} _sidata;
} linux32_siginfo_t;

#endif /* !_AMD64_LINUX32_SIGINFO_H */

cvs diff -r1.2 -r1.3 src/sys/compat/linux32/arch/amd64/linux32_signal.h (expand / switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/linux32_signal.h 2009/06/08 14:42:10 1.2
+++ src/sys/compat/linux32/arch/amd64/linux32_signal.h 2011/11/18 04:08:56 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_signal.h,v 1.2 2009/06/08 14:42:10 njoly Exp $ */ 1/* $NetBSD: linux32_signal.h,v 1.3 2011/11/18 04:08:56 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. 4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -81,157 +81,26 @@ typedef u_int32_t linux32_old_sigset_t; @@ -81,157 +81,26 @@ typedef u_int32_t linux32_old_sigset_t;
81#define LINUX32_SIGRTMIN LINUX_SIGRTMIN 81#define LINUX32_SIGRTMIN LINUX_SIGRTMIN
82 82
83typedef struct { 83typedef struct {
84 u_int32_t sig[LINUX32__NSIG_WORDS]; 84 u_int32_t sig[LINUX32__NSIG_WORDS];
85} linux32_sigset_t; 85} linux32_sigset_t;
86 86
87struct linux32_sigaction { 87struct linux32_sigaction {
88 linux32_handler_t linux_sa_handler; 88 linux32_handler_t linux_sa_handler;
89 u_int32_t linux_sa_flags; 89 u_int32_t linux_sa_flags;
90 linux32_restorer_t linux_sa_restorer; 90 linux32_restorer_t linux_sa_restorer;
91 linux32_sigset_t linux_sa_mask; 91 linux32_sigset_t linux_sa_mask;
92}; 92};
93 93
94typedef union linux32_sigval { 
95 int sival_int; 
96 netbsd32_voidp sival_ptr; 
97} linux32_sigval_t; 
98 
99#define SI_MAX_SIZE 128 
100#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3) 
101 
102typedef struct linux32_siginfo { 
103 int lsi_signo; 
104 int lsi_errno; 
105 int lsi_code; 
106 union { 
107 int _pad[SI_PAD_SIZE]; 
108 
109 /* kill() */ 
110 struct { 
111 linux32_pid_t _pid; 
112 linux32_uid_t _uid; 
113 } _kill; 
114 
115 /* POSIX.1b signals */ 
116 struct { 
117 linux32_pid_t _pid; 
118 linux32_uid_t _uid; 
119 linux32_sigval_t _sigval; 
120 } _rt; 
121 
122 /* POSIX.1b timers */ 
123 struct { 
124 unsigned int _timer1; 
125 unsigned int _timer2; 
126 } _timer; 
127 
128 /* SIGCHLD */ 
129 struct { 
130 linux32_pid_t _pid; 
131 linux32_uid_t _uid; 
132 int _status; 
133 linux32_clock_t _utime; 
134 linux32_clock_t _stime; 
135 } _sigchld; 
136 
137 /* SIGPOLL */ 
138 struct { 
139 int _band; 
140 int _fd; 
141 } _sigpoll; 
142 
143 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 
144 struct { 
145 netbsd32_voidp _addr; 
146 } _sigfault; 
147 } _sidata; 
148} linux32_siginfo_t; 
149 
150#define lsi_pid _sidata._kill._pid 
151#define lsi_uid _sidata._kill._uid 
152#define lsi_status _sidata._sigchld._status 
153#define lsi_utime _sidata._sigchld._utime 
154#define lsi_stime _sidata._sigchld._stime 
155#define lsi_value _sidata._rt._sigval 
156#define lsi_int _sidata._rt._sigval.sival_int 
157#define lsi_ptr _sidata._rt._sigval.sival_ptr 
158#define lsi_addr _sidata._sigfault._addr 
159#define lsi_band _sidata._sigpoll._band 
160#define lsi_fd _sidata._sigpoll._fd 
161 
162/* 
163 * si_code values for non-signals 
164 */ 
165#define LINUX32_SI_USER 0 
166#define LINUX32_SI_KERNEL 0x80 
167#define LINUX32_SI_QUEUE -1 
168#define LINUX32_SI_TIMER -2 
169#define LINUX32_SI_MESGQ -3 
170#define LINUX32_SI_ASYNCIO -4 
171#define LINUX32_SI_SIGIO -5 
172#define LINUX32_SI_SIGNL -6 
173 
174/* si_code values for SIGILL */ 
175#define LINUX32_ILL_ILLOPC 1 
176#define LINUX32_ILL_ILLOPN 2 
177#define LINUX32_ILL_ILLADR 3 
178#define LINUX32_ILL_ILLTRP 4 
179#define LINUX32_ILL_PRVOPC 5 
180#define LINUX32_ILL_PRVREG 6 
181#define LINUX32_ILL_COPROC 7 
182#define LINUX32_ILL_BADSTK 8 
183 
184/* si_code values for SIGFPE */ 
185#define LINUX32_FPE_INTDIV 1 
186#define LINUX32_FPE_INTOVF 2 
187#define LINUX32_FPE_FLTDIV 3 
188#define LINUX32_FPE_FLTOVF 4 
189#define LINUX32_FPE_FLTUND 5 
190#define LINUX32_FPE_FLTRES 6 
191#define LINUX32_FPE_FLTINV 7 
192#define LINUX32_FPE_FLTSUB 8 
193 
194/* si_code values for SIGSEGV */ 
195#define LINUX32_SEGV_MAPERR 1 
196#define LINUX32_SEGV_ACCERR 2 
197 
198/* si_code values for SIGBUS */ 
199#define LINUX32_BUS_ADRALN 1 
200#define LINUX32_BUS_ADRERR 2 
201#define LINUX32_BUS_OBJERR 3 
202 
203/* si_code values for SIGTRAP */ 
204#define LINUX32_TRAP_BRKPT 1 
205#define LINUX32_TRAP_TRACE 2 
206 
207/* si_code values for SIGCHLD */ 
208#define LINUX32_CLD_EXITED 1 
209#define LINUX32_CLD_KILLED 2 
210#define LINUX32_CLD_DUMPED 3 
211#define LINUX32_CLD_TRAPPED 4 
212#define LINUX32_CLD_STOPPED 5 
213#define LINUX32_CLD_CONTINUED 6 
214 
215/* si_code values for SIGPOLL */ 
216#define LINUX32_POLL_IN 1 
217#define LINUX32_POLL_OUT 2 
218#define LINUX32_POLL_MSG 3 
219#define LINUX32_POLL_ERR 4 
220#define LINUX32_POLL_PRI 5 
221#define LINUX32_POLL_HUP 6 
222 
223#define LINUX32_SI_FROMUSER(sp) ((sp)->si_code <= 0) 
224#define LINUX32_SI_FROMKERNEL(sp) ((sp)->si_code > 0) 
225 94
226struct linux32_sigaltstack {  95struct linux32_sigaltstack {
227 netbsd32_voidp ss_sp; 96 netbsd32_voidp ss_sp;
228 int ss_flags;  97 int ss_flags;
229 netbsd32_size_t ss_size; 98 netbsd32_size_t ss_size;
230};  99};
231 100
232struct linux32_sigcontext { 101struct linux32_sigcontext {
233 int sc_gs; 102 int sc_gs;
234 int sc_fs; 103 int sc_fs;
235 int sc_es; 104 int sc_es;
236 int sc_ds; 105 int sc_ds;
237 int sc_edi; 106 int sc_edi;

cvs diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_syscall.h (expand / switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/linux32_syscall.h 2011/05/30 21:37:40 1.63
+++ src/sys/compat/linux32/arch/amd64/linux32_syscall.h 2011/11/18 04:08:56 1.64
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_syscall.h,v 1.63 2011/05/30 21:37:40 alnsn Exp $ */ 1/* $NetBSD: linux32_syscall.h,v 1.64 2011/11/18 04:08:56 christos Exp $ */
2 2
3/* 3/*
4 * System call numbers. 4 * System call numbers.
5 * 5 *
6 * DO NOT EDIT-- this file is automatically generated. 6 * DO NOT EDIT-- this file is automatically generated.
7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp 7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp
8 */ 8 */
9 9
10#ifndef _LINUX32_SYS_SYSCALL_H_ 10#ifndef _LINUX32_SYS_SYSCALL_H_
11#define _LINUX32_SYS_SYSCALL_H_ 11#define _LINUX32_SYS_SYSCALL_H_
12 12
13#define LINUX32_SYS_MAXSYSARGS 8 13#define LINUX32_SYS_MAXSYSARGS 8
14 14
@@ -435,26 +435,29 @@ @@ -435,26 +435,29 @@
435 435
436/* syscall: "rt_sigreturn" ret: "int" args: "linux32_ucontextp_t" */ 436/* syscall: "rt_sigreturn" ret: "int" args: "linux32_ucontextp_t" */
437#define LINUX32_SYS_rt_sigreturn 173 437#define LINUX32_SYS_rt_sigreturn 173
438 438
439/* syscall: "rt_sigaction" ret: "int" args: "int" "linux32_sigactionp_t" "linux32_sigactionp_t" "netbsd32_size_t" */ 439/* syscall: "rt_sigaction" ret: "int" args: "int" "linux32_sigactionp_t" "linux32_sigactionp_t" "netbsd32_size_t" */
440#define LINUX32_SYS_rt_sigaction 174 440#define LINUX32_SYS_rt_sigaction 174
441 441
442/* syscall: "rt_sigprocmask" ret: "int" args: "int" "linux32_sigsetp_t" "linux32_sigsetp_t" "netbsd32_size_t" */ 442/* syscall: "rt_sigprocmask" ret: "int" args: "int" "linux32_sigsetp_t" "linux32_sigsetp_t" "netbsd32_size_t" */
443#define LINUX32_SYS_rt_sigprocmask 175 443#define LINUX32_SYS_rt_sigprocmask 175
444 444
445/* syscall: "rt_sigpending" ret: "int" args: "linux32_sigsetp_t" "netbsd32_size_t" */ 445/* syscall: "rt_sigpending" ret: "int" args: "linux32_sigsetp_t" "netbsd32_size_t" */
446#define LINUX32_SYS_rt_sigpending 176 446#define LINUX32_SYS_rt_sigpending 176
447 447
 448/* syscall: "rt_sigtimedwait" ret: "int" args: "const linux32_sigset_t *" "linux32_siginfo_t *" "const struct linux_timespec32 *" */
 449#define LINUX32_SYS_rt_sigtimedwait 177
 450
448/* syscall: "rt_queueinfo" ret: "int" args: "int" "int" "linux32_siginfop_t" */ 451/* syscall: "rt_queueinfo" ret: "int" args: "int" "int" "linux32_siginfop_t" */
449#define LINUX32_SYS_rt_queueinfo 178 452#define LINUX32_SYS_rt_queueinfo 178
450 453
451/* syscall: "rt_sigsuspend" ret: "int" args: "linux32_sigsetp_t" "netbsd32_size_t" */ 454/* syscall: "rt_sigsuspend" ret: "int" args: "linux32_sigsetp_t" "netbsd32_size_t" */
452#define LINUX32_SYS_rt_sigsuspend 179 455#define LINUX32_SYS_rt_sigsuspend 179
453 456
454/* syscall: "pread" ret: "netbsd32_ssize_t" args: "int" "netbsd32_voidp" "netbsd32_size_t" "linux32_off_t" */ 457/* syscall: "pread" ret: "netbsd32_ssize_t" args: "int" "netbsd32_voidp" "netbsd32_size_t" "linux32_off_t" */
455#define LINUX32_SYS_pread 180 458#define LINUX32_SYS_pread 180
456 459
457/* syscall: "pwrite" ret: "netbsd32_ssize_t" args: "int" "netbsd32_voidp" "netbsd32_size_t" "linux32_off_t" */ 460/* syscall: "pwrite" ret: "netbsd32_ssize_t" args: "int" "netbsd32_voidp" "netbsd32_size_t" "linux32_off_t" */
458#define LINUX32_SYS_pwrite 181 461#define LINUX32_SYS_pwrite 181
459 462
460/* syscall: "chown16" ret: "int" args: "netbsd32_charp" "linux32_uid16_t" "linux32_gid16_t" */ 463/* syscall: "chown16" ret: "int" args: "netbsd32_charp" "linux32_uid16_t" "linux32_gid16_t" */

cvs diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h (expand / switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h 2011/05/30 21:37:40 1.63
+++ src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h 2011/11/18 04:08:56 1.64
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_syscallargs.h,v 1.63 2011/05/30 21:37:40 alnsn Exp $ */ 1/* $NetBSD: linux32_syscallargs.h,v 1.64 2011/11/18 04:08:56 christos Exp $ */
2 2
3/* 3/*
4 * System call argument lists. 4 * System call argument lists.
5 * 5 *
6 * DO NOT EDIT-- this file is automatically generated. 6 * DO NOT EDIT-- this file is automatically generated.
7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp 7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp
8 */ 8 */
9 9
10#ifndef _LINUX32_SYS_SYSCALLARGS_H_ 10#ifndef _LINUX32_SYS_SYSCALLARGS_H_
11#define _LINUX32_SYS_SYSCALLARGS_H_ 11#define _LINUX32_SYS_SYSCALLARGS_H_
12 12
13#define LINUX32_SYS_MAXSYSARGS 8 13#define LINUX32_SYS_MAXSYSARGS 8
14 14
@@ -594,26 +594,33 @@ struct linux32_sys_rt_sigprocmask_args { @@ -594,26 +594,33 @@ struct linux32_sys_rt_sigprocmask_args {
594 syscallarg(int) how; 594 syscallarg(int) how;
595 syscallarg(linux32_sigsetp_t) set; 595 syscallarg(linux32_sigsetp_t) set;
596 syscallarg(linux32_sigsetp_t) oset; 596 syscallarg(linux32_sigsetp_t) oset;
597 syscallarg(netbsd32_size_t) sigsetsize; 597 syscallarg(netbsd32_size_t) sigsetsize;
598}; 598};
599check_syscall_args(linux32_sys_rt_sigprocmask) 599check_syscall_args(linux32_sys_rt_sigprocmask)
600 600
601struct linux32_sys_rt_sigpending_args { 601struct linux32_sys_rt_sigpending_args {
602 syscallarg(linux32_sigsetp_t) set; 602 syscallarg(linux32_sigsetp_t) set;
603 syscallarg(netbsd32_size_t) sigsetsize; 603 syscallarg(netbsd32_size_t) sigsetsize;
604}; 604};
605check_syscall_args(linux32_sys_rt_sigpending) 605check_syscall_args(linux32_sys_rt_sigpending)
606 606
 607struct linux32_sys_rt_sigtimedwait_args {
 608 syscallarg(const linux32_sigset_t *) set;
 609 syscallarg(linux32_siginfo_t *) info;
 610 syscallarg(const struct linux_timespec32 *) timeout;
 611};
 612check_syscall_args(linux32_sys_rt_sigtimedwait)
 613
607struct linux32_sys_rt_queueinfo_args { 614struct linux32_sys_rt_queueinfo_args {
608 syscallarg(int) pid; 615 syscallarg(int) pid;
609 syscallarg(int) sig; 616 syscallarg(int) sig;
610 syscallarg(linux32_siginfop_t) uinfo; 617 syscallarg(linux32_siginfop_t) uinfo;
611}; 618};
612check_syscall_args(linux32_sys_rt_queueinfo) 619check_syscall_args(linux32_sys_rt_queueinfo)
613 620
614struct linux32_sys_rt_sigsuspend_args { 621struct linux32_sys_rt_sigsuspend_args {
615 syscallarg(linux32_sigsetp_t) unewset; 622 syscallarg(linux32_sigsetp_t) unewset;
616 syscallarg(netbsd32_size_t) sigsetsize; 623 syscallarg(netbsd32_size_t) sigsetsize;
617}; 624};
618check_syscall_args(linux32_sys_rt_sigsuspend) 625check_syscall_args(linux32_sys_rt_sigsuspend)
619 626
@@ -1179,26 +1186,28 @@ int netbsd32_poll(struct lwp *, const st @@ -1179,26 +1186,28 @@ int netbsd32_poll(struct lwp *, const st
1179 1186
1180int linux32_sys_setresgid16(struct lwp *, const struct linux32_sys_setresgid16_args *, register_t *); 1187int linux32_sys_setresgid16(struct lwp *, const struct linux32_sys_setresgid16_args *, register_t *);
1181 1188
1182int linux32_sys_getresgid16(struct lwp *, const struct linux32_sys_getresgid16_args *, register_t *); 1189int linux32_sys_getresgid16(struct lwp *, const struct linux32_sys_getresgid16_args *, register_t *);
1183 1190
1184int linux32_sys_rt_sigreturn(struct lwp *, const struct linux32_sys_rt_sigreturn_args *, register_t *); 1191int linux32_sys_rt_sigreturn(struct lwp *, const struct linux32_sys_rt_sigreturn_args *, register_t *);
1185 1192
1186int linux32_sys_rt_sigaction(struct lwp *, const struct linux32_sys_rt_sigaction_args *, register_t *); 1193int linux32_sys_rt_sigaction(struct lwp *, const struct linux32_sys_rt_sigaction_args *, register_t *);
1187 1194
1188int linux32_sys_rt_sigprocmask(struct lwp *, const struct linux32_sys_rt_sigprocmask_args *, register_t *); 1195int linux32_sys_rt_sigprocmask(struct lwp *, const struct linux32_sys_rt_sigprocmask_args *, register_t *);
1189 1196
1190int linux32_sys_rt_sigpending(struct lwp *, const struct linux32_sys_rt_sigpending_args *, register_t *); 1197int linux32_sys_rt_sigpending(struct lwp *, const struct linux32_sys_rt_sigpending_args *, register_t *);
1191 1198
 1199int linux32_sys_rt_sigtimedwait(struct lwp *, const struct linux32_sys_rt_sigtimedwait_args *, register_t *);
 1200
1192int linux32_sys_rt_queueinfo(struct lwp *, const struct linux32_sys_rt_queueinfo_args *, register_t *); 1201int linux32_sys_rt_queueinfo(struct lwp *, const struct linux32_sys_rt_queueinfo_args *, register_t *);
1193 1202
1194int linux32_sys_rt_sigsuspend(struct lwp *, const struct linux32_sys_rt_sigsuspend_args *, register_t *); 1203int linux32_sys_rt_sigsuspend(struct lwp *, const struct linux32_sys_rt_sigsuspend_args *, register_t *);
1195 1204
1196int linux32_sys_pread(struct lwp *, const struct linux32_sys_pread_args *, register_t *); 1205int linux32_sys_pread(struct lwp *, const struct linux32_sys_pread_args *, register_t *);
1197 1206
1198int linux32_sys_pwrite(struct lwp *, const struct linux32_sys_pwrite_args *, register_t *); 1207int linux32_sys_pwrite(struct lwp *, const struct linux32_sys_pwrite_args *, register_t *);
1199 1208
1200int linux32_sys_chown16(struct lwp *, const struct linux32_sys_chown16_args *, register_t *); 1209int linux32_sys_chown16(struct lwp *, const struct linux32_sys_chown16_args *, register_t *);
1201 1210
1202int netbsd32___getcwd(struct lwp *, const struct netbsd32___getcwd_args *, register_t *); 1211int netbsd32___getcwd(struct lwp *, const struct netbsd32___getcwd_args *, register_t *);
1203 1212
1204int sys___vfork14(struct lwp *, const void *, register_t *); 1213int sys___vfork14(struct lwp *, const void *, register_t *);

cvs diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_syscalls.c (expand / switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/linux32_syscalls.c 2011/05/30 21:37:40 1.63
+++ src/sys/compat/linux32/arch/amd64/linux32_syscalls.c 2011/11/18 04:08:56 1.64
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1/* $NetBSD: linux32_syscalls.c,v 1.63 2011/05/30 21:37:40 alnsn Exp $ */ 1/* $NetBSD: linux32_syscalls.c,v 1.64 2011/11/18 04:08:56 christos Exp $ */
2 2
3/* 3/*
4 * System call names. 4 * System call names.
5 * 5 *
6 * DO NOT EDIT-- this file is automatically generated. 6 * DO NOT EDIT-- this file is automatically generated.
7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp 7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp
8 */ 8 */
9 9
10#include <sys/cdefs.h> 10#include <sys/cdefs.h>
11__KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.63 2011/05/30 21:37:40 alnsn Exp $"); 11__KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.64 2011/11/18 04:08:56 christos Exp $");
12 12
13#if defined(_KERNEL_OPT) 13#if defined(_KERNEL_OPT)
14#include <sys/param.h> 14#include <sys/param.h>
15#include <sys/poll.h> 15#include <sys/poll.h>
16#include <sys/systm.h> 16#include <sys/systm.h>
17#include <sys/signal.h> 17#include <sys/signal.h>
18#include <sys/mount.h> 18#include <sys/mount.h>
19#include <sys/syscallargs.h> 19#include <sys/syscallargs.h>
20#include <machine/netbsd32_machdep.h> 20#include <machine/netbsd32_machdep.h>
21#include <compat/netbsd32/netbsd32.h> 21#include <compat/netbsd32/netbsd32.h>
22#include <compat/netbsd32/netbsd32_syscallargs.h> 22#include <compat/netbsd32/netbsd32_syscallargs.h>
23#include <compat/linux32/common/linux32_types.h> 23#include <compat/linux32/common/linux32_types.h>
24#include <compat/linux32/common/linux32_signal.h> 24#include <compat/linux32/common/linux32_signal.h>
@@ -202,27 +202,27 @@ const char *const linux32_syscallnames[] @@ -202,27 +202,27 @@ const char *const linux32_syscallnames[]
202 /* 164 */ "setresuid16", 202 /* 164 */ "setresuid16",
203 /* 165 */ "getresuid16", 203 /* 165 */ "getresuid16",
204 /* 166 */ "#166 (unimplemented vm86)", 204 /* 166 */ "#166 (unimplemented vm86)",
205 /* 167 */ "#167 (unimplemented query_module)", 205 /* 167 */ "#167 (unimplemented query_module)",
206 /* 168 */ "netbsd32_poll", 206 /* 168 */ "netbsd32_poll",
207 /* 169 */ "#169 (unimplemented nfsservctl)", 207 /* 169 */ "#169 (unimplemented nfsservctl)",
208 /* 170 */ "setresgid16", 208 /* 170 */ "setresgid16",
209 /* 171 */ "getresgid16", 209 /* 171 */ "getresgid16",
210 /* 172 */ "#172 (unimplemented prctl)", 210 /* 172 */ "#172 (unimplemented prctl)",
211 /* 173 */ "rt_sigreturn", 211 /* 173 */ "rt_sigreturn",
212 /* 174 */ "rt_sigaction", 212 /* 174 */ "rt_sigaction",
213 /* 175 */ "rt_sigprocmask", 213 /* 175 */ "rt_sigprocmask",
214 /* 176 */ "rt_sigpending", 214 /* 176 */ "rt_sigpending",
215 /* 177 */ "#177 (unimplemented rt_sigtimedwait)", 215 /* 177 */ "rt_sigtimedwait",
216 /* 178 */ "rt_queueinfo", 216 /* 178 */ "rt_queueinfo",
217 /* 179 */ "rt_sigsuspend", 217 /* 179 */ "rt_sigsuspend",
218 /* 180 */ "pread", 218 /* 180 */ "pread",
219 /* 181 */ "pwrite", 219 /* 181 */ "pwrite",
220 /* 182 */ "chown16", 220 /* 182 */ "chown16",
221 /* 183 */ "netbsd32___getcwd", 221 /* 183 */ "netbsd32___getcwd",
222 /* 184 */ "#184 (unimplemented capget)", 222 /* 184 */ "#184 (unimplemented capget)",
223 /* 185 */ "#185 (unimplemented capset)", 223 /* 185 */ "#185 (unimplemented capset)",
224 /* 186 */ "#186 (unimplemented sigaltstack)", 224 /* 186 */ "#186 (unimplemented sigaltstack)",
225 /* 187 */ "#187 (unimplemented sendfile)", 225 /* 187 */ "#187 (unimplemented sendfile)",
226 /* 188 */ "#188 (unimplemented getpmsg)", 226 /* 188 */ "#188 (unimplemented getpmsg)",
227 /* 189 */ "#189 (unimplemented putpmsg)", 227 /* 189 */ "#189 (unimplemented putpmsg)",
228 /* 190 */ "__vfork14", 228 /* 190 */ "__vfork14",

cvs diff -r1.63 -r1.64 src/sys/compat/linux32/arch/amd64/linux32_sysent.c (expand / switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/linux32_sysent.c 2011/05/30 21:37:40 1.63
+++ src/sys/compat/linux32/arch/amd64/linux32_sysent.c 2011/11/18 04:08:56 1.64
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1/* $NetBSD: linux32_sysent.c,v 1.63 2011/05/30 21:37:40 alnsn Exp $ */ 1/* $NetBSD: linux32_sysent.c,v 1.64 2011/11/18 04:08:56 christos Exp $ */
2 2
3/* 3/*
4 * System call switch table. 4 * System call switch table.
5 * 5 *
6 * DO NOT EDIT-- this file is automatically generated. 6 * DO NOT EDIT-- this file is automatically generated.
7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp 7 * created from NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp
8 */ 8 */
9 9
10#include <sys/cdefs.h> 10#include <sys/cdefs.h>
11__KERNEL_RCSID(0, "$NetBSD: linux32_sysent.c,v 1.63 2011/05/30 21:37:40 alnsn Exp $"); 11__KERNEL_RCSID(0, "$NetBSD: linux32_sysent.c,v 1.64 2011/11/18 04:08:56 christos Exp $");
12 12
13#include <sys/param.h> 13#include <sys/param.h>
14#include <sys/poll.h> 14#include <sys/poll.h>
15#include <sys/systm.h> 15#include <sys/systm.h>
16#include <sys/signal.h> 16#include <sys/signal.h>
17#include <sys/mount.h> 17#include <sys/mount.h>
18#include <sys/syscallargs.h> 18#include <sys/syscallargs.h>
19#include <machine/netbsd32_machdep.h> 19#include <machine/netbsd32_machdep.h>
20#include <compat/netbsd32/netbsd32.h> 20#include <compat/netbsd32/netbsd32.h>
21#include <compat/netbsd32/netbsd32_syscallargs.h> 21#include <compat/netbsd32/netbsd32_syscallargs.h>
22#include <compat/linux32/common/linux32_types.h> 22#include <compat/linux32/common/linux32_types.h>
23#include <compat/linux32/common/linux32_signal.h> 23#include <compat/linux32/common/linux32_signal.h>
24#include <compat/linux32/arch/amd64/linux32_missing.h> 24#include <compat/linux32/arch/amd64/linux32_missing.h>
@@ -381,28 +381,28 @@ struct sysent linux32_sysent[] = { @@ -381,28 +381,28 @@ struct sysent linux32_sysent[] = {
381 (sy_call_t *)linux32_sys_setresgid16 },/* 170 = setresgid16 */ 381 (sy_call_t *)linux32_sys_setresgid16 },/* 170 = setresgid16 */
382 { ns(struct linux32_sys_getresgid16_args), 0, 382 { ns(struct linux32_sys_getresgid16_args), 0,
383 (sy_call_t *)linux32_sys_getresgid16 },/* 171 = getresgid16 */ 383 (sy_call_t *)linux32_sys_getresgid16 },/* 171 = getresgid16 */
384 { 0, 0, 0, 384 { 0, 0, 0,
385 linux_sys_nosys }, /* 172 = unimplemented prctl */ 385 linux_sys_nosys }, /* 172 = unimplemented prctl */
386 { ns(struct linux32_sys_rt_sigreturn_args), 0, 386 { ns(struct linux32_sys_rt_sigreturn_args), 0,
387 (sy_call_t *)linux32_sys_rt_sigreturn },/* 173 = rt_sigreturn */ 387 (sy_call_t *)linux32_sys_rt_sigreturn },/* 173 = rt_sigreturn */
388 { ns(struct linux32_sys_rt_sigaction_args), 0, 388 { ns(struct linux32_sys_rt_sigaction_args), 0,
389 (sy_call_t *)linux32_sys_rt_sigaction },/* 174 = rt_sigaction */ 389 (sy_call_t *)linux32_sys_rt_sigaction },/* 174 = rt_sigaction */
390 { ns(struct linux32_sys_rt_sigprocmask_args), 0, 390 { ns(struct linux32_sys_rt_sigprocmask_args), 0,
391 (sy_call_t *)linux32_sys_rt_sigprocmask },/* 175 = rt_sigprocmask */ 391 (sy_call_t *)linux32_sys_rt_sigprocmask },/* 175 = rt_sigprocmask */
392 { ns(struct linux32_sys_rt_sigpending_args), 0, 392 { ns(struct linux32_sys_rt_sigpending_args), 0,
393 (sy_call_t *)linux32_sys_rt_sigpending },/* 176 = rt_sigpending */ 393 (sy_call_t *)linux32_sys_rt_sigpending },/* 176 = rt_sigpending */
394 { 0, 0, 0, 394 { ns(struct linux32_sys_rt_sigtimedwait_args), 0,
395 linux_sys_nosys }, /* 177 = unimplemented rt_sigtimedwait */ 395 (sy_call_t *)linux32_sys_rt_sigtimedwait },/* 177 = rt_sigtimedwait */
396 { ns(struct linux32_sys_rt_queueinfo_args), 0, 396 { ns(struct linux32_sys_rt_queueinfo_args), 0,
397 (sy_call_t *)linux32_sys_rt_queueinfo },/* 178 = rt_queueinfo */ 397 (sy_call_t *)linux32_sys_rt_queueinfo },/* 178 = rt_queueinfo */
398 { ns(struct linux32_sys_rt_sigsuspend_args), 0, 398 { ns(struct linux32_sys_rt_sigsuspend_args), 0,
399 (sy_call_t *)linux32_sys_rt_sigsuspend },/* 179 = rt_sigsuspend */ 399 (sy_call_t *)linux32_sys_rt_sigsuspend },/* 179 = rt_sigsuspend */
400 { ns(struct linux32_sys_pread_args), 0, 400 { ns(struct linux32_sys_pread_args), 0,
401 (sy_call_t *)linux32_sys_pread }, /* 180 = pread */ 401 (sy_call_t *)linux32_sys_pread }, /* 180 = pread */
402 { ns(struct linux32_sys_pwrite_args), 0, 402 { ns(struct linux32_sys_pwrite_args), 0,
403 (sy_call_t *)linux32_sys_pwrite }, /* 181 = pwrite */ 403 (sy_call_t *)linux32_sys_pwrite }, /* 181 = pwrite */
404 { ns(struct linux32_sys_chown16_args), 0, 404 { ns(struct linux32_sys_chown16_args), 0,
405 (sy_call_t *)linux32_sys_chown16 }, /* 182 = chown16 */ 405 (sy_call_t *)linux32_sys_chown16 }, /* 182 = chown16 */
406 { ns(struct netbsd32___getcwd_args), 0, 406 { ns(struct netbsd32___getcwd_args), 0,
407 (sy_call_t *)netbsd32___getcwd }, /* 183 = netbsd32___getcwd */ 407 (sy_call_t *)netbsd32___getcwd }, /* 183 = netbsd32___getcwd */
408 { 0, 0, 0, 408 { 0, 0, 0,

cvs diff -r1.59 -r1.60 src/sys/compat/linux32/arch/amd64/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/syscalls.master 2011/05/30 17:50:32 1.59
+++ src/sys/compat/linux32/arch/amd64/syscalls.master 2011/11/18 04:08:56 1.60
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.59 2011/05/30 17:50:32 alnsn Exp $ 1 $NetBSD: syscalls.master,v 1.60 2011/11/18 04:08:56 christos Exp $
2 2
3; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file. 3; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
4; (See syscalls.conf to see what it is processed into.) 4; (See syscalls.conf to see what it is processed into.)
5; 5;
6; Fields: number type [type-dependent ...] 6; Fields: number type [type-dependent ...]
7; number system call number, must be in order 7; number system call number, must be in order
8; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 8; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
9; the compatibility options defined in syscalls.conf. 9; the compatibility options defined in syscalls.conf.
10; 10;
11; types: 11; types:
12; STD always included 12; STD always included
13; OBSOL obsolete, not included in system 13; OBSOL obsolete, not included in system
14; UNIMPL unimplemented, not included in system 14; UNIMPL unimplemented, not included in system
@@ -307,27 +307,30 @@ @@ -307,27 +307,30 @@
307 linux32_gid16p_t egid, linux32_gid16p_t sgid); } 307 linux32_gid16p_t egid, linux32_gid16p_t sgid); }
308172 UNIMPL prctl 308172 UNIMPL prctl
309173 STD { int|linux32_sys||rt_sigreturn(linux32_ucontextp_t ucp); } 309173 STD { int|linux32_sys||rt_sigreturn(linux32_ucontextp_t ucp); }
310174 STD { int|linux32_sys||rt_sigaction(int signum, \ 310174 STD { int|linux32_sys||rt_sigaction(int signum, \
311 linux32_sigactionp_t nsa, \ 311 linux32_sigactionp_t nsa, \
312 linux32_sigactionp_t osa, \ 312 linux32_sigactionp_t osa, \
313 netbsd32_size_t sigsetsize); } 313 netbsd32_size_t sigsetsize); }
314175 STD { int|linux32_sys||rt_sigprocmask(int how, \ 314175 STD { int|linux32_sys||rt_sigprocmask(int how, \
315 linux32_sigsetp_t set, \ 315 linux32_sigsetp_t set, \
316 linux32_sigsetp_t oset, \ 316 linux32_sigsetp_t oset, \
317 netbsd32_size_t sigsetsize); } 317 netbsd32_size_t sigsetsize); }
318176 STD { int|linux32_sys||rt_sigpending(linux32_sigsetp_t set, \ 318176 STD { int|linux32_sys||rt_sigpending(linux32_sigsetp_t set, \
319 netbsd32_size_t sigsetsize); } 319 netbsd32_size_t sigsetsize); }
320177 UNIMPL rt_sigtimedwait 320177 STD { int|linux32_sys||rt_sigtimedwait( \
 321 const linux32_sigset_t *set, \
 322 linux32_siginfo_t *info, \
 323 const struct linux_timespec32 *timeout); }
321178 STD { int|linux32_sys||rt_queueinfo(int pid, int sig, \ 324178 STD { int|linux32_sys||rt_queueinfo(int pid, int sig, \
322 linux32_siginfop_t uinfo); } 325 linux32_siginfop_t uinfo); }
323179 STD { int|linux32_sys||rt_sigsuspend(linux32_sigsetp_t unewset, \ 326179 STD { int|linux32_sys||rt_sigsuspend(linux32_sigsetp_t unewset, \
324 netbsd32_size_t sigsetsize); } 327 netbsd32_size_t sigsetsize); }
325180 STD { netbsd32_ssize_t|linux32_sys||pread(int fd, \ 328180 STD { netbsd32_ssize_t|linux32_sys||pread(int fd, \
326 netbsd32_voidp buf, netbsd32_size_t nbyte, \ 329 netbsd32_voidp buf, netbsd32_size_t nbyte, \
327 linux32_off_t offset); } 330 linux32_off_t offset); }
328181 STD { netbsd32_ssize_t|linux32_sys||pwrite(int fd, \ 331181 STD { netbsd32_ssize_t|linux32_sys||pwrite(int fd, \
329 netbsd32_voidp buf, netbsd32_size_t nbyte, \ 332 netbsd32_voidp buf, netbsd32_size_t nbyte, \
330 linux32_off_t offset); } 333 linux32_off_t offset); }
331182 STD { int|linux32_sys||chown16(netbsd32_charp path, \ 334182 STD { int|linux32_sys||chown16(netbsd32_charp path, \
332 linux32_uid16_t uid, linux32_gid16_t gid); } 335 linux32_uid16_t uid, linux32_gid16_t gid); }
333183 NOARGS { int|netbsd32||__getcwd(netbsd32_charp bufp, \ 336183 NOARGS { int|netbsd32||__getcwd(netbsd32_charp bufp, \

cvs diff -r1.21 -r1.22 src/sys/compat/linux32/common/linux32_misc.c (expand / switch to unified diff)

--- src/sys/compat/linux32/common/linux32_misc.c 2010/11/02 18:18:07 1.21
+++ src/sys/compat/linux32/common/linux32_misc.c 2011/11/18 04:08:56 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_misc.c,v 1.21 2010/11/02 18:18:07 chs Exp $ */ 1/* $NetBSD: linux32_misc.c,v 1.22 2011/11/18 04:08:56 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe 8 * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe
9 * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center; 9 * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center;
10 * by Edgar Fu\ss, Mathematisches Institut der Uni Bonn. 10 * by Edgar Fu\ss, Mathematisches Institut der Uni Bonn.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -22,43 +22,44 @@ @@ -22,43 +22,44 @@
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.21 2010/11/02 18:18:07 chs Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.22 2011/11/18 04:08:56 christos Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/proc.h> 38#include <sys/proc.h>
39#include <sys/time.h> 39#include <sys/time.h>
40#include <sys/types.h> 40#include <sys/types.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/fstypes.h> 42#include <sys/fstypes.h>
43#include <sys/vfs_syscalls.h> 43#include <sys/vfs_syscalls.h>
44#include <sys/ptrace.h> 44#include <sys/ptrace.h>
45#include <sys/syscall.h> 45#include <sys/syscall.h>
46 46
47#include <compat/netbsd32/netbsd32.h> 47#include <compat/netbsd32/netbsd32.h>
48#include <compat/netbsd32/netbsd32_syscallargs.h> 48#include <compat/netbsd32/netbsd32_syscallargs.h>
49 49
50#include <compat/linux32/common/linux32_types.h> 50#include <compat/linux32/common/linux32_types.h>
51#include <compat/linux32/common/linux32_signal.h> 51#include <compat/linux32/common/linux32_signal.h>
 52#include <compat/linux32/common/linux32_sched.h>
52#include <compat/linux32/linux32_syscallargs.h> 53#include <compat/linux32/linux32_syscallargs.h>
53 54
54#include <compat/linux/common/linux_ptrace.h> 55#include <compat/linux/common/linux_ptrace.h>
55#include <compat/linux/common/linux_types.h> 56#include <compat/linux/common/linux_types.h>
56#include <compat/linux/common/linux_emuldata.h> 57#include <compat/linux/common/linux_emuldata.h>
57#include <compat/linux/common/linux_signal.h> 58#include <compat/linux/common/linux_signal.h>
58#include <compat/linux/common/linux_misc.h> 59#include <compat/linux/common/linux_misc.h>
59#include <compat/linux/common/linux_statfs.h> 60#include <compat/linux/common/linux_statfs.h>
60#include <compat/linux/common/linux_ipc.h> 61#include <compat/linux/common/linux_ipc.h>
61#include <compat/linux/common/linux_sem.h> 62#include <compat/linux/common/linux_sem.h>
62#include <compat/linux/common/linux_futex.h> 63#include <compat/linux/common/linux_futex.h>
63#include <compat/linux/linux_syscallargs.h> 64#include <compat/linux/linux_syscallargs.h>
64 65

File Added: src/sys/compat/linux32/common/linux32_sched.h
/*	$NetBSD: linux32_sched.h,v 1.1 2011/11/18 04:08:56 christos Exp $	*/

/*-
 * Copyright (c) 1999 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 * NASA Ames Research Center.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _LINUX32_SCHED_H
#define	_LINUX32_SCHED_H

/*
 * Flags passed to the Linux __clone(2) system call.
 */
#define	LINUX32_CLONE_CSIGNAL	0x000000ff	/* signal to be sent at exit */
#define	LINUX32_CLONE_VM		0x00000100	/* share address space */
#define	LINUX32_CLONE_FS		0x00000200	/* share "file system" info */
#define	LINUX32_CLONE_FILES	0x00000400	/* share file descriptors */
#define	LINUX32_CLONE_SIGHAND	0x00000800	/* share signal actions */
#define	LINUX32_CLONE_PID		0x00001000	/* share process ID */
#define	LINUX32_CLONE_PTRACE	0x00002000	/* ptrace(2) continues on
						   child */
#define	LINUX32_CLONE_VFORK	0x00004000	/* parent blocks until child
						   exits */
#define LINUX32_CLONE_PARENT	0x00008000	/* want same parent as cloner */
#define LINUX32_CLONE_THREAD	0x00010000	/* same thread group */
#define LINUX32_CLONE_NEWNS	0x00020000	/* new namespace group */
#define LINUX32_CLONE_SYSVSEM	0x00040000	/* share SysV SEM_UNDO */
#define LINUX32_CLONE_SETTLS	0x00080000	/* create new TLS for child */
#define LINUX32_CLONE_PARENT_SETTID \
				0x00100000	/* set TID in the parent */
#define LINUX32_CLONE_CHILD_CLEARTID \
				0x00200000	/* clear TID in the child */
#define LINUX32_CLONE_DETACHED	0x00400000	/* unused */
#define LINUX32_CLONE_UNTRACED	0x00800000	/* set if parent cannot force CLONE_PTRACE */
#define LINUX32_CLONE_CHILD_SETTID \
				0x01000000	/* set TID in the child */
#define LINUX32_CLONE_STOPPED	0x02000000	/* start in stopped state */

struct linux32_sched_param {
	int	sched_priority;
};

#define LINUX32_SCHED_OTHER	0
#define LINUX32_SCHED_FIFO	1
#define LINUX32_SCHED_RR		2

struct linux32_timespec {
	linux32_time_t	tv_sec;		/* seconds */
	int		tv_nsec;	/* nanoseconds */
};

#define LINUX32_CLOCK_REALTIME		0
#define LINUX32_CLOCK_MONOTONIC		1
#define LINUX32_CLOCK_PROCESS_CPUTIME_ID	2
#define LINUX32_CLOCK_THREAD_CPUTIME_ID	3
#define LINUX32_CLOCK_REALTIME_HR		4
#define LINUX32_CLOCK_MONOTONIC_HR	5

int linux32_to_native_clockid(clockid_t *, clockid_t);
void native_to_linux32_timespec(struct linux32_timespec *, struct timespec *);
void linux32_to_native_timespec(struct timespec *, struct linux32_timespec *);

#endif /* _LINUX32_SCHED_H */

File Added: src/sys/compat/linux32/common/linux32_siginfo.h
/* 	$NetBSD: linux32_siginfo.h,v 1.1 2011/11/18 04:08:56 christos Exp $	*/

/*-
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Eric Haszlakiewicz.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _LINUX32_SIGINFO_H
#define _LINUX32_SIGINFO_H

#if defined(__amd64__)
#include <compat/linux32/arch/amd64/linux32_siginfo.h>
#endif

/* si_code values for non signal */
#define	LINUX32_SI_USER		0
#define	LINUX32_SI_KERNEL		0x80
#define	LINUX32_SI_QUEUE		-1
#ifndef LINUX32_SI_TIMER /* all except mips */
#define	LINUX32_SI_TIMER		-2
#define	LINUX32_SI_MESGQ		-3
#define	LINUX32_SI_ASYNCIO	-4
#endif /* LINUX32_SI_TIMER */
#define	LINUX32_SI_SIGIO		-5
#define	LINUX32_SI_TKILL		-6
#define	LINUX32_SI_DETHREAD	-7

/* si_code values for SIGILL */
#define	LINUX32_ILL_ILLOPC	1
#define	LINUX32_ILL_ILLOPN	2
#define	LINUX32_ILL_ILLADR	3
#define	LINUX32_ILL_ILLTRP	4
#define	LINUX32_ILL_PRVOPC	5
#define	LINUX32_ILL_PRVREG	6
#define	LINUX32_ILL_COPROC	7
#define	LINUX32_ILL_BADSTK	8

/* si_code values for SIGFPE */
#define	LINUX32_FPE_INTDIV	1
#define	LINUX32_FPE_INTOVF	2
#define	LINUX32_FPE_FLTDIV	3
#define	LINUX32_FPE_FLTOVF	4
#define	LINUX32_FPE_FLTUND	5
#define	LINUX32_FPE_FLTRES	6
#define	LINUX32_FPE_FLTINV	7
#define	LINUX32_FPE_FLTSUB	8

/* si_code values for SIGSEGV */
#define	LINUX32_SEGV_MAPERR	1
#define	LINUX32_SEGV_ACCERR	2

/* si_code values for SIGBUS */
#define	LINUX32_BUS_ADRALN	1
#define	LINUX32_BUS_ADRERR	2
#define	LINUX32_BUS_OBJERR	3

/* si_code values for SIGTRAP */
#define	LINUX32_TRAP_BRKPT	1
#define	LINUX32_TRAP_TRACE	2

/* si_code values for SIGCHLD */
#define	LINUX32_CLD_EXITED	1
#define	LINUX32_CLD_KILLED	2
#define	LINUX32_CLD_DUMPED	3
#define	LINUX32_CLD_TRAPPED	4
#define	LINUX32_CLD_STOPPED	5
#define	LINUX32_CLD_CONTINUED	6

/* si_code values for SIGPOLL */
#define	LINUX32_POLL_IN		1
#define	LINUX32_POLL_OUT		2
#define	LINUX32_POLL_MSG		3
#define	LINUX32_POLL_ERR		4
#define	LINUX32_POLL_PRI		5
#define	LINUX32_POLL_HUP		6

#define	LINUX32_SI_FROMUSER(sp)	((sp)->si_code <= 0)
#define	LINUX32_SI_FROMKERNEL(sp)	((sp)->si_code > 0)

#define lsi_pid		_sidata._kill._pid
#define lsi_uid		_sidata._kill._uid
#define lsi_status      _sidata._sigchld._status
#define lsi_utime       _sidata._sigchld._utime
#define lsi_stime       _sidata._sigchld._stime
#define lsi_value       _sidata._rt._sigval
#define lsi_sival_int   _sidata._rt._sigval.sival_int
#define lsi_sival_ptr   _sidata._rt._sigval.sival_ptr
#define lsi_addr        _sidata._sigfault._addr
#define lsi_band        _sidata._sigpoll._band
#define lsi_fd          _sidata._sigpoll._fd

void native_to_linux32_siginfo(linux32_siginfo_t *, const struct _ksiginfo *);

#endif /* !_LINUX32_SIGINFO_H */

cvs diff -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_signal.c (expand / switch to unified diff)

--- src/sys/compat/linux32/common/linux32_signal.c 2009/06/08 13:34:23 1.13
+++ src/sys/compat/linux32/common/linux32_signal.c 2011/11/18 04:08:56 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_signal.c,v 1.13 2009/06/08 13:34:23 njoly Exp $ */ 1/* $NetBSD: linux32_signal.c,v 1.14 2011/11/18 04:08:56 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. 4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -22,40 +22,45 @@ @@ -22,40 +22,45 @@
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,  22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS  24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.13 2009/06/08 13:34:23 njoly Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.14 2011/11/18 04:08:56 christos Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/ucred.h> 38#include <sys/ucred.h>
39#include <sys/signalvar.h> 39#include <sys/signalvar.h>
40#include <sys/lwp.h> 40#include <sys/lwp.h>
41#include <sys/time.h> 41#include <sys/time.h>
42#include <sys/proc.h> 42#include <sys/proc.h>
 43#include <sys/wait.h>
43 44
44#include <compat/netbsd32/netbsd32.h> 45#include <compat/netbsd32/netbsd32.h>
45 46
 47#include <compat/linux/common/linux_signal.h>
46#include <compat/linux32/common/linux32_types.h> 48#include <compat/linux32/common/linux32_types.h>
47#include <compat/linux32/common/linux32_signal.h> 49#include <compat/linux32/common/linux32_signal.h>
 50#include <compat/linux32/common/linux32_siginfo.h>
48#include <compat/linux32/linux32_syscallargs.h> 51#include <compat/linux32/linux32_syscallargs.h>
 52#include <compat/linux32/common/linux32_errno.h>
 53#include <compat/linux32/common/linux32_sched.h>
49 54
50#define linux32_sigemptyset(s) memset((s), 0, sizeof(*(s))) 55#define linux32_sigemptyset(s) memset((s), 0, sizeof(*(s)))
51#define linux32_sigismember(s, n) ((s)->sig[((n) - 1) / LINUX32__NSIG_BPW] \ 56#define linux32_sigismember(s, n) ((s)->sig[((n) - 1) / LINUX32__NSIG_BPW] \
52 & (1 << ((n) - 1) % LINUX32__NSIG_BPW)) 57 & (1 << ((n) - 1) % LINUX32__NSIG_BPW))
53#define linux32_sigaddset(s, n) ((s)->sig[((n) - 1) / LINUX32__NSIG_BPW] \ 58#define linux32_sigaddset(s, n) ((s)->sig[((n) - 1) / LINUX32__NSIG_BPW] \
54 |= (1 << ((n) - 1) % LINUX32__NSIG_BPW)) 59 |= (1 << ((n) - 1) % LINUX32__NSIG_BPW))
55 60
56extern const int native_to_linux32_signo[]; 61extern const int native_to_linux32_signo[];
57extern const int linux32_to_native_signo[]; 62extern const int linux32_to_native_signo[];
58 63
59#ifdef DEBUG_LINUX 64#ifdef DEBUG_LINUX
60#define DPRINTF(a) uprintf a 65#define DPRINTF(a) uprintf a
61#else 66#else
@@ -82,26 +87,91 @@ native_to_linux32_sigset(linux32_sigset_ @@ -82,26 +87,91 @@ native_to_linux32_sigset(linux32_sigset_
82{ 87{
83 int i, newsig; 88 int i, newsig;
84 89
85 linux32_sigemptyset(lss); 90 linux32_sigemptyset(lss);
86 for (i = 1; i < NSIG; i++) { 91 for (i = 1; i < NSIG; i++) {
87 if (sigismember(bss, i)) { 92 if (sigismember(bss, i)) {
88 newsig = native_to_linux32_signo[i]; 93 newsig = native_to_linux32_signo[i];
89 if (newsig) 94 if (newsig)
90 linux32_sigaddset(lss, newsig); 95 linux32_sigaddset(lss, newsig);
91 } 96 }
92 } 97 }
93} 98}
94 99
 100void
 101native_to_linux32_siginfo(linux32_siginfo_t *lsi, const struct _ksiginfo *ksi)
 102{
 103 memset(lsi, 0, sizeof(*lsi));
 104
 105 lsi->lsi_signo = native_to_linux32_signo[ksi->_signo];
 106 lsi->lsi_errno = native_to_linux32_errno[ksi->_errno];
 107 lsi->lsi_code = native_to_linux32_si_code(ksi->_code);
 108
 109 switch (ksi->_code) {
 110 case SI_NOINFO:
 111 break;
 112
 113 case SI_USER:
 114 lsi->lsi_pid = ksi->_reason._rt._pid;
 115 lsi->lsi_uid = ksi->_reason._rt._uid;
 116 if (lsi->lsi_signo == LINUX_SIGALRM ||
 117 lsi->lsi_signo >= LINUX_SIGRTMIN)
 118 NETBSD32PTR32(lsi->lsi_value.sival_ptr,
 119 ksi->_reason._rt._value.sival_ptr);
 120 break;
 121
 122 case SI_TIMER:
 123 case SI_QUEUE:
 124 lsi->lsi_uid = ksi->_reason._rt._uid;
 125 lsi->lsi_uid = ksi->_reason._rt._uid;
 126 NETBSD32PTR32(lsi->lsi_value.sival_ptr,
 127 ksi->_reason._rt._value.sival_ptr);
 128 break;
 129
 130 case SI_ASYNCIO:
 131 case SI_MESGQ:
 132 NETBSD32PTR32(lsi->lsi_value.sival_ptr,
 133 ksi->_reason._rt._value.sival_ptr);
 134 break;
 135
 136 default:
 137 switch (ksi->_signo) {
 138 case SIGCHLD:
 139 lsi->lsi_uid = ksi->_reason._child._uid;
 140 lsi->lsi_pid = ksi->_reason._child._pid;
 141 lsi->lsi_status = native_to_linux32_si_status(
 142 ksi->_code, ksi->_reason._child._status);
 143 lsi->lsi_utime = ksi->_reason._child._utime;
 144 lsi->lsi_stime = ksi->_reason._child._stime;
 145 break;
 146
 147 case SIGILL:
 148 case SIGFPE:
 149 case SIGSEGV:
 150 case SIGBUS:
 151 case SIGTRAP:
 152 NETBSD32PTR32(lsi->lsi_addr, ksi->_reason._fault._addr);
 153 break;
 154
 155 case SIGIO:
 156 lsi->lsi_fd = ksi->_reason._poll._fd;
 157 lsi->lsi_band = ksi->_reason._poll._band;
 158 break;
 159 default:
 160 break;
 161 }
 162 }
 163}
 164
95unsigned int  165unsigned int
96native_to_linux32_sigflags(const int bsf) 166native_to_linux32_sigflags(const int bsf)
97{ 167{
98 unsigned int lsf = 0; 168 unsigned int lsf = 0;
99 if ((bsf & SA_NOCLDSTOP) != 0) 169 if ((bsf & SA_NOCLDSTOP) != 0)
100 lsf |= LINUX32_SA_NOCLDSTOP; 170 lsf |= LINUX32_SA_NOCLDSTOP;
101 if ((bsf & SA_NOCLDWAIT) != 0) 171 if ((bsf & SA_NOCLDWAIT) != 0)
102 lsf |= LINUX32_SA_NOCLDWAIT; 172 lsf |= LINUX32_SA_NOCLDWAIT;
103 if ((bsf & SA_ONSTACK) != 0) 173 if ((bsf & SA_ONSTACK) != 0)
104 lsf |= LINUX32_SA_ONSTACK; 174 lsf |= LINUX32_SA_ONSTACK;
105 if ((bsf & SA_RESTART) != 0) 175 if ((bsf & SA_RESTART) != 0)
106 lsf |= LINUX32_SA_RESTART; 176 lsf |= LINUX32_SA_RESTART;
107 if ((bsf & SA_NODEFER) != 0) 177 if ((bsf & SA_NODEFER) != 0)
@@ -352,26 +422,86 @@ linux32_sys_rt_sigsuspend(struct lwp *l, @@ -352,26 +422,86 @@ linux32_sys_rt_sigsuspend(struct lwp *l,
352 422
353 if (SCARG(uap, sigsetsize) != sizeof(linux32_sigset_t)) 423 if (SCARG(uap, sigsetsize) != sizeof(linux32_sigset_t))
354 return EINVAL; 424 return EINVAL;
355 425
356 if ((error = copyin(SCARG_P32(uap, unewset),  426 if ((error = copyin(SCARG_P32(uap, unewset),
357 &lss, sizeof(linux32_sigset_t))) != 0) 427 &lss, sizeof(linux32_sigset_t))) != 0)
358 return error; 428 return error;
359 429
360 linux32_to_native_sigset(&bss, &lss); 430 linux32_to_native_sigset(&bss, &lss);
361 431
362 return sigsuspend1(l, &bss); 432 return sigsuspend1(l, &bss);
363} 433}
364 434
 435static int
 436fetchss(const void *u, void *s, size_t len)
 437{
 438 int error;
 439 linux32_sigset_t lss;
 440
 441 KASSERT(len == sizeof(lss));
 442 if ((error = copyin(u, &lss, sizeof(lss))) != 0)
 443 return error;
 444
 445 linux32_to_native_sigset(s, &lss);
 446 return 0;
 447}
 448
 449static int
 450fetchts(const void *u, void *s, size_t len)
 451{
 452 int error;
 453 struct linux32_timespec lts;
 454
 455 KASSERT(len == sizeof(lts));
 456 if ((error = copyin(u, &lts, sizeof(lts))) != 0)
 457 return error;
 458
 459 linux32_to_native_timespec(s, &lts);
 460 return 0;
 461}
 462
 463static int
 464fakestorets(const void *u, void *s, size_t len)
 465{
 466 /* Do nothing, sigtimedwait does not alter timeout like ours */
 467 return 0;
 468}
 469
 470static int
 471storeinfo(const void *s, void *u, size_t len)
 472{
 473 linux32_siginfo_t lsi;
 474
 475 KASSERT(len == sizeof(lsi));
 476
 477 native_to_linux32_siginfo(&lsi, &((const siginfo_t *)s)->_info);
 478 return copyout(&lsi, u, sizeof(lsi));
 479}
 480
 481int
 482linux32_sys_rt_sigtimedwait(struct lwp *l,
 483 const struct linux32_sys_rt_sigtimedwait_args *uap, register_t *retval)
 484{
 485 /* {
 486 syscallarg(const linux32_sigset_t *) set;
 487 syscallarg(linux32_siginfo_t *) info);
 488 syscallarg(const struct linux32_timespec *) timeout;
 489 } */
 490
 491 return sigtimedwait1(l, (const struct sys_____sigtimedwait50_args *)uap,
 492 retval, fetchss, storeinfo, fetchts, fakestorets);
 493}
 494
365int 495int
366linux32_sys_signal(struct lwp *l, const struct linux32_sys_signal_args *uap, register_t *retval) 496linux32_sys_signal(struct lwp *l, const struct linux32_sys_signal_args *uap, register_t *retval)
367{ 497{
368 /* { 498 /* {
369 syscallarg(int) signum; 499 syscallarg(int) signum;
370 syscallarg(linux32_handler_t) handler; 500 syscallarg(linux32_handler_t) handler;
371 } */ 501 } */
372 struct sigaction nbsa, obsa; 502 struct sigaction nbsa, obsa;
373 int error, sig; 503 int error, sig;
374 504
375 *retval = -1; 505 *retval = -1;
376 506
377 sig = SCARG(uap, signum); 507 sig = SCARG(uap, signum);
@@ -460,13 +590,51 @@ linux32_sys_rt_queueinfo(struct lwp *l,  @@ -460,13 +590,51 @@ linux32_sys_rt_queueinfo(struct lwp *l,
460 int error; 590 int error;
461 linux32_siginfo_t info; 591 linux32_siginfo_t info;
462 592
463 error = copyin(SCARG_P32(uap, uinfo), &info, sizeof(info)); 593 error = copyin(SCARG_P32(uap, uinfo), &info, sizeof(info));
464 if (error) 594 if (error)
465 return error; 595 return error;
466 if (info.lsi_code >= 0) 596 if (info.lsi_code >= 0)
467 return EPERM; 597 return EPERM;
468 598
469 /* XXX To really implement this we need to */ 599 /* XXX To really implement this we need to */
470 /* XXX keep a list of queued signals somewhere. */ 600 /* XXX keep a list of queued signals somewhere. */
471 return linux32_sys_kill(l, (const void *)uap, retval); 601 return linux32_sys_kill(l, (const void *)uap, retval);
472} 602}
 603
 604int
 605native_to_linux32_si_code(int code)
 606{
 607 int si_codes[] = {
 608 LINUX32_SI_USER, LINUX32_SI_QUEUE, LINUX32_SI_TIMER,
 609 LINUX32_SI_ASYNCIO, LINUX32_SI_MESGQ, LINUX32_SI_TKILL /* SI_LWP */
 610 };
 611
 612 if (code <= 0 && -code < __arraycount(si_codes))
 613 return si_codes[-code];
 614
 615 return code;
 616}
 617
 618int
 619native_to_linux32_si_status(int code, int status)
 620{
 621 int sts;
 622
 623 switch (code) {
 624 case CLD_CONTINUED:
 625 sts = LINUX_SIGCONT;
 626 break;
 627 case CLD_EXITED:
 628 sts = WEXITSTATUS(status);
 629 break;
 630 case CLD_STOPPED:
 631 case CLD_TRAPPED:
 632 case CLD_DUMPED:
 633 case CLD_KILLED:
 634 default:
 635 sts = native_to_linux32_signo[WTERMSIG(status)];
 636 break;
 637 }
 638
 639 return sts;
 640}

cvs diff -r1.2 -r1.3 src/sys/compat/linux32/common/linux32_signal.h (expand / switch to unified diff)

--- src/sys/compat/linux32/common/linux32_signal.h 2007/12/04 18:40:18 1.2
+++ src/sys/compat/linux32/common/linux32_signal.h 2011/11/18 04:08:56 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_signal.h,v 1.2 2007/12/04 18:40:18 dsl Exp $ */ 1/* $NetBSD: linux32_signal.h,v 1.3 2011/11/18 04:08:56 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. 4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -23,33 +23,36 @@ @@ -23,33 +23,36 @@
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS  24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33#ifndef _LINUX32_SIGNAL_H_ 33#ifndef _LINUX32_SIGNAL_H_
34#define _LINUX32_SIGNAL_H_ 34#define _LINUX32_SIGNAL_H_
35 35
 36#include <compat/linux32/common/linux32_siginfo.h>
36#ifdef __amd64__ 37#ifdef __amd64__
37#include <compat/linux32/arch/amd64/linux32_signal.h> 38#include <compat/linux32/arch/amd64/linux32_signal.h>
38#endif 39#endif
39 40
40void linux32_to_native_sigset(sigset_t *, const linux32_sigset_t *); 41void linux32_to_native_sigset(sigset_t *, const linux32_sigset_t *);
41void native_to_linux32_sigset(linux32_sigset_t *, const sigset_t *); 42void native_to_linux32_sigset(linux32_sigset_t *, const sigset_t *);
42int linux32_to_native_sigflags(const unsigned long); 43int linux32_to_native_sigflags(const unsigned long);
43unsigned int native_to_linux32_sigflags(const int); 44unsigned int native_to_linux32_sigflags(const int);
44void linux32_to_native_sigaction(struct sigaction *,  45void linux32_to_native_sigaction(struct sigaction *,
45 const struct linux32_sigaction *); 46 const struct linux32_sigaction *);
46void native_to_linux32_sigaction(struct linux32_sigaction *,  47void native_to_linux32_sigaction(struct linux32_sigaction *,
47 const struct sigaction *); 48 const struct sigaction *);
48void native_to_linux32_sigaltstack(struct linux32_sigaltstack *, 49void native_to_linux32_sigaltstack(struct linux32_sigaltstack *,
49 const struct sigaltstack *); 50 const struct sigaltstack *);
50void native_to_linux32_old_sigset(linux32_old_sigset_t *, const sigset_t *); 51void native_to_linux32_old_sigset(linux32_old_sigset_t *, const sigset_t *);
51void linux32_old_extra_to_native_sigset(sigset_t *, 52void linux32_old_extra_to_native_sigset(sigset_t *,
52 const linux32_old_sigset_t *, const unsigned long *); 53 const linux32_old_sigset_t *, const unsigned long *);
53void linux32_old_to_native_sigset(sigset_t *, const linux32_old_sigset_t *); 54void linux32_old_to_native_sigset(sigset_t *, const linux32_old_sigset_t *);
 55int native_to_linux32_si_code(int);
 56int native_to_linux32_si_status(int, int);
54 57
55#endif /* _LINUX32_SIGNAL_H_ */ 58#endif /* _LINUX32_SIGNAL_H_ */

cvs diff -r1.35 -r1.36 src/sys/compat/linux32/common/linux32_time.c (expand / switch to unified diff)

--- src/sys/compat/linux32/common/linux32_time.c 2010/07/12 12:01:53 1.35
+++ src/sys/compat/linux32/common/linux32_time.c 2011/11/18 04:08:56 1.36
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_time.c,v 1.35 2010/07/12 12:01:53 njoly Exp $ */ 1/* $NetBSD: linux32_time.c,v 1.36 2011/11/18 04:08:56 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. 4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS  24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35 35
36__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.35 2010/07/12 12:01:53 njoly Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.36 2011/11/18 04:08:56 christos Exp $");
37 37
38#include <sys/types.h> 38#include <sys/types.h>
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/fstypes.h> 40#include <sys/fstypes.h>
41#include <sys/signal.h> 41#include <sys/signal.h>
42#include <sys/dirent.h> 42#include <sys/dirent.h>
43#include <sys/kauth.h> 43#include <sys/kauth.h>
44#include <sys/kernel.h> 44#include <sys/kernel.h>
45#include <sys/fcntl.h> 45#include <sys/fcntl.h>
46#include <sys/namei.h> 46#include <sys/namei.h>
47#include <sys/select.h> 47#include <sys/select.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
49#include <sys/resourcevar.h> 49#include <sys/resourcevar.h>
@@ -64,26 +64,27 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_time @@ -64,26 +64,27 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_time
64#include <compat/linux/common/linux_machdep.h> 64#include <compat/linux/common/linux_machdep.h>
65#include <compat/linux/common/linux_misc.h> 65#include <compat/linux/common/linux_misc.h>
66#include <compat/linux/common/linux_oldolduname.h> 66#include <compat/linux/common/linux_oldolduname.h>
67#include <compat/linux/common/linux_sched.h> 67#include <compat/linux/common/linux_sched.h>
68#include <compat/linux/common/linux_ipc.h> 68#include <compat/linux/common/linux_ipc.h>
69#include <compat/linux/common/linux_sem.h> 69#include <compat/linux/common/linux_sem.h>
70#include <compat/linux/linux_syscallargs.h> 70#include <compat/linux/linux_syscallargs.h>
71 71
72#include <compat/linux32/common/linux32_types.h> 72#include <compat/linux32/common/linux32_types.h>
73#include <compat/linux32/common/linux32_signal.h> 73#include <compat/linux32/common/linux32_signal.h>
74#include <compat/linux32/common/linux32_machdep.h> 74#include <compat/linux32/common/linux32_machdep.h>
75#include <compat/linux32/common/linux32_sysctl.h> 75#include <compat/linux32/common/linux32_sysctl.h>
76#include <compat/linux32/common/linux32_socketcall.h> 76#include <compat/linux32/common/linux32_socketcall.h>
 77#include <compat/linux32/common/linux32_sched.h>
77#include <compat/linux32/linux32_syscallargs.h> 78#include <compat/linux32/linux32_syscallargs.h>
78 79
79extern struct timezone linux_sys_tz; 80extern struct timezone linux_sys_tz;
80 81
81void native_to_linux32_timespec(struct linux32_timespec *, struct timespec *); 82void native_to_linux32_timespec(struct linux32_timespec *, struct timespec *);
82void linux32_to_native_timespec(struct timespec *, struct linux32_timespec *); 83void linux32_to_native_timespec(struct timespec *, struct linux32_timespec *);
83 84
84int 85int
85linux32_sys_gettimeofday(struct lwp *l, const struct linux32_sys_gettimeofday_args *uap, register_t *retval) 86linux32_sys_gettimeofday(struct lwp *l, const struct linux32_sys_gettimeofday_args *uap, register_t *retval)
86{ 87{
87 /* { 88 /* {
88 syscallarg(netbsd32_timeval50p_t) tp; 89 syscallarg(netbsd32_timeval50p_t) tp;
89 syscallarg(netbsd32_timezonep_t) tzp; 90 syscallarg(netbsd32_timezonep_t) tzp;

cvs diff -r1.14 -r1.15 src/sys/compat/linux32/common/linux32_types.h (expand / switch to unified diff)

--- src/sys/compat/linux32/common/linux32_types.h 2010/11/02 18:14:06 1.14
+++ src/sys/compat/linux32/common/linux32_types.h 2011/11/18 04:08:56 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_types.h,v 1.14 2010/11/02 18:14:06 chs Exp $ */ 1/* $NetBSD: linux32_types.h,v 1.15 2011/11/18 04:08:56 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. 4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -101,27 +101,22 @@ struct linux32_sysinfo { @@ -101,27 +101,22 @@ struct linux32_sysinfo {
101 netbsd32_u_long totalram; 101 netbsd32_u_long totalram;
102 netbsd32_u_long freeram; 102 netbsd32_u_long freeram;
103 netbsd32_u_long sharedram; 103 netbsd32_u_long sharedram;
104 netbsd32_u_long bufferram;  104 netbsd32_u_long bufferram;
105 netbsd32_u_long totalswap; 105 netbsd32_u_long totalswap;
106 netbsd32_u_long freeswap; 106 netbsd32_u_long freeswap;
107 unsigned short procs;  107 unsigned short procs;
108 netbsd32_u_long totalbig; 108 netbsd32_u_long totalbig;
109 netbsd32_u_long freebig; 109 netbsd32_u_long freebig;
110 unsigned int mem_unit; 110 unsigned int mem_unit;
111 char _f[20-2*sizeof(netbsd32_long)-sizeof(int)];  111 char _f[20-2*sizeof(netbsd32_long)-sizeof(int)];
112}; 112};
113 113
114struct linux32_timespec { 
115 linux32_time_t tv_sec; 
116 netbsd32_long tv_nsec; 
117}; 
118 
119#define LINUX32_MAXNAMLEN 255 114#define LINUX32_MAXNAMLEN 255
120struct linux32_dirent { 115struct linux32_dirent {
121 linux32_ino_t d_ino; 116 linux32_ino_t d_ino;
122 linux32_off_t d_off; 117 linux32_off_t d_off;
123 u_short d_reclen; 118 u_short d_reclen;
124 char d_name[LINUX32_MAXNAMLEN + 2]; 119 char d_name[LINUX32_MAXNAMLEN + 2];
125}; 120};
126 121
127#endif /* !_LINUX32_TYPES_H */ 122#endif /* !_LINUX32_TYPES_H */