diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-04-16 22:19:29 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-04-16 22:19:29 +0000 |
commit | 86718cb35d929cb9692f5bda49aa9cae99483179 (patch) | |
tree | 13b91791b7ceb49b987d1be1327ec995769feb55 /sys/miscfs | |
parent | 8cfe6a4577283fbd292e70a1dfb76eff3191c45e (diff) |
Remove regs and fpregs pseudo-files from procfs.
ok deraadt@, miod@
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/procfs/procfs_fpregs.c | 108 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_regs.c | 100 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_subr.c | 10 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 6 |
4 files changed, 2 insertions, 222 deletions
diff --git a/sys/miscfs/procfs/procfs_fpregs.c b/sys/miscfs/procfs/procfs_fpregs.c deleted file mode 100644 index a4f91348007..00000000000 --- a/sys/miscfs/procfs/procfs_fpregs.c +++ /dev/null @@ -1,108 +0,0 @@ -/* $OpenBSD: procfs_fpregs.c,v 1.7 2004/05/05 23:52:10 tedu Exp $ */ -/* $NetBSD: procfs_fpregs.c,v 1.4 1995/08/13 09:06:05 mycroft Exp $ */ - -/* - * Copyright (c) 1993 Jan-Simon Pendry - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)procfs_fpregs.c 8.2 (Berkeley) 6/15/94 - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/time.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/vnode.h> -#include <sys/ptrace.h> -#include <machine/reg.h> -#include <miscfs/procfs/procfs.h> - -int -procfs_dofpregs(curp, p, pfs, uio) - struct proc *curp; /* tracer */ - struct proc *p; /* traced */ - struct pfsnode *pfs; - struct uio *uio; -{ -#if defined(PT_GETFPREGS) || defined(PT_SETFPREGS) - int error; - struct fpreg r; - char *kv; - int kl; - - if ((error = procfs_checkioperm(curp, p)) != 0) - return (error); - - kl = sizeof(r); - kv = (char *)&r; - - kv += uio->uio_offset; - kl -= uio->uio_offset; - if (kl > uio->uio_resid) - kl = uio->uio_resid; - - PHOLD(p); - - if (uio->uio_offset > (off_t)sizeof(r)) - error = EINVAL; - else - error = process_read_fpregs(p, &r); - if (error == 0) - error = uiomove(kv, kl, uio); - if (error == 0 && uio->uio_rw == UIO_WRITE) { - if (p->p_stat != SSTOP) - error = EBUSY; - else - error = process_write_fpregs(p, &r); - } - - PRELE(p); - - uio->uio_offset = 0; - return (error); -#else - return (EINVAL); -#endif -} - -int -procfs_validfpregs(p, mp) - struct proc *p; - struct mount *mp; -{ - -#if defined(PT_SETFPREGS) || defined(PT_GETFPREGS) - return ((p->p_flag & P_SYSTEM) == 0); -#else - return (0); -#endif -} diff --git a/sys/miscfs/procfs/procfs_regs.c b/sys/miscfs/procfs/procfs_regs.c deleted file mode 100644 index 5fe351ca511..00000000000 --- a/sys/miscfs/procfs/procfs_regs.c +++ /dev/null @@ -1,100 +0,0 @@ -/* $OpenBSD: procfs_regs.c,v 1.8 2004/05/05 23:52:10 tedu Exp $ */ -/* $NetBSD: procfs_regs.c,v 1.9 1995/08/13 09:06:07 mycroft Exp $ */ - -/* - * Copyright (c) 1993 Jan-Simon Pendry - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/time.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/vnode.h> -#include <sys/ptrace.h> -#include <machine/reg.h> -#include <miscfs/procfs/procfs.h> - -int -procfs_doregs(curp, p, pfs, uio) - struct proc *curp; /* tracer */ - struct proc *p; /* traced */ - struct pfsnode *pfs; - struct uio *uio; -{ - int error; - struct reg r; - char *kv; - int kl; - - if ((error = procfs_checkioperm(curp, p)) != 0) - return (error); - - kl = sizeof(r); - kv = (char *)&r; - - kv += uio->uio_offset; - kl -= uio->uio_offset; - if (kl > uio->uio_resid) - kl = uio->uio_resid; - - PHOLD(p); - - if (uio->uio_offset > (off_t)sizeof(r)) - error = EINVAL; - else - error = process_read_regs(p, &r); - if (error == 0) - error = uiomove(kv, kl, uio); - if (error == 0 && uio->uio_rw == UIO_WRITE) { - if (p->p_stat != SSTOP) - error = EBUSY; - else - error = process_write_regs(p, &r); - } - - PRELE(p); - - uio->uio_offset = 0; - return (error); -} - -int -procfs_validregs(p, mp) - struct proc *p; - struct mount *mp; -{ - - return ((p->p_flag & P_SYSTEM) == 0); -} diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index a7f9ff5f06f..ea58588ee0b 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_subr.c,v 1.21 2004/05/05 23:52:10 tedu Exp $ */ +/* $OpenBSD: procfs_subr.c,v 1.22 2005/04/16 22:19:28 kettenis Exp $ */ /* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */ /* @@ -222,14 +222,6 @@ procfs_rw(v) case Pnotepg: return (procfs_donote(curp, p, pfs, uio)); -#ifdef PTRACE - case Pregs: - return (procfs_doregs(curp, p, pfs, uio)); - - case Pfpregs: - return (procfs_dofpregs(curp, p, pfs, uio)); -#endif - case Pctl: return (procfs_doctl(curp, p, pfs, uio)); diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 03f8f295d5d..a9125261db2 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vnops.c,v 1.34 2005/04/01 20:16:01 pedro Exp $ */ +/* $OpenBSD: procfs_vnops.c,v 1.35 2005/04/16 22:19:28 kettenis Exp $ */ /* $NetBSD: procfs_vnops.c,v 1.40 1996/03/16 23:52:55 christos Exp $ */ /* @@ -86,10 +86,6 @@ struct proc_target { { DT_DIR, N(".."), Proot, NULL }, { DT_REG, N("file"), Pfile, procfs_validfile }, { DT_REG, N("mem"), Pmem, NULL }, -#ifdef PTRACE - { DT_REG, N("regs"), Pregs, procfs_validregs }, - { DT_REG, N("fpregs"), Pfpregs, procfs_validfpregs }, -#endif { DT_REG, N("ctl"), Pctl, NULL }, { DT_REG, N("status"), Pstatus, NULL }, { DT_REG, N("note"), Pnote, NULL }, |