More trailing white space.
This commit is contained in:
parent
312f023d61
commit
f68ec00b50
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kvm.3,v 1.4 1998/02/06 05:41:59 perry Exp $
|
||||
.\" $NetBSD: kvm.3,v 1.5 1999/07/02 15:28:49 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1992, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -73,7 +73,7 @@ Accordingly, the generic portion of the interface (i.e.,
|
|||
.Fn kvm_write ,
|
||||
and
|
||||
.Fn kvm_nlist )
|
||||
has been incorporated into the
|
||||
has been incorporated into the
|
||||
.Bx
|
||||
interface. Indeed, many kvm
|
||||
applications (i.e., debuggers and statistical monitors) use only
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm.c,v 1.63 1999/04/01 09:53:09 mycroft Exp $ */
|
||||
/* $NetBSD: kvm.c,v 1.64 1999/07/02 15:28:49 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1992, 1993
|
||||
|
@ -42,7 +42,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm.c,v 1.63 1999/04/01 09:53:09 mycroft Exp $");
|
||||
__RCSID("$NetBSD: kvm.c,v 1.64 1999/07/02 15:28:49 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -308,7 +308,7 @@ _kvm_open(kd, uf, mf, sf, flag, errout)
|
|||
* not be opened, open the namelist argument so we
|
||||
* revert to slow nlist() calls.
|
||||
*/
|
||||
if ((ufgiven || kvm_dbopen(kd) < 0) &&
|
||||
if ((ufgiven || kvm_dbopen(kd) < 0) &&
|
||||
(kd->nlfd = open(uf, O_RDONLY, 0)) < 0) {
|
||||
_kvm_syserr(kd, kd->program, "%s", uf);
|
||||
goto failed;
|
||||
|
@ -326,7 +326,7 @@ _kvm_open(kd, uf, mf, sf, flag, errout)
|
|||
|
||||
/*
|
||||
* If there is no valid core header, fail silently here.
|
||||
* The address translations however will fail without
|
||||
* The address translations however will fail without
|
||||
* header. Things can be made to run by calling
|
||||
* kvm_dump_mkheader() before doing any translation.
|
||||
*/
|
||||
|
@ -353,7 +353,7 @@ failed:
|
|||
* (opaque) cpu_data; (size is cpu_hdr.c_size)
|
||||
* kcore_seg_t mem_hdr;
|
||||
* (memory) mem_data; (size is mem_hdr.c_size)
|
||||
*
|
||||
*
|
||||
* Note: khdr is padded to khdr.c_hdrsize;
|
||||
* cpu_hdr and mem_hdr are padded to khdr.c_seghdrsize
|
||||
*/
|
||||
|
@ -703,7 +703,7 @@ kvm_close(kd)
|
|||
|
||||
/*
|
||||
* Set up state necessary to do queries on the kernel namelist
|
||||
* data base. If the data base is out-of-data/incompatible with
|
||||
* data base. If the data base is out-of-data/incompatible with
|
||||
* given executable, set up things so we revert to standard nlist call.
|
||||
* Only called for live kernels. Return 0 on success, -1 on failure.
|
||||
*/
|
||||
|
@ -744,7 +744,7 @@ kvm_dbopen(kd)
|
|||
if (rec.data == 0 || rec.size != sizeof(struct nlist))
|
||||
goto close;
|
||||
memcpy(&nitem, rec.data, sizeof(nitem));
|
||||
if (kvm_read(kd, (u_long)nitem.n_value, kversion, dbversionlen) !=
|
||||
if (kvm_read(kd, (u_long)nitem.n_value, kversion, dbversionlen) !=
|
||||
dbversionlen)
|
||||
goto close;
|
||||
/*
|
||||
|
@ -769,7 +769,7 @@ kvm_nlist(kd, nl)
|
|||
int nvalid, rv;
|
||||
|
||||
/*
|
||||
* If we can't use the data base, revert to the
|
||||
* If we can't use the data base, revert to the
|
||||
* slow library call.
|
||||
*/
|
||||
if (kd->db == 0) {
|
||||
|
@ -882,7 +882,7 @@ kvm_read(kd, kva, buf, len)
|
|||
while (len > 0) {
|
||||
u_long pa;
|
||||
off_t foff;
|
||||
|
||||
|
||||
cc = _kvm_kvatop(kd, kva, &pa);
|
||||
if (cc == 0)
|
||||
return (-1);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* $NetBSD: kvm_alpha.c,v 1.14 1998/08/17 20:11:32 thorpej Exp $ */
|
||||
/* $NetBSD: kvm_alpha.c,v 1.15 1999/07/02 15:28:49 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
|
@ -183,7 +183,7 @@ lose:
|
|||
/*
|
||||
* Translate a physical address to a file-offset in the crash-dump.
|
||||
*/
|
||||
off_t
|
||||
off_t
|
||||
_kvm_pa2off(kd, pa)
|
||||
kvm_t *kd;
|
||||
u_long pa;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kvm_dump.3,v 1.5 1998/06/08 10:57:31 lukem Exp $
|
||||
.\" $NetBSD: kvm_dump.3,v 1.6 1999/07/02 15:28:49 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1996 Leo Weppelman
|
||||
.\" All rights reserved.
|
||||
|
@ -55,10 +55,10 @@ First note that the functions described here were designed to be used by
|
|||
.Pp
|
||||
The function
|
||||
.Fn kvm_dump_mkheader
|
||||
checks if the physical memory file associated with
|
||||
checks if the physical memory file associated with
|
||||
.Fa kd
|
||||
contains a valid crash-dump header as generated by a dumping kernel. When a
|
||||
valid header is found,
|
||||
valid header is found,
|
||||
.Fn kvm_dump_mkheader
|
||||
initializes the internal kvm data structures as if a crash-dump generated by
|
||||
the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_file.c,v 1.12 1999/04/01 09:57:00 veego Exp $ */
|
||||
/* $NetBSD: kvm_file.c,v 1.13 1999/07/02 15:28:50 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1992, 1993
|
||||
|
@ -38,12 +38,12 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_file.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_file.c,v 1.12 1999/04/01 09:57:00 veego Exp $");
|
||||
__RCSID("$NetBSD: kvm_file.c,v 1.13 1999/07/02 15:28:50 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* File list interface for kvm. pstat, fstat and netstat are
|
||||
* File list interface for kvm. pstat, fstat and netstat are
|
||||
* users of this code, so we've factored it out into a separate module.
|
||||
* Thus, we keep this grunge out of the other kvm applications (i.e.,
|
||||
* most other applications are interested only in open/close/read/nlist).
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kvm_geterr.3,v 1.3 1998/02/05 18:51:42 perry Exp $
|
||||
.\" $NetBSD: kvm_geterr.3,v 1.4 1999/07/02 15:28:50 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1992, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -57,7 +57,7 @@ on the descriptor
|
|||
The results are undefined if the most recent
|
||||
.Xr kvm 3
|
||||
library call did not produce an error.
|
||||
The string returned is stored in memory owned by
|
||||
The string returned is stored in memory owned by
|
||||
.Xr kvm 3
|
||||
so the message should be copied out and saved elsewhere if necessary.
|
||||
.Sh BUGS
|
||||
|
@ -67,7 +67,7 @@ call, since failure is indicated by returning a
|
|||
.Dv NULL
|
||||
descriptor.
|
||||
Therefore, errors on open are output to the special error buffer
|
||||
passed to
|
||||
passed to
|
||||
.Fn kvm_openfiles .
|
||||
This option is not available to
|
||||
.Fn kvm_open .
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kvm_getprocs.3,v 1.4 1998/02/05 18:51:45 perry Exp $
|
||||
.\" $NetBSD: kvm_getprocs.3,v 1.5 1999/07/02 15:28:50 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1992, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -43,7 +43,7 @@
|
|||
.Sh NAME
|
||||
.Nm kvm_getprocs ,
|
||||
.Nm kvm_getargv ,
|
||||
.Nm kvm_getenvv
|
||||
.Nm kvm_getenvv
|
||||
.Nd access user process state
|
||||
.Sh LIBRARY
|
||||
.Lb libkvm
|
||||
|
@ -75,7 +75,7 @@ describes the filtering predicate as follows:
|
|||
.It Sy KERN_PROC_ALL
|
||||
all processes
|
||||
.It Sy KERN_PROC_PID
|
||||
processes with process id
|
||||
processes with process id
|
||||
.Fa arg
|
||||
.It Sy KERN_PROC_PGRP
|
||||
processes with process group
|
||||
|
@ -98,13 +98,13 @@ The number of processes found is returned in the reference parameter
|
|||
.Fa cnt .
|
||||
The processes are returned as a contiguous array of kinfo_proc structures.
|
||||
This memory is locally allocated, and subsequent calls to
|
||||
.Fn kvm_getprocs
|
||||
and
|
||||
.Fn kvm_getprocs
|
||||
and
|
||||
.Fn kvm_close
|
||||
will overwrite this storage.
|
||||
.Pp
|
||||
.Fn kvm_getargv
|
||||
returns a null-terminated argument vector that corresponds to the
|
||||
returns a null-terminated argument vector that corresponds to the
|
||||
command line arguments passed to process indicated by
|
||||
.Fa p .
|
||||
Most likely, these arguments correspond to the values passed to
|
||||
|
@ -115,7 +115,7 @@ Note that the original command name can be found, unaltered,
|
|||
in the p_comm field of the process structure returned by
|
||||
.Fn kvm_getprocs .
|
||||
.Pp
|
||||
The
|
||||
The
|
||||
.Fa nchr
|
||||
argument indicates the maximum number of characters, including null bytes,
|
||||
to use in building the strings. If this amount is exceeded, the string
|
||||
|
@ -128,13 +128,13 @@ that print only a one line summary of a command and should not copy
|
|||
out large amounts of text only to ignore it.
|
||||
If
|
||||
.Fa nchr
|
||||
is zero, no limit is imposed and all argument strings are returned in
|
||||
is zero, no limit is imposed and all argument strings are returned in
|
||||
their entirety.
|
||||
.Pp
|
||||
The memory allocated to the argv pointers and string storage
|
||||
is owned by the kvm library. Subsequent
|
||||
.Fn kvm_getprocs
|
||||
and
|
||||
is owned by the kvm library. Subsequent
|
||||
.Fn kvm_getprocs
|
||||
and
|
||||
.Xr kvm_close 3
|
||||
calls will clobber this storage.
|
||||
.Pp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_i386.c,v 1.14 1998/09/27 18:16:00 christos Exp $ */
|
||||
/* $NetBSD: kvm_i386.c,v 1.15 1999/07/02 15:28:50 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1992, 1993
|
||||
|
@ -42,7 +42,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_i386.c,v 1.14 1998/09/27 18:16:00 christos Exp $");
|
||||
__RCSID("$NetBSD: kvm_i386.c,v 1.15 1999/07/02 15:28:50 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -166,7 +166,7 @@ _kvm_pa2off(kd, pa)
|
|||
u_long pa;
|
||||
{
|
||||
cpu_kcore_hdr_t *cpu_kh;
|
||||
phys_ram_seg_t *ramsegs;
|
||||
phys_ram_seg_t *ramsegs;
|
||||
off_t off;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_m68k_cmn.c,v 1.8 1998/06/30 20:29:39 thorpej Exp $ */
|
||||
/* $NetBSD: kvm_m68k_cmn.c,v 1.9 1999/07/02 15:28:50 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 Jason R. Thorpe. All rights reserved.
|
||||
|
@ -43,7 +43,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_m68k_cmn.c,v 1.8 1998/06/30 20:29:39 thorpej Exp $");
|
||||
__RCSID("$NetBSD: kvm_m68k_cmn.c,v 1.9 1999/07/02 15:28:50 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -192,7 +192,7 @@ vatop_030(kd, stpa, va, pa)
|
|||
|
||||
/*
|
||||
* Can't use KREAD to read kernel segment table entries.
|
||||
* Fortunately it is 1-to-1 mapped so we don't have to.
|
||||
* Fortunately it is 1-to-1 mapped so we don't have to.
|
||||
*/
|
||||
if (stpa == m->sysseg_pa) {
|
||||
if (pread(kd->pmfd, &ste, sizeof(ste),
|
||||
|
@ -219,7 +219,7 @@ vatop_030(kd, stpa, va, pa)
|
|||
return (0);
|
||||
}
|
||||
*pa = addr + offset;
|
||||
|
||||
|
||||
return (h->page_size - offset);
|
||||
invalid:
|
||||
_kvm_err(kd, 0, "invalid address (%x)", va);
|
||||
|
@ -258,7 +258,7 @@ vatop_040(kd, stpa, va, pa)
|
|||
|
||||
/*
|
||||
* Can't use KREAD to read kernel segment table entries.
|
||||
* Fortunately it is 1-to-1 mapped so we don't have to.
|
||||
* Fortunately it is 1-to-1 mapped so we don't have to.
|
||||
*/
|
||||
if (stpa == m->sysseg_pa) {
|
||||
if (pread(kd->pmfd, &ste, sizeof(ste),
|
||||
|
@ -303,7 +303,7 @@ vatop_040(kd, stpa, va, pa)
|
|||
return (0);
|
||||
}
|
||||
*pa = addr + offset;
|
||||
|
||||
|
||||
return (h->page_size - offset);
|
||||
|
||||
invalid:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_mips.c,v 1.11 1998/06/30 20:29:39 thorpej Exp $ */
|
||||
/* $NetBSD: kvm_mips.c,v 1.12 1999/07/02 15:28:50 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
|
@ -11,13 +11,13 @@
|
|||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified for NetBSD/mips by Jason R. Thorpe, Numerical Aerospace
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: kvm_mips.c,v 1.11 1998/06/30 20:29:39 thorpej Exp $");
|
||||
__RCSID("$NetBSD: kvm_mips.c,v 1.12 1999/07/02 15:28:50 simonb Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_ns32k.c,v 1.9 1998/06/30 20:29:39 thorpej Exp $ */
|
||||
/* $NetBSD: kvm_ns32k.c,v 1.10 1999/07/02 15:28:50 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1992, 1993
|
||||
|
@ -42,12 +42,12 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_ns32k.c,v 1.9 1998/06/30 20:29:39 thorpej Exp $");
|
||||
__RCSID("$NetBSD: kvm_ns32k.c,v 1.10 1999/07/02 15:28:50 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* ns32k machine dependent routines for kvm. Hopefully, the forthcoming
|
||||
* ns32k machine dependent routines for kvm. Hopefully, the forthcoming
|
||||
* vm code will one day obsolete this module.
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kvm_open.3,v 1.5 1998/02/06 05:41:59 perry Exp $
|
||||
.\" $NetBSD: kvm_open.3,v 1.6 1999/07/02 15:28:50 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1992, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -60,10 +60,10 @@
|
|||
.Sh DESCRIPTION
|
||||
The functions
|
||||
.Fn kvm_open
|
||||
and
|
||||
and
|
||||
.Fn kvm_openfiles
|
||||
return a descriptor used to access kernel virtual memory
|
||||
via the
|
||||
via the
|
||||
.Xr kvm 3
|
||||
library routines. Both active kernels and crash dumps are accessible
|
||||
through this interface.
|
||||
|
@ -79,10 +79,10 @@ which is indicated by
|
|||
in
|
||||
.Pa Aq paths.h .
|
||||
.Pp
|
||||
.Fa corefile
|
||||
.Fa corefile
|
||||
is the kernel memory device file. It can be either
|
||||
.Pa /dev/mem
|
||||
or a crash dump core generated by
|
||||
or a crash dump core generated by
|
||||
.Xr savecore 8 .
|
||||
If
|
||||
.Fa corefile
|
||||
|
@ -103,7 +103,7 @@ from
|
|||
is used.
|
||||
.Pp
|
||||
The
|
||||
.Fa flags
|
||||
.Fa flags
|
||||
argument indicates read/write access as in
|
||||
.Xr open 2
|
||||
and applies only to the core file.
|
||||
|
@ -114,7 +114,7 @@ and
|
|||
.Dv O_RDWR
|
||||
are permitted.
|
||||
.Pp
|
||||
There are two open routines which differ only with respect to
|
||||
There are two open routines which differ only with respect to
|
||||
the error mechanism.
|
||||
One provides backward compatibility with the SunOS kvm library, while the
|
||||
other provides an improved error reporting framework.
|
||||
|
@ -125,11 +125,11 @@ function is the Sun kvm compatible open call. Here, the
|
|||
.Fa errstr
|
||||
argument indicates how errors should be handled. If it is
|
||||
.Dv NULL ,
|
||||
no errors are reported and the application cannot know the
|
||||
no errors are reported and the application cannot know the
|
||||
specific nature of the failed kvm call.
|
||||
If it is not
|
||||
.Dv NULL ,
|
||||
errors are printed to stderr with
|
||||
errors are printed to stderr with
|
||||
.Fa errstr
|
||||
prepended to the message, as in
|
||||
.Xr perror 3 .
|
||||
|
@ -167,7 +167,7 @@ argument. This buffer should be _POSIX2_LINE_MAX characters large (from
|
|||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn kvm_open
|
||||
and
|
||||
and
|
||||
.Fn kvm_openfiles
|
||||
functions both return a descriptor to be used
|
||||
in all subsequent kvm library calls.
|
||||
|
@ -176,7 +176,7 @@ On failure,
|
|||
.Dv NULL
|
||||
is returned, in which case
|
||||
.Fn kvm_openfiles
|
||||
writes the error message into
|
||||
writes the error message into
|
||||
.Fa errbuf .
|
||||
.Pp
|
||||
The
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_proc.c,v 1.30 1999/03/24 05:50:50 mrg Exp $ */
|
||||
/* $NetBSD: kvm_proc.c,v 1.31 1999/07/02 15:28:50 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -78,7 +78,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_proc.c,v 1.30 1999/03/24 05:50:50 mrg Exp $");
|
||||
__RCSID("$NetBSD: kvm_proc.c,v 1.31 1999/07/02 15:28:50 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -256,7 +256,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
|||
}
|
||||
|
||||
switch(what) {
|
||||
|
||||
|
||||
case KERN_PROC_PID:
|
||||
if (proc.p_pid != (pid_t)arg)
|
||||
continue;
|
||||
|
@ -294,7 +294,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
|||
eproc.e_pgid = pgrp.pg_id;
|
||||
eproc.e_jobc = pgrp.pg_jobc;
|
||||
if (KREAD(kd, (u_long)pgrp.pg_session, &sess)) {
|
||||
_kvm_err(kd, kd->program, "can't read session at %x",
|
||||
_kvm_err(kd, kd->program, "can't read session at %x",
|
||||
pgrp.pg_session);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
|||
if (tty.t_pgrp != NULL) {
|
||||
if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) {
|
||||
_kvm_err(kd, kd->program,
|
||||
"can't read tpgrp at &x",
|
||||
"can't read tpgrp at &x",
|
||||
tty.t_pgrp);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
|||
if (sess.s_leader == p)
|
||||
eproc.e_flag |= EPROC_SLEADER;
|
||||
if (proc.p_wmesg)
|
||||
(void)kvm_read(kd, (u_long)proc.p_wmesg,
|
||||
(void)kvm_read(kd, (u_long)proc.p_wmesg,
|
||||
eproc.e_wmesg, WMESGLEN);
|
||||
|
||||
(void)kvm_read(kd, (u_long)proc.p_vmspace,
|
||||
|
@ -339,7 +339,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
|||
break;
|
||||
|
||||
case KERN_PROC_TTY:
|
||||
if ((proc.p_flag & P_CONTROLT) == 0 ||
|
||||
if ((proc.p_flag & P_CONTROLT) == 0 ||
|
||||
eproc.e_tdev != (dev_t)arg)
|
||||
continue;
|
||||
break;
|
||||
|
@ -409,7 +409,7 @@ kvm_getprocs(kd, op, arg, cnt)
|
|||
|
||||
if (kd->procbase != 0) {
|
||||
free((void *)kd->procbase);
|
||||
/*
|
||||
/*
|
||||
* Clear this pointer in case this call fails. Otherwise,
|
||||
* kvm_close() will free it again.
|
||||
*/
|
||||
|
@ -506,7 +506,7 @@ _kvm_realloc(kd, p, n)
|
|||
|
||||
/*
|
||||
* Read in an argument vector from the user address space of process p.
|
||||
* addr if the user-space base address of narg null-terminated contiguous
|
||||
* addr if the user-space base address of narg null-terminated contiguous
|
||||
* strings. This is used to read in both the command arguments and
|
||||
* environment strings. Read at most maxcnt characters of strings.
|
||||
*/
|
||||
|
@ -536,13 +536,13 @@ kvm_argv(kd, p, addr, narg, maxcnt)
|
|||
* Try to avoid reallocs.
|
||||
*/
|
||||
kd->argc = MAX(narg + 1, 32);
|
||||
kd->argv = (char **)_kvm_malloc(kd, kd->argc *
|
||||
kd->argv = (char **)_kvm_malloc(kd, kd->argc *
|
||||
sizeof(*kd->argv));
|
||||
if (kd->argv == 0)
|
||||
return (0);
|
||||
} else if (narg + 1 > kd->argc) {
|
||||
kd->argc = MAX(2 * kd->argc, narg + 1);
|
||||
kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc *
|
||||
kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc *
|
||||
sizeof(*kd->argv));
|
||||
if (kd->argv == 0)
|
||||
return (0);
|
||||
|
@ -665,7 +665,7 @@ proc_verify(kd, kernp, p)
|
|||
* Just read in the whole proc. It's not that big relative
|
||||
* to the cost of the read system call.
|
||||
*/
|
||||
if (kvm_read(kd, kernp, (void *)&kernproc, sizeof(kernproc)) !=
|
||||
if (kvm_read(kd, kernp, (void *)&kernproc, sizeof(kernproc)) !=
|
||||
sizeof(kernproc))
|
||||
return (0);
|
||||
return (p->p_pid == kernproc.p_pid &&
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kvm_read.3,v 1.3 1998/02/05 18:51:48 perry Exp $
|
||||
.\" $NetBSD: kvm_read.3,v 1.4 1999/07/02 15:28:50 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1992, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -67,19 +67,19 @@ for information regarding opening kernel virtual memory and crash dumps.
|
|||
The
|
||||
.Fn kvm_read
|
||||
function transfers
|
||||
.Fa nbytes
|
||||
.Fa nbytes
|
||||
bytes of data from
|
||||
the kernel space address
|
||||
.Fa addr
|
||||
to
|
||||
.Fa buf .
|
||||
Conversely,
|
||||
Conversely,
|
||||
.Fn kvm_write
|
||||
transfers data from
|
||||
.Fa buf
|
||||
to
|
||||
.Fa addr .
|
||||
Unlike their SunOS counterparts, these functions cannot be used to
|
||||
Unlike their SunOS counterparts, these functions cannot be used to
|
||||
read or write process address spaces.
|
||||
.Sh RETURN VALUES
|
||||
Upon success, the number of bytes actually transferred is returned.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_sparc.c,v 1.20 1999/02/01 09:15:35 mrg Exp $ */
|
||||
/* $NetBSD: kvm_sparc.c,v 1.21 1999/07/02 15:28:51 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -42,12 +42,12 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_sparc.c,v 1.20 1999/02/01 09:15:35 mrg Exp $");
|
||||
__RCSID("$NetBSD: kvm_sparc.c,v 1.21 1999/07/02 15:28:51 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* Sparc machine dependent routines for kvm. Hopefully, the forthcoming
|
||||
* Sparc machine dependent routines for kvm. Hopefully, the forthcoming
|
||||
* vm code will one day obsolete this module.
|
||||
*/
|
||||
|
||||
|
@ -88,7 +88,7 @@ int _kvm_kvatop4u __P((kvm_t *, u_long, u_long *));
|
|||
|
||||
/*
|
||||
* XXX
|
||||
* taken from /sys/arch/sparc64/include/kcore.h.
|
||||
* taken from /sys/arch/sparc64/include/kcore.h.
|
||||
* this is the same as the sparc one, except for the kphys addition,
|
||||
* so luckily we can use this here...
|
||||
*/
|
||||
|
@ -151,7 +151,7 @@ _kvm_initvtop(kd)
|
|||
/*
|
||||
* Translate a kernel virtual address to a physical address using the
|
||||
* mapping information in kd->vm. Returns the result in pa, and returns
|
||||
* the number of bytes that are contiguously available from this
|
||||
* the number of bytes that are contiguously available from this
|
||||
* physical address. This routine is used only for crashdumps.
|
||||
*/
|
||||
int
|
||||
|
@ -307,12 +307,12 @@ _kvm_kvatop4u(kd, va, pa)
|
|||
if (va < kernbase)
|
||||
goto err;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Kernel layout:
|
||||
*
|
||||
* kernbase:
|
||||
* 4MB locked TLB (text+data+BSS)
|
||||
* Random other stuff.
|
||||
* Random other stuff.
|
||||
*/
|
||||
if (va >= kernbase && va < kernbase + 4*1024*1024)
|
||||
return (va - kernbase) + kphys;
|
||||
|
@ -353,9 +353,9 @@ err:
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Translate a physical address to a file-offset in the crash-dump.
|
||||
*/
|
||||
*/
|
||||
off_t
|
||||
_kvm_pa2off(kd, pa)
|
||||
kvm_t *kd;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_sparc64.c,v 1.1 1998/11/25 05:49:58 eeh Exp $ */
|
||||
/* $NetBSD: kvm_sparc64.c,v 1.2 1999/07/02 15:28:51 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -42,12 +42,12 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_sparc64.c,v 1.1 1998/11/25 05:49:58 eeh Exp $");
|
||||
__RCSID("$NetBSD: kvm_sparc64.c,v 1.2 1999/07/02 15:28:51 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* Sparc machine dependent routines for kvm. Hopefully, the forthcoming
|
||||
* Sparc machine dependent routines for kvm. Hopefully, the forthcoming
|
||||
* vm code will one day obsolete this module.
|
||||
*/
|
||||
|
||||
|
@ -99,7 +99,7 @@ _kvm_initvtop(kd)
|
|||
/*
|
||||
* Translate a kernel virtual address to a physical address using the
|
||||
* mapping information in kd->vm. Returns the result in pa, and returns
|
||||
* the number of bytes that are contiguously available from this
|
||||
* the number of bytes that are contiguously available from this
|
||||
* physical address. This routine is used only for crashdumps.
|
||||
*/
|
||||
int
|
||||
|
@ -121,7 +121,7 @@ _kvm_kvatop(kd, va, pa)
|
|||
vaddr = va - cpup->kernbase;
|
||||
*pa = cpup->kphys + va;
|
||||
return (4*1024*1024 - va);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
/*
|
||||
* Layout of CPU segment:
|
||||
|
@ -159,9 +159,9 @@ err:
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Translate a physical address to a file-offset in the crash-dump.
|
||||
*/
|
||||
*/
|
||||
off_t
|
||||
_kvm_pa2off(kd, pa)
|
||||
kvm_t *kd;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_sun3.c,v 1.8 1997/10/12 11:04:18 briggs Exp $ */
|
||||
/* $NetBSD: kvm_sun3.c,v 1.9 1999/07/02 15:28:51 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -42,7 +42,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_sun3.c,v 1.8 1997/10/12 11:04:18 briggs Exp $");
|
||||
__RCSID("$NetBSD: kvm_sun3.c,v 1.9 1999/07/02 15:28:51 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -131,7 +131,7 @@ _kvm_sun3_freevtop(kd)
|
|||
/*
|
||||
* Translate a kernel virtual address to a physical address using the
|
||||
* mapping information in kd->vm. Returns the result in pa, and returns
|
||||
* the number of bytes that are contiguously available from this
|
||||
* the number of bytes that are contiguously available from this
|
||||
* physical address. This routine is used only for crashdumps.
|
||||
*/
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_sun3x.c,v 1.5 1997/10/12 11:04:22 briggs Exp $ */
|
||||
/* $NetBSD: kvm_sun3x.c,v 1.6 1999/07/02 15:28:51 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_sun3x.c,v 1.5 1997/10/12 11:04:22 briggs Exp $");
|
||||
__RCSID("$NetBSD: kvm_sun3x.c,v 1.6 1999/07/02 15:28:51 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -104,7 +104,7 @@ _kvm_sun3x_freevtop(kd)
|
|||
/*
|
||||
* Translate a kernel virtual address to a physical address using the
|
||||
* mapping information in kd->vm. Returns the result in pa, and returns
|
||||
* the number of bytes that are contiguously available from this
|
||||
* the number of bytes that are contiguously available from this
|
||||
* physical address. This routine is used only for crashdumps.
|
||||
*/
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kvm_vax.c,v 1.7 1998/02/03 19:12:45 perry Exp $ */
|
||||
/* $NetBSD: kvm_vax.c,v 1.8 1999/07/02 15:28:51 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -107,7 +107,7 @@ _kvm_initvtop(kd)
|
|||
/*
|
||||
* Translate a kernel virtual address to a physical address using the
|
||||
* mapping information in kd->vm. Returns the result in pa, and returns
|
||||
* the number of bytes that are contiguously available from this
|
||||
* the number of bytes that are contiguously available from this
|
||||
* physical address. This routine is used only for crashdumps.
|
||||
*/
|
||||
int
|
||||
|
@ -133,14 +133,14 @@ _kvm_kvatop(kd, va, pa)
|
|||
return (end - va);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Translate a physical address to a file-offset in the crash-dump.
|
||||
* XXX - crash-dumps doesn't work anyway.
|
||||
*/
|
||||
off_t
|
||||
_kvm_pa2off(kd, pa)
|
||||
kvm_t *kd;
|
||||
u_long pa;
|
||||
u_long pa;
|
||||
{
|
||||
return(kd->dump_off + pa);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue