autoconf.h revision 6532b9600e063234d62bca681503353c01abad20
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_AUTOCONF_H
#define _SYS_AUTOCONF_H
/* Derived from autoconf.h, SunOS 4.1.1 1.15 */
#ifdef __cplusplus
extern "C" {
#endif
/*
* This defines a parallel structure to the devops list.
*/
#include <sys/dditypes.h>
struct devnames {
char *dn_name; /* Name of this driver */
int dn_flags; /* per-driver flags, see below */
int dn_instance; /* Next instance no. to assign */
void *dn_inlist; /* instance # nodes for this driver */
};
/*
* dn_lock is used to protect the driver initialization/loading
* reference count, the dn_flags, and the dn_head linked list of
* driver instances. The busy_changing bit is used to avoid
* recursive calls to ddi_hold_installed_driver to hold the
* same driver.
*/
/*
* Defines for dn_flags.
*/
#define DN_CONF_PARSED 0x0001
#ifdef _KERNEL
/*
* Debugging flags and macros
*/
#define DDI_AUDIT 0x0001
#define DDI_DEBUG 0x0002
#define DDI_MTCONFIG 0x0004
extern int ddidebug;
#ifdef DEBUG
#else
#define NDI_CONFIG_DEBUG(args)
#define DCOMPATPRINTF(args)
#define LDI_OPENCLOSE(args)
#define LDI_ALLOCFREE(args)
#define LDI_STREAMS_LNK(args)
#define LDI_EVENTCB(args)
#define DDI_INTR_APIDBG(args)
#define DDI_INTR_IMPLDBG(args)
#define DDI_INTR_NEXDBG(args)
#define DDI_INTR_IRMDBG(args)
#endif
/*
* DDI configuration logs
*/
#define DDI_STACK_DEPTH 14
typedef struct devinfo_audit {
int da_device_state; /* device state */
int da_depth;
typedef struct {
int dh_max;
int dh_curr;
int dh_hits;
struct di_cache {
void *cache_data;
};
extern int di_cache_debug;
extern volatile ulong_t devtree_gen;
/*
* Special dev_info nodes
*/
#define DI_CACHE_FILE "/etc/devices/snapshot_cache"
extern dev_info_t *options_dip;
extern dev_info_t *pseudo_dip;
extern dev_info_t *clone_dip;
extern major_t clone_major;
extern major_t nulldriver_major;
extern struct devnames orphanlist;
/*
* Obsolete interface, no longer used, to be removed.
* Retained only for driver compatibility.
*/
/*
* Acquires dn_lock, as above.
*/
/*
* Not to be used without obtaining the per-driver lock.
*/
(opsp) != &mod_nodev_ops)
extern void impl_rem_dev_props(dev_info_t *);
extern void add_class(char *, char *);
extern int make_mbind(char *, int, char *, struct bind **);
extern void delete_mbind(char *, struct bind **);
extern void purge_mbind(int, struct bind **);
extern void configure(void);
#if defined(__sparc)
extern void setcputype(void);
#endif
extern void devtree_freeze(void);
extern void reset_leaves(void);
extern void quiesce_devices(dev_info_t *, void *);
extern void setup_ddi(void);
extern void setup_ddi_poststartup(void);
extern void impl_ddi_callback_init(void);
extern int impl_check_cpu(dev_info_t *);
extern int check_status(int, char *, dev_info_t *);
extern int exclude_settrap(int);
extern int exclude_level(int);
extern major_t path_to_major(char *);
extern void i_ddi_node_cache_init(void);
ddi_prop_t *, int);
extern void i_ddi_forceattach_drivers(void);
extern int i_ddi_io_initialized(void);
extern void i_ddi_di_cache_invalidate(int kmflag);
/* devname_state - for /dev to denote reconfig and system available */
extern int i_ddi_sysavail(void);
extern int i_ddi_reconfig(void);
extern void i_ddi_set_sysavail(void);
extern void i_ddi_set_reconfig(void);
/* I/O retire related */
extern int e_ddi_unretire_device(char *path);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AUTOCONF_H */