8446 uts: pci_check_bios() should check for BIOS
[unleashed.git] / include / sys / kdi.h
blob6959aef7d2e9f0f3211cd8b068adefa3be47aa4f
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _KDI_H
27 #define _KDI_H
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.
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
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;
55 struct cpu;
56 struct modctl;
57 struct gate_desc;
58 struct user_desc;
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;
66 #define KDI_VERSION 7
68 extern void kdi_dvec_vmready(void);
69 extern void kdi_dvec_memavail(void);
70 #if defined(__sparc)
71 extern void kdi_dvec_cpu_init(struct cpu *);
72 extern void kdi_dvec_cpr_restart(void);
73 #endif
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
84 * states.
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
91 } kdi_dtrace_set_t;
93 typedef enum {
94 KDI_DTSTATE_DTRACE_ACTIVE,
95 KDI_DTSTATE_IDLE,
96 KDI_DTSTATE_KMDB_BPT_ACTIVE
97 } kdi_dtrace_state_t;
99 extern int kdi_dtrace_set(kdi_dtrace_set_t);
101 #ifdef __cplusplus
103 #endif
105 #endif /* _KDI_H */