dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / mdb / common / kmdb / kmdb_auxv.h
blobbf3cc8fdf160bebf679cd0249a5fef8a7ff41c3b
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 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _KMDB_AUXV_H
27 #define _KMDB_AUXV_H
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
37 * system.
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.
52 #include <gelf.h>
53 #include <sys/machelf.h>
54 #include <sys/kdi.h>
55 #ifdef sun4v
56 #include <sys/obpdefs.h>
57 #endif
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
63 typedef struct kmdb_auxv_nv {
64 char kanv_name[25];
65 char kanv_val[50];
66 } kmdb_auxv_nv_t;
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 */
79 #ifdef __sparc
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 */
84 #ifdef sun4v
85 caddr_t kav_tba_kernel; /* Kernel's trap table */
86 #endif
87 caddr_t kav_tba_native; /* kmdb's trap table */
88 size_t kav_tba_native_sz; /* kmdb's trap table size */
89 #endif
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 */
94 #endif
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 */
106 #ifdef __sparc
107 void (*kav_ktrap_install)(int, void (*)(void)); /* Add to krnl trptbl */
108 void (*kav_ktrap_restore)(void); /* Restore krnl trap hdlrs */
109 #ifdef sun4v
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 */
118 #endif
119 #endif
121 } kmdb_auxv_t;
123 #ifdef __cplusplus
125 #endif
127 #endif /* _KMDB_AUXV_H */