Mechanical LWP'ification of IRIX compat code; untested as of right now.

This commit is contained in:
rafal 2003-01-22 12:58:22 +00:00
parent 41ad61ee76
commit 5234d1eb92
16 changed files with 260 additions and 222 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_dirent.c,v 1.7 2002/03/09 13:32:12 manu Exp $ */ /* $NetBSD: irix_dirent.c,v 1.8 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 1994, 2001 The NetBSD Foundation, Inc. * Copyright (c) 1994, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_dirent.c,v 1.7 2002/03/09 13:32:12 manu Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_dirent.c,v 1.8 2003/01/22 12:58:22 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -71,8 +71,8 @@ __KERNEL_RCSID(0, "$NetBSD: irix_dirent.c,v 1.7 2002/03/09 13:32:12 manu Exp $")
#define SVR4_NAMEOFF(dp) ((char *)&(dp)->d_name - (char *)dp) #define SVR4_NAMEOFF(dp) ((char *)&(dp)->d_name - (char *)dp)
int int
irix_sys_ngetdents(p, v, retval) irix_sys_ngetdents(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -82,6 +82,7 @@ irix_sys_ngetdents(p, v, retval)
syscallarg(unsigned short) nbyte; syscallarg(unsigned short) nbyte;
syscallarg(int *) eof; syscallarg(int *) eof;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct dirent *bdp; struct dirent *bdp;
struct vnode *vp; struct vnode *vp;
caddr_t inp, buf; /* BSD-format */ caddr_t inp, buf; /* BSD-format */
@ -200,8 +201,8 @@ out1:
} }
int int
irix_sys_getdents(p, v, retval) irix_sys_getdents(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -218,7 +219,7 @@ irix_sys_getdents(p, v, retval)
SCARG(&cup, nbyte) = SCARG(uap, nbyte); SCARG(&cup, nbyte) = SCARG(uap, nbyte);
SCARG(&cup, eof) = NULL; SCARG(&cup, eof) = NULL;
return irix_sys_ngetdents(p, (void *)&cup, retval); return irix_sys_ngetdents(l, (void *)&cup, retval);
} }
@ -227,8 +228,8 @@ irix_sys_getdents(p, v, retval)
* 32 bit versions (only 3 lines of diff) * 32 bit versions (only 3 lines of diff)
*/ */
int int
irix_sys_ngetdents64(p, v, retval) irix_sys_ngetdents64(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -239,6 +240,7 @@ irix_sys_ngetdents64(p, v, retval)
syscallarg(int *) eof; syscallarg(int *) eof;
} */ *uap = v; } */ *uap = v;
struct dirent *bdp; struct dirent *bdp;
struct proc *p = l->l_proc;
struct vnode *vp; struct vnode *vp;
caddr_t inp, buf; /* BSD-format */ caddr_t inp, buf; /* BSD-format */
int len, reclen; /* BSD-format */ int len, reclen; /* BSD-format */
@ -352,8 +354,8 @@ out1:
} }
int int
irix_sys_getdents64(p, v, retval) irix_sys_getdents64(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -370,5 +372,5 @@ irix_sys_getdents64(p, v, retval)
SCARG(&cup, nbyte) = SCARG(uap, nbyte); SCARG(&cup, nbyte) = SCARG(uap, nbyte);
SCARG(&cup, eof) = NULL; SCARG(&cup, eof) = NULL;
return irix_sys_ngetdents64(p, (void *)&cup, retval); return irix_sys_ngetdents64(l, (void *)&cup, retval);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_exec.c,v 1.26 2002/11/30 13:18:13 jdolecek Exp $ */ /* $NetBSD: irix_exec.c,v 1.27 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc. * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.26 2002/11/30 13:18:13 jdolecek Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.27 2003/01/22 12:58:22 rafal Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -111,12 +111,12 @@ const struct emul emul_irix = {
* set registers on exec for N32 applications * set registers on exec for N32 applications
*/ */
void void
irix_n32_setregs(p, pack, stack) irix_n32_setregs(l, pack, stack)
struct proc *p; struct lwp *l;
struct exec_package *pack; struct exec_package *pack;
u_long stack; u_long stack;
{ {
struct frame *f = (struct frame *)p->p_md.md_regs; struct frame *f = (struct frame *)l->l_md.md_regs;
/* Enable 64 bit instructions (eg: sd) */ /* Enable 64 bit instructions (eg: sd) */
f->f_regs[SR] |= MIPS3_SR_UX; f->f_regs[SR] |= MIPS3_SR_UX;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_exec.h,v 1.16 2002/11/30 13:18:13 jdolecek Exp $ */ /* $NetBSD: irix_exec.h,v 1.17 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc. * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@ -104,7 +104,7 @@ int irix_elf64_probe __P((struct proc *, struct exec_package *, void *,
char *, vaddr_t *)); char *, vaddr_t *));
#endif #endif
void irix_n32_setregs __P((struct proc *, struct exec_package *, u_long)); void irix_n32_setregs __P((struct lwp *, struct exec_package *, u_long));
extern const struct emul emul_irix; extern const struct emul emul_irix;
extern const struct emul emul_irix; extern const struct emul emul_irix;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_fcntl.c,v 1.11 2003/01/18 07:44:50 thorpej Exp $ */ /* $NetBSD: irix_fcntl.c,v 1.12 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc. * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.11 2003/01/18 07:44:50 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.12 2003/01/22 12:58:22 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -69,13 +69,13 @@ __KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.11 2003/01/18 07:44:50 thorpej Exp
#include <compat/svr4/svr4_fcntl.h> #include <compat/svr4/svr4_fcntl.h>
#include <compat/svr4/svr4_syscallargs.h> #include <compat/svr4/svr4_syscallargs.h>
static int fd_truncate __P((struct proc *, int, int, off_t, register_t *)); static int fd_truncate __P((struct lwp *, int, int, off_t, register_t *));
static int bsd_to_irix_fcntl_flags __P((int)); static int bsd_to_irix_fcntl_flags __P((int));
static int irix_to_bsd_fcntl_flags __P((int)); static int irix_to_bsd_fcntl_flags __P((int));
int int
irix_sys_lseek64(p, v, retval) irix_sys_lseek64(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -106,12 +106,12 @@ irix_sys_lseek64(p, v, retval)
SCARG(&cup, offset) = SCARG(uap, offset); SCARG(&cup, offset) = SCARG(uap, offset);
SCARG(&cup, whence) = SCARG(uap, whence); SCARG(&cup, whence) = SCARG(uap, whence);
return sys_lseek(p, (void *)&cup, retval); return sys_lseek(l, (void *)&cup, retval);
} }
int int
irix_sys_fcntl(p, v, retval) irix_sys_fcntl(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -133,7 +133,7 @@ irix_sys_fcntl(p, v, retval)
if ((error = copyin(SCARG(uap, arg), &fl, sizeof(fl))) != 0) if ((error = copyin(SCARG(uap, arg), &fl, sizeof(fl))) != 0)
return error; return error;
return fd_truncate(p, SCARG(uap, fd), return fd_truncate(l, SCARG(uap, fd),
fl.l_whence, fl.l_start, retval); fl.l_whence, fl.l_start, retval);
break; break;
} }
@ -145,7 +145,7 @@ irix_sys_fcntl(p, v, retval)
if ((error = copyin(SCARG(uap, arg), &fl, sizeof(fl))) != 0) if ((error = copyin(SCARG(uap, arg), &fl, sizeof(fl))) != 0)
return error; return error;
return fd_truncate(p, SCARG(uap, fd), return fd_truncate(l, SCARG(uap, fd),
fl.l_whence, fl.l_start, retval); fl.l_whence, fl.l_start, retval);
break; break;
} }
@ -162,7 +162,7 @@ irix_sys_fcntl(p, v, retval)
SCARG(&cup, fd) = SCARG(uap, fd); SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, cmd) = F_GETFL; SCARG(&cup, cmd) = F_GETFL;
SCARG(&cup, arg) = SCARG(uap, arg); SCARG(&cup, arg) = SCARG(uap, arg);
if ((error = sys_fcntl(p, &cup, retval)) != 0) if ((error = sys_fcntl(l, &cup, retval)) != 0)
return error; return error;
*retval = bsd_to_irix_fcntl_flags(*retval); *retval = bsd_to_irix_fcntl_flags(*retval);
return 0; return 0;
@ -180,7 +180,7 @@ irix_sys_fcntl(p, v, retval)
SCARG(&cup, arg) = SCARG(&cup, arg) =
(char *)irix_to_bsd_fcntl_flags((int)SCARG(uap, arg)); (char *)irix_to_bsd_fcntl_flags((int)SCARG(uap, arg));
SCARG(&cup, cmd) = F_SETFL; SCARG(&cup, cmd) = F_SETFL;
return sys_fcntl(p, &cup, retval); return sys_fcntl(l, &cup, retval);
break; break;
case SVR4_F_DUPFD: case SVR4_F_DUPFD:
@ -235,17 +235,18 @@ irix_sys_fcntl(p, v, retval)
SCARG(&cup, fd) = SCARG(uap, fd); SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, cmd) = cmd; SCARG(&cup, cmd) = cmd;
SCARG(&cup, arg) = SCARG(uap, arg); SCARG(&cup, arg) = SCARG(uap, arg);
return svr4_sys_fcntl(p, &cup, retval); return svr4_sys_fcntl(l, &cup, retval);
} }
static int static int
fd_truncate(p, fd, whence, start, retval) fd_truncate(l, fd, whence, start, retval)
struct proc *p; struct lwp *l;
int fd; int fd;
int whence; int whence;
off_t start; off_t start;
register_t *retval; register_t *retval;
{ {
struct proc *p = l->l_proc;
struct filedesc *fdp = p->p_fd; struct filedesc *fdp = p->p_fd;
struct file *fp; struct file *fp;
struct vnode *vp; struct vnode *vp;
@ -281,12 +282,12 @@ fd_truncate(p, fd, whence, start, retval)
} }
SCARG(&ft, fd) = fd; SCARG(&ft, fd) = fd;
return sys_ftruncate(p, &ft, retval); return sys_ftruncate(l, &ft, retval);
} }
int int
irix_sys_open(p, v, retval) irix_sys_open(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -296,13 +297,14 @@ irix_sys_open(p, v, retval)
syscallarg(mode_t) mode; syscallarg(mode_t) mode;
} */ *uap = v; } */ *uap = v;
extern const struct cdevsw irix_usema_cdevsw; extern const struct cdevsw irix_usema_cdevsw;
struct proc *p = l->l_proc;
int error; int error;
int fd; int fd;
struct file *fp; struct file *fp;
struct vnode *vp; struct vnode *vp;
struct vnode *nvp; struct vnode *nvp;
if ((error = svr4_sys_open(p, v, retval)) != 0) if ((error = svr4_sys_open(l, v, retval)) != 0)
return error; return error;
fd = (int)*retval; fd = (int)*retval;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_ioctl.c,v 1.5 2002/10/05 21:29:02 manu Exp $ */ /* $NetBSD: irix_ioctl.c,v 1.6 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.5 2002/10/05 21:29:02 manu Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.6 2003/01/22 12:58:22 rafal Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/proc.h> #include <sys/proc.h>
@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.5 2002/10/05 21:29:02 manu Exp $");
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/vnode.h> #include <sys/vnode.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/sa.h>
#include <sys/syscallargs.h> #include <sys/syscallargs.h>
#include <sys/conf.h> #include <sys/conf.h>
@ -71,8 +72,8 @@ __KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.5 2002/10/05 21:29:02 manu Exp $");
#include <compat/irix/irix_syscallargs.h> #include <compat/irix/irix_syscallargs.h>
int int
irix_sys_ioctl(p, v, retval) irix_sys_ioctl(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -82,6 +83,7 @@ irix_sys_ioctl(p, v, retval)
syscallarg(caddr_t) data; syscallarg(caddr_t) data;
} */ *uap = v; } */ *uap = v;
extern const struct cdevsw irix_usema_cdevsw; extern const struct cdevsw irix_usema_cdevsw;
struct proc *p = l->l_proc;
u_long cmd; u_long cmd;
caddr_t data; caddr_t data;
struct file *fp; struct file *fp;
@ -185,7 +187,7 @@ out:
break; break;
default: /* Fallback to the standard SVR4 ioctl's */ default: /* Fallback to the standard SVR4 ioctl's */
error = svr4_sys_ioctl(p, v, retval); error = svr4_sys_ioctl(l, v, retval);
break; break;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_misc.c,v 1.4 2002/11/09 09:03:58 manu Exp $ */ /* $NetBSD: irix_misc.c,v 1.5 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.4 2002/11/09 09:03:58 manu Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.5 2003/01/22 12:58:22 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -46,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.4 2002/11/09 09:03:58 manu Exp $");
#include <sys/kernel.h> #include <sys/kernel.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h> #include <sys/syscallargs.h>
#include <compat/svr4/svr4_types.h> #include <compat/svr4/svr4_types.h>
@ -67,8 +67,8 @@ __KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.4 2002/11/09 09:03:58 manu Exp $");
* Maybe consider moving this to sys/compat/common/compat_util.c? * Maybe consider moving this to sys/compat/common/compat_util.c?
*/ */
int int
irix_sys_setpgrp(p, v, retval) irix_sys_setpgrp(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -76,6 +76,7 @@ irix_sys_setpgrp(p, v, retval)
syscallarg(int) pid; syscallarg(int) pid;
syscallarg(int) pgid; syscallarg(int) pgid;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
/* /*
* difference to our setpgid call is to include backwards * difference to our setpgid call is to include backwards
@ -85,16 +86,16 @@ irix_sys_setpgrp(p, v, retval)
*/ */
if (!SCARG(uap, pgid) && if (!SCARG(uap, pgid) &&
(!SCARG(uap, pid) || SCARG(uap, pid) == p->p_pid)) (!SCARG(uap, pid) || SCARG(uap, pid) == p->p_pid))
return sys_setsid(p, uap, retval); return sys_setsid(l, uap, retval);
else else
return sys_setpgid(p, uap, retval); return sys_setpgid(l, uap, retval);
} }
#define BUF_SIZE 16 #define BUF_SIZE 16
int int
irix_sys_uname(p, v, retval) irix_sys_uname(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -128,8 +129,8 @@ irix_sys_uname(p, v, retval)
} }
int int
irix_sys_utssys(p, v, retval) irix_sys_utssys(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -144,12 +145,12 @@ irix_sys_utssys(p, v, retval)
case 0: { /* uname(2) */ case 0: { /* uname(2) */
struct irix_sys_uname_args ua; struct irix_sys_uname_args ua;
SCARG(&ua, name) = SCARG(uap, a1); SCARG(&ua, name) = SCARG(uap, a1);
return irix_sys_uname(p, &ua, retval); return irix_sys_uname(l, &ua, retval);
} }
break; break;
default: default:
return(svr4_sys_utssys(p, v, retval)); return(svr4_sys_utssys(l, v, retval));
break; break;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_mman.c,v 1.7 2002/11/30 12:28:26 jdolecek Exp $ */ /* $NetBSD: irix_mman.c,v 1.8 2003/01/22 12:58:22 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.7 2002/11/30 12:28:26 jdolecek Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.8 2003/01/22 12:58:22 rafal Exp $");
#if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT)
#include "opt_sysv.h" #include "opt_sysv.h"
@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.7 2002/11/30 12:28:26 jdolecek Exp $
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/lock.h> #include <sys/lock.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/sa.h>
#include <sys/syscallargs.h> #include <sys/syscallargs.h>
#include <compat/svr4/svr4_types.h> #include <compat/svr4/svr4_types.h>
@ -70,12 +71,12 @@ __KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.7 2002/11/30 12:28:26 jdolecek Exp $
#include <compat/irix/irix_exec.h> #include <compat/irix/irix_exec.h>
#include <compat/irix/irix_syscallargs.h> #include <compat/irix/irix_syscallargs.h>
static int irix_mmap __P((struct proc *, void *, size_t, int , static int irix_mmap __P((struct lwp *, void *, size_t, int ,
int, int, off_t, register_t *)); int, int, off_t, register_t *));
int int
irix_sys_mmap(p, v, retval) irix_sys_mmap(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -88,14 +89,14 @@ irix_sys_mmap(p, v, retval)
syscallarg(irix_off_t) pos; syscallarg(irix_off_t) pos;
} */ *uap = v; } */ *uap = v;
return irix_mmap(p, SCARG(uap, addr), SCARG(uap, len), return irix_mmap(l, SCARG(uap, addr), SCARG(uap, len),
SCARG(uap, prot), SCARG(uap, flags), SCARG(uap, fd), SCARG(uap, prot), SCARG(uap, flags), SCARG(uap, fd),
SCARG(uap, pos), retval); SCARG(uap, pos), retval);
} }
int int
irix_sys_mmap64(p, v, retval) irix_sys_mmap64(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -108,14 +109,15 @@ irix_sys_mmap64(p, v, retval)
syscallarg(int) pad1; syscallarg(int) pad1;
syscallarg(irix_off64_t) pos; syscallarg(irix_off64_t) pos;
} */ *uap = v; } */ *uap = v;
return irix_mmap(p, SCARG(uap, addr), SCARG(uap, len),
return irix_mmap(l, SCARG(uap, addr), SCARG(uap, len),
SCARG(uap, prot), SCARG(uap, flags), SCARG(uap, fd), SCARG(uap, prot), SCARG(uap, flags), SCARG(uap, fd),
SCARG(uap, pos), retval); SCARG(uap, pos), retval);
} }
static int static int
irix_mmap(p, addr, len, prot, flags, fd, pos, retval) irix_mmap(l, addr, len, prot, flags, fd, pos, retval)
struct proc *p; struct lwp *l;
void *addr; void *addr;
size_t len; size_t len;
int prot; int prot;
@ -124,6 +126,7 @@ irix_mmap(p, addr, len, prot, flags, fd, pos, retval)
off_t pos; off_t pos;
register_t *retval; register_t *retval;
{ {
struct proc *p = l->l_proc;
struct sys_mmap_args cup; struct sys_mmap_args cup;
int bsd_flags = 0; int bsd_flags = 0;
int error = 0; int error = 0;
@ -226,21 +229,21 @@ out:
/* A private mapping that should not be visible to the share group */ /* A private mapping that should not be visible to the share group */
if (flags & IRIX_MAP_LOCAL) { if (flags & IRIX_MAP_LOCAL) {
if ((error = sys_mmap(p, &cup, retval)) != 0) if ((error = sys_mmap(l, &cup, retval)) != 0)
return error; return error;
addr = (void *)*retval; addr = (void *)*retval;
irix_isrr_insert((vaddr_t)addr, len, IRIX_ISRR_PRIVATE, p); irix_isrr_insert((vaddr_t)addr, len, IRIX_ISRR_PRIVATE, p);
return 0; return 0;
} }
IRIX_VM_SYNC(p, error = sys_mmap(p, &cup, retval)); IRIX_VM_SYNC(p, error = sys_mmap(l, &cup, retval));
return error; return error;
} }
int int
irix_sys_munmap(p, v, retval) irix_sys_munmap(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -248,9 +251,10 @@ irix_sys_munmap(p, v, retval)
syscallarg(void *) addr; syscallarg(void *) addr;
syscallarg(size_t) len; syscallarg(size_t) len;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
int error; int error;
IRIX_VM_SYNC(p, error = sys_munmap(p, v, retval)); IRIX_VM_SYNC(p, error = sys_munmap(l, v, retval));
if (error == 0) if (error == 0)
irix_isrr_insert((vaddr_t)SCARG(uap, addr), irix_isrr_insert((vaddr_t)SCARG(uap, addr),
SCARG(uap, len), IRIX_ISRR_SHARED, p); SCARG(uap, len), IRIX_ISRR_SHARED, p);
@ -259,39 +263,42 @@ irix_sys_munmap(p, v, retval)
} }
int int
irix_sys_break(p, v, retval) irix_sys_break(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
struct proc *p = l->l_proc;
int error; int error;
IRIX_VM_SYNC(p, error = svr4_sys_break(p, v, retval)); IRIX_VM_SYNC(p, error = svr4_sys_break(l, v, retval));
return error; return error;
} }
#ifdef SYSVSHM #ifdef SYSVSHM
int int
irix_sys_shmsys(p, v, retval) irix_sys_shmsys(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
struct proc *p = l->l_proc;
int error; int error;
IRIX_VM_SYNC(p, error = svr4_sys_shmsys(p, v, retval)); IRIX_VM_SYNC(p, error = svr4_sys_shmsys(l, v, retval));
return error; return error;
} }
#endif #endif
int int
irix_sys_mprotect(p, v, retval) irix_sys_mprotect(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
struct proc *p = l->l_proc;
int error; int error;
IRIX_VM_SYNC(p, error = sys_mprotect(p, v, retval)); IRIX_VM_SYNC(p, error = sys_mprotect(l, v, retval));
return error; return error;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_mount.c,v 1.4 2002/03/16 20:43:52 christos Exp $ */ /* $NetBSD: irix_mount.c,v 1.5 2003/01/22 12:58:23 rafal Exp $ */
/*- /*-
* Copyright (c) 2001 The NetBSD Foundation, Inc. * Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_mount.c,v 1.4 2002/03/16 20:43:52 christos Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_mount.c,v 1.5 2003/01/22 12:58:23 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -57,8 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: irix_mount.c,v 1.4 2002/03/16 20:43:52 christos Exp
#include <compat/irix/irix_syscallargs.h> #include <compat/irix/irix_syscallargs.h>
int int
irix_sys_getmountid(p, v, retval) irix_sys_getmountid(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -66,6 +66,7 @@ irix_sys_getmountid(p, v, retval)
syscallarg(const char *) path; syscallarg(const char *) path;
syscallarg(irix_mountid_t *) buf; syscallarg(irix_mountid_t *) buf;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
struct ucred *cred = crget(); struct ucred *cred = crget();
struct vnode *vp; struct vnode *vp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_resource.c,v 1.1 2002/06/14 20:33:11 manu Exp $ */ /* $NetBSD: irix_resource.c,v 1.2 2003/01/22 12:58:23 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_resource.c,v 1.1 2002/06/14 20:33:11 manu Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_resource.c,v 1.2 2003/01/22 12:58:23 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: irix_resource.c,v 1.1 2002/06/14 20:33:11 manu Exp $
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/sa.h>
#include <sys/syscallargs.h> #include <sys/syscallargs.h>
#include <compat/common/compat_util.h> #include <compat/common/compat_util.h>
@ -96,8 +97,8 @@ irix_to_native_resource(irix_res)
} }
int int
irix_sys_getrlimit(p, v, retval) irix_sys_getrlimit(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -105,6 +106,7 @@ irix_sys_getrlimit(p, v, retval)
syscallarg(int) resource; syscallarg(int) resource;
syscallarg(struct irix_rlimit *) rlp; syscallarg(struct irix_rlimit *) rlp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
struct sys_getrlimit_args cup; struct sys_getrlimit_args cup;
struct rlimit rlp; struct rlimit rlp;
@ -114,7 +116,7 @@ irix_sys_getrlimit(p, v, retval)
SCARG(&cup, which) = irix_to_native_resource(SCARG(uap, resource)); SCARG(&cup, which) = irix_to_native_resource(SCARG(uap, resource));
SCARG(&cup, rlp) = stackgap_alloc(p, &sg, sizeof(struct rlimit)); SCARG(&cup, rlp) = stackgap_alloc(p, &sg, sizeof(struct rlimit));
if ((error = sys_getrlimit(p, &cup, retval)) != 0) if ((error = sys_getrlimit(l, &cup, retval)) != 0)
return error; return error;
if ((error = copyin(SCARG(&cup, rlp), &rlp, sizeof(rlp))) != 0) if ((error = copyin(SCARG(&cup, rlp), &rlp, sizeof(rlp))) != 0)
@ -137,8 +139,8 @@ irix_sys_getrlimit(p, v, retval)
} }
int int
irix_sys_getrlimit64(p, v, retval) irix_sys_getrlimit64(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -146,6 +148,7 @@ irix_sys_getrlimit64(p, v, retval)
syscallarg(int) resource; syscallarg(int) resource;
syscallarg(struct irix_rlimit64 *) rlp; syscallarg(struct irix_rlimit64 *) rlp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
struct sys_getrlimit_args cup; struct sys_getrlimit_args cup;
struct rlimit rlp; struct rlimit rlp;
@ -155,7 +158,7 @@ irix_sys_getrlimit64(p, v, retval)
SCARG(&cup, which) = irix_to_native_resource(SCARG(uap, resource)); SCARG(&cup, which) = irix_to_native_resource(SCARG(uap, resource));
SCARG(&cup, rlp) = stackgap_alloc(p, &sg, sizeof(struct rlimit)); SCARG(&cup, rlp) = stackgap_alloc(p, &sg, sizeof(struct rlimit));
if ((error = sys_getrlimit(p, &cup, retval)) != 0) if ((error = sys_getrlimit(l, &cup, retval)) != 0)
return error; return error;
if ((error = copyin(SCARG(&cup, rlp), &rlp, sizeof(rlp))) != 0) if ((error = copyin(SCARG(&cup, rlp), &rlp, sizeof(rlp))) != 0)
@ -178,8 +181,8 @@ irix_sys_getrlimit64(p, v, retval)
} }
int int
irix_sys_setrlimit(p, v, retval) irix_sys_setrlimit(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -187,6 +190,7 @@ irix_sys_setrlimit(p, v, retval)
syscallarg(int) resource; syscallarg(int) resource;
syscallarg(struct irix_rlimit *) rlp; syscallarg(struct irix_rlimit *) rlp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
struct sys_setrlimit_args cup; struct sys_setrlimit_args cup;
struct rlimit rlp; struct rlimit rlp;
@ -212,15 +216,15 @@ irix_sys_setrlimit(p, v, retval)
if ((error = copyout(&rlp, (void *)SCARG(&cup, rlp), sizeof(rlp))) != 0) if ((error = copyout(&rlp, (void *)SCARG(&cup, rlp), sizeof(rlp))) != 0)
return error; return error;
if ((error = sys_setrlimit(p, &cup, retval)) != 0) if ((error = sys_setrlimit(l, &cup, retval)) != 0)
return error; return error;
return 0; return 0;
} }
int int
irix_sys_setrlimit64(p, v, retval) irix_sys_setrlimit64(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -228,6 +232,7 @@ irix_sys_setrlimit64(p, v, retval)
syscallarg(int) resource; syscallarg(int) resource;
syscallarg(struct irix_rlimit64 *) rlp; syscallarg(struct irix_rlimit64 *) rlp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
struct sys_setrlimit_args cup; struct sys_setrlimit_args cup;
struct rlimit rlp; struct rlimit rlp;
@ -253,7 +258,7 @@ irix_sys_setrlimit64(p, v, retval)
if ((error = copyout(&rlp, (void *)SCARG(&cup, rlp), sizeof(rlp))) != 0) if ((error = copyout(&rlp, (void *)SCARG(&cup, rlp), sizeof(rlp))) != 0)
return error; return error;
if ((error = sys_setrlimit(p, &cup, retval)) != 0) if ((error = sys_setrlimit(l, &cup, retval)) != 0)
return error; return error;
return 0; return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_signal.c,v 1.23 2003/01/18 07:44:51 thorpej Exp $ */ /* $NetBSD: irix_signal.c,v 1.24 2003/01/22 12:58:23 rafal Exp $ */
/*- /*-
* Copyright (c) 1994, 2001-2002 The NetBSD Foundation, Inc. * Copyright (c) 1994, 2001-2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.23 2003/01/18 07:44:51 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.24 2003/01/22 12:58:23 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -77,11 +77,11 @@ static int irix_wait_siginfo __P((struct proc *, int,
static void irix_signal_siginfo __P((struct irix_irix5_siginfo *, static void irix_signal_siginfo __P((struct irix_irix5_siginfo *,
int, u_long, caddr_t)); int, u_long, caddr_t));
static void irix_set_ucontext __P((struct irix_ucontext*, sigset_t *, static void irix_set_ucontext __P((struct irix_ucontext*, sigset_t *,
int, struct proc *)); int, struct lwp *));
static void irix_set_sigcontext __P((struct irix_sigcontext*, sigset_t *, static void irix_set_sigcontext __P((struct irix_sigcontext*, sigset_t *,
int, struct proc *)); int, struct lwp *));
static void irix_get_ucontext __P((struct irix_ucontext*, struct proc *)); static void irix_get_ucontext __P((struct irix_ucontext*, struct lwp *));
static void irix_get_sigcontext __P((struct irix_sigcontext*, struct proc *)); static void irix_get_sigcontext __P((struct irix_sigcontext*, struct lwp *));
#define irix_sigmask(n) (1 << (((n) - 1) & 31)) #define irix_sigmask(n) (1 << (((n) - 1) & 31))
#define irix_sigword(n) (((n) - 1) >> 5) #define irix_sigword(n) (((n) - 1) >> 5)
@ -265,7 +265,8 @@ irix_sendsig(sig, mask, code)
sigset_t *mask; sigset_t *mask;
u_long code; u_long code;
{ {
struct proc *p = curlwp; struct lwp *l = curlwp;
struct proc *p = l->l_proc;
void *sp; void *sp;
struct frame *f; struct frame *f;
int onstack; int onstack;
@ -273,7 +274,7 @@ irix_sendsig(sig, mask, code)
sig_t catcher = SIGACTION(p, sig).sa_handler; sig_t catcher = SIGACTION(p, sig).sa_handler;
struct irix_sigframe sf; struct irix_sigframe sf;
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
#ifdef DEBUG_IRIX #ifdef DEBUG_IRIX
printf("irix_sendsig()\n"); printf("irix_sendsig()\n");
printf("catcher = %p, sig = %d, code = 0x%lx\n", printf("catcher = %p, sig = %d, code = 0x%lx\n",
@ -307,11 +308,11 @@ irix_sendsig(sig, mask, code)
*/ */
bzero(&sf, sizeof(sf)); bzero(&sf, sizeof(sf));
if (SIGACTION(p, sig).sa_flags & SA_SIGINFO) { if (SIGACTION(p, sig).sa_flags & SA_SIGINFO) {
irix_set_ucontext(&sf.isf_ctx.iss.iuc, mask, code, p); irix_set_ucontext(&sf.isf_ctx.iss.iuc, mask, code, l);
irix_signal_siginfo(&sf.isf_ctx.iss.iis, sig, irix_signal_siginfo(&sf.isf_ctx.iss.iis, sig,
code, (caddr_t)f->f_regs[BADVADDR]); code, (caddr_t)f->f_regs[BADVADDR]);
} else { } else {
irix_set_sigcontext(&sf.isf_ctx.isc, mask, code, p); irix_set_sigcontext(&sf.isf_ctx.isc, mask, code, l);
} }
/* /*
@ -332,7 +333,7 @@ irix_sendsig(sig, mask, code)
#ifdef DEBUG_IRIX #ifdef DEBUG_IRIX
printf("irix_sendsig: stack trashed\n"); printf("irix_sendsig: stack trashed\n");
#endif /* DEBUG_IRIX */ #endif /* DEBUG_IRIX */
sigexit(p, SIGILL); sigexit(l, SIGILL);
/* NOTREACHED */ /* NOTREACHED */
} }
@ -387,19 +388,20 @@ irix_sendsig(sig, mask, code)
} }
static void static void
irix_set_sigcontext (scp, mask, code, p) irix_set_sigcontext (scp, mask, code, l)
struct irix_sigcontext *scp; struct irix_sigcontext *scp;
sigset_t *mask; sigset_t *mask;
int code; int code;
struct proc *p; struct lwp *l;
{ {
struct proc *p = l->l_proc;
int i; int i;
struct frame *f; struct frame *f;
#ifdef DEBUG_IRIX #ifdef DEBUG_IRIX
printf("irix_set_sigcontext()\n"); printf("irix_set_sigcontext()\n");
#endif #endif
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
/* /*
* Build stack frame for signal trampoline. * Build stack frame for signal trampoline.
*/ */
@ -420,17 +422,17 @@ irix_set_sigcontext (scp, mask, code, p)
* Save the floating-pointstate, if necessary, then copy it. * Save the floating-pointstate, if necessary, then copy it.
*/ */
#ifndef SOFTFLOAT #ifndef SOFTFLOAT
scp->isc_ownedfp = p->p_md.md_flags & MDP_FPUSED; scp->isc_ownedfp = l->l_md.md_flags & MDP_FPUSED;
if (scp->isc_ownedfp) { if (scp->isc_ownedfp) {
/* if FPU has current state, save it first */ /* if FPU has current state, save it first */
if (p == fpcurlwp) if (l == fpcurlwp)
savefpregs(p); savefpregs(l);
(void)memcpy(&scp->isc_fpregs, &p->p_addr->u_pcb.pcb_fpregs, (void)memcpy(&scp->isc_fpregs, &l->l_addr->u_pcb.pcb_fpregs,
sizeof(scp->isc_fpregs)); sizeof(scp->isc_fpregs));
scp->isc_fpc_csr = p->p_addr->u_pcb.pcb_fpregs.r_regs[32]; scp->isc_fpc_csr = l->l_addr->u_pcb.pcb_fpregs.r_regs[32];
} }
#else #else
(void)memcpy(&scp->isc_fpregs, &p->p_addr->u_pcb.pcb_fpregs, (void)memcpy(&scp->isc_fpregs, &l->l_addr->u_pcb.pcb_fpregs,
sizeof(scp->isc_fpregs)); sizeof(scp->isc_fpregs));
#endif #endif
/* /*
@ -443,18 +445,19 @@ irix_set_sigcontext (scp, mask, code, p)
} }
void void
irix_set_ucontext(ucp, mask, code, p) irix_set_ucontext(ucp, mask, code, l)
struct irix_ucontext *ucp; struct irix_ucontext *ucp;
sigset_t *mask; sigset_t *mask;
int code; int code;
struct proc *p; struct lwp *l;
{ {
struct proc *p = l->l_proc;
struct frame *f; struct frame *f;
#ifdef DEBUG_IRIX #ifdef DEBUG_IRIX
printf("irix_set_ucontext()\n"); printf("irix_set_ucontext()\n");
#endif #endif
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
/* /*
* Save general purpose registers * Save general purpose registers
*/ */
@ -471,19 +474,19 @@ irix_set_ucontext(ucp, mask, code, p)
* Save the floating-pointstate, if necessary, then copy it. * Save the floating-pointstate, if necessary, then copy it.
*/ */
#ifndef SOFTFLOAT #ifndef SOFTFLOAT
if (p->p_md.md_flags & MDP_FPUSED) { if (l->l_md.md_flags & MDP_FPUSED) {
/* if FPU has current state, save it first */ /* if FPU has current state, save it first */
if (p == fpcurlwp) if (l == fpcurlwp)
savefpregs(p); savefpregs(l);
(void)memcpy(&ucp->iuc_mcontext.svr4___fpregs, (void)memcpy(&ucp->iuc_mcontext.svr4___fpregs,
&p->p_addr->u_pcb.pcb_fpregs, &l->l_addr->u_pcb.pcb_fpregs,
sizeof(ucp->iuc_mcontext.svr4___fpregs)); sizeof(ucp->iuc_mcontext.svr4___fpregs));
ucp->iuc_mcontext.svr4___fpregs.svr4___fp_csr = ucp->iuc_mcontext.svr4___fpregs.svr4___fp_csr =
p->p_addr->u_pcb.pcb_fpregs.r_regs[32]; l->l_addr->u_pcb.pcb_fpregs.r_regs[32];
} }
#else #else
(void)memcpy(&ucp->iuc_mcontext.svr4___fpregs, (void)memcpy(&ucp->iuc_mcontext.svr4___fpregs,
&p->p_addr->u_pcb.pcb_fpregs, &l->l_addr->u_pcb.pcb_fpregs,
sizeof(ucp->iuc_mcontext.svr4___fpregs)); sizeof(ucp->iuc_mcontext.svr4___fpregs));
#endif #endif
/* /*
@ -511,8 +514,8 @@ irix_set_ucontext(ucp, mask, code, p)
} }
int int
irix_sys_sigreturn(p, v, retval) irix_sys_sigreturn(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -545,35 +548,36 @@ irix_sys_sigreturn(p, v, retval)
sizeof(ksf.isf_ctx))) != 0) sizeof(ksf.isf_ctx))) != 0)
return error; return error;
irix_get_ucontext(&ksf.isf_ctx.iss.iuc, p); irix_get_ucontext(&ksf.isf_ctx.iss.iuc, l);
} else { } else {
if ((error = copyin(usf, &ksf.isf_ctx.isc, if ((error = copyin(usf, &ksf.isf_ctx.isc,
sizeof(ksf.isf_ctx))) != 0) sizeof(ksf.isf_ctx))) != 0)
return error; return error;
irix_get_sigcontext(&ksf.isf_ctx.isc, p); irix_get_sigcontext(&ksf.isf_ctx.isc, l);
} }
#ifdef DEBUG_IRIX #ifdef DEBUG_IRIX
printf("irix_sys_sigreturn(): returning [PC=%p SP=%p SR=0x%08lx]\n", printf("irix_sys_sigreturn(): returning [PC=%p SP=%p SR=0x%08lx]\n",
(void *)((struct frame *)(p->p_md.md_regs))->f_regs[PC], (void *)((struct frame *)(l->l_md.md_regs))->f_regs[PC],
(void *)((struct frame *)(p->p_md.md_regs))->f_regs[SP], (void *)((struct frame *)(l->l_md.md_regs))->f_regs[SP],
((struct frame *)(p->p_md.md_regs))->f_regs[SR]); ((struct frame *)(l->l_md.md_regs))->f_regs[SR]);
#endif #endif
return EJUSTRETURN; return EJUSTRETURN;
} }
static void static void
irix_get_ucontext(ucp, p) irix_get_ucontext(ucp, l)
struct irix_ucontext *ucp; struct irix_ucontext *ucp;
struct proc *p; struct lwp *l;
{ {
struct proc *p = l->l_proc;
struct frame *f; struct frame *f;
sigset_t mask; sigset_t mask;
/* Restore the register context. */ /* Restore the register context. */
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
if (ucp->iuc_flags & IRIX_UC_CPU) { if (ucp->iuc_flags & IRIX_UC_CPU) {
(void)memcpy(&f->f_regs, &ucp->iuc_mcontext.svr4___gregs, (void)memcpy(&f->f_regs, &ucp->iuc_mcontext.svr4___gregs,
@ -591,17 +595,17 @@ irix_get_ucontext(ucp, p)
#ifndef SOFTFLOAT #ifndef SOFTFLOAT
/* Disable the FPU to fault in FP registers. */ /* Disable the FPU to fault in FP registers. */
f->f_regs[SR] &= ~MIPS_SR_COP_1_BIT; f->f_regs[SR] &= ~MIPS_SR_COP_1_BIT;
if (p == fpcurlwp) if (l == fpcurlwp)
fpcurlwp = (struct proc *)0; fpcurlwp = NULL;
(void)memcpy(&p->p_addr->u_pcb.pcb_fpregs, (void)memcpy(&l->l_addr->u_pcb.pcb_fpregs,
&ucp->iuc_mcontext.svr4___fpregs, &ucp->iuc_mcontext.svr4___fpregs,
sizeof(p->p_addr->u_pcb.pcb_fpregs)); sizeof(l->l_addr->u_pcb.pcb_fpregs));
p->p_addr->u_pcb.pcb_fpregs.r_regs[32] = l->l_addr->u_pcb.pcb_fpregs.r_regs[32] =
ucp->iuc_mcontext.svr4___fpregs.svr4___fp_csr; ucp->iuc_mcontext.svr4___fpregs.svr4___fp_csr;
#else #else
(void)memcpy(&p->p_addr->u_pcb.pcb_fpregs, (void)memcpy(&l->l_addr->u_pcb.pcb_fpregs,
&ucp->iuc_mcontext.svr4___fpregs, &ucp->iuc_mcontext.svr4___fpregs,
sizeof(p->p_addr->u_pcb.pcb_fpregs)); sizeof(l->l_addr->u_pcb.pcb_fpregs));
#endif #endif
} }
@ -636,16 +640,17 @@ irix_get_ucontext(ucp, p)
} }
static void static void
irix_get_sigcontext(scp, p) irix_get_sigcontext(scp, l)
struct irix_sigcontext *scp; struct irix_sigcontext *scp;
struct proc *p; struct lwp *l;
{ {
struct proc *p = l->l_proc;
int i; int i;
struct frame *f; struct frame *f;
sigset_t mask; sigset_t mask;
/* Restore the register context. */ /* Restore the register context. */
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
for (i = 1; i < 32; i++) /* restore gpr1 to gpr31 */ for (i = 1; i < 32; i++) /* restore gpr1 to gpr31 */
f->f_regs[i] = scp->isc_regs[i]; f->f_regs[i] = scp->isc_regs[i];
@ -657,15 +662,15 @@ irix_get_sigcontext(scp, p)
if (scp->isc_ownedfp) { if (scp->isc_ownedfp) {
/* Disable the FPU to fault in FP registers. */ /* Disable the FPU to fault in FP registers. */
f->f_regs[SR] &= ~MIPS_SR_COP_1_BIT; f->f_regs[SR] &= ~MIPS_SR_COP_1_BIT;
if (p == fpcurlwp) if (l == fpcurlwp)
fpcurlwp = (struct proc *)0; fpcurlwp = NULL;
(void)memcpy(&p->p_addr->u_pcb.pcb_fpregs, &scp->isc_fpregs, (void)memcpy(&l->l_addr->u_pcb.pcb_fpregs, &scp->isc_fpregs,
sizeof(scp->isc_fpregs)); sizeof(scp->isc_fpregs));
p->p_addr->u_pcb.pcb_fpregs.r_regs[32] = scp->isc_fpc_csr; l->l_addr->u_pcb.pcb_fpregs.r_regs[32] = scp->isc_fpc_csr;
} }
#else #else
(void)memcpy(&p->p_addr->u_pcb.pcb_fpregs, &scp->isc_fpregs, (void)memcpy(&l->l_addr->u_pcb.pcb_fpregs, &scp->isc_fpregs,
sizeof(p->p_addr->u_pcb.pcb_fpregs)); sizeof(l->l_addr->u_pcb.pcb_fpregs));
#endif #endif
/* Restore signal stack. */ /* Restore signal stack. */
@ -684,8 +689,8 @@ irix_get_sigcontext(scp, p)
int int
irix_sys_sginap(p, v, retval) irix_sys_sginap(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -715,19 +720,20 @@ irix_sys_sginap(p, v, retval)
* XXX Untested. Expect bugs and security problems here * XXX Untested. Expect bugs and security problems here
*/ */
int int
irix_sys_getcontext(p, v, retval) irix_sys_getcontext(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
struct irix_sys_getcontext_args /* { struct irix_sys_getcontext_args /* {
syscallarg(struct irix_ucontext *) ucp; syscallarg(struct irix_ucontext *) ucp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct frame *f; struct frame *f;
struct irix_ucontext kucp; struct irix_ucontext kucp;
int i, error; int i, error;
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
kucp.iuc_flags = IRIX_UC_ALL; kucp.iuc_flags = IRIX_UC_ALL;
kucp.iuc_link = NULL; /* XXX */ kucp.iuc_link = NULL; /* XXX */
@ -758,14 +764,15 @@ irix_sys_getcontext(p, v, retval)
* XXX Untested. Expect bugs and security problems here * XXX Untested. Expect bugs and security problems here
*/ */
int int
irix_sys_setcontext(p, v, retval) irix_sys_setcontext(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
struct irix_sys_setcontext_args /* { struct irix_sys_setcontext_args /* {
syscallarg(struct irix_ucontext *) ucp; syscallarg(struct irix_ucontext *) ucp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct frame *f; struct frame *f;
struct irix_ucontext kucp; struct irix_ucontext kucp;
int i, error; int i, error;
@ -774,7 +781,7 @@ irix_sys_setcontext(p, v, retval)
if (error) if (error)
goto out; goto out;
f = (struct frame *)p->p_md.md_regs; f = (struct frame *)l->l_md.md_regs;
if (kucp.iuc_flags & IRIX_UC_SIGMASK) if (kucp.iuc_flags & IRIX_UC_SIGMASK)
irix_to_native_sigset(&kucp.iuc_sigmask, irix_to_native_sigset(&kucp.iuc_sigmask,
@ -818,8 +825,8 @@ out:
* from svr4_misc.c, or push the irix_irix5_siginfo into svr4_siginfo.h * from svr4_misc.c, or push the irix_irix5_siginfo into svr4_siginfo.h
*/ */
int int
irix_sys_waitsys(p, v, retval) irix_sys_waitsys(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -830,6 +837,7 @@ irix_sys_waitsys(p, v, retval)
syscallarg(int) options; syscallarg(int) options;
syscallarg(struct rusage *) ru; syscallarg(struct rusage *) ru;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
int nfound, error, s; int nfound, error, s;
struct proc *q, *t; struct proc *q, *t;
@ -977,8 +985,8 @@ loop:
} }
int int
irix_sys_sigprocmask(p, v, retval) irix_sys_sigprocmask(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -987,6 +995,7 @@ irix_sys_sigprocmask(p, v, retval)
syscallarg(irix_sigset_t *) set; syscallarg(irix_sigset_t *) set;
syscallarg(irix_sigset_t *) oset; syscallarg(irix_sigset_t *) oset;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct svr4_sys_sigprocmask_args cup; struct svr4_sys_sigprocmask_args cup;
int error; int error;
sigset_t *obss; sigset_t *obss;
@ -1014,12 +1023,12 @@ irix_sys_sigprocmask(p, v, retval)
SCARG(&cup, how) = SVR4_SIG_SETMASK; SCARG(&cup, how) = SVR4_SIG_SETMASK;
} }
return svr4_sys_sigprocmask(p, &cup, retval); return svr4_sys_sigprocmask(l, &cup, retval);
} }
int int
irix_sys_sigaction(p, v, retval) irix_sys_sigaction(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -1029,6 +1038,7 @@ irix_sys_sigaction(p, v, retval)
syscallarg(struct svr4_sigaction *) osa; syscallarg(struct svr4_sigaction *) osa;
syscallarg(void *) sigtramp; syscallarg(void *) sigtramp;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
int signum; int signum;
struct svr4_sys_sigaction_args cup; struct svr4_sys_sigaction_args cup;
struct irix_emuldata *ied; struct irix_emuldata *ied;
@ -1085,5 +1095,5 @@ irix_sys_sigaction(p, v, retval)
SCARG(&cup, nsa) = SCARG(uap, nsa); SCARG(&cup, nsa) = SCARG(uap, nsa);
SCARG(&cup, osa) = SCARG(uap, osa); SCARG(&cup, osa) = SCARG(uap, osa);
return svr4_sys_sigaction(p, &cup, retval); return svr4_sys_sigaction(l, &cup, retval);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_stat.c,v 1.6 2003/01/18 07:44:51 thorpej Exp $ */ /* $NetBSD: irix_stat.c,v 1.7 2003/01/22 12:58:23 rafal Exp $ */
/*- /*-
* Copyright (c) 2001 The NetBSD Foundation, Inc. * Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.6 2003/01/18 07:44:51 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.7 2003/01/22 12:58:23 rafal Exp $");
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/types.h> #include <sys/types.h>
@ -128,8 +128,8 @@ bsd_to_irix_stat64(bsp, isp)
} }
int int
irix_sys_xstat(p, v, retval) irix_sys_xstat(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -138,6 +138,7 @@ irix_sys_xstat(p, v, retval)
syscallarg(const char *) path; syscallarg(const char *) path;
syscallarg(struct stat *) buf; syscallarg(struct stat *) buf;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct sys___stat13_args cup; struct sys___stat13_args cup;
struct stat st; struct stat st;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
@ -147,7 +148,7 @@ irix_sys_xstat(p, v, retval)
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path); SCARG(&cup, path) = SCARG(uap, path);
if ((error = sys___stat13(p, &cup, retval)) != 0) if ((error = sys___stat13(l, &cup, retval)) != 0)
return error; return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@ -185,8 +186,8 @@ irix_sys_xstat(p, v, retval)
} }
int int
irix_sys_lxstat(p, v, retval) irix_sys_lxstat(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -195,6 +196,7 @@ irix_sys_lxstat(p, v, retval)
syscallarg(const char *) path; syscallarg(const char *) path;
syscallarg(struct stat *) buf; syscallarg(struct stat *) buf;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct sys___lstat13_args cup; struct sys___lstat13_args cup;
struct stat st; struct stat st;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);
@ -204,7 +206,7 @@ irix_sys_lxstat(p, v, retval)
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path); SCARG(&cup, path) = SCARG(uap, path);
if ((error = sys___lstat13(p, &cup, retval)) != 0) if ((error = sys___lstat13(l, &cup, retval)) != 0)
return error; return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@ -242,8 +244,8 @@ irix_sys_lxstat(p, v, retval)
} }
int int
irix_sys_fxstat(p, v, retval) irix_sys_fxstat(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -252,6 +254,7 @@ irix_sys_fxstat(p, v, retval)
syscallarg(const int) fd; syscallarg(const int) fd;
syscallarg(struct stat *) buf; syscallarg(struct stat *) buf;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
struct sys___fstat13_args cup; struct sys___fstat13_args cup;
struct stat st; struct stat st;
int error; int error;
@ -260,7 +263,7 @@ irix_sys_fxstat(p, v, retval)
SCARG(&cup, sb) = stackgap_alloc(p, &sg, sizeof(struct stat)); SCARG(&cup, sb) = stackgap_alloc(p, &sg, sizeof(struct stat));
SCARG(&cup, fd) = SCARG(uap, fd); SCARG(&cup, fd) = SCARG(uap, fd);
if ((error = sys___fstat13(p, &cup, retval)) != 0) if ((error = sys___fstat13(l, &cup, retval)) != 0)
return error; return error;
if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0) if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_swap.c,v 1.8 2003/01/18 07:44:51 thorpej Exp $ */ /* $NetBSD: irix_swap.c,v 1.9 2003/01/22 12:58:23 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_swap.c,v 1.8 2003/01/18 07:44:51 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_swap.c,v 1.9 2003/01/22 12:58:23 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -66,8 +66,8 @@ __KERNEL_RCSID(0, "$NetBSD: irix_swap.c,v 1.8 2003/01/18 07:44:51 thorpej Exp $"
extern struct lock swap_syscall_lock; extern struct lock swap_syscall_lock;
int int
irix_sys_swapctl(p, v, retval) irix_sys_swapctl(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -111,7 +111,7 @@ irix_sys_swapctl(p, v, retval)
SCARG(&cup, arg) = isr.sr_name; SCARG(&cup, arg) = isr.sr_name;
SCARG(&cup, misc) = SCARG(&cup, misc) =
(SCARG(uap, cmd) == IRIX_SC_SGIADD) ? isr.sr_pri : 0; (SCARG(uap, cmd) == IRIX_SC_SGIADD) ? isr.sr_pri : 0;
return sys_swapctl(p, &cup, retval); return sys_swapctl(l, &cup, retval);
break; break;
} }
@ -120,7 +120,7 @@ irix_sys_swapctl(p, v, retval)
SCARG(&cup, cmd) = SWAP_NSWAP; SCARG(&cup, cmd) = SWAP_NSWAP;
SCARG(&cup, arg) = NULL; SCARG(&cup, arg) = NULL;
SCARG(&cup, misc) = 0; SCARG(&cup, misc) = 0;
return sys_swapctl(p, &cup, retval); return sys_swapctl(l, &cup, retval);
break; break;
case IRIX_SC_LIST: { /* Get swap list */ case IRIX_SC_LIST: { /* Get swap list */
@ -197,7 +197,7 @@ bad:
SCARG(&cup, cmd) = SWAP_NSWAP; SCARG(&cup, cmd) = SWAP_NSWAP;
SCARG(&cup, arg) = NULL; SCARG(&cup, arg) = NULL;
SCARG(&cup, misc) = 0; SCARG(&cup, misc) = 0;
if ((error = sys_swapctl(p, &cup, (register_t *)&entries)) != 0) if ((error = sys_swapctl(l, &cup, (register_t *)&entries)) != 0)
return error; return error;
sep = (struct swapent *)malloc( sep = (struct swapent *)malloc(

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_sysmp.c,v 1.8 2002/04/20 21:25:01 manu Exp $ */ /* $NetBSD: irix_sysmp.c,v 1.9 2003/01/22 12:58:23 rafal Exp $ */
/*- /*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc. * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_sysmp.c,v 1.8 2002/04/20 21:25:01 manu Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_sysmp.c,v 1.9 2003/01/22 12:58:23 rafal Exp $");
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/param.h> #include <sys/param.h>
@ -69,8 +69,8 @@ extern struct loadavg averunnable;
extern long irix_kernel_var[32]; extern long irix_kernel_var[32];
int int
irix_sys_sysmp(p, v, retval) irix_sys_sysmp(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -81,6 +81,7 @@ irix_sys_sysmp(p, v, retval)
syscallarg(void *) arg3; syscallarg(void *) arg3;
syscallarg(void *) arg4; syscallarg(void *) arg4;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
int cmd = SCARG(uap, cmd); int cmd = SCARG(uap, cmd);
int error = 0; int error = 0;
caddr_t sg = stackgap_init(p, 0); caddr_t sg = stackgap_init(p, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_syssgi.c,v 1.34 2003/01/18 07:44:51 thorpej Exp $ */ /* $NetBSD: irix_syssgi.c,v 1.35 2003/01/22 12:58:24 rafal Exp $ */
/*- /*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc. * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.34 2003/01/18 07:44:51 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.35 2003/01/22 12:58:24 rafal Exp $");
#if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT)
#include "opt_ddb.h" #include "opt_ddb.h"
@ -88,12 +88,12 @@ void ELFNAME(load_psection)(struct exec_vmcmd_set *, struct vnode *,
static int irix_syssgi_mapelf __P((int, Elf_Phdr *, int, static int irix_syssgi_mapelf __P((int, Elf_Phdr *, int,
struct proc *, register_t *)); struct proc *, register_t *));
static int irix_syssgi_sysconf __P((int name, struct proc *, register_t *)); static int irix_syssgi_sysconf __P((int name, struct lwp *, register_t *));
static int irix_syssgi_pathconf __P((char *, int, struct proc *, register_t *)); static int irix_syssgi_pathconf __P((char *, int, struct lwp *, register_t *));
int int
irix_sys_syssgi(p, v, retval) irix_sys_syssgi(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -105,6 +105,7 @@ irix_sys_syssgi(p, v, retval)
syscallarg(void *) arg4; syscallarg(void *) arg4;
syscallarg(void *) arg5; syscallarg(void *) arg5;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
int request = SCARG(uap, request); int request = SCARG(uap, request);
void *arg1, *arg2, *arg3; void *arg1, *arg2, *arg3;
@ -121,7 +122,7 @@ irix_sys_syssgi(p, v, retval)
SCARG(&cup, gidsetsize) = (int)SCARG(uap, arg1); SCARG(&cup, gidsetsize) = (int)SCARG(uap, arg1);
SCARG(&cup, gidset) = (gid_t *)SCARG(uap, arg2); SCARG(&cup, gidset) = (gid_t *)SCARG(uap, arg2);
return (sys_setgroups(p, &cup, retval)); return (sys_setgroups(l, &cup, retval));
break; break;
} }
@ -130,19 +131,19 @@ irix_sys_syssgi(p, v, retval)
SCARG(&cup, gidsetsize) = (int)SCARG(uap, arg1); SCARG(&cup, gidsetsize) = (int)SCARG(uap, arg1);
SCARG(&cup, gidset) = (gid_t *)SCARG(uap, arg2); SCARG(&cup, gidset) = (gid_t *)SCARG(uap, arg2);
return (sys_getgroups(p, &cup, retval)); return (sys_getgroups(l, &cup, retval));
break; break;
} }
case IRIX_SGI_SETSID: /* Set session ID: setsid(2) */ case IRIX_SGI_SETSID: /* Set session ID: setsid(2) */
return (sys_setsid(p, NULL, retval)); return (sys_setsid(l, NULL, retval));
break; break;
case IRIX_SGI_GETSID: { /* Get session ID: getsid(2) */ case IRIX_SGI_GETSID: { /* Get session ID: getsid(2) */
struct sys_getsid_args cup; struct sys_getsid_args cup;
SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1); SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1);
return (sys_getsid(p, &cup, retval)); return (sys_getsid(l, &cup, retval));
break; break;
} }
@ -150,7 +151,7 @@ irix_sys_syssgi(p, v, retval)
struct sys_getpgid_args cup; struct sys_getpgid_args cup;
SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1); SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1);
return (sys_getpgid(p, &cup, retval)); return (sys_getpgid(l, &cup, retval));
break; break;
} }
@ -159,13 +160,13 @@ irix_sys_syssgi(p, v, retval)
SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1); SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1);
SCARG(&cup, pgid) = (pid_t)SCARG(uap, arg2); SCARG(&cup, pgid) = (pid_t)SCARG(uap, arg2);
return (sys_setpgid(p, &cup, retval)); return (sys_setpgid(l, &cup, retval));
break; break;
} }
case IRIX_SGI_PATHCONF: /* Get file limits: pathconf(3) */ case IRIX_SGI_PATHCONF: /* Get file limits: pathconf(3) */
return irix_syssgi_pathconf((char *)SCARG(uap, arg1), return irix_syssgi_pathconf((char *)SCARG(uap, arg1),
(int)SCARG(uap, arg2), p, retval); (int)SCARG(uap, arg2), l, retval);
break; break;
case IRIX_SGI_RUSAGE: { /* BSD getrusage(2) */ case IRIX_SGI_RUSAGE: { /* BSD getrusage(2) */
@ -173,7 +174,7 @@ irix_sys_syssgi(p, v, retval)
SCARG(&cup, who) = (int)SCARG(uap, arg1); SCARG(&cup, who) = (int)SCARG(uap, arg1);
SCARG(&cup, rusage) = (struct rusage *)SCARG(uap, arg2); SCARG(&cup, rusage) = (struct rusage *)SCARG(uap, arg2);
return sys_getrusage(p, &cup, retval); return sys_getrusage(l, &cup, retval);
break; break;
} }
@ -263,7 +264,7 @@ irix_sys_syssgi(p, v, retval)
case IRIX_SGI_SYSCONF: /* POSIX sysconf */ case IRIX_SGI_SYSCONF: /* POSIX sysconf */
arg1 = SCARG(uap, arg1); /* system variable name */ arg1 = SCARG(uap, arg1); /* system variable name */
return irix_syssgi_sysconf((int)arg1, p, retval); return irix_syssgi_sysconf((int)arg1, l, retval);
break; break;
case IRIX_SGI_SATCTL: /* control audit stream */ case IRIX_SGI_SATCTL: /* control audit stream */
@ -456,11 +457,12 @@ bad:
static int static int
irix_syssgi_sysconf(name, p, retval) irix_syssgi_sysconf(name, l, retval)
int name; int name;
struct proc *p; struct lwp *l;
register_t *retval; register_t *retval;
{ {
struct proc *p = l->l_proc;
int error = 0; int error = 0;
int mib[2], value; int mib[2], value;
int len = sizeof(value); int len = sizeof(value);
@ -533,14 +535,14 @@ irix_syssgi_sysconf(name, p, retval)
SCARG(&cup, new) = NULL; SCARG(&cup, new) = NULL;
SCARG(&cup, newlen) = 0; SCARG(&cup, newlen) = 0;
return sys___sysctl(p, &cup, retval); return sys___sysctl(l, &cup, retval);
} }
static int static int
irix_syssgi_pathconf(path, name, p, retval) irix_syssgi_pathconf(path, name, l, retval)
char *path; char *path;
int name; int name;
struct proc *p; struct lwp *l;
register_t *retval; register_t *retval;
{ {
struct sys_pathconf_args cup; struct sys_pathconf_args cup;
@ -575,5 +577,5 @@ irix_syssgi_pathconf(path, name, p, retval)
} }
SCARG(&cup, path) = path; SCARG(&cup, path) = path;
SCARG(&cup, name) = bname; SCARG(&cup, name) = bname;
return sys_pathconf(p, &cup, retval); return sys_pathconf(l, &cup, retval);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_systeminfo.c,v 1.6 2003/01/18 07:44:52 thorpej Exp $ */ /* $NetBSD: irix_systeminfo.c,v 1.7 2003/01/22 12:58:24 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_systeminfo.c,v 1.6 2003/01/18 07:44:52 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_systeminfo.c,v 1.7 2003/01/22 12:58:24 rafal Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -77,8 +77,8 @@ char irix_si_version[128] = "04131232";
#define BUF_SIZE 16 #define BUF_SIZE 16
int int
irix_sys_systeminfo(p, v, retval) irix_sys_systeminfo(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -87,6 +87,7 @@ irix_sys_systeminfo(p, v, retval)
syscallarg(char *) buf; syscallarg(char *) buf;
syscallarg(long) len; syscallarg(long) len;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
const char *str = NULL; const char *str = NULL;
char strbuf[BUF_SIZE + 1]; char strbuf[BUF_SIZE + 1];
int error; int error;
@ -161,7 +162,7 @@ irix_sys_systeminfo(p, v, retval)
case SVR4_MIPS_SI_SERIAL: /* Unimplemented yet */ case SVR4_MIPS_SI_SERIAL: /* Unimplemented yet */
default: default:
return svr4_sys_systeminfo(p, v, retval); return svr4_sys_systeminfo(l, v, retval);
break; break;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_usema.c,v 1.8 2002/10/23 09:12:54 jdolecek Exp $ */ /* $NetBSD: irix_usema.c,v 1.9 2003/01/22 12:58:24 rafal Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_usema.c,v 1.8 2002/10/23 09:12:54 jdolecek Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_usema.c,v 1.9 2003/01/22 12:58:24 rafal Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -405,8 +405,8 @@ IRIX_USEMA_VNOP_WRAP(fcntl)
* but it is closely related to it. * but it is closely related to it.
*/ */
int int
irix_sys_usync_cntl(p, v, retval) irix_sys_usync_cntl(l, v, retval)
struct proc *p; struct lwp *l;
void *v; void *v;
register_t *retval; register_t *retval;
{ {
@ -414,6 +414,7 @@ irix_sys_usync_cntl(p, v, retval)
syscallarg(int) cmd; syscallarg(int) cmd;
syscallarg(void *) arg; syscallarg(void *) arg;
} */ *uap = v; } */ *uap = v;
struct proc *p = l->l_proc;
int error; int error;
struct irix_usync_arg iua; struct irix_usync_arg iua;
struct irix_usema_rec *iur; struct irix_usema_rec *iur;