kmdb_auxv.h revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _KMDB_AUXV_H
#define _KMDB_AUXV_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The kmdb_auxv is the interface between the driver and the debugger portions
* of kmdb. It is used for three purposes:
*
* 1) To pass system-specific configuration information to the debugger. This
* information is used by the debugger to tailor itself to the running
* system.
*
* 2) To pass debugger state information to the driver.
*
* 3) To configure the DPI.
*
* We use this somewhat torturous method to initialize and configure kmdb due to
* the somewhat unique requirements of kmdb as a pseudo-standalone debugger.
* The debugger portion of kmdb is compiled as a standalone, without any
* external dependencies. As a result, it cannot communicate directly to the
* outside world. Any such communications must be through functions passed to
* it by the driver. The auxv provides a means by which these pointers and
* other parameters may be passed to the debugger.
*/
#include <gelf.h>
#ifdef sun4v
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct kmdb_auxv_nv {
char kanv_name[25];
char kanv_val[50];
typedef struct kmdb_auxv {
int kav_ncpu; /* Maximum number of CPUs */
void *kav_romp; /* Opaque PROM handle */
#ifdef __sparc
int *kav_promexitarmp; /* PROM exit kmdb entry armer */
#ifdef sun4v
#endif
#endif
int kav_nprops; /* Size of prop cache */
#endif
void (*kav_wrintr_fire)(void); /* Send softint to driver */
const char *kav_config; /* State string from MDB */
const char **kav_argv; /* Args from boot line */
const char *kav_modpath; /* kernel module_path */
#ifdef __sparc
void (*kav_ktrap_install)(int, void (*)(void)); /* Add to krnl trptbl */
void (*kav_ktrap_restore)(void); /* Restore krnl trap hdlrs */
#ifdef sun4v
#endif
#endif
} kmdb_auxv_t;
#ifdef __cplusplus
}
#endif
#endif /* _KMDB_AUXV_H */