Commit | Line | Data |
---|---|---|
b8b13822 KM |
1 | /*- |
2 | * Copyright (c) 1992 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
1741f35d KB |
5 | * This code is derived from software developed by the Computer Systems |
6 | * Engineering group at Lawrence Berkeley Laboratory under DARPA contract | |
7 | * BG 91-66 and contributed to Berkeley. | |
8 | * | |
b8b13822 KM |
9 | * %sccs.include.redist.c% |
10 | * | |
1741f35d | 11 | * @(#)kvm_private.h 5.3 (Berkeley) %G% |
b8b13822 KM |
12 | */ |
13 | ||
14 | struct __kvm { | |
15 | /* | |
16 | * a string to be prepended to error messages | |
17 | * provided for compatibility with sun's interface | |
18 | * if this value is null, errors are saved in errbuf[] | |
19 | */ | |
20 | const char *program; | |
21 | char *errp; /* XXX this can probably go away */ | |
22 | char errbuf[_POSIX2_LINE_MAX]; | |
938a1499 | 23 | DB *db; |
b8b13822 KM |
24 | #define ISALIVE(kd) ((kd)->vmfd >= 0) |
25 | int pmfd; /* physical memory file (or crashdump) */ | |
26 | int vmfd; /* virtual memory file (-1 if crashdump) */ | |
27 | int swfd; /* swap file (e.g., /dev/drum) */ | |
28 | int nlfd; /* namelist file (e.g., /vmunix) */ | |
29 | struct kinfo_proc *procbase; | |
30 | char *argspc; /* (dynamic) storage for argv strings */ | |
31 | int arglen; /* length of the above */ | |
32 | char **argv; /* (dynamic) storage for argv pointers */ | |
33 | int argc; /* length of above (not actual # present) */ | |
34 | /* | |
35 | * Kernel virtual address translation state. This only gets filled | |
36 | * in for dead kernels; otherwise, the running kernel (i.e. kmem) | |
37 | * will do the translations for us. It could be big, so we | |
38 | * only allocate it if necessary. | |
39 | */ | |
40 | struct vmstate *vmst; | |
41 | }; | |
42 | ||
43 | /* | |
44 | * Functions used internally by kvm, but across kvm modules. | |
45 | */ | |
938a1499 KS |
46 | void _kvm_err __P((kvm_t *kd, const char *program, const char *fmt, ...)); |
47 | void _kvm_freeprocs __P((kvm_t *kd)); | |
48 | void _kvm_freevtop __P((kvm_t *)); | |
49 | int _kvm_initvtop __P((kvm_t *)); | |
50 | int _kvm_kvatop __P((kvm_t *, u_long, u_long *)); | |
51 | void *_kvm_malloc __P((kvm_t *kd, size_t)); | |
52 | void *_kvm_realloc __P((kvm_t *kd, void *, size_t)); | |
53 | void _kvm_syserr | |
54 | __P((kvm_t *kd, const char *program, const char *fmt, ...)); | |
55 | int _kvm_uvatop __P((kvm_t *, const struct proc *, u_long, u_long *)); |