xref: /titanic_50/usr/src/lib/libkvm/kvm.h (revision 35a5a3587fd94b666239c157d3722745250ccbd7)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1987-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_KVM_H
28 #define	_KVM_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <nlist.h>
34 #include <sys/user.h>
35 #include <sys/proc.h>
36 
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /* define a 'cookie' to pass around between user code and the library */
43 typedef struct _kvmd kvm_t;
44 
45 /* libkvm routine definitions */
46 
47 #ifdef __STDC__
48 
49 extern kvm_t	*kvm_open(const char *, const char *, const char *,
50 		int, const char *);
51 extern int	kvm_close(kvm_t *);
52 extern int	kvm_nlist(kvm_t *, struct nlist []);
53 extern ssize_t	kvm_read(kvm_t *, uintptr_t, void *, size_t);
54 extern ssize_t	kvm_kread(kvm_t *, uintptr_t, void *, size_t);
55 extern ssize_t	kvm_uread(kvm_t *, uintptr_t, void *, size_t);
56 extern ssize_t	kvm_aread(kvm_t *, uintptr_t, void *, size_t, struct as *);
57 extern ssize_t	kvm_pread(kvm_t *, uint64_t, void *, size_t);
58 extern ssize_t	kvm_write(kvm_t *, uintptr_t, const void *, size_t);
59 extern ssize_t	kvm_kwrite(kvm_t *, uintptr_t, const void *, size_t);
60 extern ssize_t	kvm_uwrite(kvm_t *, uintptr_t, const void *, size_t);
61 extern ssize_t	kvm_awrite(kvm_t *, uintptr_t, const void *, size_t,
62 		struct as *);
63 extern ssize_t	kvm_pwrite(kvm_t *, uint64_t, const void *, size_t);
64 extern uint64_t	kvm_physaddr(kvm_t *, struct as *, uintptr_t);
65 extern proc_t	*kvm_getproc(kvm_t *, pid_t);
66 extern proc_t	*kvm_nextproc(kvm_t *);
67 extern int	kvm_setproc(kvm_t *);
68 extern user_t	*kvm_getu(kvm_t *, struct proc *);
69 extern int	kvm_getcmd(kvm_t *, proc_t *, user_t *, char ***, char ***);
70 
71 #else
72 
73 extern kvm_t	*kvm_open();
74 extern int	kvm_close();
75 extern int	kvm_nlist();
76 extern ssize_t	kvm_read();
77 extern ssize_t	kvm_kread();
78 extern ssize_t	kvm_uread();
79 extern ssize_t	kvm_aread();
80 extern ssize_t	kvm_pread();
81 extern ssize_t	kvm_write();
82 extern ssize_t	kvm_kwrite();
83 extern ssize_t	kvm_uwrite();
84 extern ssize_t	kvm_awrite();
85 extern ssize_t	kvm_pwrite();
86 extern uint64_t	Kvm_physaddr();
87 extern proc_t	*kvm_getproc();
88 extern proc_t	*kvm_nextproc();
89 extern int	kvm_setproc();
90 extern user_t	*kvm_getu();
91 extern int	kvm_getcmd();
92 
93 #endif	/* __STDC__ */
94 
95 #ifdef	__cplusplus
96 }
97 #endif
98 
99 #endif	/* _KVM_H */
100