2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 1987, 1998, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _KVM_H
2N/A#define _KVM_H
2N/A
2N/A#include <sys/types.h>
2N/A#include <nlist.h>
2N/A#include <sys/user.h>
2N/A#include <sys/proc.h>
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/* define a 'cookie' to pass around between user code and the library */
2N/Atypedef struct _kvmd kvm_t;
2N/A
2N/A/* libkvm routine definitions */
2N/A
2N/A#ifdef __STDC__
2N/A
2N/Aextern kvm_t *kvm_open(const char *, const char *, const char *,
2N/A int, const char *);
2N/Aextern int kvm_close(kvm_t *);
2N/Aextern int kvm_nlist(kvm_t *, struct nlist []);
2N/Aextern ssize_t kvm_read(kvm_t *, uintptr_t, void *, size_t);
2N/Aextern ssize_t kvm_kread(kvm_t *, uintptr_t, void *, size_t);
2N/Aextern ssize_t kvm_uread(kvm_t *, uintptr_t, void *, size_t);
2N/Aextern ssize_t kvm_aread(kvm_t *, uintptr_t, void *, size_t, struct as *);
2N/Aextern ssize_t kvm_pread(kvm_t *, uint64_t, void *, size_t);
2N/Aextern ssize_t kvm_write(kvm_t *, uintptr_t, const void *, size_t);
2N/Aextern ssize_t kvm_kwrite(kvm_t *, uintptr_t, const void *, size_t);
2N/Aextern ssize_t kvm_uwrite(kvm_t *, uintptr_t, const void *, size_t);
2N/Aextern ssize_t kvm_awrite(kvm_t *, uintptr_t, const void *, size_t,
2N/A struct as *);
2N/Aextern ssize_t kvm_pwrite(kvm_t *, uint64_t, const void *, size_t);
2N/Aextern uint64_t kvm_physaddr(kvm_t *, struct as *, uintptr_t);
2N/Aextern proc_t *kvm_getproc(kvm_t *, pid_t);
2N/Aextern proc_t *kvm_nextproc(kvm_t *);
2N/Aextern int kvm_setproc(kvm_t *);
2N/Aextern user_t *kvm_getu(kvm_t *, struct proc *);
2N/Aextern int kvm_getcmd(kvm_t *, proc_t *, user_t *, char ***, char ***);
2N/A
2N/A#else
2N/A
2N/Aextern kvm_t *kvm_open();
2N/Aextern int kvm_close();
2N/Aextern int kvm_nlist();
2N/Aextern ssize_t kvm_read();
2N/Aextern ssize_t kvm_kread();
2N/Aextern ssize_t kvm_uread();
2N/Aextern ssize_t kvm_aread();
2N/Aextern ssize_t kvm_pread();
2N/Aextern ssize_t kvm_write();
2N/Aextern ssize_t kvm_kwrite();
2N/Aextern ssize_t kvm_uwrite();
2N/Aextern ssize_t kvm_awrite();
2N/Aextern ssize_t kvm_pwrite();
2N/Aextern uint64_t Kvm_physaddr();
2N/Aextern proc_t *kvm_getproc();
2N/Aextern proc_t *kvm_nextproc();
2N/Aextern int kvm_setproc();
2N/Aextern user_t *kvm_getu();
2N/Aextern int kvm_getcmd();
2N/A
2N/A#endif /* __STDC__ */
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _KVM_H */