kctl.h revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _KCTL_H
#define _KCTL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <kmdb/kmdb_auxv.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
KCTL_ST_INACTIVE = 0, /* kmdb is inactive */
KCTL_ST_DSEG_ALLOCED, /* kmdb segment has been allocated */
KCTL_ST_INITIALIZED, /* kmdb_init has been called */
KCTL_ST_KCTL_PREACTIVATED, /* kctl preactivation completed */
KCTL_ST_MOD_NOTIFIERS, /* krtld module notifiers registered */
KCTL_ST_THREAD_STARTED, /* WR queue thread started */
KCTL_ST_DBG_ACTIVATED, /* kmdb activated */
KCTL_ST_ACTIVE, /* kernel is aware of kmdb activation */
KCTL_ST_DEACTIVATING /* debugger is being deactivated */
} kctl_state_t;
typedef enum {
KCTL_WR_ST_RUN, /* WR queue thread is running */
KCTL_WR_ST_STOP, /* WR queue thread is stopping */
KCTL_WR_ST_STOPPED /* WR queue thread has stopped */
typedef struct kctl {
const char *kctl_execname; /* Path of this module */
#ifdef __sparc
#endif
} kctl_t;
struct bootops;
extern void kctl_dprintf(const char *, ...);
extern void kctl_warn(const char *, ...);
extern int kctl_preactivate_isadep(void);
extern void kctl_activate_isadep(kdi_debugvec_t *);
extern void kctl_depreactivate_isadep(void);
extern void kctl_cleanup(void);
extern void *kctl_boot_tmpinit(void);
extern void kctl_boot_tmpfini(void *);
extern void kctl_auxv_init(kmdb_auxv_t *, const char *, const char **, void *);
extern void kctl_auxv_init_isadep(kmdb_auxv_t *, void *);
extern void kctl_auxv_fini(kmdb_auxv_t *);
extern void kctl_auxv_fini_isadep(kmdb_auxv_t *);
#ifdef sun4v
extern void kctl_auxv_set_promif(kmdb_auxv_t *);
extern void kctl_switch_promif(void);
#endif
extern void kctl_wrintr(void);
extern void kctl_wrintr_fire(void);
extern void kctl_wr_thr_start(void);
extern void kctl_wr_thr_stop(void);
extern void kctl_wr_thr_join(void);
extern int kctl_mod_decompress(struct modctl *);
extern void kctl_mod_loaded(struct modctl *);
extern void kctl_mod_notify_reg(void);
extern void kctl_mod_notify_unreg(void);
extern void kctl_dmod_init(void);
extern void kctl_dmod_fini(void);
extern void kctl_dmod_sync(void);
extern void kctl_dmod_autoload(const char *);
extern void kctl_dmod_unload_all(void);
extern void kctl_dmod_path_reset(void);
extern int kctl_wr_process(void);
extern void kctl_wr_unload(void);
extern char *kctl_basename(char *);
extern char *kctl_strdup(const char *);
extern void kctl_strfree(char *);
#if defined(__sparc)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _KCTL_H */