Commit Graph

20 Commits

Author SHA1 Message Date
dsl 7c166415e7 Remove the #include <sys/user.h> from all of libkvm.
sys/user.h is a stub that just #includes sys/pcb.h.
There are no 'struct pcb' anywhere in here, so I'm extremely doubtful
any of the builds will fail.
OTOH it might be relying on a header that pcb.h includes.
In any case i386 and amd64 build.
2014-02-19 20:21:22 +00:00
matt 0deb66dfa6 Add missing __RCSID("$NetBSD$"); 2014-01-27 21:00:01 +00:00
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
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
thorpej 2c6ba846c5 Rename a local to avoid a -Wshadow warning. 2001-11-29 23:32:42 +00:00
chuck a089eada9d include machine/vmparam.h so it will compile once again 2001-09-07 01:48:37 +00:00
matt 6ea9494104 be consistent in the use of u_long. eventually they should be uintptr_t. 2000-10-27 21:38:10 +00:00
he dd0d61e300 Use %lx instead of %x with _kvm_err when arg is u_long. 2000-10-10 20:44:16 +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
perry 0b7831a37b remove obsolete register declarations 1998-02-03 19:12:13 +00:00
ragge 41d776ab5c Fix warnings. 1997-10-20 12:49:50 +00:00
gwr f638574915 Add _kvm_mdopen() 1997-08-12 16:34:07 +00:00
ragge 5c3223d49a Vax now uses new libkvm. 1997-06-07 12:18:54 +00:00
thorpej 346e67f879 RCS id police. 1996-03-18 22:33:07 +00:00
ragge 5993e44288 kvm_vax.c added. 1995-04-25 15:41:11 +00:00
ragge 460abf6176 kvm machine specific code for VAX. 1995-04-17 12:44:34 +00:00