Home | History | Annotate | Download | only in libkvm
History log of /src/lib/libkvm/kvm_private.h
RevisionDateAuthorComments
 1.23  19-Apr-2022  rillig lib: remove CONSTCOND comment

Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
 1.22  10-Jan-2022  christos Get rid of usrstack/USRSTACK. Document that the old version of getargv is
broken because of ASLR.
 1.21  28-Apr-2020  christos Implement kvm_write() for dump files. We map the file privately so that
changes don't get propagated back, and then write to the private buffer.
This is not useful yes, but it is simple enough to make pread use the buffer
if it is available.
 1.20  12-Sep-2011  christos add a function to report the name of the file kvm_open{,.files} is using.
 1.19  26-Sep-2010  jym Define KREAD() inside kvm_private.h, for reusability.
 1.18  20-Sep-2010  jym Change kvm_pa2off() and kvm_kvatop() prototypes (private to kvm(3)):

-int _kvm_kvatop(kvm_t *, u_long, u_long *);
-off_t _kvm_pa2off(kvm_t *, u_long);
+int _kvm_kvatop(kvm_t *, vaddr_t, paddr_t *);
+off_t _kvm_pa2off(kvm_t *, paddr_t);

Basically, use vaddr_t for VA and paddr_t for PA. In addition, for variables
representing addresses, use paddr_t or vaddr_t, depending on the context.

For most arches, vaddr_t and paddr_t are equivalent to unsigned long. However,
the change was needed for exotic situations, like i386 PAE, were unsigned long
is not suitable for PA which are 64 bits long. As this required a complete
change of the function prototypes, all arches had to be adapted accordingly.

Core files from before this commit should still work with the new code; I did
not see any direct dependency between core's structure and kvatop/pa2off.

The change was compile tested for all arches, as it impacts all of them.

See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html
 1.17  19-Sep-2010  jym Ansify and KNF all functions within kvm(3). No objection on current-users@.

Used as ground for u_long => vaddr_t/paddr_t replacements in kvm(3)
private functions.

Compile tested for all arches. See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html
 1.16  15-Jan-2008  ad Handle reading from raw disk devices.
 1.15  16-Feb-2006  christos branches: 1.15.10;
1. Eliminate some unnecessary to kvm_{m,re}alloc.
2. Don't malloc/free procbase/procbase2/lwpbase continuously. Keep track
of the size, and only do it if necessary.
3. Write a macro to malloc/realloc and set the size of members so that it
is done correctly. Previous open coded version in kvm_file.c always
set the length, which is incorrect.
4. Remove bogus check against INT_MAX.
5. use NULL to initialize pointers instead of 0.
 1.14  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13  16-May-2003  wiz Consistently spell "crash dump" as two separate words. From jmc@openbsd.
 1.12  11-May-2003  ragge Make the kvm routines use /dev/ksyms to get the kernel namelist.
If it fails, use /netbsd instead.
 1.11  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.10  04-Oct-2000  sommerfeld branches: 1.10.2;
format-string audit cleanups
 1.9  26-May-2000  simonb Add kvm interface to the new sysctls:
kvm_getproc2() -> sysctl(KERN_PROC2)
kvm_getargv2() -> sysctl(KERN_PROC_ARGS, KERN_PROC_ARGV)
kvm_getenvv2() -> sysctl(KERN_PROC_ARGS, KERN_PROC_ENV)
Add new KVM_NO_FILES flag to kvm_open*() - set up enough state to
use the above calls without having to open any kernel files.

XXX: kvm_getprocs.3 and kvm_open.3 to be updated soon.
 1.8  12-Aug-1997  gwr branches: 1.8.4;
Add the members: usrstack, min_uva, max_uva to struct __kvm
and declare the function _kvm_mdopen() that initializes them.
 1.7  05-May-1996  gwr Allow more flexibility in the format of cpu_kcore_hdr_t and isolate
the knowledge of that struct in the machine-dependent module.
 1.6  18-Mar-1996  thorpej RCS id police.
 1.5  16-Mar-1996  leo New libkvm/savecore implementation. With the following differences:
1) savecore will not access the dump or live-kernel directly. It
will always use the kvm-functions. Allowing it to work on kernels
that don't have a 1-1 PA-VA mapping.
2) the kvm-lib has some additional functions to accomplish 1
- kvm_dump_mkheader()
- kvm_dump_wrtheader()
- kvm_dump_inval()
3) the file formats of the dump generated by the kernel and the dump
generated by savecore have been changed. The file format now looks
like the format produced for 'normal' core dumps.
Ports not yet supporting the new kvm-format will be using libkvm.old/
savecore.old for the time being.
 1.4  16-May-1995  mycroft Use the new ps_strings format. Find the arguments using their
addresses in the argv array, rather than guessing based on the location
of NULs.
 1.3  09-Jan-1995  mycroft Eliminate _kvm_uvatop(), in favor of using the machine-independent VM structures.
 1.2  18-Sep-1994  mycroft Move the swap page buffer into struct __kvm. Cache the page size during
kvm_open(). Fix an existing memory leak.
 1.1  09-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  09-May-1994  cgd new libkvm
 1.8.4.1  04-Oct-2000  he Pull up revision 1.10 (requested by sommerfeld):
Format string audit.
 1.10.2.1  23-Apr-2002  nathanw Make libkvm able to cope with a LWPified kernel.

Add a kvm_getlwps() function to retrieve the LWPs of a specific process.
 1.15.10.1  23-Mar-2008  matt sync with HEAD

RSS XML Feed