summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authordarrenr <darrenr@NetBSD.org>2003-06-28 14:20:43 +0000
committerdarrenr <darrenr@NetBSD.org>2003-06-28 14:20:43 +0000
commit960df3c8d11a934b85f6f7d3ac388ec5ee57c12f (patch)
tree04eacdb0da6eefa4c57bf27833661e791d6a5853 /sys/compat/linux
parentda6b84e29093b9bfc2c3f38bfa199d379d8984d5 (diff)
Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace "struct proc *" with "struct lwp *" in various function prototypes, pass the lwp through and use l_proc to get the process pointer when needed. Bump the kernel rev up to 1.6V
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/arch/i386/linux_machdep.c21
-rw-r--r--sys/compat/linux/common/linux_blkio.c17
-rw-r--r--sys/compat/linux/common/linux_cdrom.c59
-rw-r--r--sys/compat/linux/common/linux_exec.c6
-rw-r--r--sys/compat/linux/common/linux_exec.h16
-rw-r--r--sys/compat/linux/common/linux_exec_aout.c22
-rw-r--r--sys/compat/linux/common/linux_exec_elf32.c43
-rw-r--r--sys/compat/linux/common/linux_fdio.c14
-rw-r--r--sys/compat/linux/common/linux_file.c62
-rw-r--r--sys/compat/linux/common/linux_file64.c14
-rw-r--r--sys/compat/linux/common/linux_hdio.c25
-rw-r--r--sys/compat/linux/common/linux_ioctl.c37
-rw-r--r--sys/compat/linux/common/linux_ioctl.h16
-rw-r--r--sys/compat/linux/common/linux_misc.c14
-rw-r--r--sys/compat/linux/common/linux_misc_notalpha.c6
-rw-r--r--sys/compat/linux/common/linux_socket.c30
-rw-r--r--sys/compat/linux/common/linux_sysctl.c40
-rw-r--r--sys/compat/linux/common/linux_termios.c32
-rw-r--r--sys/compat/linux/common/linux_uselib.c12
19 files changed, 247 insertions, 239 deletions
diff --git a/sys/compat/linux/arch/i386/linux_machdep.c b/sys/compat/linux/arch/i386/linux_machdep.c
index a0b99628fbc..6c8de6a3e3c 100644
--- a/sys/compat/linux/arch/i386/linux_machdep.c
+++ b/sys/compat/linux/arch/i386/linux_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.c,v 1.87 2003/03/21 21:13:54 dsl Exp $ */
+/* $NetBSD: linux_machdep.c,v 1.88 2003/06/28 14:21:20 darrenr Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.87 2003/03/21 21:13:54 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.88 2003/06/28 14:21:20 darrenr Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@@ -803,8 +803,8 @@ fd2biosinfo(p, fp)
* We come here in a last attempt to satisfy a Linux ioctl() call
*/
int
-linux_machdepioctl(p, v, retval)
- struct proc *p;
+linux_machdepioctl(l, v, retval)
+ struct lwp *l;
void *v;
register_t *retval;
{
@@ -829,11 +829,12 @@ linux_machdepioctl(p, v, retval)
int fd;
struct disklabel label, *labp;
struct partinfo partp;
- int (*ioctlf)(struct file *, u_long, void *, struct proc *);
+ int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
u_long start, biostotal, realtotal;
u_char heads, sectors;
u_int cylinders;
struct ioctl_pt pt;
+ struct proc *p = l->l_proc;
fd = SCARG(uap, fd);
SCARG(&bia, fd) = fd;
@@ -965,8 +966,8 @@ linux_machdepioctl(p, v, retval)
*/
bip = fd2biosinfo(p, fp);
ioctlf = fp->f_ops->fo_ioctl;
- error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, p);
- error1 = ioctlf(fp, DIOCGPART, (caddr_t)&partp, p);
+ error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, l);
+ error1 = ioctlf(fp, DIOCGPART, (caddr_t)&partp, l);
if (error != 0 && error1 != 0) {
error = error1;
goto out;
@@ -1017,8 +1018,8 @@ linux_machdepioctl(p, v, retval)
ioctlf = fp->f_ops->fo_ioctl;
pt.com = SCARG(uap, com);
pt.data = SCARG(uap, data);
- error = ioctlf(fp, PTIOCLINUX, (caddr_t)&pt, p);
- FILE_UNUSE(fp, p);
+ error = ioctlf(fp, PTIOCLINUX, (caddr_t)&pt, l);
+ FILE_UNUSE(fp, l);
if (error == EJUSTRETURN) {
retval[0] = (register_t)pt.data;
error = 0;
@@ -1033,7 +1034,7 @@ linux_machdepioctl(p, v, retval)
/* XXX NJWLWP */
error = sys_ioctl(curlwp, &bia, retval);
out:
- FILE_UNUSE(fp ,p);
+ FILE_UNUSE(fp ,l);
return error;
}
diff --git a/sys/compat/linux/common/linux_blkio.c b/sys/compat/linux/common/linux_blkio.c
index 4be9a4d7860..f0094e4fac0 100644
--- a/sys/compat/linux/common/linux_blkio.c
+++ b/sys/compat/linux/common/linux_blkio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_blkio.c,v 1.7 2003/03/21 21:13:53 dsl Exp $ */
+/* $NetBSD: linux_blkio.c,v 1.8 2003/06/28 14:21:20 darrenr Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_blkio.c,v 1.7 2003/03/21 21:13:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_blkio.c,v 1.8 2003/06/28 14:21:20 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,15 +59,16 @@ __KERNEL_RCSID(0, "$NetBSD: linux_blkio.c,v 1.7 2003/03/21 21:13:53 dsl Exp $");
#include <compat/linux/linux_syscallargs.h>
int
-linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
+linux_ioctl_blkio(struct lwp *l, struct linux_sys_ioctl_args *uap,
register_t *retval)
{
+ struct proc *p = l->l_proc;
u_long com;
long size;
int error;
struct filedesc *fdp;
struct file *fp;
- int (*ioctlf)(struct file *, u_long, void *, struct proc *);
+ int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
struct partinfo partp;
struct disklabel label;
@@ -87,9 +88,9 @@ linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
* fails, it may be a disk without label; try to get
* the default label and compute the size from it.
*/
- error = ioctlf(fp, DIOCGPART, (caddr_t)&partp, p);
+ error = ioctlf(fp, DIOCGPART, (caddr_t)&partp, l);
if (error != 0) {
- error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, p);
+ error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, l);
if (error != 0)
break;
size = label.d_nsectors * label.d_ntracks *
@@ -99,7 +100,7 @@ linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = copyout(&size, SCARG(uap, data), sizeof size);
break;
case LINUX_BLKSECTGET:
- error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, p);
+ error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, l);
if (error != 0)
break;
error = copyout(&label.d_secsize, SCARG(uap, data),
@@ -120,7 +121,7 @@ linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = ENOTTY;
}
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
diff --git a/sys/compat/linux/common/linux_cdrom.c b/sys/compat/linux/common/linux_cdrom.c
index f34b3d604f2..6fec3be06b9 100644
--- a/sys/compat/linux/common/linux_cdrom.c
+++ b/sys/compat/linux/common/linux_cdrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_cdrom.c,v 1.15 2003/03/21 21:13:53 dsl Exp $ */
+/* $NetBSD: linux_cdrom.c,v 1.16 2003/06/28 14:21:20 darrenr Exp $ */
/*
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.15 2003/03/21 21:13:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.16 2003/06/28 14:21:20 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -91,8 +91,8 @@ bsd_to_linux_msf_lba(unsigned address_format, union msf_lba *bml,
}
int
-linux_ioctl_cdrom(p, uap, retval)
- struct proc *p;
+linux_ioctl_cdrom(l, uap, retval)
+ struct lwp *l;
struct linux_sys_ioctl_args /* {
syscallarg(int) fd;
syscallarg(u_long) com;
@@ -105,7 +105,7 @@ linux_ioctl_cdrom(p, uap, retval)
caddr_t sg;
struct file *fp;
struct filedesc *fdp;
- int (*ioctlf)(struct file *, u_long, void *, struct proc *);
+ int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
struct linux_cdrom_blk l_blk;
struct linux_cdrom_msf l_msf;
@@ -125,6 +125,7 @@ linux_ioctl_cdrom(p, uap, retval)
struct cd_sub_channel_info *info, t_info;
struct ioc_read_subchannel t_subchannel;
struct ioc_vol t_vol;
+ struct proc *p = l->l_proc;
dvd_struct ds;
dvd_authinfo dai;
@@ -152,7 +153,7 @@ linux_ioctl_cdrom(p, uap, retval)
t_msf.end_s = l_msf.cdmsf_sec1;
t_msf.end_f = l_msf.cdmsf_frame1;
- error = ioctlf(fp, CDIOCPLAYMSF, (caddr_t)&t_msf, p);
+ error = ioctlf(fp, CDIOCPLAYMSF, (caddr_t)&t_msf, l);
break;
case LINUX_CDROMPLAYTRKIND:
@@ -165,11 +166,11 @@ linux_ioctl_cdrom(p, uap, retval)
t_track.end_track = l_ti.cdti_trk1;
t_track.end_index = l_ti.cdti_ind1;
- error = ioctlf(fp, CDIOCPLAYTRACKS, (caddr_t)&t_track, p);
+ error = ioctlf(fp, CDIOCPLAYTRACKS, (caddr_t)&t_track, l);
break;
case LINUX_CDROMREADTOCHDR:
- error = ioctlf(fp, CDIOREADTOCHEADER, (caddr_t)&t_header, p);
+ error = ioctlf(fp, CDIOREADTOCHEADER, (caddr_t)&t_header, l);
if (error)
break;
@@ -193,7 +194,7 @@ linux_ioctl_cdrom(p, uap, retval)
t_toc_entry.data = entry;
error = ioctlf(fp, CDIOREADTOCENTRIES, (caddr_t)&t_toc_entry,
- p);
+ l);
if (error)
break;
@@ -224,11 +225,11 @@ linux_ioctl_cdrom(p, uap, retval)
t_vol.vol[2] = l_volctrl.channel2;
t_vol.vol[3] = l_volctrl.channel3;
- error = ioctlf(fp, CDIOCSETVOL, (caddr_t)&t_vol, p);
+ error = ioctlf(fp, CDIOCSETVOL, (caddr_t)&t_vol, l);
break;
case LINUX_CDROMVOLREAD:
- error = ioctlf(fp, CDIOCGETVOL, (caddr_t)&t_vol, p);
+ error = ioctlf(fp, CDIOCGETVOL, (caddr_t)&t_vol, l);
if (error)
break;
@@ -256,7 +257,7 @@ linux_ioctl_cdrom(p, uap, retval)
l_subchnl.cdsc_format, l_subchnl.cdsc_trk));
error = ioctlf(fp, CDIOCREADSUBCHANNEL, (caddr_t)&t_subchannel,
- p);
+ l);
if (error)
break;
@@ -302,7 +303,7 @@ linux_ioctl_cdrom(p, uap, retval)
t_blocks.blk = l_blk.from;
t_blocks.len = l_blk.len;
- error = ioctlf(fp, CDIOCPLAYBLOCKS, (caddr_t)&t_blocks, p);
+ error = ioctlf(fp, CDIOCPLAYBLOCKS, (caddr_t)&t_blocks, l);
break;
case LINUX_CDROMEJECT_SW:
@@ -314,31 +315,31 @@ linux_ioctl_cdrom(p, uap, retval)
ncom = CDIOCALLOW;
else
ncom = CDIOCPREVENT;
- error = ioctlf(fp, ncom, NULL, p);
+ error = ioctlf(fp, ncom, NULL, l);
break;
case LINUX_CDROMPAUSE:
- error = ioctlf(fp, CDIOCPAUSE, NULL, p);
+ error = ioctlf(fp, CDIOCPAUSE, NULL, l);
break;
case LINUX_CDROMRESUME:
- error = ioctlf(fp, CDIOCRESUME, NULL, p);
+ error = ioctlf(fp, CDIOCRESUME, NULL, l);
break;
case LINUX_CDROMSTOP:
- error = ioctlf(fp, CDIOCSTOP, NULL, p);
+ error = ioctlf(fp, CDIOCSTOP, NULL, l);
break;
case LINUX_CDROMSTART:
- error = ioctlf(fp, CDIOCSTART, NULL, p);
+ error = ioctlf(fp, CDIOCSTART, NULL, l);
break;
case LINUX_CDROMEJECT:
- error = ioctlf(fp, CDIOCEJECT, NULL, p);
+ error = ioctlf(fp, CDIOCEJECT, NULL, l);
break;
case LINUX_CDROMRESET:
- error = ioctlf(fp, CDIOCRESET, NULL, p);
+ error = ioctlf(fp, CDIOCRESET, NULL, l);
break;
case LINUX_CDROMMULTISESSION:
@@ -346,7 +347,7 @@ linux_ioctl_cdrom(p, uap, retval)
if (error)
break;
- error = ioctlf(fp, CDIOREADTOCHEADER, (caddr_t)&t_header, p);
+ error = ioctlf(fp, CDIOREADTOCHEADER, (caddr_t)&t_header, l);
if (error)
break;
@@ -358,7 +359,7 @@ linux_ioctl_cdrom(p, uap, retval)
t_toc_entry.data = entry;
error = ioctlf(fp, CDIOREADTOCENTRIES,
- (caddr_t)&t_toc_entry, p);
+ (caddr_t)&t_toc_entry, l);
if (error)
break;
@@ -379,12 +380,12 @@ linux_ioctl_cdrom(p, uap, retval)
break;
case LINUX_CDROMCLOSETRAY:
- error = ioctlf(fp, CDIOCCLOSE, NULL, p);
+ error = ioctlf(fp, CDIOCCLOSE, NULL, l);
break;
case LINUX_CDROM_LOCKDOOR:
ncom = SCARG(uap, data) != 0 ? CDIOCPREVENT : CDIOCALLOW;
- error = ioctlf(fp, ncom, NULL, p);
+ error = ioctlf(fp, ncom, NULL, l);
break;
case LINUX_CDROM_SET_OPTIONS:
@@ -394,7 +395,7 @@ linux_ioctl_cdrom(p, uap, retval)
case LINUX_CDROM_DEBUG:
ncom = SCARG(uap, data) != 0 ? CDIOCSETDEBUG : CDIOCCLRDEBUG;
- error = ioctlf(fp, ncom, NULL, p);
+ error = ioctlf(fp, ncom, NULL, l);
break;
case LINUX_CDROM_SELECT_SPEED:
@@ -411,7 +412,7 @@ linux_ioctl_cdrom(p, uap, retval)
error = copyin(SCARG(uap, data), &ds, sizeof ds);
if (error)
break;
- error = ioctlf(fp, DVD_READ_STRUCT, (caddr_t)&ds, p);
+ error = ioctlf(fp, DVD_READ_STRUCT, (caddr_t)&ds, l);
if (error)
break;
error = copyout(&ds, SCARG(uap, data), sizeof ds);
@@ -421,7 +422,7 @@ linux_ioctl_cdrom(p, uap, retval)
error = copyin(SCARG(uap, data), &ds, sizeof ds);
if (error)
break;
- error = ioctlf(fp, DVD_WRITE_STRUCT, (caddr_t)&ds, p);
+ error = ioctlf(fp, DVD_WRITE_STRUCT, (caddr_t)&ds, l);
if (error)
break;
error = copyout(&ds, SCARG(uap, data), sizeof ds);
@@ -431,7 +432,7 @@ linux_ioctl_cdrom(p, uap, retval)
error = copyin(SCARG(uap, data), &dai, sizeof dai);
if (error)
break;
- error = ioctlf(fp, DVD_AUTH, (caddr_t)&dai, p);
+ error = ioctlf(fp, DVD_AUTH, (caddr_t)&dai, l);
if (error)
break;
error = copyout(&dai, SCARG(uap, data), sizeof dai);
@@ -443,6 +444,6 @@ linux_ioctl_cdrom(p, uap, retval)
error = EINVAL;
}
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c
index 2e82bcf514a..117ab817b1a 100644
--- a/sys/compat/linux/common/linux_exec.c
+++ b/sys/compat/linux/common/linux_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.c,v 1.62 2003/03/01 04:36:39 thorpej Exp $ */
+/* $NetBSD: linux_exec.c,v 1.63 2003/06/28 14:21:20 darrenr Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998, 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.62 2003/03/01 04:36:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.63 2003/06/28 14:21:20 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -99,7 +99,7 @@ linux_sys_execve(l, v, retval)
caddr_t sg;
sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&ap, path) = SCARG(uap, path);
SCARG(&ap, argp) = SCARG(uap, argp);
diff --git a/sys/compat/linux/common/linux_exec.h b/sys/compat/linux/common/linux_exec.h
index ede613e3903..a3a575b0374 100644
--- a/sys/compat/linux/common/linux_exec.h
+++ b/sys/compat/linux/common/linux_exec.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.27 2003/04/09 00:39:38 thorpej Exp $ */
+/* $NetBSD: linux_exec.h,v 1.28 2003/06/28 14:21:20 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -121,23 +121,23 @@ __BEGIN_DECLS
extern const struct emul emul_linux;
int linux_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
- struct proc *));
+ struct lwp *));
void linux_setregs __P((struct lwp *, struct exec_package *, u_long));
-int exec_linux_aout_makecmds __P((struct proc *, struct exec_package *));
-int linux_aout_copyargs __P((struct proc *, struct exec_package *,
+int exec_linux_aout_makecmds __P((struct lwp *, struct exec_package *));
+int linux_aout_copyargs __P((struct lwp *, struct exec_package *,
struct ps_strings *, char **, void *));
void linux_trapsignal __P((struct lwp *, int, u_long));
#ifdef EXEC_ELF32
-int linux_elf32_probe __P((struct proc *, struct exec_package *, void *,
+int linux_elf32_probe __P((struct lwp *, struct exec_package *, void *,
char *, vaddr_t *));
-int linux_elf32_copyargs __P((struct proc *, struct exec_package *,
+int linux_elf32_copyargs __P((struct lwp *, struct exec_package *,
struct ps_strings *, char **, void *));
#endif
#ifdef EXEC_ELF64
-int linux_elf64_probe __P((struct proc *, struct exec_package *, void *,
+int linux_elf64_probe __P((struct lwp *, struct exec_package *, void *,
char *, vaddr_t *));
-int linux_elf64_copyargs __P((struct proc *, struct exec_package *,
+int linux_elf64_copyargs __P((struct lwp *, struct exec_package *,
struct ps_strings *, char **, void *));
#endif
__END_DECLS
diff --git a/sys/compat/linux/common/linux_exec_aout.c b/sys/compat/linux/common/linux_exec_aout.c
index cf50d2a2cbf..f91e673401a 100644
--- a/sys/compat/linux/common/linux_exec_aout.c
+++ b/sys/compat/linux/common/linux_exec_aout.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_aout.c,v 1.52 2003/04/01 15:05:11 thorpej Exp $ */
+/* $NetBSD: linux_exec_aout.c,v 1.53 2003/06/28 14:21:21 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.52 2003/04/01 15:05:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.53 2003/06/28 14:21:21 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,7 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.52 2003/04/01 15:05:11 thorpej
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_syscall.h>
-int linux_aout_copyargs __P((struct proc *, struct exec_package *,
+int linux_aout_copyargs __P((struct lwp *, struct exec_package *,
struct ps_strings *, char **, void *));
static int exec_linux_aout_prep_zmagic __P((struct proc *,
@@ -83,8 +83,8 @@ static int exec_linux_aout_prep_qmagic __P((struct proc *,
struct exec_package *));
int
-linux_aout_copyargs(p, pack, arginfo, stackp, argp)
- struct proc *p;
+linux_aout_copyargs(l, pack, arginfo, stackp, argp)
+ struct lwp *l;
struct exec_package *pack;
struct ps_strings *arginfo;
char **stackp;
@@ -139,8 +139,8 @@ linux_aout_copyargs(p, pack, arginfo, stackp, argp)
}
int
-exec_linux_aout_makecmds(p, epp)
- struct proc *p;
+exec_linux_aout_makecmds(l, epp)
+ struct lwp *l;
struct exec_package *epp;
{
struct exec *linux_ep = epp->ep_hdr;
@@ -156,16 +156,16 @@ exec_linux_aout_makecmds(p, epp)
switch (magic) {
case QMAGIC:
- error = exec_linux_aout_prep_qmagic(p, epp);
+ error = exec_linux_aout_prep_qmagic(l->l_proc, epp);
break;
case ZMAGIC:
- error = exec_linux_aout_prep_zmagic(p, epp);
+ error = exec_linux_aout_prep_zmagic(l->l_proc, epp);
break;
case NMAGIC:
- error = exec_linux_aout_prep_nmagic(p, epp);
+ error = exec_linux_aout_prep_nmagic(l->l_proc, epp);
break;
case OMAGIC:
- error = exec_linux_aout_prep_omagic(p, epp);
+ error = exec_linux_aout_prep_omagic(l->l_proc, epp);
break;
}
return error;
diff --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c
index 09b21470ef5..bc00c224e06 100644
--- a/sys/compat/linux/common/linux_exec_elf32.c
+++ b/sys/compat/linux/common/linux_exec_elf32.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_elf32.c,v 1.61 2003/01/18 08:02:51 thorpej Exp $ */
+/* $NetBSD: linux_exec_elf32.c,v 1.62 2003/06/28 14:21:21 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.61 2003/01/18 08:02:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.62 2003/06/28 14:21:21 darrenr Exp $");
#ifndef ELFSIZE
/* XXX should die */
@@ -77,14 +77,14 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.61 2003/01/18 08:02:51 thorpe
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_syscall.h>
-static int ELFNAME2(linux,signature) __P((struct proc *, struct exec_package *,
+static int ELFNAME2(linux,signature) __P((struct lwp *, struct exec_package *,
Elf_Ehdr *, char *));
#ifdef LINUX_GCC_SIGNATURE
-static int ELFNAME2(linux,gcc_signature) __P((struct proc *p,
+static int ELFNAME2(linux,gcc_signature) __P((struct lwp *l,
struct exec_package *, Elf_Ehdr *));
#endif
#ifdef LINUX_ATEXIT_SIGNATURE
-static int ELFNAME2(linux,atexit_signature) __P((struct proc *p,
+static int ELFNAME2(linux,atexit_signature) __P((struct lwp *l,
struct exec_package *, Elf_Ehdr *));
#endif
@@ -177,8 +177,8 @@ out:
* XXX NetBSD binaries as Linux.
*/
static int
-ELFNAME2(linux,gcc_signature)(p, epp, eh)
- struct proc *p;
+ELFNAME2(linux,gcc_signature)(l, epp, eh)
+ struct lwp *l;
struct exec_package *epp;
Elf_Ehdr *eh;
{
@@ -191,7 +191,7 @@ ELFNAME2(linux,gcc_signature)(p, epp, eh)
shsize = eh->e_shnum * sizeof(Elf_Shdr);
sh = (Elf_Shdr *) malloc(shsize, M_TEMP, M_WAITOK);
- error = exec_read_from(p, epp->ep_vp, eh->e_shoff, sh, shsize);
+ error = exec_read_from(l, epp->ep_vp, eh->e_shoff, sh, shsize);
if (error)
goto out;
@@ -209,7 +209,7 @@ ELFNAME2(linux,gcc_signature)(p, epp, eh)
s->sh_size < sizeof(signature) - 1)
continue;
- error = exec_read_from(p, epp->ep_vp, s->sh_offset, buf,
+ error = exec_read_from(l, epp->ep_vp, s->sh_offset, buf,
sizeof(signature) - 1);
if (error)
continue;
@@ -232,8 +232,8 @@ out:
#endif
static int
-ELFNAME2(linux,signature)(p, epp, eh, itp)
- struct proc *p;
+ELFNAME2(linux,signature)(l, epp, eh, itp)
+ struct lwp *l;
struct exec_package *epp;
Elf_Ehdr *eh;
char *itp;
@@ -250,7 +250,7 @@ ELFNAME2(linux,signature)(p, epp, eh, itp)
phsize = eh->e_phnum * sizeof(Elf_Phdr);
ph = (Elf_Phdr *)malloc(phsize, M_TEMP, M_WAITOK);
- error = exec_read_from(p, epp->ep_vp, eh->e_phoff, ph, phsize);
+ error = exec_read_from(l, epp->ep_vp, eh->e_phoff, ph, phsize);
if (error)
goto out;
@@ -265,7 +265,7 @@ ELFNAME2(linux,signature)(p, epp, eh, itp)
continue;
np = (Elf_Nhdr *)malloc(ephp->p_filesz, M_TEMP, M_WAITOK);
- error = exec_read_from(p, epp->ep_vp, ephp->p_offset, np,
+ error = exec_read_from(l, epp->ep_vp, ephp->p_offset, np,
ephp->p_filesz);
if (error)
goto next;
@@ -309,8 +309,8 @@ out:
}
int
-ELFNAME2(linux,probe)(p, epp, eh, itp, pos)
- struct proc *p;
+ELFNAME2(linux,probe)(l, epp, eh, itp, pos)
+ struct lwp *l;
struct exec_package *epp;
void *eh;
char *itp;
@@ -318,18 +318,18 @@ ELFNAME2(linux,probe)(p, epp, eh, itp, pos)
{
int error;
- if (((error = ELFNAME2(linux,signature)(p, epp, eh, itp)) != 0) &&
+ if (((error = ELFNAME2(linux,signature)(l, epp, eh, itp)) != 0) &&
#ifdef LINUX_GCC_SIGNATURE
- ((error = ELFNAME2(linux,gcc_signature)(p, epp, eh)) != 0) &&
+ ((error = ELFNAME2(linux,gcc_signature)(l, epp, eh)) != 0) &&
#endif
#ifdef LINUX_ATEXIT_SIGNATURE
- ((error = ELFNAME2(linux,atexit_signature)(p, epp, eh)) != 0) &&
+ ((error = ELFNAME2(linux,atexit_signature)(l, epp, eh)) != 0) &&
#endif
1)
return error;
if (itp[0]) {
- if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path,
+ if ((error = emul_find_interp(l, epp->ep_esch->es_emul->e_path,
itp)))
return (error);
}
@@ -344,16 +344,17 @@ ELFNAME2(linux,probe)(p, epp, eh, itp, pos)
* extra information in case of dynamic binding.
*/
int
-ELFNAME2(linux,copyargs)(struct proc *p, struct exec_package *pack,
+ELFNAME2(linux,copyargs)(struct lwp *l, struct exec_package *pack,
struct ps_strings *arginfo, char **stackp, void *argp)
{
+ struct proc *p = l->l_proc;
size_t len;
AuxInfo ai[LINUX_ELF_AUX_ENTRIES], *a;
struct elf_args *ap;
int error;
struct vattr *vap;
- if ((error = copyargs(p, pack, arginfo, stackp, argp)) != 0)
+ if ((error = copyargs(l, pack, arginfo, stackp, argp)) != 0)
return error;
a = ai;
diff --git a/sys/compat/linux/common/linux_fdio.c b/sys/compat/linux/common/linux_fdio.c
index 6c5e62f427e..adb696b59f0 100644
--- a/sys/compat/linux/common/linux_fdio.c
+++ b/sys/compat/linux/common/linux_fdio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fdio.c,v 1.5 2003/03/21 21:13:53 dsl Exp $ */
+/* $NetBSD: linux_fdio.c,v 1.6 2003/06/28 14:21:21 darrenr Exp $ */
/*
* Copyright (c) 2000 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.5 2003/03/21 21:13:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.6 2003/06/28 14:21:21 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,13 +63,13 @@ __KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.5 2003/03/21 21:13:53 dsl Exp $");
#include <compat/linux/linux_syscallargs.h>
int
-linux_ioctl_fdio(struct proc *p, struct linux_sys_ioctl_args *uap,
+linux_ioctl_fdio(struct lwp *l, struct linux_sys_ioctl_args *uap,
register_t *retval)
{
struct filedesc *fdp;
struct file *fp;
int error;
- int (*ioctlf)(struct file *, u_long, void *, struct proc *);
+ int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
u_long com;
struct fdformat_parms fparams;
struct linux_floppy_struct lflop;
@@ -77,7 +77,7 @@ linux_ioctl_fdio(struct proc *p, struct linux_sys_ioctl_args *uap,
com = (u_long)SCARG(uap, data);
- fdp = p->p_fd;
+ fdp = l->l_proc->p_fd;
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
@@ -107,7 +107,7 @@ linux_ioctl_fdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = copyout(&ldrive, SCARG(uap, data), sizeof ldrive);
break;
case LINUX_FDGETPRM:
- error = ioctlf(fp, FDIOCGETFORMAT, (caddr_t)&fparams, p);
+ error = ioctlf(fp, FDIOCGETFORMAT, (caddr_t)&fparams, l);
if (error != 0)
break;
lflop.size = fparams.ncyl * fparams.nspt * fparams.ntrk;
@@ -168,7 +168,7 @@ linux_ioctl_fdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = EINVAL;
}
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return 0;
}
diff --git a/sys/compat/linux/common/linux_file.c b/sys/compat/linux/common/linux_file.c
index fb9ff96a4c6..6bc003cc424 100644
--- a/sys/compat/linux/common/linux_file.c
+++ b/sys/compat/linux/common/linux_file.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file.c,v 1.58 2003/03/19 11:36:35 dsl Exp $ */
+/* $NetBSD: linux_file.c,v 1.59 2003/06/28 14:21:21 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.58 2003/03/19 11:36:35 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.59 2003/06/28 14:21:21 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,7 +154,7 @@ linux_sys_creat(l, v, retval)
caddr_t sg;
sg = stackgap_init(p, 0);
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, path));
SCARG(&oa, path) = SCARG(uap, path);
SCARG(&oa, flags) = O_CREAT | O_TRUNC | O_WRONLY;
@@ -190,9 +190,9 @@ linux_sys_open(l, v, retval)
fl = linux_to_bsd_ioflags(SCARG(uap, flags));
if (fl & O_CREAT)
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, path));
else
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&boa, path) = SCARG(uap, path);
SCARG(&boa, flags) = fl;
@@ -218,9 +218,9 @@ linux_sys_open(l, v, retval)
FILE_USE(fp);
if (fp->f_type == DTYPE_VNODE) {
(fp->f_ops->fo_ioctl) (fp, TIOCSCTTY,
- (caddr_t) 0, p);
+ (caddr_t) 0, l);
}
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
}
}
return 0;
@@ -365,7 +365,7 @@ linux_sys_fcntl(l, v, retval)
val &= ~O_ASYNC;
else {
/* not a pipe, do not modify anything */
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
fp = NULL;
}
}
@@ -380,7 +380,7 @@ linux_sys_fcntl(l, v, retval)
if (fp) {
if (!error)
fp->f_flag |= FASYNC;
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
}
return (error);
@@ -439,7 +439,7 @@ linux_sys_fcntl(l, v, retval)
vp = (struct vnode *)fp->f_data;
if (vp->v_type != VCHR)
goto not_tty;
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)))
+ if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)))
return error;
cdev = cdevsw_lookup(va.va_rdev);
if (cdev == NULL)
@@ -570,9 +570,9 @@ linux_stat1(l, v, retval, dolstat)
sg = stackgap_init(p, 0);
st = stackgap_alloc(p, &sg, sizeof (struct stat));
if (dolstat)
- CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, path));
+ CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, path));
else
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&sa, ub) = st;
SCARG(&sa, path) = SCARG(uap, path);
@@ -638,7 +638,7 @@ linux_sys_access(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys_access(l, uap, retval);
}
@@ -656,7 +656,7 @@ linux_sys_unlink(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys_unlink(l, uap, retval);
}
@@ -673,7 +673,7 @@ linux_sys_chdir(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys_chdir(l, uap, retval);
}
@@ -692,7 +692,7 @@ linux_sys_mknod(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, path));
/*
* BSD handles FIFOs separately
@@ -732,7 +732,7 @@ linux_sys_chmod(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys_chmod(l, uap, retval);
}
@@ -753,7 +753,7 @@ linux_sys_chown16(l, v, retval)
struct sys___posix_chown_args bca;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&bca, path) = SCARG(uap, path);
SCARG(&bca, uid) = ((linux_uid_t)SCARG(uap, uid) == (linux_uid_t)-1) ?
@@ -801,7 +801,7 @@ linux_sys_lchown16(l, v, retval)
struct sys___posix_lchown_args bla;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, path));
+ CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, path));
SCARG(&bla, path) = SCARG(uap, path);
SCARG(&bla, uid) = ((linux_uid_t)SCARG(uap, uid) == (linux_uid_t)-1) ?
@@ -828,7 +828,7 @@ linux_sys_chown(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys___posix_chown(l, uap, retval);
}
@@ -847,7 +847,7 @@ linux_sys_lchown(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, path));
+ CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, path));
return sys___posix_lchown(l, uap, retval);
}
@@ -866,8 +866,8 @@ linux_sys_rename(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, to));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, from));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, to));
return sys___posix_rename(l, uap, retval);
}
@@ -885,7 +885,7 @@ linux_sys_mkdir(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, path));
return sys_mkdir(l, uap, retval);
}
@@ -902,7 +902,7 @@ linux_sys_rmdir(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys_rmdir(l, uap, retval);
}
@@ -920,8 +920,8 @@ linux_sys_symlink(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, to));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, to));
return sys_symlink(l, uap, retval);
}
@@ -939,8 +939,8 @@ linux_sys_link(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
- CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
+ CHECK_ALT_CREAT(l, &sg, SCARG(uap, link));
return sys_link(l, uap, retval);
}
@@ -959,7 +959,7 @@ linux_sys_readlink(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, name));
+ CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, name));
return sys_readlink(l, uap, retval);
}
@@ -977,7 +977,7 @@ linux_sys_truncate(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return compat_43_sys_truncate(l, uap, retval);
}
diff --git a/sys/compat/linux/common/linux_file64.c b/sys/compat/linux/common/linux_file64.c
index fee3438f24b..42a56d4b4b5 100644
--- a/sys/compat/linux/common/linux_file64.c
+++ b/sys/compat/linux/common/linux_file64.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file64.c,v 1.19 2003/01/18 08:02:52 thorpej Exp $ */
+/* $NetBSD: linux_file64.c,v 1.20 2003/06/28 14:21:21 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.19 2003/01/18 08:02:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.20 2003/06/28 14:21:21 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -169,7 +169,7 @@ linux_do_stat64(l, v, retval, dolstat)
sg = stackgap_init(p, 0);
st = stackgap_alloc(p, &sg, sizeof (struct stat));
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&sa, ub) = st;
SCARG(&sa, path) = SCARG(uap, path);
@@ -230,7 +230,7 @@ linux_sys_truncate64(l, v, retval)
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
return sys_truncate(l, uap, retval);
}
@@ -405,7 +405,7 @@ linux_sys_getdents64(l, v, retval)
goto out1;
}
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)))
+ if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)))
goto out1;
nbytes = SCARG(uap, count);
@@ -423,7 +423,7 @@ again:
auio.uio_iovcnt = 1;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = p;
+ auio.uio_lwp = l;
auio.uio_resid = buflen;
auio.uio_offset = off;
/*
@@ -490,6 +490,6 @@ out:
free(cookiebuf, M_TEMP);
free(buf, M_TEMP);
out1:
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
diff --git a/sys/compat/linux/common/linux_hdio.c b/sys/compat/linux/common/linux_hdio.c
index 2727ae2d3d1..c25c3839a9b 100644
--- a/sys/compat/linux/common/linux_hdio.c
+++ b/sys/compat/linux/common/linux_hdio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_hdio.c,v 1.6 2003/03/21 21:13:53 dsl Exp $ */
+/* $NetBSD: linux_hdio.c,v 1.7 2003/06/28 14:21:21 darrenr Exp $ */
/*
* Copyright (c) 2000 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.6 2003/03/21 21:13:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.7 2003/06/28 14:21:21 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,15 +63,16 @@ __KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.6 2003/03/21 21:13:53 dsl Exp $");
#include <compat/linux/linux_syscallargs.h>
int
-linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
+linux_ioctl_hdio(struct lwp *l, struct linux_sys_ioctl_args *uap,
register_t *retval)
{
+ struct proc *p = l->l_proc;
u_long com;
int error, error1;
caddr_t sg;
struct filedesc *fdp;
struct file *fp;
- int (*ioctlf)(struct file *, u_long, void *, struct proc *);
+ int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
struct ataparams *atap, ata;
struct atareq req;
struct disklabel label, *labp;
@@ -106,7 +107,7 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
req.databuf = (caddr_t)atap;
req.datalen = DEV_BSIZE;
req.timeout = 1000;
- error = ioctlf(fp, ATAIOCCOMMAND, (caddr_t)&req, p);
+ error = ioctlf(fp, ATAIOCCOMMAND, (caddr_t)&req, l);
if (error != 0)
break;
if (req.retsts != ATACMD_OK)
@@ -122,11 +123,11 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
com == LINUX_HDIO_GET_IDENTITY ? sizeof ata : 142);
break;
case LINUX_HDIO_GETGEO:
- error = linux_machdepioctl(p, uap, retval);
+ error = linux_machdepioctl(l, uap, retval);
if (error == 0)
break;
- error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, p);
- error1 = ioctlf(fp, DIOCGPART, (caddr_t)&partp, p);
+ error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, l);
+ error1 = ioctlf(fp, DIOCGPART, (caddr_t)&partp, l);
if (error != 0 && error1 != 0) {
error = error1;
break;
@@ -139,12 +140,12 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = copyout(&hdg, SCARG(uap, data), sizeof hdg);
break;
case LINUX_HDIO_GETGEO_BIG:
- error = linux_machdepioctl(p, uap, retval);
+ error = linux_machdepioctl(l, uap, retval);
if (error == 0)
break;
case LINUX_HDIO_GETGEO_BIG_RAW:
- error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, p);
- error1 = ioctlf(fp, DIOCGPART, (caddr_t)&partp, p);
+ error = ioctlf(fp, DIOCGDEFLABEL, (caddr_t)&label, l);
+ error1 = ioctlf(fp, DIOCGPART, (caddr_t)&partp, l);
if (error != 0 && error1 != 0) {
error = error1;
break;
@@ -180,7 +181,7 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = EINVAL;
}
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
diff --git a/sys/compat/linux/common/linux_ioctl.c b/sys/compat/linux/common/linux_ioctl.c
index dcf8e0302ab..d7dd028f875 100644
--- a/sys/compat/linux/common/linux_ioctl.c
+++ b/sys/compat/linux/common/linux_ioctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ioctl.c,v 1.34 2003/06/23 21:37:27 christos Exp $ */
+/* $NetBSD: linux_ioctl.c,v 1.35 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.34 2003/06/23 21:37:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.35 2003/06/28 14:21:22 darrenr Exp $");
#if defined(_KERNEL_OPT)
#include "sequencer.h"
@@ -91,18 +91,18 @@ linux_sys_ioctl(l, v, retval)
switch (LINUX_IOCGROUP(SCARG(uap, com))) {
case 'M':
- return oss_ioctl_mixer(p, LINUX_TO_OSS(v), retval);
+ return oss_ioctl_mixer(l, LINUX_TO_OSS(v), retval);
case 'Q':
- return oss_ioctl_sequencer(p, LINUX_TO_OSS(v), retval);
+ return oss_ioctl_sequencer(l, LINUX_TO_OSS(v), retval);
case 'P':
- return oss_ioctl_audio(p, LINUX_TO_OSS(v), retval);
+ return oss_ioctl_audio(l, LINUX_TO_OSS(v), retval);
case 'r': /* VFAT ioctls; not yet supported */
return ENOSYS;
case 'S':
- return linux_ioctl_cdrom(p, uap, retval);
+ return linux_ioctl_cdrom(l, uap, retval);
case 't':
case 'f':
- return linux_ioctl_termios(p, uap, retval);
+ return linux_ioctl_termios(l, uap, retval);
case 'T':
{
#if NSEQUENCER > 0
@@ -127,29 +127,30 @@ linux_sys_ioctl(l, v, retval)
if (fp->f_type == DTYPE_VNODE &&
(vp = (struct vnode *)fp->f_data) != NULL &&
vp->v_type == VCHR &&
- VOP_GETATTR(vp, &va, p->p_ucred, p) == 0 &&
+ VOP_GETATTR(vp, &va, p->p_ucred, l) == 0 &&
cdevsw_lookup(va.va_rdev) == &sequencer_cdevsw) {
- error = oss_ioctl_sequencer(p, (void*)LINUX_TO_OSS(uap),
- retval);
+ error = oss_ioctl_sequencer(l,
+ (void*)LINUX_TO_OSS(uap),
+ retval);
}
else {
- error = linux_ioctl_termios(p, uap, retval);
+ error = linux_ioctl_termios(l, uap, retval);
}
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
#else
- return linux_ioctl_termios(p, uap, retval);
+ return linux_ioctl_termios(l, uap, retval);
#endif
}
case 0x89:
- return linux_ioctl_socket(p, uap, retval);
+ return linux_ioctl_socket(l, uap, retval);
case 0x03:
- return linux_ioctl_hdio(p, uap, retval);
+ return linux_ioctl_hdio(l, uap, retval);
case 0x02:
- return linux_ioctl_fdio(p, uap, retval);
+ return linux_ioctl_fdio(l, uap, retval);
case 0x12:
- return linux_ioctl_blkio(p, uap, retval);
+ return linux_ioctl_blkio(l, uap, retval);
default:
- return linux_machdepioctl(p, uap, retval);
+ return linux_machdepioctl(l, uap, retval);
}
}
diff --git a/sys/compat/linux/common/linux_ioctl.h b/sys/compat/linux/common/linux_ioctl.h
index 6dab328c3ac..1fedab9f64f 100644
--- a/sys/compat/linux/common/linux_ioctl.h
+++ b/sys/compat/linux/common/linux_ioctl.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ioctl.h,v 1.16 2002/01/14 23:14:42 bjh21 Exp $ */
+/* $NetBSD: linux_ioctl.h,v 1.17 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -43,18 +43,18 @@ struct linux_sys_ioctl_args;
#ifdef _KERNEL
__BEGIN_DECLS
-int linux_machdepioctl __P((struct proc *, void *, register_t *));
-int linux_ioctl_cdrom __P((struct proc *, struct linux_sys_ioctl_args *,
+int linux_machdepioctl __P((struct lwp *, void *, register_t *));
+int linux_ioctl_cdrom __P((struct lwp *, struct linux_sys_ioctl_args *,
register_t *));
-int linux_ioctl_termios __P((struct proc *, struct linux_sys_ioctl_args *,
+int linux_ioctl_termios __P((struct lwp *, struct linux_sys_ioctl_args *,
register_t *));
-int linux_ioctl_socket __P((struct proc *, struct linux_sys_ioctl_args *,
+int linux_ioctl_socket __P((struct lwp *, struct linux_sys_ioctl_args *,
register_t *));
-int linux_ioctl_hdio __P((struct proc *, struct linux_sys_ioctl_args *,
+int linux_ioctl_hdio __P((struct lwp *, struct linux_sys_ioctl_args *,
register_t *));
-int linux_ioctl_fdio __P((struct proc *p, struct linux_sys_ioctl_args *uap,
+int linux_ioctl_fdio __P((struct lwp *p, struct linux_sys_ioctl_args *uap,
register_t *retval));
-int linux_ioctl_blkio __P((struct proc *p, struct linux_sys_ioctl_args *uap,
+int linux_ioctl_blkio __P((struct lwp *p, struct linux_sys_ioctl_args *uap,
register_t *retval));
__END_DECLS
#endif /* !_KERNEL */
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 946ca683118..14a8c88ee27 100644
--- a/sys/compat/linux/common/linux_misc.c
+++ b/sys/compat/linux/common/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.119 2003/06/23 21:32:36 christos Exp $ */
+/* $NetBSD: linux_misc.c,v 1.120 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.119 2003/06/23 21:32:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.120 2003/06/28 14:21:22 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -352,7 +352,7 @@ linux_sys_statfs(l, v, retval)
sg = stackgap_init(p, 0);
bsp = (struct statfs *) stackgap_alloc(p, &sg, sizeof (struct statfs));
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&bsa, path) = SCARG(uap, path);
SCARG(&bsa, buf) = bsp;
@@ -732,7 +732,7 @@ linux_sys_getdents(l, v, retval)
goto out1;
}
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)))
+ if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)))
goto out1;
nbytes = SCARG(uap, count);
@@ -757,7 +757,7 @@ again:
auio.uio_iovcnt = 1;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = p;
+ auio.uio_lwp = l;
auio.uio_resid = buflen;
auio.uio_offset = off;
/*
@@ -841,7 +841,7 @@ out:
free(cookiebuf, M_TEMP);
free(buf, M_TEMP);
out1:
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
@@ -1464,7 +1464,7 @@ linux_sys_setdomainname(l, v, retval)
return (error);
name = KERN_DOMAINNAME;
return (kern_sysctl(&name, 1, 0, 0, SCARG(uap, domainname),
- SCARG(uap, len), p));
+ SCARG(uap, len), l));
}
/*
diff --git a/sys/compat/linux/common/linux_misc_notalpha.c b/sys/compat/linux/common/linux_misc_notalpha.c
index a4265ac53b4..55a7fd11aab 100644
--- a/sys/compat/linux/common/linux_misc_notalpha.c
+++ b/sys/compat/linux/common/linux_misc_notalpha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc_notalpha.c,v 1.67 2003/03/05 18:46:11 dsl Exp $ */
+/* $NetBSD: linux_misc_notalpha.c,v 1.68 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.67 2003/03/05 18:46:11 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.68 2003/06/28 14:21:22 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -260,7 +260,7 @@ linux_sys_utime(l, v, retval)
sg = stackgap_init(p, 0);
tvp = (struct timeval *) stackgap_alloc(p, &sg, sizeof(tv));
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
SCARG(&ua, path) = SCARG(uap, path);
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c
index 75c933bb336..3ed42148462 100644
--- a/sys/compat/linux/common/linux_socket.c
+++ b/sys/compat/linux/common/linux_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.44 2003/03/21 21:13:53 dsl Exp $ */
+/* $NetBSD: linux_socket.c,v 1.45 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.44 2003/03/21 21:13:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.45 2003/06/28 14:21:22 darrenr Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -117,7 +117,7 @@ int linux_to_bsd_so_sockopt __P((int));
int linux_to_bsd_ip_sockopt __P((int));
int linux_to_bsd_tcp_sockopt __P((int));
int linux_to_bsd_udp_sockopt __P((int));
-int linux_getifhwaddr __P((struct proc *, register_t *, u_int, void *));
+int linux_getifhwaddr __P((struct lwp *, register_t *, u_int, void *));
static int linux_sa_get __P((struct proc *, caddr_t *sgp, struct sockaddr **sap,
const struct osockaddr *osa, int *osalen));
static int linux_sa_put __P((struct osockaddr *osa));
@@ -251,7 +251,7 @@ linux_sys_socket(l, v, retval)
(void) sosetopt((struct socket *)fp->f_data,
IPPROTO_IPV6, IPV6_V6ONLY, m);
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
}
}
#endif
@@ -672,8 +672,8 @@ linux_sys_getsockopt(l, v, retval)
#define IF_NAME_LEN 16
int
-linux_getifhwaddr(p, retval, fd, data)
- struct proc *p;
+linux_getifhwaddr(l, retval, fd, data)
+ struct lwp *l;
register_t *retval;
u_int fd;
void *data;
@@ -683,6 +683,7 @@ linux_getifhwaddr(p, retval, fd, data)
char if_name[IF_NAME_LEN];
struct osockaddr hwaddr;
} lreq;
+ struct proc *p = l->l_proc;
struct filedesc *fdp;
struct file *fp;
struct ifaddr *ifa;
@@ -797,14 +798,14 @@ linux_getifhwaddr(p, retval, fd, data)
}
out:
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
#undef IF_NAME_LEN
int
-linux_ioctl_socket(p, uap, retval)
- struct proc *p;
+linux_ioctl_socket(l, uap, retval)
+ struct lwp *l;
struct linux_sys_ioctl_args /* {
syscallarg(int) fd;
syscallarg(u_long) com;
@@ -812,13 +813,14 @@ linux_ioctl_socket(p, uap, retval)
} */ *uap;
register_t *retval;
{
+ struct proc *p = l->l_proc;
u_long com;
int error = 0, isdev = 0, dosys = 1;
struct sys_ioctl_args ia;
struct file *fp;
struct filedesc *fdp;
struct vnode *vp;
- int (*ioctlf)(struct file *, u_long, void *, struct proc *);
+ int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
struct ioctl_pt pt;
fdp = p->p_fd;
@@ -844,7 +846,7 @@ linux_ioctl_socket(p, uap, retval)
ioctlf = fp->f_ops->fo_ioctl;
pt.com = SCARG(uap, com);
pt.data = SCARG(uap, data);
- error = ioctlf(fp, PTIOCLINUX, (caddr_t)&pt, p);
+ error = ioctlf(fp, PTIOCLINUX, (caddr_t)&pt, l);
/*
* XXX hack: if the function returns EJUSTRETURN,
* it has stuffed a sysctl return value in pt.data.
@@ -888,7 +890,7 @@ linux_ioctl_socket(p, uap, retval)
SCARG(&ia, com) = SIOCDELMULTI;
break;
case LINUX_SIOCGIFHWADDR:
- error = linux_getifhwaddr(p, retval, SCARG(uap, fd),
+ error = linux_getifhwaddr(l, retval, SCARG(uap, fd),
SCARG(uap, data));
dosys = 0;
break;
@@ -897,7 +899,7 @@ linux_ioctl_socket(p, uap, retval)
}
out:
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
if (error ==0 && dosys) {
SCARG(&ia, fd) = SCARG(uap, fd);
@@ -952,7 +954,7 @@ linux_sys_connect(l, v, retval)
state = so->so_state;
prflags = so->so_proto->pr_flags;
splx(s);
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
/*
* We should only let this call succeed once per
* non-blocking connect; however we don't have
diff --git a/sys/compat/linux/common/linux_sysctl.c b/sys/compat/linux/common/linux_sysctl.c
index 06061344f33..4e5111d0eb1 100644
--- a/sys/compat/linux/common/linux_sysctl.c
+++ b/sys/compat/linux/common/linux_sysctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sysctl.c,v 1.7 2003/01/18 21:21:37 thorpej Exp $ */
+/* $NetBSD: linux_sysctl.c,v 1.8 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.7 2003/01/18 21:21:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.8 2003/06/28 14:21:22 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -62,23 +62,23 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.7 2003/01/18 21:21:37 thorpej Exp
#include <compat/linux/common/linux_exec.h>
int linux_kern_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
int linux_vm_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
int linux_net_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
int linux_proc_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
int linux_fs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
#ifdef DEBUG
int linux_debug_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
#endif
int linux_dev_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
int linux_bus_sysctl(int *, u_int, void *, size_t *, void *, size_t,
- struct proc *);
+ struct lwp *);
int
linux_sys___sysctl(struct lwp *l, void *v, register_t *retval)
@@ -161,7 +161,7 @@ linux_sys___sysctl(struct lwp *l, void *v, register_t *retval)
savelen = oldlen;
}
error = (*fn)(name + 1, ls.nlen - 1, ls.oldval, oldlenp, ls.newval,
- ls.newlen, p);
+ ls.newlen, l);
if (ls.oldval != NULL)
uvm_vsunlock(p, ls.oldval, savelen);
if (error)
@@ -185,7 +185,7 @@ char linux_version[128] = "#0 Sun Nov 11 11:11:11 MET 2000";
*/
int
linux_kern_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
/*
* Note that we allow writing into this, so that userland
@@ -211,7 +211,7 @@ linux_kern_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
*/
int
linux_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
if (nlen != 2 || name[0] != EMUL_LINUX_KERN)
return EOPNOTSUPP;
@@ -240,35 +240,35 @@ linux_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
*/
int
linux_vm_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
int
linux_net_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
int
linux_proc_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
int
linux_fs_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
#ifdef DEBUG
int
linux_debug_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
@@ -276,14 +276,14 @@ linux_debug_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
int
linux_dev_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
int
linux_bus_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
- void *newp, size_t newlen, struct proc *p)
+ void *newp, size_t newlen, struct lwp *l)
{
return (EOPNOTSUPP);
}
diff --git a/sys/compat/linux/common/linux_termios.c b/sys/compat/linux/common/linux_termios.c
index fa94eec18af..d79a99285cc 100644
--- a/sys/compat/linux/common/linux_termios.c
+++ b/sys/compat/linux/common/linux_termios.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_termios.c,v 1.18 2003/03/21 21:13:53 dsl Exp $ */
+/* $NetBSD: linux_termios.c,v 1.19 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.18 2003/03/21 21:13:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.19 2003/06/28 14:21:22 darrenr Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -462,8 +462,8 @@ bsd_termios_to_linux_termios(bts, lts)
}
int
-linux_ioctl_termios(p, uap, retval)
- struct proc *p;
+linux_ioctl_termios(l, uap, retval)
+ struct lwp *l;
struct linux_sys_ioctl_args /* {
syscallarg(int) fd;
syscallarg(u_long) com;
@@ -481,9 +481,9 @@ linux_ioctl_termios(p, uap, retval)
struct sys_ioctl_args ia;
int error;
char tioclinux;
- int (*bsdioctl)(struct file *, u_long, void *, struct proc *);
+ int (*bsdioctl)(struct file *, u_long, void *, struct lwp *);
- fdp = p->p_fd;
+ fdp = l->l_proc->p_fd;
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
@@ -500,7 +500,7 @@ linux_ioctl_termios(p, uap, retval)
switch (com) {
case LINUX_TCGETS:
- error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, p);
+ error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, l);
if (error)
goto out;
bsd_termios_to_linux_termios(&tmpbts, &tmplts);
@@ -513,7 +513,7 @@ linux_ioctl_termios(p, uap, retval)
* First fill in all fields, so that we keep the current
* values for fields that Linux doesn't know about.
*/
- error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, p);
+ error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, l);
if (error)
goto out;
error = copyin(SCARG(uap, data), &tmplts, sizeof tmplts);
@@ -531,10 +531,10 @@ linux_ioctl_termios(p, uap, retval)
com = TIOCSETAF;
break;
}
- error = (*bsdioctl)(fp, com, (caddr_t)&tmpbts, p);
+ error = (*bsdioctl)(fp, com, (caddr_t)&tmpbts, l);
goto out;
case LINUX_TCGETA:
- error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, p);
+ error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, l);
if (error)
goto out;
bsd_termios_to_linux_termio(&tmpbts, &tmplt);
@@ -547,7 +547,7 @@ linux_ioctl_termios(p, uap, retval)
* First fill in all fields, so that we keep the current
* values for fields that Linux doesn't know about.
*/
- error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, p);
+ error = (*bsdioctl)(fp, TIOCGETA, (caddr_t)&tmpbts, l);
if (error)
goto out;
error = copyin(SCARG(uap, data), &tmplt, sizeof tmplt);
@@ -565,7 +565,7 @@ linux_ioctl_termios(p, uap, retval)
com = TIOCSETAF;
break;
}
- error = (*bsdioctl)(fp, com, (caddr_t)&tmpbts, p);
+ error = (*bsdioctl)(fp, com, (caddr_t)&tmpbts, l);
goto out;
case LINUX_TCFLSH:
switch((u_long)SCARG(uap, data)) {
@@ -582,10 +582,10 @@ linux_ioctl_termios(p, uap, retval)
error = EINVAL;
goto out;
}
- error = (*bsdioctl)(fp, TIOCFLUSH, (caddr_t)&idat, p);
+ error = (*bsdioctl)(fp, TIOCFLUSH, (caddr_t)&idat, l);
goto out;
case LINUX_TIOCGETD:
- error = (*bsdioctl)(fp, TIOCGETD, (caddr_t)&idat, p);
+ error = (*bsdioctl)(fp, TIOCGETD, (caddr_t)&idat, l);
if (error)
goto out;
switch (idat) {
@@ -639,7 +639,7 @@ linux_ioctl_termios(p, uap, retval)
error = EINVAL;
goto out;
}
- error = (*bsdioctl)(fp, TIOCSETD, (caddr_t)&idat, p);
+ error = (*bsdioctl)(fp, TIOCSETD, (caddr_t)&idat, l);
goto out;
case LINUX_TIOCLINUX:
error = copyin(SCARG(uap, data), &tioclinux, sizeof tioclinux);
@@ -718,6 +718,6 @@ linux_ioctl_termios(p, uap, retval)
/* XXX NJWLWP */
error = sys_ioctl(curlwp, &ia, retval);
out:
- FILE_UNUSE(fp, p);
+ FILE_UNUSE(fp, l);
return error;
}
diff --git a/sys/compat/linux/common/linux_uselib.c b/sys/compat/linux/common/linux_uselib.c
index fecd4f7c2e3..49043e3c1e3 100644
--- a/sys/compat/linux/common/linux_uselib.c
+++ b/sys/compat/linux/common/linux_uselib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_uselib.c,v 1.10 2003/04/01 15:05:12 thorpej Exp $ */
+/* $NetBSD: linux_uselib.c,v 1.11 2003/06/28 14:21:22 darrenr Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.10 2003/04/01 15:05:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.11 2003/06/28 14:21:22 darrenr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -108,9 +108,9 @@ linux_sys_uselib(l, v, retval)
size_t rem;
sg = stackgap_init(p, 0);
- CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ CHECK_ALT_EXIST(l, &sg, SCARG(uap, path));
- NDINIT(&ni, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
+ NDINIT(&ni, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), l);
if ((error = namei(&ni)))
return error;
@@ -119,7 +119,7 @@ linux_sys_uselib(l, v, retval)
if ((error = vn_rdwr(UIO_READ, vp, (caddr_t) &hdr, LINUX_AOUT_HDR_SIZE,
0, UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
- &rem, p))) {
+ &rem, l))) {
vrele(vp);
return error;
}
@@ -162,7 +162,7 @@ linux_sys_uselib(l, v, retval)
struct exec_vmcmd *vcp;
vcp = &vcset.evs_cmds[i];
- error = (*vcp->ev_proc)(p, vcp);
+ error = (*vcp->ev_proc)(l, vcp);
}
kill_vmcmds(&vcset);