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.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/types.h>
34 * The Kernel/Debugger interface.
36 * The Debugger -> Kernel portion of the interface is handled by the kdi_t,
37 * which is defined in the archkdi.h files. These functions are intended to
38 * be called only when the system is stopped and the debugger is in control.
40 * The Kernel -> Debugger portion is handled by the debugvec_t, which is
41 * defined here. These functions are used by the kernel to inform the debugger
42 * of various state changes.
50 * The VA range reserved for the debugger; used by kmdb.
52 extern const caddr_t kdi_segdebugbase
;
53 extern const size_t kdi_segdebugsize
;
60 typedef struct kdi_debugvec kdi_debugvec_t
;
61 typedef struct kdi kdi_t
;
63 extern kdi_debugvec_t
*kdi_dvec
;
64 extern struct modctl
*kdi_dmods
;
68 extern void kdi_dvec_vmready(void);
69 extern void kdi_dvec_memavail(void);
71 extern void kdi_dvec_cpu_init(struct cpu
*);
72 extern void kdi_dvec_cpr_restart(void);
74 extern void kdi_dvec_modavail(void);
75 extern void kdi_dvec_thravail(void);
76 extern void kdi_dvec_mod_loaded(struct modctl
*);
77 extern void kdi_dvec_mod_unloading(struct modctl
*);
80 * The state machine described below is used to coordinate the efforts of
81 * kmdb and dtrace. As both use breakpoints, only one may be currently be
82 * active at a given time. Transitions are possible between the idle state
83 * and either of the active states, but not directly between the two active
86 typedef enum kdi_dtrace_set
{
87 KDI_DTSET_DTRACE_ACTIVATE
,
88 KDI_DTSET_DTRACE_DEACTIVATE
,
89 KDI_DTSET_KMDB_BPT_ACTIVATE
,
90 KDI_DTSET_KMDB_BPT_DEACTIVATE
94 KDI_DTSTATE_DTRACE_ACTIVE
,
96 KDI_DTSTATE_KMDB_BPT_ACTIVE
99 extern int kdi_dtrace_set(kdi_dtrace_set_t
);