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