diff options
author | dyson <dyson@FreeBSD.org> | 1996-06-18 05:16:00 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-06-18 05:16:00 +0000 |
commit | 01d0667f094f295d42229575567f6b5a2ce0b746 (patch) | |
tree | 56e5b93363f08a48419fadcd9de833c9ef6a5292 /sys/miscfs | |
parent | 26ad2004f9ad2d994e528b2448f065726dfe7ca2 (diff) | |
download | FreeBSD-src-01d0667f094f295d42229575567f6b5a2ce0b746.zip FreeBSD-src-01d0667f094f295d42229575567f6b5a2ce0b746.tar.gz |
Clean-up the new VM map procfs code, and also add support for executable
format file "etype". It contains a description of the binary type for
a process.
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 9 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_map.c | 9 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_subr.c | 6 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 6 |
4 files changed, 24 insertions, 6 deletions
diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index e28185e..69d88bd 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -36,7 +36,7 @@ * * @(#)procfs.h 8.6 (Berkeley) 2/3/94 * - * $Id: procfs.h,v 1.9 1996/01/24 18:40:37 peter Exp $ + * $Id: procfs.h,v 1.10 1996/06/17 22:43:35 dyson Exp $ */ /* @@ -53,7 +53,8 @@ typedef enum { Pstatus, /* process status */ Pnote, /* process notifier */ Pnotepg, /* process group notifier */ - Pmap /* memory map */ + Pmap, /* memory map */ + Ptype /* executable type */ } pfstype; /* @@ -134,11 +135,15 @@ extern int procfs_dofpregs __P((struct proc *, struct proc *, struct pfsnode *pf extern int procfs_domem __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); extern int procfs_doctl __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); extern int procfs_dostatus __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); +extern int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); +extern int procfs_dotype __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); /* check to see if the process has the "items" (regs/file) */ int procfs_validfile __P((struct proc *)); int procfs_validfpregs __P((struct proc *)); int procfs_validregs __P((struct proc *)); +int procfs_validmap __P((struct proc *)); +int procfs_validtype __P((struct proc *)); #define PROCFS_LOCKED 0x01 #define PROCFS_WANT 0x02 diff --git a/sys/miscfs/procfs/procfs_map.c b/sys/miscfs/procfs/procfs_map.c index 2117048..0a586bf 100644 --- a/sys/miscfs/procfs/procfs_map.c +++ b/sys/miscfs/procfs/procfs_map.c @@ -36,7 +36,7 @@ * * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * - * $Id: procfs_status.c,v 1.5 1996/02/02 05:19:20 wosch Exp $ + * $Id: procfs_map.c,v 1.1 1996/06/17 22:53:27 dyson Exp $ */ #include <sys/param.h> @@ -167,3 +167,10 @@ case OBJT_DEVICE: kmem_free(kernel_map, (vm_offset_t)kbuffer, MAXKBUFFER); return error; } + +int +procfs_validmap(p) + struct proc *p; +{ + return ((p->p_flag & P_SYSTEM) == 0); +} diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index f8840aa..872a4e9 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -36,7 +36,7 @@ * * @(#)procfs_subr.c 8.4 (Berkeley) 1/27/94 * - * $Id: procfs_subr.c,v 1.6 1996/06/12 03:37:36 davidg Exp $ + * $Id: procfs_subr.c,v 1.7 1996/06/17 22:43:35 dyson Exp $ */ #include <sys/param.h> @@ -166,6 +166,7 @@ loop: pfs->pfs_mode = (VWRITE); break; + case Ptype: case Pmap: case Pstatus: pfs->pfs_mode = (VREAD) | @@ -257,6 +258,9 @@ procfs_rw(ap) case Pmem: return (procfs_domem(curp, p, pfs, uio)); + case Ptype: + return (procfs_dotype(curp, p, pfs, uio)); + default: return (EOPNOTSUPP); } diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index c830ea2..6325969 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.21 1996/03/11 06:13:09 hsu Exp $ + * $Id: procfs_vnops.c,v 1.22 1996/06/17 22:43:36 dyson Exp $ */ /* @@ -95,7 +95,8 @@ static struct pfsnames { { N("status"), Pstatus, NULL }, { N("note"), Pnote, NULL }, { N("notepg"), Pnotepg, NULL }, - { N("map"), Pmap, NULL }, + { N("map"), Pmap, procfs_validmap }, + { N("etype"), Ptype, procfs_validtype }, #undef N }; #define Nprocent (sizeof(procent)/sizeof(procent[0])) @@ -431,6 +432,7 @@ procfs_getattr(ap) vap->va_gid = KMEM_GROUP; break; + case Ptype: case Pmap: case Pregs: case Pfpregs: |