4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
31 * The default KVM backend, which simply calls directly into libkvm for all
35 #include <mdb/mdb_kb.h>
36 #include <mdb/mdb_target_impl.h>
44 libkvm_sym_io(void *kvm
, const char *ignored
)
47 const char *symfile
= kvm_namelist(kvm
);
49 if ((io
= mdb_fdio_create_path(NULL
, symfile
, O_RDONLY
, 0)) == NULL
)
50 mdb_warn("failed to open %s", symfile
);
58 static mdb_kb_ops_t ops
= {
59 .kb_open
= (void *(*)())kvm_open
,
60 .kb_close
= (int (*)())kvm_close
,
61 .kb_sym_io
= libkvm_sym_io
,
62 .kb_kread
= (ssize_t (*)())kvm_kread
,
63 .kb_kwrite
= (ssize_t (*)())kvm_kwrite
,
64 .kb_aread
= (ssize_t (*)())kvm_aread
,
65 .kb_awrite
= (ssize_t (*)())kvm_awrite
,
66 .kb_pread
= (ssize_t (*)())kvm_pread
,
67 .kb_pwrite
= (ssize_t (*)())kvm_pwrite
,
68 .kb_getmregs
= (int (*)())mdb_tgt_notsup
,
69 .kb_vtop
= (uint64_t (*)())kvm_physaddr
,