diff --git a/sys/compat/hpux/hpux_compat.c b/sys/compat/hpux/hpux_compat.c index bd9e4ad8c5a4..fefb55bd6ad4 100644 --- a/sys/compat/hpux/hpux_compat.c +++ b/sys/compat/hpux/hpux_compat.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: hpux_compat.c 1.64 93/08/05$ * * from: @(#)hpux_compat.c 8.4 (Berkeley) 2/13/94 - * $Id: hpux_compat.c,v 1.11 1994/05/25 11:55:06 mycroft Exp $ + * $Id: hpux_compat.c,v 1.12 1994/10/20 04:47:31 cgd Exp $ */ /* @@ -116,20 +116,23 @@ short bsdtohpuxerrnomap[NERR] = { /*80*/ BERR,BERR, 11 }; -notimp(p, uap, retval, code, nargs) +notimp(p, uap, retval, code, nargs, argsize) struct proc *p; - int *uap, *retval; - int code, nargs; + void *uap; + register_t *retval; + int code, nargs, argsize; { int error = 0; #ifdef DEBUG - register int *argp = uap; + register register_t *argp = uap; extern char *hpux_syscallnames[]; printf("HP-UX %s(", hpux_syscallnames[code]); - if (nargs) - while (nargs--) - printf("%x%c", *argp++, nargs? ',' : ')'); + if (argsize) + while (argsize) { + argsize -= sizeof *uap; + printf("%x%c", *argp++, argsize ? ',' : ')'); + } else printf(")"); printf("\n"); @@ -154,7 +157,7 @@ notimp(p, uap, retval, code, nargs) hpux_fork(p, uap, retval) struct proc *p; struct hpux_wait3_args *uap; - int *retval; + register_t *retval; { int error; @@ -167,8 +170,7 @@ hpux_fork(p, uap, retval) hpux_vfork(p, uap, retval) struct proc *p; struct hpux_wait3_args *uap; - int *retval; - + register_t *retval; { int error; @@ -186,11 +188,11 @@ struct hpux_execv_args { hpux_execv(p, uap, retval) struct proc *p; struct hpux_execv_args *uap; - int *retval; + register_t *retval; { extern int execve(); - uap->envp = NULL; + SCARG(uap, envp) = NULL; return (execve(p, uap, retval)); } @@ -208,14 +210,14 @@ struct hpux_wait3_args { hpux_wait3(p, uap, retval) struct proc *p; struct hpux_wait3_args *uap; - int *retval; + register_t *retval; { /* rusage pointer must be zero */ - if (uap->rusage) + if (SCARG(uap, rusage)) return (EINVAL); p->p_md.md_regs[PS] = PSL_ALLCC; - p->p_md.md_regs[R0] = uap->options; - p->p_md.md_regs[R1] = uap->rusage; + p->p_md.md_regs[R0] = SCARG(uap, options); + p->p_md.md_regs[R1] = SCARG(uap, rusage); return (hpux_wait(p, uap, retval)); } @@ -225,11 +227,11 @@ struct hpux_wait_args { hpux_wait(p, uap, retval) struct proc *p; struct hpux_wait_args *uap; - int *retval; + register_t *retval; { int sig, *statp, error; - statp = uap->status; /* owait clobbers first arg */ + statp = SCARG(uap, status); /* owait clobbers first arg */ error = owait(p, uap, retval); /* * HP-UX wait always returns EINTR when interrupted by a signal @@ -261,11 +263,11 @@ struct hpux_waitpid_args { hpux_waitpid(p, uap, retval) struct proc *p; struct hpux_waitpid_args *uap; - int *retval; + register_t *retval; { int rv, sig, xstat, error; - uap->rusage = 0; + SCARG(uap, rusage) = 0; error = wait4(p, uap, retval); /* * HP-UX wait always returns EINTR when interrupted by a signal @@ -275,13 +277,13 @@ hpux_waitpid(p, uap, retval) error = EINTR; if (error) return (error); - if (uap->status) { + if (SCARG(uap, status)) { /* * Wait4 already wrote the status out to user space, * pull it back, change the signal portion, and write * it back out. */ - rv = fuword((caddr_t)uap->status); + rv = fuword((caddr_t)SCARG(uap, status)); if (WIFSTOPPED(rv)) { sig = WSTOPSIG(rv); rv = W_STOPCODE(bsdtohpuxsig(sig)); @@ -291,7 +293,7 @@ hpux_waitpid(p, uap, retval) rv = W_EXITCODE(xstat, bsdtohpuxsig(sig)) | WCOREDUMP(rv); } - (void)suword((caddr_t)uap->status, rv); + (void)suword((caddr_t)SCARG(uap, status), rv); } return (error); } @@ -306,7 +308,7 @@ struct hpux_creat_args { hpux_creat(p, uap, retval) struct proc *p; register struct hpux_creat_args *uap; - int *retval; + register_t *retval; { struct nargs { char *fname; @@ -314,8 +316,8 @@ hpux_creat(p, uap, retval) int crtmode; } openuap; - openuap.fname = uap->fname; - openuap.crtmode = uap->fmode; + openuap.fname = SCARG(uap, fname); + openuap.crtmode = SCARG(uap, fmode); openuap.mode = O_WRONLY | O_CREAT | O_TRUNC; return (open(p, &openuap, retval)); } @@ -343,12 +345,12 @@ struct hpux_open_args { hpux_open(p, uap, retval) struct proc *p; register struct hpux_open_args *uap; - int *retval; + register_t *retval; { int mode, error; - mode = uap->mode; - uap->mode &= + mode = SCARG(uap, mode); + SCARG(uap, mode) &= ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFEXCL|HPUXFTRUNC|HPUXFCREAT); if (mode & HPUXFCREAT) { /* @@ -358,19 +360,19 @@ hpux_open(p, uap, retval) * proper error). */ if ((mode & HPUXFEXCL) || (FFLAGS(mode) & FWRITE)) - uap->mode |= O_CREAT; + SCARG(uap, mode) |= O_CREAT; } if (mode & HPUXFTRUNC) - uap->mode |= O_TRUNC; + SCARG(uap, mode) |= O_TRUNC; if (mode & HPUXFEXCL) - uap->mode |= O_EXCL; + SCARG(uap, mode) |= O_EXCL; if (mode & HPUXNONBLOCK) - uap->mode |= O_NDELAY; + SCARG(uap, mode) |= O_NDELAY; error = open(p, uap, retval); /* * Record non-blocking mode for fcntl, read, write, etc. */ - if (error == 0 && (uap->mode & O_NDELAY)) + if (error == 0 && (SCARG(uap, mode) & O_NDELAY)) p->p_fd->fd_ofileflags[*retval] |= (mode & HPUXNONBLOCK) ? UF_NONBLOCK_ON : UF_FNDELAY_ON; return (error); @@ -384,7 +386,7 @@ struct hpux_fcntl_args { hpux_fcntl(p, uap, retval) struct proc *p; register struct hpux_fcntl_args *uap; - int *retval; + register_t *retval; { int mode, error, flg = F_POSIX; struct file *fp; @@ -393,25 +395,25 @@ hpux_fcntl(p, uap, retval) struct flock fl; struct vnode *vp; - if ((unsigned)uap->fdes >= p->p_fd->fd_nfiles || - (fp = p->p_fd->fd_ofiles[uap->fdes]) == NULL) + if ((unsigned)SCARG(uap, fdes) >= p->p_fd->fd_nfiles || + (fp = p->p_fd->fd_ofiles[SCARG(uap, fdes)]) == NULL) return (EBADF); - pop = &p->p_fd->fd_ofileflags[uap->fdes]; - switch (uap->cmd) { + pop = &p->p_fd->fd_ofileflags[SCARG(uap, fdes)]; + switch (SCARG(uap, cmd)) { case F_SETFL: - if (uap->arg & HPUXNONBLOCK) + if (SCARG(uap, arg) & HPUXNONBLOCK) *pop |= UF_NONBLOCK_ON; else *pop &= ~UF_NONBLOCK_ON; - if (uap->arg & HPUXNDELAY) + if (SCARG(uap, arg) & HPUXNDELAY) *pop |= UF_FNDELAY_ON; else *pop &= ~UF_FNDELAY_ON; if (*pop & (UF_NONBLOCK_ON|UF_FNDELAY_ON|UF_FIONBIO_ON)) - uap->arg |= FNONBLOCK; + SCARG(uap, arg) |= FNONBLOCK; else - uap->arg &= ~FNONBLOCK; - uap->arg &= ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFREMOTE); + SCARG(uap, arg) &= ~FNONBLOCK; + SCARG(uap, arg) &= ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFREMOTE); break; case F_GETFL: case F_DUPFD: @@ -428,7 +430,8 @@ hpux_fcntl(p, uap, retval) return (EBADF); vp = (struct vnode *)fp->f_data; /* Copy in the lock structure */ - error = copyin((caddr_t)uap->arg, (caddr_t)&hfl, sizeof (hfl)); + error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&hfl, + sizeof (hfl)); if (error) return (error); fl.l_start = hfl.hl_start; @@ -465,7 +468,8 @@ hpux_fcntl(p, uap, retval) return (EBADF); vp = (struct vnode *)fp->f_data; /* Copy in the lock structure */ - error = copyin((caddr_t)uap->arg, (caddr_t)&hfl, sizeof (hfl)); + error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&hfl, + sizeof (hfl)); if (error) return (error); fl.l_start = hfl.hl_start; @@ -482,13 +486,14 @@ hpux_fcntl(p, uap, retval) hfl.hl_pid = fl.l_pid; hfl.hl_type = fl.l_type; hfl.hl_whence = fl.l_whence; - return (copyout((caddr_t)&hfl, (caddr_t)uap->arg, sizeof (hfl))); + return (copyout((caddr_t)&hfl, (caddr_t)SCARG(uap, arg), + sizeof (hfl))); default: return (EINVAL); } error = fcntl(p, uap, retval); - if (error == 0 && uap->cmd == F_GETFL) { + if (error == 0 && SCARG(uap, cmd) == F_GETFL) { mode = *retval; *retval &= ~(O_CREAT|O_TRUNC|O_EXCL); if (mode & FNONBLOCK) { @@ -523,13 +528,13 @@ struct hpux_rw_args { hpux_read(p, uap, retval) struct proc *p; struct hpux_rw_args *uap; - int *retval; + register_t *retval; { int error; error = read(p, uap, retval); if (error == EWOULDBLOCK) { - char *fp = &p->p_fd->fd_ofileflags[uap->fd]; + char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)]; if (*fp & UF_NONBLOCK_ON) { *retval = -1; @@ -545,13 +550,13 @@ hpux_read(p, uap, retval) hpux_write(p, uap, retval) struct proc *p; struct hpux_rw_args *uap; - int *retval; + register_t *retval; { int error; error = write(p, uap, retval); if (error == EWOULDBLOCK) { - char *fp = &p->p_fd->fd_ofileflags[uap->fd]; + char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)]; if (*fp & UF_NONBLOCK_ON) { *retval = -1; @@ -567,13 +572,13 @@ hpux_write(p, uap, retval) hpux_readv(p, uap, retval) struct proc *p; struct hpux_rw_args *uap; - int *retval; + register_t *retval; { int error; error = readv(p, uap, retval); if (error == EWOULDBLOCK) { - char *fp = &p->p_fd->fd_ofileflags[uap->fd]; + char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)]; if (*fp & UF_NONBLOCK_ON) { *retval = -1; @@ -589,13 +594,13 @@ hpux_readv(p, uap, retval) hpux_writev(p, uap, retval) struct proc *p; struct hpux_rw_args *uap; - int *retval; + register_t *retval; { int error; error = writev(p, uap, retval); if (error == EWOULDBLOCK) { - char *fp = &p->p_fd->fd_ofileflags[uap->fd]; + char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)]; if (*fp & UF_NONBLOCK_ON) { *retval = -1; @@ -618,19 +623,20 @@ struct hpux_dup_args { hpux_dup(p, uap, retval) struct proc *p; register struct hpux_dup_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; struct file *fp; int fd, error; - if (((unsigned)uap->i) >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[uap->i]) == NULL) + if (((unsigned)SCARG(uap, i)) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[SCARG(uap, i)]) == NULL) return (EBADF); if (error = fdalloc(p, 0, &fd)) return (error); fdp->fd_ofiles[fd] = fp; - fdp->fd_ofileflags[fd] = fdp->fd_ofileflags[uap->i] &~ UF_EXCLOSE; + fdp->fd_ofileflags[fd] = + fdp->fd_ofileflags[SCARG(uap, i)] &~ UF_EXCLOSE; fp->f_count++; if (fd > fdp->fd_lastfile) fdp->fd_lastfile = fd; @@ -646,12 +652,12 @@ struct hpux_utssys_args { hpux_utssys(p, uap, retval) struct proc *p; register struct hpux_utssys_args *uap; - int *retval; + register_t *retval; { register int i; int error; - switch (uap->request) { + switch (SCARG(uap, request)) { /* uname */ case 0: /* fill in machine type */ @@ -694,17 +700,17 @@ hpux_utssys(p, uap, retval) for (i = 0; i < 8 && hostname[i] != '.'; i++) proto_utsname.nodename[i] = hostname[i]; proto_utsname.nodename[i] = '\0'; - error = copyout((caddr_t)&proto_utsname, (caddr_t)uap->uts, - sizeof(struct hpux_utsname)); + error = copyout((caddr_t)&proto_utsname, + (caddr_t)SCARG(uap, uts), sizeof(struct hpux_utsname)); break; /* gethostname */ case 5: - /* uap->dev is length */ - if (uap->dev > hostnamelen + 1) - uap->dev = hostnamelen + 1; - error = copyout((caddr_t)hostname, (caddr_t)uap->uts, - uap->dev); + /* SCARG(uap, dev) is length */ + if (SCARG(uap, dev) > hostnamelen + 1) + SCARG(uap, dev) = hostnamelen + 1; + error = copyout((caddr_t)hostname, (caddr_t)SCARG(uap, uts), + SCARG(uap, dev)); break; case 1: /* ?? */ @@ -724,9 +730,9 @@ struct hpux_sysconf_args { hpux_sysconf(p, uap, retval) struct proc *p; struct hpux_sysconf_args *uap; - int *retval; + register_t *retval; { - switch (uap->name) { + switch (SCARG(uap, name)) { /* clock ticks per second */ case HPUX_SYSCONF_CLKTICK: @@ -759,7 +765,8 @@ hpux_sysconf(p, uap, retval) } break; default: - uprintf("HP-UX sysconf(%d) not implemented\n", uap->name); + uprintf("HP-UX sysconf(%d) not implemented\n", + SCARG(uap, name)); return (EINVAL); } return (0); @@ -772,9 +779,9 @@ struct hpux_stat_args { hpux_stat(p, uap, retval) struct proc *p; struct hpux_stat_args *uap; - int *retval; + register_t *retval; { - return (hpux_stat1(uap->fname, uap->hsb, FOLLOW, p)); + return (hpux_stat1(SCARG(uap, fname), SCARG(uap, hsb), FOLLOW, p)); } struct hpux_lstat_args { @@ -784,9 +791,9 @@ struct hpux_lstat_args { hpux_lstat(p, uap, retval) struct proc *p; struct hpux_lstat_args *uap; - int *retval; + register_t *retval; { - return (hpux_stat1(uap->fname, uap->hsb, NOFOLLOW, p)); + return (hpux_stat1(SCARG(uap, fname), SCARG(uap, hsb), NOFOLLOW, p)); } struct hpux_fstat_args { @@ -796,15 +803,15 @@ struct hpux_fstat_args { hpux_fstat(p, uap, retval) struct proc *p; register struct hpux_fstat_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct file *fp; struct stat sb; int error; - if (((unsigned)uap->fdes) >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[uap->fdes]) == NULL) + if (((unsigned)SCARG(uap, fdes)) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[SCARG(uap, fdes)]) == NULL) return (EBADF); switch (fp->f_type) { @@ -823,7 +830,7 @@ hpux_fstat(p, uap, retval) } /* is this right for sockets?? */ if (error == 0) - error = bsdtohpuxstat(&sb, uap->hsb); + error = bsdtohpuxstat(&sb, SCARG(uap, hsb)); return (error); } @@ -834,19 +841,19 @@ struct hpux_ulimit_args { hpux_ulimit(p, uap, retval) struct proc *p; register struct hpux_ulimit_args *uap; - long *retval; + register_t *retval; { struct rlimit *limp; int error = 0; limp = &p->p_rlimit[RLIMIT_FSIZE]; - switch (uap->cmd) { + switch (SCARG(uap, cmd)) { case 2: - uap->newlimit *= 512; - if (uap->newlimit > limp->rlim_max && + SCARG(uap, newlimit) *= 512; + if (SCARG(uap, newlimit) > limp->rlim_max && (error = suser(p->p_ucred, &p->p_acflag))) break; - limp->rlim_cur = limp->rlim_max = uap->newlimit; + limp->rlim_cur = limp->rlim_max = SCARG(uap, newlimit); /* else fall into... */ case 1: @@ -876,24 +883,25 @@ struct hpux_rtprio_args { hpux_rtprio(cp, uap, retval) struct proc *cp; register struct hpux_rtprio_args *uap; - int *retval; + register_t *retval; { struct proc *p; int nice, error; - if (uap->prio < RTPRIO_MIN && uap->prio > RTPRIO_MAX && - uap->prio != RTPRIO_NOCHG && uap->prio != RTPRIO_RTOFF) + if (SCARG(uap, prio) < RTPRIO_MIN && SCARG(uap, prio) > RTPRIO_MAX && + SCARG(uap, prio) != RTPRIO_NOCHG && + SCARG(uap, prio) != RTPRIO_RTOFF) return (EINVAL); - if (uap->pid == 0) + if (SCARG(uap, pid) == 0) p = cp; - else if ((p = pfind(uap->pid)) == 0) + else if ((p = pfind(SCARG(uap, pid))) == 0) return (ESRCH); nice = p->p_nice; if (nice < NZERO) *retval = (nice + 16) << 3; else *retval = RTPRIO_RTOFF; - switch (uap->prio) { + switch (SCARG(uap, prio)) { case RTPRIO_NOCHG: return (0); @@ -905,7 +913,7 @@ hpux_rtprio(cp, uap, retval) break; default: - nice = (uap->prio >> 3) - 16; + nice = (SCARG(uap, prio) >> 3) - 16; break; } error = donice(cp, p, nice); @@ -920,11 +928,11 @@ struct hpux_advise_args { hpux_advise(p, uap, retval) struct proc *p; struct hpux_advise_args *uap; - int *retval; + register_t *retval; { int error = 0; - switch (uap->arg) { + switch (SCARG(uap, arg)) { case 0: p->p_md.md_flags |= MDP_HPUXMMAP; break; @@ -950,19 +958,19 @@ struct hpux_ptrace_args { hpux_ptrace(p, uap, retval) struct proc *p; struct hpux_ptrace_args *uap; - int *retval; + register_t *retval; { int error, isps = 0; struct proc *cp; - switch (uap->req) { + switch (SCARG(uap, req)) { /* map signal */ case PT_STEP: case PT_CONTINUE: - if (uap->data) { - uap->data = hpuxtobsdsig(uap->data); - if (uap->data == 0) - uap->data = NSIG; + if (SCARG(uap, data)) { + SCARG(uap, data) = hpuxtobsdsig(SCARG(uap, data)); + if (SCARG(uap, data) == 0) + SCARG(uap, data) = NSIG; } break; /* map u-area offset */ @@ -977,9 +985,10 @@ hpux_ptrace(p, uap, retval) * has the correct value (the child has already trapped * into the kernel). */ - if ((cp = pfind(uap->pid)) == 0) + if ((cp = pfind(SCARG(uap, pid))) == 0) return (ESRCH); - uap->addr = (int *) hpuxtobsduoff(uap->addr, &isps, cp); + SCARG(uap, addr) = + (int *)hpuxtobsduoff(SCARG(uap, addr), &isps, cp); /* * Since HP-UX PS is only 16-bits in ar0, requests @@ -988,8 +997,8 @@ hpux_ptrace(p, uap, retval) * in the low word. Move the PS value to where BSD * expects it. */ - if (isps && uap->req == PT_WRITE_U) - uap->data >>= 16; + if (isps && SCARG(uap, req) == PT_WRITE_U) + SCARG(uap, data) >>= 16; break; } error = ptrace(p, uap, retval); @@ -998,7 +1007,7 @@ hpux_ptrace(p, uap, retval) * Note that we do not return the high part of PC like HP-UX * would, but the HP-UX debuggers don't require it. */ - if (isps && error == 0 && uap->req == PT_READ_U) + if (isps && error == 0 && SCARG(uap, req) == PT_READ_U) *retval <<= 16; return (error); } @@ -1031,7 +1040,7 @@ struct hpux_shmctl_args { hpux_shmctl1(p, uap, retval, isnew) struct proc *p; struct hpux_shmctl_args *uap; - int *retval; + register_t *retval; int isnew; { register struct shmid_ds *shp; @@ -1039,10 +1048,10 @@ hpux_shmctl1(p, uap, retval, isnew) struct hpux_shmid_ds sbuf; int error; - if (error = shmvalid(uap->shmid)) + if (error = shmvalid(SCARG(uap, shmid))) return (error); - shp = &shmsegs[uap->shmid % SHMMMNI]; - switch (uap->cmd) { + shp = &shmsegs[SCARG(uap, shmid) % SHMMMNI]; + switch (SCARG(uap, cmd)) { case SHM_LOCK: case SHM_UNLOCK: /* don't really do anything, but make them think we did */ @@ -1072,7 +1081,8 @@ hpux_shmctl1(p, uap, retval, isnew) sbuf.shm_atime = shp->shm_atime; sbuf.shm_dtime = shp->shm_dtime; sbuf.shm_ctime = shp->shm_ctime; - error = copyout((caddr_t)&sbuf, uap->buf, sizeof sbuf); + error = copyout((caddr_t)&sbuf, SCARG(uap, buf), + sizeof sbuf); } return (error); @@ -1083,7 +1093,7 @@ hpux_shmctl1(p, uap, retval, isnew) cred->cr_uid != shp->shm_perm.cuid) { return (EPERM); } - error = copyin(uap->buf, (caddr_t)&sbuf, sizeof sbuf); + error = copyin(SCARG(uap, buf), (caddr_t)&sbuf, sizeof sbuf); if (error == 0) { shp->shm_perm.uid = sbuf.shm_perm.uid; shp->shm_perm.gid = sbuf.shm_perm.gid; @@ -1111,7 +1121,7 @@ struct hpux_mmap_args { hpux_mmap(p, uap, retval) struct proc *p; struct hpux_mmap_args *uap; - int *retval; + register_t *retval; { struct mmap_args { caddr_t addr; @@ -1123,17 +1133,17 @@ hpux_mmap(p, uap, retval) off_t pos; } nargs; - nargs.addr = uap->addr; - nargs.len = uap->len; - nargs.prot = uap->prot; - nargs.flags = uap->flags & + nargs.addr = SCARG(uap, addr); + nargs.len = SCARG(uap, len); + nargs.prot = SCARG(uap, prot); + nargs.flags = SCARG(uap, flags) & ~(HPUXMAP_FIXED|HPUXMAP_REPLACE|HPUXMAP_ANON); - if (uap->flags & HPUXMAP_FIXED) + if (SCARG(uap, flags) & HPUXMAP_FIXED) nargs.flags |= MAP_FIXED; - if (uap->flags & HPUXMAP_ANON) + if (SCARG(uap, flags) & HPUXMAP_ANON) nargs.flags |= MAP_ANON; - nargs.fd = (nargs.flags & MAP_ANON) ? -1 : uap->fd; - nargs.pos = uap->pos; + nargs.fd = (nargs.flags & MAP_ANON) ? -1 : SCARG(uap, fd); + nargs.pos = SCARG(uap, pos); return (mmap(p, &nargs, retval)); } @@ -1267,7 +1277,7 @@ struct hpux_ioctl_args { hpux_ioctl(p, uap, retval) struct proc *p; register struct hpux_ioctl_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct file *fp; @@ -1278,16 +1288,16 @@ hpux_ioctl(p, uap, retval) char stkbuf[STK_PARAMS]; caddr_t data = stkbuf; - com = uap->cmd; + com = SCARG(uap, cmd); #ifdef COMPAT_OHPUX /* XXX */ if (com == HPUXTIOCGETP || com == HPUXTIOCSETP) - return (getsettty(p, uap->fdes, com, uap->cmarg)); + return (getsettty(p, SCARG(uap, fdes), com, SCARG(uap, cmarg))); #endif - if (((unsigned)uap->fdes) >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[uap->fdes]) == NULL) + if (((unsigned)SCARG(uap, fdes)) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[SCARG(uap, fdes)]) == NULL) return (EBADF); if ((fp->f_flag & (FREAD|FWRITE)) == 0) return (EBADF); @@ -1306,14 +1316,14 @@ hpux_ioctl(p, uap, retval) } if (com&IOC_IN) { if (size) { - error = copyin(uap->cmarg, data, (u_int)size); + error = copyin(SCARG(uap, cmarg), data, (u_int)size); if (error) { if (memp) free(memp, M_IOCTLOPS); return (error); } } else - *(caddr_t *)data = uap->cmarg; + *(caddr_t *)data = SCARG(uap, cmarg); } else if ((com&IOC_OUT) && size) /* * Zero the buffer so the user always @@ -1321,13 +1331,13 @@ hpux_ioctl(p, uap, retval) */ bzero(data, size); else if (com&IOC_VOID) - *(caddr_t *)data = uap->cmarg; + *(caddr_t *)data = SCARG(uap, cmarg); switch (com) { case HPUXFIOSNBIO: { - char *ofp = &fdp->fd_ofileflags[uap->fdes]; + char *ofp = &fdp->fd_ofileflags[SCARG(uap, fdes)]; int tmp; if (*(int *)data) @@ -1385,7 +1395,7 @@ hpux_ioctl(p, uap, retval) case HPUXTCSETATTR: case HPUXTCSETATTRD: case HPUXTCSETATTRF: - error = hpux_termio(uap->fdes, com, data, p); + error = hpux_termio(SCARG(uap, fdes), com, data, p); break; default: @@ -1397,7 +1407,7 @@ hpux_ioctl(p, uap, retval) * already set and checked above. */ if (error == 0 && (com&IOC_OUT) && size) - error = copyout(data, uap->cmarg, (u_int)size); + error = copyout(data, SCARG(uap, cmarg), (u_int)size); if (memp) free(memp, M_IOCTLOPS); return (error); @@ -1413,24 +1423,24 @@ struct hpux_getcontext_args { hpux_getcontext(p, uap, retval) struct proc *p; struct hpux_getcontext_args *uap; - int *retval; + register_t *retval; { int error = 0; register int len; #if defined(HP380) if (machineid == HP_380) { - len = min(uap->len, sizeof(hpux_040context)); + len = min(SCARG(uap, len), sizeof(hpux_040context)); if (len) - error = copyout(hpux_040context, uap->buf, len); + error = copyout(hpux_040context, SCARG(uap, buf), len); if (error == 0) *retval = sizeof(hpux_040context); return (error); } #endif - len = min(uap->len, sizeof(hpux_context)); + len = min(SCARG(uap, len), sizeof(hpux_context)); if (len) - error = copyout(hpux_context, uap->buf, (u_int)len); + error = copyout(hpux_context, SCARG(uap, buf), (u_int)len); if (error == 0) *retval = sizeof(hpux_context); return (error); @@ -1446,13 +1456,13 @@ struct hpux_getpgrp2_args { hpux_getpgrp2(cp, uap, retval) struct proc *cp; register struct hpux_getpgrp2_args *uap; - int *retval; + register_t *retval; { register struct proc *p; - if (uap->pid == 0) - uap->pid = cp->p_pid; - p = pfind(uap->pid); + if (SCARG(uap, pid) == 0) + SCARG(uap, pid) = cp->p_pid; + p = pfind(SCARG(uap, pid)); if (p == 0) return (ESRCH); if (cp->p_ucred->cr_uid && p->p_ucred->cr_uid != cp->p_ucred->cr_uid && @@ -1473,10 +1483,10 @@ struct hpux_setpgrp2_args { hpux_setpgrp2(p, uap, retval) struct proc *p; struct hpux_setpgrp2_args *uap; - int *retval; + register_t *retval; { /* empirically determined */ - if (uap->pgrp < 0 || uap->pgrp >= 30000) + if (SCARG(uap, pgrp) < 0 || SCARG(uap, pgrp) >= 30000) return (EINVAL); return (setpgid(p, uap, retval)); } @@ -1492,7 +1502,7 @@ struct hpux_setresuid_args { hpux_setresuid(p, uap, retval) struct proc *p; struct hpux_setresuid_args *uap; - int *retval; + register_t *retval; { return (osetreuid(p, uap, retval)); } @@ -1505,7 +1515,7 @@ struct hpux_setresgid_args { hpux_setresgid(p, uap, retval) struct proc *p; struct hpux_setresgid_args *uap; - int *retval; + register_t *retval; { return (osetregid(p, uap, retval)); } @@ -1517,24 +1527,24 @@ struct hpux_rlimit_args { hpux_getrlimit(p, uap, retval) struct proc *p; struct hpux_rlimit_args *uap; - int *retval; + register_t *retval; { - if (uap->which > HPUXRLIMIT_NOFILE) + if (SCARG(uap, which) > HPUXRLIMIT_NOFILE) return (EINVAL); - if (uap->which == HPUXRLIMIT_NOFILE) - uap->which = RLIMIT_NOFILE; + if (SCARG(uap, which) == HPUXRLIMIT_NOFILE) + SCARG(uap, which) = RLIMIT_NOFILE; return (ogetrlimit(p, uap, retval)); } hpux_setrlimit(p, uap, retval) struct proc *p; struct hpux_rlimit_args *uap; - int *retval; + register_t *retval; { - if (uap->which > HPUXRLIMIT_NOFILE) + if (SCARG(uap, which) > HPUXRLIMIT_NOFILE) return (EINVAL); - if (uap->which == HPUXRLIMIT_NOFILE) - uap->which = RLIMIT_NOFILE; + if (SCARG(uap, which) == HPUXRLIMIT_NOFILE) + SCARG(uap, which) = RLIMIT_NOFILE; return (osetrlimit(p, uap, retval)); } @@ -1549,7 +1559,7 @@ struct hpux_lockf_args { hpux_lockf(p, uap, retval) struct proc *p; struct hpux_lockf_args *uap; - int *retval; + register_t *retval; { return (0); } @@ -1565,7 +1575,7 @@ struct hpux_getaccess_args { hpux_getaccess(p, uap, retval) register struct proc *p; register struct hpux_getaccess_args *uap; - int *retval; + register_t *retval; { int lgroups[NGROUPS]; int error = 0; @@ -1577,7 +1587,7 @@ hpux_getaccess(p, uap, retval) * Build an appropriate credential structure */ cred = crdup(p->p_ucred); - switch (uap->uid) { + switch (SCARG(uap, uid)) { case 65502: /* UID_EUID */ break; case 65503: /* UID_RUID */ @@ -1587,12 +1597,12 @@ hpux_getaccess(p, uap, retval) error = EINVAL; break; default: - if (uap->uid > 65504) + if (SCARG(uap, uid) > 65504) error = EINVAL; - cred->cr_uid = uap->uid; + cred->cr_uid = SCARG(uap, uid); break; } - switch (uap->ngroups) { + switch (SCARG(uap, ngroups)) { case -1: /* NGROUPS_EGID */ cred->cr_ngroups = 1; break; @@ -1616,18 +1626,19 @@ hpux_getaccess(p, uap, retval) error = EINVAL; break; default: - if (uap->ngroups > 0 && uap->ngroups <= NGROUPS) - error = copyin((caddr_t)uap->gidset, + if (SCARG(uap, ngroups) > 0 && SCARG(uap, ngroups) <= NGROUPS) + error = copyin((caddr_t)SCARG(uap, gidset), (caddr_t)&lgroups[0], - uap->ngroups * sizeof(lgroups[0])); + SCARG(uap, ngroups) * + sizeof(lgroups[0])); else error = EINVAL; if (error == 0) { int gid; - for (gid = 0; gid < uap->ngroups; gid++) + for (gid = 0; gid < SCARG(uap, ngroups); gid++) cred->cr_groups[gid] = lgroups[gid]; - cred->cr_ngroups = uap->ngroups; + cred->cr_ngroups = SCARG(uap, ngroups); } break; } @@ -1636,7 +1647,7 @@ hpux_getaccess(p, uap, retval) */ if (error == 0) { NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, - uap->path, p); + SCARG(uap, path), p); error = namei(&nd); } if (error) { @@ -1884,12 +1895,12 @@ struct ohpux_time_args { ohpux_time(p, uap, retval) struct proc *p; register struct ohpux_time_args *uap; - int *retval; + register_t *retval; { int error = 0; - if (uap->tp) - error = copyout((caddr_t)&time.tv_sec, (caddr_t)uap->tp, + if (SCARG(uap, tp)) + error = copyout((caddr_t)&time.tv_sec, (caddr_t)SCARG(uap, tp), sizeof (long)); *(time_t *)retval = time.tv_sec; return (error); @@ -1901,12 +1912,12 @@ struct ohpux_stime_args { ohpux_stime(p, uap, retval) struct proc *p; register struct ohpux_stime_args *uap; - int *retval; + register_t *retval; { struct timeval tv; int s, error; - tv.tv_sec = uap->time; + tv.tv_sec = SCARG(uap, time); tv.tv_usec = 0; if (error = suser(p->p_ucred, &p->p_acflag)) return (error); @@ -1924,7 +1935,7 @@ struct ohpux_ftime_args { ohpux_ftime(p, uap, retval) struct proc *p; register struct ohpux_ftime_args *uap; - int *retval; + register_t *retval; { struct hpux_timeb tb; int s; @@ -1935,7 +1946,7 @@ ohpux_ftime(p, uap, retval) splx(s); tb.timezone = tz.tz_minuteswest; tb.dstflag = tz.tz_dsttime; - return (copyout((caddr_t)&tb, (caddr_t)uap->tp, sizeof (tb))); + return (copyout((caddr_t)&tb, (caddr_t)SCARG(uap, tp), sizeof (tb))); } struct ohpux_alarm_args { @@ -1944,7 +1955,7 @@ struct ohpux_alarm_args { ohpux_alarm(p, uap, retval) register struct proc *p; register struct ohpux_alarm_args *uap; - int *retval; + register_t *retval; { int s = splhigh(); @@ -1954,13 +1965,13 @@ ohpux_alarm(p, uap, retval) if (timerisset(&p->p_realtimer.it_value) && timercmp(&p->p_realtimer.it_value, &time, >)) *retval = p->p_realtimer.it_value.tv_sec - time.tv_sec; - if (uap->deltat == 0) { + if (SCARG(uap, deltat) == 0) { timerclear(&p->p_realtimer.it_value); splx(s); return (0); } p->p_realtimer.it_value = time; - p->p_realtimer.it_value.tv_sec += uap->deltat; + p->p_realtimer.it_value.tv_sec += SCARG(uap, deltat); timeout(realitexpire, (caddr_t)p, hzto(&p->p_realtimer.it_value)); splx(s); return (0); @@ -1972,11 +1983,11 @@ struct ohpux_nice_args { ohpux_nice(p, uap, retval) register struct proc *p; register struct ohpux_nice_args *uap; - int *retval; + register_t *retval; { int error; - error = donice(p, p, (p->p_nice-NZERO)+uap->niceness); + error = donice(p, p, (p->p_nice-NZERO)+SCARG(uap, niceness)); if (error == 0) *retval = p->p_nice - NZERO; return (error); @@ -1988,7 +1999,7 @@ struct ohpux_times_args { ohpux_times(p, uap, retval) struct proc *p; register struct ohpux_times_args *uap; - int *retval; + register_t *retval; { struct timeval ru, rs; struct tms atms; @@ -1999,7 +2010,8 @@ ohpux_times(p, uap, retval) atms.tms_stime = hpux_scale(&rs); atms.tms_cutime = hpux_scale(&p->p_stats->p_cru.ru_utime); atms.tms_cstime = hpux_scale(&p->p_stats->p_cru.ru_stime); - error = copyout((caddr_t)&atms, (caddr_t)uap->tmsb, sizeof (atms)); + error = copyout((caddr_t)&atms, (caddr_t)SCARG(uap, tmsb), + sizeof (atms)); if (error == 0) *(time_t *)retval = hpux_scale(&time) - hpux_scale(&boottime); return (error); @@ -2027,7 +2039,7 @@ struct ohpux_utime_args { ohpux_utime(p, uap, retval) struct proc *p; register struct ohpux_utime_args *uap; - int *retval; + register_t *retval; { register struct vnode *vp; struct vattr vattr; @@ -2035,8 +2047,9 @@ ohpux_utime(p, uap, retval) int error; struct nameidata nd; - if (uap->tptr) { - error = copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof (tv)); + if (SCARG(uap, tptr)) { + error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv, + sizeof (tv)); if (error) return (error); } else @@ -2046,7 +2059,8 @@ ohpux_utime(p, uap, retval) vattr.va_atime.ts_nsec = 0; vattr.va_mtime.ts_sec = tv[1]; vattr.va_mtime.ts_nsec = 0; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->fname, p); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, + SCARG(uap, fname), p); if (error = namei(&nd)) return (error); vp = nd.ni_vp; @@ -2077,17 +2091,17 @@ struct ohpux_fstat_args { ohpux_fstat(p, uap, retval) struct proc *p; register struct ohpux_fstat_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; struct file *fp; - if (((unsigned)uap->fd) >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[uap->fd]) == NULL) + if (((unsigned)SCARG(uap, fd)) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL) return (EBADF); if (fp->f_type != DTYPE_VNODE) return (EINVAL); - return (ohpux_stat1((struct vnode *)fp->f_data, uap->sb, p)); + return (ohpux_stat1((struct vnode *)fp->f_data, SCARG(uap, sb), p)); } /* @@ -2100,15 +2114,16 @@ struct ohpux_stat_args { ohpux_stat(p, uap, retval) struct proc *p; register struct ohpux_stat_args *uap; - int *retval; + register_t *retval; { int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->fname, p); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, + SCARG(uap, fname), p); if (error = namei(&nd)) return (error); - error = ohpux_stat1(nd.ni_vp, uap->sb, p); + error = ohpux_stat1(nd.ni_vp, SCARG(uap, sb), p); vput(nd.ni_vp); return (error); } diff --git a/sys/compat/hpux/hpux_net.c b/sys/compat/hpux/hpux_net.c index 43daea0d539f..0b2a61a4b01e 100644 --- a/sys/compat/hpux/hpux_net.c +++ b/sys/compat/hpux/hpux_net.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: hpux_net.c 1.8 93/08/02$ * * from: @(#)hpux_net.c 8.2 (Berkeley) 9/9/93 - * $Id: hpux_net.c,v 1.6 1994/05/23 08:04:18 mycroft Exp $ + * $Id: hpux_net.c,v 1.7 1994/10/20 04:47:33 cgd Exp $ */ /* @@ -105,14 +105,14 @@ struct hpux_netioctl_args { hpux_netioctl(p, uap, retval) struct proc *p; struct hpux_netioctl_args *uap; - int *retval; + register_t *retval; { int *args, i; register int code; int error; - args = uap->args; - code = uap->call - MINBSDIPCCODE; + args = SCARG(uap, args); + code = SCARG(uap, call) - MINBSDIPCCODE; if (code < 0 || code >= NUMBSDIPC || hpuxtobsdipc[code].rout == NULL) return (EINVAL); if ((i = hpuxtobsdipc[code].nargs * sizeof (int)) && @@ -168,42 +168,42 @@ struct hpux_setsockopt_args { hpux_setsockopt(p, uap, retval) struct proc *p; struct hpux_setsockopt_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mbuf *m = NULL; int tmp, error; - if (error = getsock(p->p_fd, uap->s, &fp)) + if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) return (error); - if (uap->valsize > MLEN) + if (SCARG(uap, valsize) > MLEN) return (EINVAL); - if (uap->val) { + if (SCARG(uap, val)) { m = m_get(M_WAIT, MT_SOOPTS); if (m == NULL) return (ENOBUFS); - if (error = copyin(uap->val, mtod(m, caddr_t), - (u_int)uap->valsize)) { + if (error = copyin(SCARG(uap, val), mtod(m, caddr_t), + (u_int)SCARG(uap, valsize))) { (void) m_free(m); return (error); } - if (uap->name == SO_LINGER) { + if (SCARG(uap, name) == SO_LINGER) { tmp = *mtod(m, int *); mtod(m, struct linger *)->l_onoff = 1; mtod(m, struct linger *)->l_linger = tmp; m->m_len = sizeof(struct linger); } else - socksetsize(uap->valsize, m); - } else if (uap->name == ~SO_LINGER) { + socksetsize(SCARG(uap, valsize), m); + } else if (SCARG(uap, name) == ~SO_LINGER) { m = m_get(M_WAIT, MT_SOOPTS); if (m) { - uap->name = SO_LINGER; + SCARG(uap, name) = SO_LINGER; mtod(m, struct linger *)->l_onoff = 0; m->m_len = sizeof(struct linger); } } - return (sosetopt((struct socket *)fp->f_data, uap->level, - uap->name, m)); + return (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), + SCARG(uap, name), m)); } struct hpux_setsockopt2_args { @@ -217,29 +217,29 @@ struct hpux_setsockopt2_args { hpux_setsockopt2(p, uap, retval) struct proc *p; register struct hpux_setsockopt2_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mbuf *m = NULL; int error; - if (error = getsock(p->p_fd, uap->s, &fp)) + if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) return (error); - if (uap->valsize > MLEN) + if (SCARG(uap, valsize) > MLEN) return (EINVAL); - if (uap->val) { + if (SCARG(uap, val)) { m = m_get(M_WAIT, MT_SOOPTS); if (m == NULL) return (ENOBUFS); - if (error = copyin(uap->val, mtod(m, caddr_t), - (u_int)uap->valsize)) { + if (error = copyin(SCARG(uap, val), mtod(m, caddr_t), + (u_int)SCARG(uap, valsize))) { (void) m_free(m); return (error); } - socksetsize(uap->valsize, m); + socksetsize(SCARG(uap, valsize), m); } - return (sosetopt((struct socket *)fp->f_data, uap->level, - uap->name, m)); + return (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), + SCARG(uap, name), m)); } struct hpux_getsockopt_args { @@ -252,25 +252,25 @@ struct hpux_getsockopt_args { hpux_getsockopt(p, uap, retval) struct proc *p; struct hpux_getsockopt_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mbuf *m = NULL; int valsize, error; - if (error = getsock(p->p_fd, uap->s, &fp)) + if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) return (error); - if (uap->val) { - if (error = copyin((caddr_t)uap->avalsize, (caddr_t)&valsize, - sizeof (valsize))) + if (SCARG(uap, val)) { + if (error = copyin((caddr_t)SCARG(uap, avalsize), + (caddr_t)&valsize, sizeof (valsize))) return (error); } else valsize = 0; - if (error = sogetopt((struct socket *)fp->f_data, uap->level, - uap->name, &m)) + if (error = sogetopt((struct socket *)fp->f_data, SCARG(uap, level), + SCARG(uap, name), &m)) goto bad; - if (uap->val && valsize && m != NULL) { - if (uap->name == SO_LINGER) { + if (SCARG(uap, val) && valsize && m != NULL) { + if (SCARG(uap, name) == SO_LINGER) { if (mtod(m, struct linger *)->l_onoff) *mtod(m, int *) = mtod(m, struct linger *)->l_linger; else @@ -279,10 +279,11 @@ hpux_getsockopt(p, uap, retval) } if (valsize > m->m_len) valsize = m->m_len; - error = copyout(mtod(m, caddr_t), uap->val, (u_int)valsize); + error = copyout(mtod(m, caddr_t), SCARG(uap, val), + (u_int)valsize); if (error == 0) error = copyout((caddr_t)&valsize, - (caddr_t)uap->avalsize, sizeof (valsize)); + (caddr_t)SCARG(uap, avalsize), sizeof (valsize)); } bad: if (m != NULL) diff --git a/sys/compat/hpux/hpux_sig.c b/sys/compat/hpux/hpux_sig.c index 1fb46a4c3b21..8c1b192e5046 100644 --- a/sys/compat/hpux/hpux_sig.c +++ b/sys/compat/hpux/hpux_sig.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: hpux_sig.c 1.4 92/01/20$ * * from: @(#)hpux_sig.c 8.2 (Berkeley) 9/23/93 - * $Id: hpux_sig.c,v 1.9 1994/05/23 08:04:19 mycroft Exp $ + * $Id: hpux_sig.c,v 1.10 1994/10/20 04:47:34 cgd Exp $ */ /* @@ -86,7 +86,7 @@ struct hpux_sigvec_args { hpux_sigvec(p, uap, retval) struct proc *p; register struct hpux_sigvec_args *uap; - int *retval; + register_t *retval; { struct sigvec vec; register struct sigacts *ps = p->p_sigacts; @@ -94,11 +94,11 @@ hpux_sigvec(p, uap, retval) register int sig; int bit, error; - sig = hpuxtobsdsig(uap->signo); + sig = hpuxtobsdsig(SCARG(uap, signo)); if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) return (EINVAL); sv = &vec; - if (uap->osv) { + if (SCARG(uap, osv)) { sv->sv_handler = ps->ps_sigact[sig]; sv->sv_mask = ps->ps_catchmask[sig]; bit = sigmask(sig); @@ -112,12 +112,14 @@ hpux_sigvec(p, uap, retval) if (p->p_flag & SOUSIG) sv->sv_flags |= HPUXSV_RESET; /* XXX */ #endif - error = copyout((caddr_t)sv, (caddr_t)uap->osv, sizeof (vec)); + error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv), + sizeof (vec)); if (error) return (error); } - if (uap->nsv) { - error = copyin((caddr_t)uap->nsv, (caddr_t)sv, sizeof (vec)); + if (SCARG(uap, nsv)) { + error = copyin((caddr_t)SCARG(uap, nsv), (caddr_t)sv, + sizeof (vec)); if (error) return (error); if (sig == SIGCONT && sv->sv_handler == SIG_IGN) @@ -139,12 +141,12 @@ struct hpux_sigblock_args { hpux_sigblock(p, uap, retval) register struct proc *p; struct hpux_sigblock_args *uap; - int *retval; + register_t *retval; { (void) splhigh(); *retval = bsdtohpuxmask(p->p_sigmask); - p->p_sigmask |= hpuxtobsdmask(uap->mask) &~ sigcantmask; + p->p_sigmask |= hpuxtobsdmask(SCARG(uap, mask)) &~ sigcantmask; (void) spl0(); return (0); } @@ -155,12 +157,12 @@ struct hpux_sigsetmask_args { hpux_sigsetmask(p, uap, retval) struct proc *p; struct hpux_sigsetmask_args *uap; - int *retval; + register_t *retval; { (void) splhigh(); *retval = bsdtohpuxmask(p->p_sigmask); - p->p_sigmask = hpuxtobsdmask(uap->mask) &~ sigcantmask; + p->p_sigmask = hpuxtobsdmask(SCARG(uap, mask)) &~ sigcantmask; (void) spl0(); return (0); } @@ -171,10 +173,10 @@ struct hpux_sigpause_args { hpux_sigpause(p, uap, retval) struct proc *p; struct hpux_sigpause_args *uap; - int *retval; + register_t *retval; { - uap->mask = hpuxtobsdmask(uap->mask); + SCARG(uap, mask) = hpuxtobsdmask(SCARG(uap, mask)); return (sigsuspend(p, uap, retval)); } @@ -186,13 +188,13 @@ struct hpux_kill_args { hpux_kill(p, uap, retval) struct proc *p; struct hpux_kill_args *uap; - int *retval; + register_t *retval; { - if (uap->signo) { - uap->signo = hpuxtobsdsig(uap->signo); - if (uap->signo == 0) - uap->signo = NSIG; + if (SCARG(uap, signo)) { + SCARG(uap, signo) = hpuxtobsdsig(SCARG(uap, signo)); + if (SCARG(uap, signo) == 0) + SCARG(uap, signo) = NSIG; } return (kill(p, uap, retval)); } @@ -217,7 +219,7 @@ struct hpux_sigprocmask_args { hpux_sigprocmask(p, uap, retval) register struct proc *p; struct hpux_sigprocmask_args *uap; - int *retval; + register_t *retval; { int mask, error = 0; hpux_sigset_t sigset; @@ -226,18 +228,20 @@ hpux_sigprocmask(p, uap, retval) * Copy out old mask first to ensure no errors. * (proc sigmask should not be changed if call fails for any reason) */ - if (uap->oset) { + if (SCARG(uap, oset)) { bzero((caddr_t)&sigset, sizeof(sigset)); sigset.sigset[0] = bsdtohpuxmask(p->p_sigmask); - if (copyout((caddr_t)&sigset, (caddr_t)uap->oset, sizeof(sigset))) + if (copyout((caddr_t)&sigset, (caddr_t)SCARG(uap, oset), + sizeof(sigset))) return (EFAULT); } - if (uap->set) { - if (copyin((caddr_t)uap->set, (caddr_t)&sigset, sizeof(sigset))) + if (SCARG(uap, set)) { + if (copyin((caddr_t)SCARG(uap, set), (caddr_t)&sigset, + sizeof(sigset))) return (EFAULT); mask = hpuxtobsdmask(sigset.sigset[0]); (void) splhigh(); - switch (uap->how) { + switch (SCARG(uap, how)) { case HPUXSIG_BLOCK: p->p_sigmask |= mask &~ sigcantmask; break; @@ -262,12 +266,13 @@ struct hpux_sigpending_args { hpux_sigpending(p, uap, retval) register struct proc *p; struct hpux_sigpending_args *uap; - int *retval; + register_t *retval; { hpux_sigset_t sigset; sigset.sigset[0] = bsdtohpuxmask(p->p_siglist); - return (copyout((caddr_t)&sigset, (caddr_t)uap->set, sizeof(sigset))); + return (copyout((caddr_t)&sigset, (caddr_t)SCARG(uap, set), + sizeof(sigset))); } struct hpux_sigsuspend_args { @@ -276,13 +281,13 @@ struct hpux_sigsuspend_args { hpux_sigsuspend(p, uap, retval) register struct proc *p; struct hpux_sigsuspend_args *uap; - int *retval; + register_t *retval; { register struct sigacts *ps = p->p_sigacts; hpux_sigset_t sigset; int mask; - if (copyin((caddr_t)uap->set, (caddr_t)&sigset, sizeof(sigset))) + if (copyin((caddr_t)SCARG(uap, set), (caddr_t)&sigset, sizeof(sigset))) return (EFAULT); mask = hpuxtobsdmask(sigset.sigset[0]); ps->ps_oldmask = p->p_sigmask; @@ -301,7 +306,7 @@ struct hpux_sigaction_args { hpux_sigaction(p, uap, retval) struct proc *p; register struct hpux_sigaction_args *uap; - int *retval; + register_t *retval; { struct hpux_sigaction action; register struct sigacts *ps = p->p_sigacts; @@ -309,12 +314,12 @@ hpux_sigaction(p, uap, retval) register int sig; int bit; - sig = hpuxtobsdsig(uap->signo); + sig = hpuxtobsdsig(SCARG(uap, signo)); if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) return (EINVAL); sa = &action; - if (uap->osa) { + if (SCARG(uap, osa)) { sa->sa_handler = ps->ps_sigact[sig]; bzero((caddr_t)&sa->sa_mask, sizeof(sa->sa_mask)); sa->sa_mask.sigset[0] = bsdtohpuxmask(ps->ps_catchmask[sig]); @@ -329,13 +334,15 @@ hpux_sigaction(p, uap, retval) #endif if (p->p_flag & P_NOCLDSTOP) sa->sa_flags |= HPUXSA_NOCLDSTOP; - if (copyout((caddr_t)sa, (caddr_t)uap->osa, sizeof (action))) + if (copyout((caddr_t)sa, (caddr_t)SCARG(uap, osa), + sizeof (action))) return (EFAULT); } - if (uap->nsa) { + if (SCARG(uap, nsa)) { struct sigaction act; - if (copyin((caddr_t)uap->nsa, (caddr_t)sa, sizeof (action))) + if (copyin((caddr_t)SCARG(uap, nsa), (caddr_t)sa, + sizeof (action))) return (EFAULT); if (sig == SIGCONT && sa->sa_handler == SIG_IGN) return (EINVAL); @@ -367,14 +374,14 @@ struct ohpux_ssig_args { ohpux_ssig(p, uap, retval) struct proc *p; struct ohpux_ssig_args *uap; - int *retval; + register_t *retval; { register int a; struct sigaction vec; register struct sigaction *sa = &vec; - a = hpuxtobsdsig(uap->signo); - sa->sa_handler = uap->fun; + a = hpuxtobsdsig(SCARG(uap, signo)); + sa->sa_handler = SCARG(uap, fun); /* * Kill processes trying to use job control facilities * (this'll help us find any vestiges of the old stuff). diff --git a/sys/compat/hpux/hpux_tty.c b/sys/compat/hpux/hpux_tty.c index bf392336377f..5a6b9b436cc4 100644 --- a/sys/compat/hpux/hpux_tty.c +++ b/sys/compat/hpux/hpux_tty.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: hpux_tty.c 1.14 93/08/05$ * * from: @(#)hpux_tty.c 8.3 (Berkeley) 1/12/94 - * $Id: hpux_tty.c,v 1.6 1994/05/23 08:04:26 mycroft Exp $ + * $Id: hpux_tty.c,v 1.7 1994/10/20 04:47:36 cgd Exp $ */ /* @@ -470,19 +470,21 @@ struct ohpux_sgtty_args { ohpux_gtty(p, uap, retval) struct proc *p; struct ohpux_sgtty_args *uap; - int *retval; + register_t *retval; { - return (getsettty(p, uap->fdes, HPUXTIOCGETP, uap->cmarg)); + return (getsettty(p, SCARG(uap, fdes), HPUXTIOCGETP, + SCARG(uap, cmarg))); } ohpux_stty(p, uap, retval) struct proc *p; struct ohpux_sgtty_args *uap; - int *retval; + register_t *retval; { - return (getsettty(p, uap->fdes, HPUXTIOCSETP, uap->cmarg)); + return (getsettty(p, SCARG(uap, fdes), HPUXTIOCSETP, + SCARG(uap, cmarg))); } /* diff --git a/sys/compat/sunos/sun_ioctl.c b/sys/compat/sunos/sun_ioctl.c index cca9fa10e101..276d7787886c 100644 --- a/sys/compat/sunos/sun_ioctl.c +++ b/sys/compat/sunos/sun_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun_ioctl.c,v 1.11 1994/06/29 06:30:16 cgd Exp $ */ +/* $NetBSD: sun_ioctl.c,v 1.12 1994/10/20 04:47:43 cgd Exp $ */ /* * Copyright (c) 1993 Markus Wild. @@ -388,7 +388,7 @@ int sun_ioctl(p, uap, retval) register struct proc *p; register struct sun_ioctl_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct file *fp; diff --git a/sys/compat/sunos/sun_misc.c b/sys/compat/sunos/sun_misc.c index c5d2dc65fb15..e02a529b1ca2 100644 --- a/sys/compat/sunos/sun_misc.c +++ b/sys/compat/sunos/sun_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun_misc.c,v 1.31 1994/09/28 00:41:28 deraadt Exp $ */ +/* $NetBSD: sun_misc.c,v 1.32 1994/10/20 04:47:46 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -101,7 +101,7 @@ struct sun_wait4_args { sun_wait4(p, uap, retval) struct proc *p; struct sun_wait4_args *uap; - int *retval; + register_t *retval; { if (uap->pid == 0) @@ -116,7 +116,7 @@ struct sun_creat_args { sun_creat(p, uap, retval) struct proc *p; struct sun_creat_args *uap; - int *retval; + register_t *retval; { struct args { char *fname; @@ -138,7 +138,7 @@ struct sun_execv_args { sun_execv(p, uap, retval) struct proc *p; struct sun_execv_args *uap; - int *retval; + register_t *retval; { uap->envp = NULL; @@ -153,7 +153,7 @@ struct sun_omsync_args { sun_omsync(p, uap, retval) struct proc *p; struct sun_omsync_args *uap; - int *retval; + register_t *retval; { if (uap->flags) @@ -168,7 +168,7 @@ struct sun_unmount_args { sun_unmount(p, uap, retval) struct proc *p; struct sun_unmount_args *uap; - int *retval; + register_t *retval; { uap->flags = 0; @@ -210,7 +210,7 @@ struct sun_mount_args { sun_mount(p, uap, retval) struct proc *p; struct sun_mount_args *uap; - int *retval; + register_t *retval; { int oflags = uap->flags, nflags, error; extern char sigcode[], esigcode[]; @@ -275,7 +275,7 @@ sun_mount(p, uap, retval) async_daemon(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { struct nfssvc_args { int flag; @@ -293,7 +293,7 @@ struct sun_sigpending_args { sun_sigpending(p, uap, retval) struct proc *p; struct sun_sigpending_args *uap; - int *retval; + register_t *retval; { int mask = p->p_siglist & p->p_sigmask; @@ -328,7 +328,7 @@ struct sun_getdents_args { sun_getdents(p, uap, retval) struct proc *p; register struct sun_getdents_args *uap; - int *retval; + register_t *retval; { register struct vnode *vp; register caddr_t inp, buf; /* BSD-format */ @@ -436,7 +436,7 @@ struct sun_mmap_args { sun_mmap(p, uap, retval) register struct proc *p; register struct sun_mmap_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp; register struct file *fp; @@ -490,7 +490,7 @@ struct sun_mctl_args { sun_mctl(p, uap, retval) register struct proc *p; register struct sun_mctl_args *uap; - int *retval; + register_t *retval; { switch (uap->func) { @@ -516,7 +516,7 @@ struct sun_setsockopt_args { sun_setsockopt(p, uap, retval) struct proc *p; register struct sun_setsockopt_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mbuf *m = NULL; @@ -557,7 +557,7 @@ struct sun_fchroot_args { sun_fchroot(p, uap, retval) register struct proc *p; register struct sun_fchroot_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct vnode *vp; @@ -607,7 +607,7 @@ struct sun_uname_args { sun_uname(p, uap, retval) struct proc *p; struct sun_uname_args *uap; - int *retval; + register_t *retval; { struct sun_utsname sut; extern char ostype[], machine[], osrelease[]; @@ -632,7 +632,7 @@ int sun_setpgid(p, uap, retval) struct proc *p; struct sun_setpgid_args *uap; - int *retval; + register_t *retval; { /* * difference to our setpgid call is to include backwards @@ -654,7 +654,7 @@ struct sun_open_args { sun_open(p, uap, retval) struct proc *p; struct sun_open_args *uap; - int *retval; + register_t *retval; { int l, r; int noctty = uap->fmode & 0x8000; @@ -696,7 +696,7 @@ struct sun_nfssvc_args { sun_nfssvc(p, uap, retval) struct proc *p; struct sun_nfssvc_args *uap; - int *retval; + register_t *retval; { struct nfssvc_args outuap; struct sockaddr sa; @@ -733,7 +733,7 @@ struct sun_ustat_args { sun_ustat(p, uap, retval) struct proc *p; struct sun_ustat_args *uap; - int *retval; + register_t *retval; { struct sun_ustat us; int error; @@ -759,7 +759,7 @@ struct sun_quotactl_args { sun_quotactl(p, uap, retval) struct proc *p; struct sun_quotactl_args *uap; - int *retval; + register_t *retval; { return EINVAL; } @@ -767,7 +767,7 @@ sun_quotactl(p, uap, retval) sun_vhangup(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { return 0; } @@ -809,7 +809,7 @@ struct sun_statfs_args { sun_statfs(p, uap, retval) struct proc *p; struct sun_statfs_args *uap; - int *retval; + register_t *retval; { register struct mount *mp; register struct statfs *sp; @@ -835,7 +835,7 @@ struct sun_fstatfs_args { sun_fstatfs(p, uap, retval) struct proc *p; struct sun_fstatfs_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mount *mp; @@ -859,7 +859,7 @@ struct sun_exportfs_args { sun_exportfs(p, uap, retval) struct proc *p; struct sun_exportfs_args *uap; - int *retval; + register_t *retval; { /* * XXX: should perhaps translate into a mount(2) @@ -877,7 +877,7 @@ struct sun_mknod_args { sun_mknod(p, uap, retval) struct proc *p; struct sun_mknod_args *uap; - int *retval; + register_t *retval; { if (S_ISFIFO(uap->fmode)) return mkfifo(p, uap, retval); @@ -901,7 +901,7 @@ struct sun_sysconf_args { sun_sysconf(p, uap, retval) struct proc *p; struct sun_sysconf_args *uap; - int *retval; + register_t *retval; { extern int maxfiles; @@ -951,7 +951,7 @@ struct sun_getrlimit_args { sun_getrlimit(p, uap, retval) struct proc *p; struct sun_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SUN_RLIM_NLIMITS) return EINVAL; @@ -970,7 +970,7 @@ struct sun_setrlimit_args { sun_setrlimit(p, uap, retval) struct proc *p; struct sun_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SUN_RLIM_NLIMITS) return EINVAL; diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c index 5d3431b97779..82263edcc612 100644 --- a/sys/compat/sunos/sunos_ioctl.c +++ b/sys/compat/sunos/sunos_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_ioctl.c,v 1.11 1994/06/29 06:30:16 cgd Exp $ */ +/* $NetBSD: sunos_ioctl.c,v 1.12 1994/10/20 04:47:43 cgd Exp $ */ /* * Copyright (c) 1993 Markus Wild. @@ -388,7 +388,7 @@ int sun_ioctl(p, uap, retval) register struct proc *p; register struct sun_ioctl_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct file *fp; diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index 51e44134da65..dbdd4ba5cdb5 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_misc.c,v 1.31 1994/09/28 00:41:28 deraadt Exp $ */ +/* $NetBSD: sunos_misc.c,v 1.32 1994/10/20 04:47:46 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -101,7 +101,7 @@ struct sun_wait4_args { sun_wait4(p, uap, retval) struct proc *p; struct sun_wait4_args *uap; - int *retval; + register_t *retval; { if (uap->pid == 0) @@ -116,7 +116,7 @@ struct sun_creat_args { sun_creat(p, uap, retval) struct proc *p; struct sun_creat_args *uap; - int *retval; + register_t *retval; { struct args { char *fname; @@ -138,7 +138,7 @@ struct sun_execv_args { sun_execv(p, uap, retval) struct proc *p; struct sun_execv_args *uap; - int *retval; + register_t *retval; { uap->envp = NULL; @@ -153,7 +153,7 @@ struct sun_omsync_args { sun_omsync(p, uap, retval) struct proc *p; struct sun_omsync_args *uap; - int *retval; + register_t *retval; { if (uap->flags) @@ -168,7 +168,7 @@ struct sun_unmount_args { sun_unmount(p, uap, retval) struct proc *p; struct sun_unmount_args *uap; - int *retval; + register_t *retval; { uap->flags = 0; @@ -210,7 +210,7 @@ struct sun_mount_args { sun_mount(p, uap, retval) struct proc *p; struct sun_mount_args *uap; - int *retval; + register_t *retval; { int oflags = uap->flags, nflags, error; extern char sigcode[], esigcode[]; @@ -275,7 +275,7 @@ sun_mount(p, uap, retval) async_daemon(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { struct nfssvc_args { int flag; @@ -293,7 +293,7 @@ struct sun_sigpending_args { sun_sigpending(p, uap, retval) struct proc *p; struct sun_sigpending_args *uap; - int *retval; + register_t *retval; { int mask = p->p_siglist & p->p_sigmask; @@ -328,7 +328,7 @@ struct sun_getdents_args { sun_getdents(p, uap, retval) struct proc *p; register struct sun_getdents_args *uap; - int *retval; + register_t *retval; { register struct vnode *vp; register caddr_t inp, buf; /* BSD-format */ @@ -436,7 +436,7 @@ struct sun_mmap_args { sun_mmap(p, uap, retval) register struct proc *p; register struct sun_mmap_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp; register struct file *fp; @@ -490,7 +490,7 @@ struct sun_mctl_args { sun_mctl(p, uap, retval) register struct proc *p; register struct sun_mctl_args *uap; - int *retval; + register_t *retval; { switch (uap->func) { @@ -516,7 +516,7 @@ struct sun_setsockopt_args { sun_setsockopt(p, uap, retval) struct proc *p; register struct sun_setsockopt_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mbuf *m = NULL; @@ -557,7 +557,7 @@ struct sun_fchroot_args { sun_fchroot(p, uap, retval) register struct proc *p; register struct sun_fchroot_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct vnode *vp; @@ -607,7 +607,7 @@ struct sun_uname_args { sun_uname(p, uap, retval) struct proc *p; struct sun_uname_args *uap; - int *retval; + register_t *retval; { struct sun_utsname sut; extern char ostype[], machine[], osrelease[]; @@ -632,7 +632,7 @@ int sun_setpgid(p, uap, retval) struct proc *p; struct sun_setpgid_args *uap; - int *retval; + register_t *retval; { /* * difference to our setpgid call is to include backwards @@ -654,7 +654,7 @@ struct sun_open_args { sun_open(p, uap, retval) struct proc *p; struct sun_open_args *uap; - int *retval; + register_t *retval; { int l, r; int noctty = uap->fmode & 0x8000; @@ -696,7 +696,7 @@ struct sun_nfssvc_args { sun_nfssvc(p, uap, retval) struct proc *p; struct sun_nfssvc_args *uap; - int *retval; + register_t *retval; { struct nfssvc_args outuap; struct sockaddr sa; @@ -733,7 +733,7 @@ struct sun_ustat_args { sun_ustat(p, uap, retval) struct proc *p; struct sun_ustat_args *uap; - int *retval; + register_t *retval; { struct sun_ustat us; int error; @@ -759,7 +759,7 @@ struct sun_quotactl_args { sun_quotactl(p, uap, retval) struct proc *p; struct sun_quotactl_args *uap; - int *retval; + register_t *retval; { return EINVAL; } @@ -767,7 +767,7 @@ sun_quotactl(p, uap, retval) sun_vhangup(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { return 0; } @@ -809,7 +809,7 @@ struct sun_statfs_args { sun_statfs(p, uap, retval) struct proc *p; struct sun_statfs_args *uap; - int *retval; + register_t *retval; { register struct mount *mp; register struct statfs *sp; @@ -835,7 +835,7 @@ struct sun_fstatfs_args { sun_fstatfs(p, uap, retval) struct proc *p; struct sun_fstatfs_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mount *mp; @@ -859,7 +859,7 @@ struct sun_exportfs_args { sun_exportfs(p, uap, retval) struct proc *p; struct sun_exportfs_args *uap; - int *retval; + register_t *retval; { /* * XXX: should perhaps translate into a mount(2) @@ -877,7 +877,7 @@ struct sun_mknod_args { sun_mknod(p, uap, retval) struct proc *p; struct sun_mknod_args *uap; - int *retval; + register_t *retval; { if (S_ISFIFO(uap->fmode)) return mkfifo(p, uap, retval); @@ -901,7 +901,7 @@ struct sun_sysconf_args { sun_sysconf(p, uap, retval) struct proc *p; struct sun_sysconf_args *uap; - int *retval; + register_t *retval; { extern int maxfiles; @@ -951,7 +951,7 @@ struct sun_getrlimit_args { sun_getrlimit(p, uap, retval) struct proc *p; struct sun_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SUN_RLIM_NLIMITS) return EINVAL; @@ -970,7 +970,7 @@ struct sun_setrlimit_args { sun_setrlimit(p, uap, retval) struct proc *p; struct sun_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SUN_RLIM_NLIMITS) return EINVAL; diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index 0574af5e5a56..34fc2b22e7db 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_ioctl.c,v 1.2 1994/06/29 06:30:33 cgd Exp $ */ +/* $NetBSD: svr4_ioctl.c,v 1.3 1994/10/20 04:47:48 cgd Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -79,7 +79,7 @@ int svr4_ioctl(p, uap, retval) register struct proc *p; register struct svr4_ioctl_args *uap; - int *retval; + register_t *retval; { char *dir; char c; diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 6cfcd1a0bce9..752c2835f211 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_misc.c,v 1.5 1994/06/29 06:30:35 cgd Exp $ */ +/* $NetBSD: svr4_misc.c,v 1.6 1994/10/20 04:47:49 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -96,7 +96,7 @@ struct svr4_wait4_args { svr4_wait4(p, uap, retval) struct proc *p; struct svr4_wait4_args *uap; - int *retval; + register_t *retval; { if (uap->pid == 0) @@ -110,7 +110,7 @@ struct svr4_wait_args { svr4_wait(p, uap, retval) struct proc *p; struct svr4_wait_args *uap; - int *retval; + register_t *retval; { int err; struct svr4_wait4_args w4; @@ -128,7 +128,7 @@ struct svr4_creat_args { svr4_creat(p, uap, retval) struct proc *p; struct svr4_creat_args *uap; - int *retval; + register_t *retval; { struct args { char *fname; @@ -150,7 +150,7 @@ struct svr4_execv_args { svr4_execv(p, uap, retval) struct proc *p; struct svr4_execv_args *uap; - int *retval; + register_t *retval; { uap->envp = NULL; @@ -164,7 +164,7 @@ struct svr4_unmount_args { svr4_unmount(p, uap, retval) struct proc *p; struct svr4_unmount_args *uap; - int *retval; + register_t *retval; { uap->flags = 0; @@ -207,7 +207,7 @@ struct svr4_mount_args { svr4_mount(p, uap, retval) struct proc *p; struct svr4_mount_args *uap; - int *retval; + register_t *retval; { int oflags = uap->flags, nflags, error; extern char sigcode[], esigcode[]; @@ -272,7 +272,7 @@ struct svr4_sigpending_args { svr4_sigpending(p, uap, retval) struct proc *p; struct svr4_sigpending_args *uap; - int *retval; + register_t *retval; { int mask = p->p_siglist & p->p_sigmask; @@ -302,7 +302,7 @@ struct svr4_getdents_args { svr4_getdents(p, uap, retval) struct proc *p; register struct svr4_getdents_args *uap; - int *retval; + register_t *retval; { register struct vnode *vp; register caddr_t inp, buf; /* BSD-format */ @@ -410,7 +410,7 @@ struct svr4_mmap_args { svr4_mmap(p, uap, retval) register struct proc *p; register struct svr4_mmap_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp; register struct file *fp; @@ -460,7 +460,7 @@ struct svr4_mctl_args { svr4_mctl(p, uap, retval) register struct proc *p; register struct svr4_mctl_args *uap; - int *retval; + register_t *retval; { switch (uap->func) { @@ -482,7 +482,7 @@ struct svr4_fchroot_args { svr4_fchroot(p, uap, retval) register struct proc *p; register struct svr4_fchroot_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct vnode *vp; @@ -531,7 +531,7 @@ struct svr4_uname_args { svr4_uname(p, uap, retval) struct proc *p; struct svr4_uname_args *uap; - int *retval; + register_t *retval; { struct svr4_utsname sut; extern struct utsname utsname; @@ -573,7 +573,7 @@ struct svr4_open_args { svr4_open(p, uap, retval) struct proc *p; struct svr4_open_args *uap; - int *retval; + register_t *retval; { int l, r = 0; int noctty = uap->fmode & 0x8000; @@ -625,7 +625,7 @@ struct svr4_nfssvc_args { svr4_nfssvc(p, uap, retval) struct proc *p; struct svr4_nfssvc_args *uap; - int *retval; + register_t *retval; { struct nfssvc_args outuap; struct sockaddr sa; @@ -663,7 +663,7 @@ struct svr4_ustat_args { svr4_ustat(p, uap, retval) struct proc *p; struct svr4_ustat_args *uap; - int *retval; + register_t *retval; { struct svr4_ustat us; int error; @@ -689,7 +689,7 @@ struct svr4_quotactl_args { svr4_quotactl(p, uap, retval) struct proc *p; struct svr4_quotactl_args *uap; - int *retval; + register_t *retval; { return EINVAL; } @@ -733,7 +733,7 @@ struct svr4_statfs_args { svr4_statfs(p, uap, retval) struct proc *p; struct svr4_statfs_args *uap; - int *retval; + register_t *retval; { register struct mount *mp; register struct nameidata *ndp; @@ -763,7 +763,7 @@ struct svr4_fstatfs_args { svr4_fstatfs(p, uap, retval) struct proc *p; struct svr4_fstatfs_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mount *mp; @@ -788,7 +788,7 @@ struct svr4_exportfs_args { svr4_exportfs(p, uap, retval) struct proc *p; struct svr4_exportfs_args *uap; - int *retval; + register_t *retval; { /* * XXX: should perhaps translate into a mount(2) @@ -807,7 +807,7 @@ struct svr4_mknod_args { svr4_mknod(p, uap, retval) struct proc *p; struct svr4_mknod_args *uap; - int *retval; + register_t *retval; { if (S_ISFIFO(uap->fmode)) return mkfifo(p, uap, retval); @@ -818,7 +818,7 @@ svr4_mknod(p, uap, retval) svr4_vhangup(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { return 0; } @@ -839,7 +839,7 @@ struct svr4_sysconfig_args { svr4_sysconfig(p, uap, retval) struct proc *p; struct svr4_sysconfig_args *uap; - int *retval; + register_t *retval; { extern int maxfiles; @@ -888,7 +888,7 @@ struct svr4_getrlimit_args { svr4_getrlimit(p, uap, retval) struct proc *p; struct svr4_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SVR4_RLIM_NLIMITS) return EINVAL; @@ -908,7 +908,7 @@ struct svr4_setrlimit_args { svr4_setrlimit(p, uap, retval) struct proc *p; struct svr4_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SVR4_RLIM_NLIMITS) return EINVAL; @@ -978,7 +978,7 @@ struct svr4_stat_args { svr4_stat(p, uap, retval) struct proc *p; struct svr4_stat_args *uap; - int *retval; + register_t *retval; { extern char sigcode[], esigcode[]; struct stat st; @@ -1010,7 +1010,7 @@ struct svr4_lstat_args { svr4_lstat(p, uap, retval) struct proc *p; struct svr4_lstat_args *uap; - int *retval; + register_t *retval; { extern char sigcode[], esigcode[]; struct stat st; @@ -1042,7 +1042,7 @@ struct svr4_fstat_args { svr4_fstat(p, uap, retval) struct proc *p; struct svr4_fstat_args *uap; - int *retval; + register_t *retval; { extern char sigcode[], esigcode[]; struct stat st; @@ -1070,7 +1070,7 @@ struct svr4_syssun_args { svr4_syssun(p, uap, retval) struct proc *p; struct svr4_syssun_args *uap; - int *retval; + register_t *retval; { #ifdef DEBUG_SVR4 printf("syssun(%d)\n", uap->gate); diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index 5fe6cef31dc2..8ff3dc191f87 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_misc.c,v 1.6 1994/08/01 14:15:08 glass Exp $ */ +/* $NetBSD: ultrix_misc.c,v 1.7 1994/10/20 04:47:51 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -147,7 +147,7 @@ struct ultrix_waitpid_args { ultrix_waitpid(p, uap, retval) struct proc *p; struct ultrix_waitpid_args *uap; - int *retval; + register_t *retval; { uap->rusage = 0; @@ -163,7 +163,7 @@ struct sun_wait4_args { sun_wait4(p, uap, retval) struct proc *p; struct sun_wait4_args *uap; - int *retval; + register_t *retval; { if (uap->pid == 0) @@ -180,7 +180,7 @@ struct sun_wait3_args { sun_wait3(p, uap, retval) struct proc *p; struct sun_wait3_args *uap; - int *retval; + register_t *retval; { struct sun_wait4_args ua; @@ -201,7 +201,7 @@ struct sun_creat_args { sun_creat(p, uap, retval) struct proc *p; struct sun_creat_args *uap; - int *retval; + register_t *retval; { struct args { char *fname; @@ -223,7 +223,7 @@ struct sun_execv_args { sun_execv(p, uap, retval) struct proc *p; struct sun_execv_args *uap; - int *retval; + register_t *retval; { uap->envp = NULL; @@ -238,7 +238,7 @@ struct sun_omsync_args { sun_omsync(p, uap, retval) struct proc *p; struct sun_omsync_args *uap; - int *retval; + register_t *retval; { if (uap->flags) @@ -253,7 +253,7 @@ struct sun_unmount_args { sun_unmount(p, uap, retval) struct proc *p; struct sun_unmount_args *uap; - int *retval; + register_t *retval; { uap->flags = 0; @@ -295,7 +295,7 @@ struct sun_mount_args { sun_mount(p, uap, retval) struct proc *p; struct sun_mount_args *uap; - int *retval; + register_t *retval; { int oflags = uap->flags, nflags, error; extern char sigcode[], esigcode[]; @@ -359,7 +359,7 @@ sun_mount(p, uap, retval) async_daemon(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { struct nfssvc_args { int flag; @@ -377,7 +377,7 @@ struct sun_sigpending_args { sun_sigpending(p, uap, retval) struct proc *p; struct sun_sigpending_args *uap; - int *retval; + register_t *retval; { int mask = p->p_siglist & p->p_sigmask; @@ -422,7 +422,7 @@ struct sun_getdents_args { sun_getdents(p, uap, retval) struct proc *p; register struct sun_getdents_args *uap; - int *retval; + register_t *retval; { register struct vnode *vp; register caddr_t inp, buf; /* BSD-format */ @@ -530,7 +530,7 @@ struct sun_mmap_args { sun_mmap(p, uap, retval) register struct proc *p; register struct sun_mmap_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp; register struct file *fp; @@ -584,7 +584,7 @@ struct sun_mctl_args { sun_mctl(p, uap, retval) register struct proc *p; register struct sun_mctl_args *uap; - int *retval; + register_t *retval; { switch (uap->func) { @@ -610,7 +610,7 @@ struct sun_setsockopt_args { sun_setsockopt(p, uap, retval) struct proc *p; register struct sun_setsockopt_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mbuf *m = NULL; @@ -651,7 +651,7 @@ struct sun_fchroot_args { sun_fchroot(p, uap, retval) register struct proc *p; register struct sun_fchroot_args *uap; - int *retval; + register_t *retval; { register struct filedesc *fdp = p->p_fd; register struct vnode *vp; @@ -701,7 +701,7 @@ struct sun_uname_args { sun_uname(p, uap, retval) struct proc *p; struct sun_uname_args *uap; - int *retval; + register_t *retval; { struct sun_utsname sut; extern char ostype[], machine[], osrelease[]; @@ -726,7 +726,7 @@ int sun_setpgid(p, uap, retval) struct proc *p; struct sun_setpgid_args *uap; - int *retval; + register_t *retval; { /* * difference to our setpgid call is to include backwards @@ -748,7 +748,7 @@ struct sun_open_args { sun_open(p, uap, retval) struct proc *p; struct sun_open_args *uap; - int *retval; + register_t *retval; { int l, r; int noctty = uap->fmode & 0x8000; @@ -790,7 +790,7 @@ struct sun_nfssvc_args { sun_nfssvc(p, uap, retval) struct proc *p; struct sun_nfssvc_args *uap; - int *retval; + register_t *retval; { struct nfssvc_args outuap; struct sockaddr sa; @@ -827,7 +827,7 @@ struct sun_ustat_args { sun_ustat(p, uap, retval) struct proc *p; struct sun_ustat_args *uap; - int *retval; + register_t *retval; { struct sun_ustat us; int error; @@ -853,7 +853,7 @@ struct sun_quotactl_args { sun_quotactl(p, uap, retval) struct proc *p; struct sun_quotactl_args *uap; - int *retval; + register_t *retval; { return EINVAL; } @@ -861,7 +861,7 @@ sun_quotactl(p, uap, retval) sun_vhangup(p, uap, retval) struct proc *p; void *uap; - int *retval; + register_t *retval; { return 0; } @@ -903,7 +903,7 @@ struct sun_statfs_args { sun_statfs(p, uap, retval) struct proc *p; struct sun_statfs_args *uap; - int *retval; + register_t *retval; { register struct mount *mp; register struct statfs *sp; @@ -929,7 +929,7 @@ struct sun_fstatfs_args { sun_fstatfs(p, uap, retval) struct proc *p; struct sun_fstatfs_args *uap; - int *retval; + register_t *retval; { struct file *fp; struct mount *mp; @@ -953,7 +953,7 @@ struct sun_exportfs_args { sun_exportfs(p, uap, retval) struct proc *p; struct sun_exportfs_args *uap; - int *retval; + register_t *retval; { /* * XXX: should perhaps translate into a mount(2) @@ -971,7 +971,7 @@ struct sun_mknod_args { sun_mknod(p, uap, retval) struct proc *p; struct sun_mknod_args *uap; - int *retval; + register_t *retval; { if (S_ISFIFO(uap->fmode)) return mkfifo(p, uap, retval); @@ -995,7 +995,7 @@ struct sun_sysconf_args { sun_sysconf(p, uap, retval) struct proc *p; struct sun_sysconf_args *uap; - int *retval; + register_t *retval; { extern int maxfiles; @@ -1045,7 +1045,7 @@ struct sun_getrlimit_args { sun_getrlimit(p, uap, retval) struct proc *p; struct sun_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SUN_RLIM_NLIMITS) return EINVAL; @@ -1064,7 +1064,7 @@ struct sun_setrlimit_args { sun_setrlimit(p, uap, retval) struct proc *p; struct sun_getrlimit_args *uap; - int *retval; + register_t *retval; { if (uap->which >= SUN_RLIM_NLIMITS) return EINVAL;