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 | |
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.
-rw-r--r-- | sys/alpha/linux/linux_sysvec.c | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs.h | 9 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_map.c | 9 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_subr.c | 6 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 6 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_sysvec.c | 5 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 4 | ||||
-rw-r--r-- | sys/kern/imgact_elf.c | 3 | ||||
-rw-r--r-- | sys/kern/init_sysvec.c | 3 | ||||
-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 | ||||
-rw-r--r-- | sys/sys/sysent.h | 3 |
14 files changed, 63 insertions, 19 deletions
diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c index 07abfbe..f2c7ba6 100644 --- a/sys/alpha/linux/linux_sysvec.c +++ b/sys/alpha/linux/linux_sysvec.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_sysvec.c,v 1.5 1996/05/01 06:31:18 jkh Exp $ + * $Id: linux_sysvec.c,v 1.6 1996/06/12 05:06:29 gpalmer Exp $ */ /* XXX we use functions that might not exist. */ @@ -382,6 +382,7 @@ struct sysentvec linux_sysvec = { linux_sigcode, &linux_szsigcode, linux_prepsyscall, + "Linux a.out" }; struct sysentvec elf_linux_sysvec = { @@ -397,6 +398,7 @@ struct sysentvec elf_linux_sysvec = { linux_sigcode, &linux_szsigcode, linux_prepsyscall, + "Linux ELF" }; /* diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index e28185e..69d88bd 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/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/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index 2117048..0a586bf 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/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/fs/procfs/procfs_subr.c b/sys/fs/procfs/procfs_subr.c index f8840aa..872a4e9 100644 --- a/sys/fs/procfs/procfs_subr.c +++ b/sys/fs/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/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index c830ea2..6325969 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/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: diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c index 402ec19..22b29b6 100644 --- a/sys/i386/ibcs2/ibcs2_sysvec.c +++ b/sys/i386/ibcs2/ibcs2_sysvec.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_sysvec.c,v 1.2 1996/03/02 19:37:43 peter Exp $ + * $Id: ibcs2_sysvec.c,v 1.3 1996/03/27 18:39:40 swallace Exp $ */ #include <sys/param.h> @@ -53,5 +53,6 @@ struct sysentvec ibcs2_svr3_sysvec = { sendsig, sigcode, /* use generic trampoline */ &szsigcode, /* use generic trampoline size */ - 0 /* prepsyscall */ + 0, /* prepsyscall */ + "IBCS2 COFF" }; diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 07abfbe..f2c7ba6 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_sysvec.c,v 1.5 1996/05/01 06:31:18 jkh Exp $ + * $Id: linux_sysvec.c,v 1.6 1996/06/12 05:06:29 gpalmer Exp $ */ /* XXX we use functions that might not exist. */ @@ -382,6 +382,7 @@ struct sysentvec linux_sysvec = { linux_sigcode, &linux_szsigcode, linux_prepsyscall, + "Linux a.out" }; struct sysentvec elf_linux_sysvec = { @@ -397,6 +398,7 @@ struct sysentvec elf_linux_sysvec = { linux_sigcode, &linux_szsigcode, linux_prepsyscall, + "Linux ELF" }; /* diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 607483f2..b44792d 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: imgact_elf.c,v 1.5 1996/05/01 02:42:43 bde Exp $ + * $Id: imgact_elf.c,v 1.6 1996/06/12 05:07:25 gpalmer Exp $ */ #include <sys/param.h> @@ -90,6 +90,7 @@ static struct sysentvec elf_freebsd_sysvec = { sigcode, &szsigcode, 0, + "FreeBSD ELF" }; static Elf32_Interp_info freebsd_interp = { diff --git a/sys/kern/init_sysvec.c b/sys/kern/init_sysvec.c index 4ef3b16..8e5e220 100644 --- a/sys/kern/init_sysvec.c +++ b/sys/kern/init_sysvec.c @@ -1,7 +1,7 @@ /* * sysentvec for native FreeBSD a.out executable format. * - * $Id$ + * $Id: init_sysvec.c,v 1.1 1996/03/02 19:38:08 peter Exp $ */ #include <sys/types.h> @@ -26,4 +26,5 @@ struct sysentvec aout_sysvec = { sigcode, &szsigcode, 0, + "FreeBSD a.out" }; 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: diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 434748c..b815763 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sysent.h,v 1.8 1996/03/29 14:29:50 bde Exp $ + * $Id: sysent.h,v 1.9 1996/04/04 01:08:20 smpatel Exp $ */ #ifndef _SYS_SYSENT_H_ @@ -62,6 +62,7 @@ struct sysentvec { int *sv_szsigcode; /* size of sigtramp code */ void (*sv_prepsyscall) __P((struct trapframe *, int *, u_int *, caddr_t *)); + char *sv_name; /* name of binary type */ }; #ifdef KERNEL |