Commit Graph

32 Commits

Author SHA1 Message Date
jym 962a341df6 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
2010-09-20 23:23:16 +00:00
jym 6dc46b923b 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
2010-09-19 02:07:00 +00:00
mrg ed79731b5f use <sparc/pmap.h> and <sparc/kcore.h> so this builds properly with
a 64 bit "cc -m32".
2008-10-25 19:09:10 +00:00
ad a7a2d171df Handle reading from raw disk devices. 2008-01-15 13:57:41 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
wiz b976c55907 Consistently spell "crash dump" as two separate words. From jmc@openbsd. 2003-05-16 10:24:55 +00:00
mrg 88199bcb84 undefine VA_VPG and VA_OFF before defining them. 2001-09-22 00:53:01 +00:00
matt cce919e025 Don't include <machine/pmap.h> and <machine/vmparam.h> if _KERNEL isn't
defined.  Include them explicitly in the few kvm_arch.c that need them.
2001-08-05 03:33:15 +00:00
sommerfeld 934ef16427 Format size mismatch 2000-10-04 18:12:01 +00:00
mrg 3b8ac18da2 <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 06:34:22 +00:00
mrg 10a6db97ee remove redundant vm includes 2000-06-26 15:34:55 +00:00
simonb f68ec00b50 More trailing white space. 1999-07-02 15:28:49 +00:00
mrg 2998626fe3 uh...make this build on the sparc again...or something. i've had
to pull a few #define's from the sparc64 include's into this file,
renamed so that they don't break the sparc64.  this is really hacky,
and should be fixed somehow.  if the sparc is going to know about
32bit sparc64 kernels, the information necessary to get this needs
to exist somewhere for it to grab, not for duplication :(
1999-02-01 09:15:35 +00:00
eeh d2aa2f5098 Need to be able to handle sparc64 executables as well. 1999-01-30 16:57:25 +00:00
thorpej 55c7ea7c28 Use pread(2) and pwrite(2) rather than lseek(2)/{read,write}(2). 1998-06-30 20:29:39 +00:00
pk 98de63c4a1 No need for autoconf.h 1998-03-15 23:26:04 +00:00
perry 0b7831a37b remove obsolete register declarations 1998-02-03 19:12:13 +00:00
mrg 88b52f5f52 clean WARNS on the sparc. 1997-10-10 13:11:50 +00:00
pk 7dad7db427 The `cpu_kcore' header has changed allowing libkvm to be independent of
the kernel's link address (KERNBASE).
1997-09-20 18:26:20 +00:00
mikel b4119f6b37 use <sys/cdefs.h> __RCSID() macro 1997-08-15 02:21:56 +00:00
gwr f638574915 Add _kvm_mdopen() 1997-08-12 16:34:07 +00:00
pk 0b0b9b7777 Off by 1 in PMEG comparison. 1997-04-02 21:07:03 +00:00
pk 9cb162ce6a Handle crash dumps new-style. 1996-11-09 23:47:34 +00:00
cgd 82501b607b sync with libkvm.old sources (change committed by pk):
>Catch up with system PMAP.
1996-04-01 19:23:03 +00:00
thorpej 346e67f879 RCS id police. 1996-03-18 22:33:07 +00:00
pk 16e30a94d1 Deal with crash dumps again. 1995-07-05 18:41:25 +00:00
pk 3c8e6db690 Disable "dead kernel" stuff until we have something new. 1995-04-13 19:32:40 +00:00
mycroft c304971439 Eliminate _kvm_uvatop(), in favor of using the machine-independent VM structures. 1995-01-09 08:59:25 +00:00
deraadt 12e0db7fb1 make this work (with a horrible hack for determining the cputyp) 1994-11-02 04:51:38 +00:00
deraadt fdf894abcd should work for sun4 and sun4c 1994-09-18 02:32:50 +00:00
pk 24c3ce74de Changes in pmap structures. 1994-06-10 14:34:58 +00:00
cgd 0215cc7d1f new libkvm 1994-05-09 03:15:36 +00:00