sbbcvar.h revision b8dc8477f9e64fb1130ab21dc1f26664309f149d
/*
* 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 _SYS_SBBCVAR_H
#define _SYS_SBBCVAR_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct sbbc_intr_map {
struct sbbc_intr_map_mask {
};
/* sbbc intrspec for initializing its children. */
struct sbbc_intrspec {
};
/*
* definition of sbbc child reg spec entry:
*/
typedef struct {
/* SBBC range entry */
typedef struct sbbc_pci_rangespec {
typedef int procid_t;
#define MAX_SBBC_DEVICES 3
/* Only used for fixed or legacy interrupts */
#define SBBC_INTR_STATE_DISABLE 0 /* disabled */
typedef struct sbbc_child_intr {
char *name;
uint_t (*intr_handler)();
typedef struct sbbcsoft {
int instance;
int oflag;
int nreg;
int range_cnt;
int range_len;
} sbbcsoft_t;
#define TRUE 1
#define FALSE 0
#if defined(DEBUG)
#define SBBC_DBG_ATTACH 0x1
#define SBBC_DBG_DETACH 0x2
#define SBBC_DBG_CTLOPS 0x4
#define SBBC_DBG_INITCHILD 0x8
#define SBBC_DBG_UNINITCHILD 0x10
#define SBBC_DBG_BUSMAP 0x20
#define SBBC_DBG_INTR 0x40
#define SBBC_DBG_PCICONF 0x80
#define SBBC_DBG_MAPRANGES 0x100
#define SBBC_DBG_PROPERTIES 0x200
#define SBBC_DBG_OPEN 0x400
#define SBBC_DBG_CLOSE 0x800
#define SBBC_DBG_IOCTL 0x1000
#define SBBC_DBG_INTROPS 0x2000
#else /* DEBUG */
#endif /* DEBUG */
/* debugging flags */
/*
* To enable tracing, uncomment this line:
* #define SBBC_TRACE 1
*/
#if defined(SBBC_TRACE)
#ifndef NSBBCTRACE
#define NSBBCTRACE 1024
#endif
struct sbbctrace {
int count;
int function; /* address of function */
int trace_action; /* descriptive 4 characters */
int object; /* object operated on */
};
/*
* For debugging, allocate space for the trace buffer
*/
extern struct sbbctrace sbbctrace_buffer[];
extern struct sbbctrace *sbbctrace_ptr;
extern int sbbctrace_count;
#define SBBCTRACEINIT() { \
if (sbbctrace_ptr == NULL) \
}
int __s = LOCK_TRACE(); \
*_p++ = ++sbbctrace_count; \
else \
UNLOCK_TRACE(__s); \
}
#else /* !SBBC_TRACE */
/* If no tracing, define no-ops */
#define SBBCTRACEINIT()
#define SBBCTRACE(a, b, c)
#endif /* !SBBC_TRACE */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SBBCVAR_H */