mdb_kvm.h revision 843e19887f64dde75055cf8842fc4db2171eff45
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _MDB_KVM_H
#define _MDB_KVM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libctf.h>
#include <kvm.h>
#include <mdb/mdb_target.h>
#include <mdb/mdb_list.h>
#include <mdb/mdb_gelf.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _MDB
typedef struct kt_module {
char *km_name; /* Module name */
void *km_data; /* Data buffer (module->symspace) */
void *km_symbuf; /* Base of symbol table in km_data */
char *km_strtab; /* Base of string table in km_data */
void *km_ctf_buf; /* CTF data for this module */
} kt_module_t;
typedef struct kt_data {
void (*k_dump_print_content)(); /* mdb_ks dump_print_content routine */
int (*k_dump_find_curproc)(); /* mdb_ks dump_find_curproc routine */
char *k_symfile; /* Symbol table pathname */
char *k_kvmfile; /* Core file pathname */
int k_xpv_domu; /* Hypervisor domain dump? */
const char *k_rtld_name; /* module containing krtld */
void *k_cookie; /* Cookie for libkvm routines */
int k_activated; /* Set if kt_activate called */
int k_ctfvalid; /* Set if kernel has a CTF arena */
} kt_data_t;
/* values for k_dumpcontent */
#define KT_DUMPCONTENT_KERNEL 0
#define KT_DUMPCONTENT_INVALID -1
#define KT_DUMPCONTENT_ALL -2
extern int kt_setflags(mdb_tgt_t *, int);
extern int kt_setcontext(mdb_tgt_t *, void *);
extern void kt_activate(mdb_tgt_t *);
extern void kt_deactivate(mdb_tgt_t *);
extern void kt_destroy(mdb_tgt_t *);
extern const char *kt_platform(mdb_tgt_t *);
void *, size_t, mdb_tgt_addr_t);
const void *, size_t, mdb_tgt_addr_t);
extern int kt_lookup_by_name(mdb_tgt_t *, const char *,
const char *, GElf_Sym *, mdb_syminfo_t *);
uint_t, mdb_tgt_sym_f *, void *);
#ifdef __sparc
extern void kt_sparcv9_init(mdb_tgt_t *);
extern void kt_sparcv7_init(mdb_tgt_t *);
#else /* __sparc */
extern void kt_ia32_init(mdb_tgt_t *);
extern void kt_amd64_init(mdb_tgt_t *);
#endif /* __sparc */
typedef int (*mdb_name_lookup_fcn_t)(const char *, GElf_Sym *);
GElf_Sym *);
extern void mdb_kvm_add_name_lookup(mdb_name_lookup_fcn_t);
extern void mdb_kvm_add_addr_lookup(mdb_addr_lookup_fcn_t);
#endif /* _MDB */
#ifdef __cplusplus
}
#endif
#endif /* _MDB_KVM_H */