2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
12 * Copyright (c) 2013 by Delphix. All rights reserved.
19 * The kernel has its own definition of exit which has a different signature
20 * than the user space definition. This seems to be the standard way to deal
23 #define exit kern_exit
25 #include <sys/cpuvar.h>
26 #include <sys/cred_impl.h>
27 #include <sys/procfs.h>
32 /* mdb versions of kernel structures used for ctf read calls */
33 typedef struct mdb_proc
{
44 kcondvar_t p_holdlwps
;
71 typedef struct mdb_kthread
{
76 uint8_t t_dtrace_stop
;
96 typedef struct mdb_seg
{
104 typedef struct mdb_as
{
108 typedef struct mdb_segvn_data
{
120 typedef struct mdb_vnode
{
127 typedef struct mdb_znode
{
131 typedef struct mdb_tmpnode
{
135 typedef struct mdb_vnodeops
{
139 typedef struct mdb_shm_data
{
140 uintptr_t shm_sptseg
;
143 typedef struct mdb_watched_page
{
146 } mdb_watched_page_t
;
148 typedef struct mdb_pid
{
152 typedef struct mdb_sess
{
156 typedef struct mdb_task
{
161 typedef struct mdb_kproject
{
165 typedef struct mdb_zone
{
170 typedef struct mdb_sc_shared
{
174 typedef struct mdb_klwp
{
179 uintptr_t lwp_curinfo
;
180 k_siginfo_t lwp_siginfo
;
181 stack_t lwp_sigaltstack
;
182 uintptr_t lwp_oldcontext
;
184 uintptr_t lwp_ustack
;
188 typedef struct mdb_cpu
{
189 processorid_t cpu_id
;
192 typedef struct mdb_lpl
{
193 lgrp_id_t lpl_lgrpid
;
196 typedef struct mdb_sigqueue
{
200 typedef struct mdb_pool
{
204 typedef struct mdb_amp
{
208 typedef struct mdb_anon_hdr
{
210 uintptr_t array_chunk
;
214 typedef struct mdb_anon
{
219 /* Used to construct a linked list of prmap_ts */
220 typedef struct prmap_node
{
221 struct prmap_node
*next
;
225 /* Fields common to psinfo_t and pstatus_t */
226 typedef struct pcommon
{
239 /* AVL walk callback structures */
240 typedef struct read_maps_cbarg
{
244 prmap_node_t
*map_head
;
245 prmap_node_t
*map_tail
;
249 typedef struct as_segat_cbarg
{
254 typedef struct getwatchprot_cbarg
{
256 mdb_watched_page_t wp
;
258 } getwatchprot_cbarg_t
;
261 typedef struct gcore_seg
{
264 struct gcore_segops
*gs_ops
;
268 * These are the ISA-dependent functions that need to be
269 * implemented for ::gcore.
271 extern uintptr_t gcore_prgetstackbase(mdb_proc_t
*);
272 extern int gcore_prfetchinstr(mdb_klwp_t
*, ulong_t
*);
273 extern int gcore_prisstep(mdb_klwp_t
*);
274 extern void gcore_getgregs(mdb_klwp_t
*, gregset_t
);
275 extern int gcore_prgetrvals(mdb_klwp_t
*, long *, long *);
277 #endif /* _MDB_GCORE_H */