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 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
32 * The kmdb_auxv is the interface between the driver and the debugger portions
33 * of kmdb. It is used for three purposes:
35 * 1) To pass system-specific configuration information to the debugger. This
36 * information is used by the debugger to tailor itself to the running
39 * 2) To pass debugger state information to the driver.
41 * 3) To configure the DPI.
43 * We use this somewhat torturous method to initialize and configure kmdb due to
44 * the somewhat unique requirements of kmdb as a pseudo-standalone debugger.
45 * The debugger portion of kmdb is compiled as a standalone, without any
46 * external dependencies. As a result, it cannot communicate directly to the
47 * outside world. Any such communications must be through functions passed to
48 * it by the driver. The auxv provides a means by which these pointers and
49 * other parameters may be passed to the debugger.
53 #include <sys/machelf.h>
56 #include <sys/obpdefs.h>
63 typedef struct kmdb_auxv_nv
{
68 #define KMDB_AUXV_FL_NOUNLOAD 0x1 /* don't allow debugger unload */
69 #define KMDB_AUXV_FL_NOTRPSWTCH 0x2 /* don't switch to kmdb's TBA/IDT */
71 typedef struct kmdb_auxv
{
72 caddr_t kav_dseg
; /* Base of segdebug */
73 size_t kav_dseg_size
; /* Size of segdebug */
74 size_t kav_pagesize
; /* Base page size */
75 int kav_ncpu
; /* Maximum number of CPUs */
76 kdi_t
*kav_kdi
; /* Ops vector for KDI */
77 void *kav_romp
; /* Opaque PROM handle */
80 int *kav_promexitarmp
; /* PROM exit kmdb entry armer */
82 caddr_t kav_tba_active
; /* Trap table to be used */
83 caddr_t kav_tba_obp
; /* OBP's trap table */
85 caddr_t kav_tba_kernel
; /* Kernel's trap table */
87 caddr_t kav_tba_native
; /* kmdb's trap table */
88 size_t kav_tba_native_sz
; /* kmdb's trap table size */
91 #if defined(__i386) || defined(__amd64)
92 kmdb_auxv_nv_t
*kav_pcache
; /* Copies of common props */
93 int kav_nprops
; /* Size of prop cache */
96 uintptr_t (*kav_lookup_by_name
)(char *, char *); /* Live kernel only */
98 void (*kav_wrintr_fire
)(void); /* Send softint to driver */
100 const char *kav_config
; /* State string from MDB */
101 const char **kav_argv
; /* Args from boot line */
102 uint_t kav_flags
; /* KMDB_AUXV_FL_* */
104 const char *kav_modpath
; /* kernel module_path */
107 void (*kav_ktrap_install
)(int, void (*)(void)); /* Add to krnl trptbl */
108 void (*kav_ktrap_restore
)(void); /* Restore krnl trap hdlrs */
110 uint_t kav_domaining
; /* Domaining status */
111 caddr_t kav_promif_root
; /* PROM shadow tree root */
112 ihandle_t kav_promif_in
; /* PROM input dev instance */
113 ihandle_t kav_promif_out
; /* PROM output dev instance */
114 phandle_t kav_promif_pin
; /* PROM input dev package */
115 phandle_t kav_promif_pout
; /* PROM output dev package */
116 pnode_t kav_promif_chosennode
; /* PROM "/chosen" node */
117 pnode_t kav_promif_optionsnode
; /* PROM "/options" node */
127 #endif /* _KMDB_AUXV_H */