Print this page
11626 introduce /etc/versions/build
11627 clean up UUID code for ::status
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/mdb/common/mdb/mdb_ks.h
+++ new/usr/src/cmd/mdb/common/mdb/mdb_ks.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 +/*
27 + * Copyright 2019 Joyent, Inc.
28 + */
29 +
26 30 #ifndef _MDB_KS_H
27 31 #define _MDB_KS_H
28 32
29 33 #include <sys/types.h>
30 34 #include <sys/int_types.h>
31 35 #include <sys/stream.h>
32 36 #include <sys/vnode.h>
33 37 #include <sys/proc.h>
34 38 #include <sys/dumphdr.h>
35 39 #include <sys/auxv.h>
36 40
37 41 #ifdef __cplusplus
38 42 extern "C" {
39 43 #endif
40 44
41 45 /*
42 46 * MDB Kernel Support Interfaces:
43 47 *
44 48 * Debugger modules for kernel crash dumps can make use of these utility
45 49 * functions. This module also provides support for <mdb/mdb_param.h>.
46 50 */
47 51
48 52 extern int mdb_vnode2path(uintptr_t, char *, size_t);
49 53
50 54 extern uintptr_t mdb_page_lookup(uintptr_t, u_offset_t);
51 55
52 56 extern pfn_t mdb_page2pfn(uintptr_t);
53 57 extern uintptr_t mdb_pfn2page(pfn_t);
54 58
55 59 extern uintptr_t mdb_pid2proc(pid_t, proc_t *);
56 60 extern char mdb_vtype2chr(vtype_t, mode_t);
57 61 extern uintptr_t mdb_addr2modctl(uintptr_t);
58 62
59 63 extern ssize_t mdb_read_refstr(uintptr_t, char *, size_t);
60 64
61 65 extern int mdb_name_to_major(const char *, major_t *);
62 66 extern const char *mdb_major_to_name(major_t);
63 67
64 68 extern int mdb_devinfo2driver(uintptr_t, char *, size_t);
65 69 extern int mdb_devinfo2statep(uintptr_t, char *, uintptr_t *);
66 70
67 71 extern int mdb_cpu2cpuid(uintptr_t);
68 72
69 73 extern int mdb_cpuset_find(uintptr_t);
70 74
71 75 extern hrtime_t mdb_gethrtime(void);
72 76 extern int64_t mdb_get_lbolt(void);
73 77
74 78 /*
75 79 * Returns a pointer to the top of the soft state struct for the instance
76 80 * specified, given the address of the global soft state pointer and size
77 81 * of the struct. Also fills in the buffer pointed to by state_buf_p (if
78 82 * non-NULL) with the contents of the state struct.
79 83 */
80 84 extern int mdb_get_soft_state_byaddr(uintptr_t, uint_t, uintptr_t *, void *,
81 85 size_t);
82 86
83 87 /*
84 88 * Returns a pointer to the top of the soft state struct for the instance
85 89 * specified, given the name of the global soft state pointer and size
86 90 * of the struct. Also fills in the buffer pointed to by state_buf_p (if
87 91 * non-NULL) with the contents of the state struct.
88 92 */
89 93 extern int mdb_get_soft_state_byname(char *, uint_t, uintptr_t *, void *,
90 94 size_t);
91 95
92 96 /*
93 97 * Returns the pathname from the root devinfo node to the dip supplied.
94 98 * Just like ddi_pathname in sunddi.c.
95 99 */
96 100 extern char *mdb_ddi_pathname(uintptr_t, char *, size_t);
97 101
98 102 /*
99 103 * MDB Kernel STREAMS Subsystem:
100 104 *
101 105 * Debugger modules such as ip can provide facilities for decoding private
102 106 * q_ptr data for STREAMS queues using this mechanism. The module first
103 107 * registers a set of functions which may be invoked when q->q_qinfo matches
104 108 * a given qinit address (such as ip`winit). The q_info function provides
105 109 * a way for the module to return an information string about the particular
106 110 * queue. The q_rnext and q_wnext functions provide a way for the generic
107 111 * queue walker to ask how to proceed deeper in the STREAM when q_next is
108 112 * NULL. This allows ip, for example, to provide access to the link-layer
109 113 * queues beneath the ip-client queue.
110 114 */
111 115
112 116 typedef struct mdb_qops {
113 117 void (*q_info)(const queue_t *, char *, size_t);
114 118 uintptr_t (*q_rnext)(const queue_t *);
115 119 uintptr_t (*q_wnext)(const queue_t *);
116 120 } mdb_qops_t;
117 121
118 122 extern void mdb_qops_install(const mdb_qops_t *, uintptr_t);
119 123 extern void mdb_qops_remove(const mdb_qops_t *, uintptr_t);
120 124
121 125 extern char *mdb_qname(const queue_t *, char *, size_t);
122 126 extern void mdb_qinfo(const queue_t *, char *, size_t);
123 127
124 128 extern uintptr_t mdb_qrnext(const queue_t *);
125 129 extern uintptr_t mdb_qwnext(const queue_t *);
126 130
127 131 /*
128 132 * These functions, provided by mdb_ks, may be used to fill in the q_rnext
129 133 * and q_wnext members of mdb_qops_t, in the case where the client wishes
130 134 * to simply return q->q_next:
131 135 */
132 136 extern uintptr_t mdb_qrnext_default(const queue_t *);
↓ open down ↓ |
97 lines elided |
↑ open up ↑ |
133 137 extern uintptr_t mdb_qwnext_default(const queue_t *);
134 138
135 139 extern int mdb_mblk_count(const mblk_t *);
136 140
137 141 /* DLPI primitive to string; returns NULL for unknown primitives */
138 142 extern const char *mdb_dlpi_prim(int);
139 143
140 144 /* Generic function for working with MAC (network layer 2) addresses. */
141 145 extern void mdb_mac_addr(const uint8_t *, size_t, char *, size_t);
142 146
147 +extern void mdb_print_buildversion(void);
148 +
143 149 /*
144 150 * Target-specific interfaces
145 151 *
146 152 * The existence and accessibility of the functions listed below is relied upon
147 153 * by the indicated targets. The targets look up and invoke these functions in
148 154 * mdb_ks so that dependencies on the current kernel implementation are
149 155 * isolated in mdb_ks.
150 156 */
151 157
152 158 /*
153 159 * MDB KPROC Target Interface:
154 160 * (user processes from kernel crash dump)
155 161 */
156 162
157 163 struct mdb_map; /* Private between kproc and ks */
158 164
159 165 extern int mdb_kproc_asiter(uintptr_t,
160 166 void (*)(const struct mdb_map *, void *), void *);
161 167 extern int mdb_kproc_auxv(uintptr_t, auxv_t *);
162 168 extern uintptr_t mdb_kproc_as(uintptr_t);
163 169 extern pid_t mdb_kproc_pid(uintptr_t);
164 170
165 171
166 172 /*
167 173 * MDB KVM Target Interface:
168 174 * (kernel dump)
169 175 */
170 176
171 177 extern void mdb_dump_print_content(dumphdr_t *, pid_t);
172 178 extern int mdb_dump_find_curproc(void);
173 179
174 180 /*
175 181 * KMDB Target Interface:
176 182 */
177 183 #ifdef _KMDB
178 184 extern const mdb_modinfo_t *mdb_ks_init(void);
179 185 #endif
180 186
181 187 #ifdef __cplusplus
182 188 }
183 189 #endif
184 190
185 191 #endif /* _MDB_KS_H */
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX