52 uint_t ibtl_errlevel = IBTF_LOG_L2;
53 uint_t ibcm_errlevel = IBTF_LOG_L2;
54 uint_t ibdm_errlevel = IBTF_LOG_L2;
55 uint_t ibnex_errlevel = IBTF_LOG_L2;
56
57 #define IBTF_DEBUG_SIZE_EXTRA_ALLOC 8
58 #define IBTF_MIN_DEBUG_BUF_SIZE 0x1000
59 #ifdef DEBUG
60 #define IBTF_DEBUG_BUF_SIZE 0x10000
61 #else
62 #define IBTF_DEBUG_BUF_SIZE 0x2000
63 #endif /* DEBUG */
64
65 int ibtf_suppress_dprintf; /* Suppress debug printing */
66 int ibtf_buffer_dprintf = 1; /* Use a debug print buffer */
67 int ibtf_debug_buf_size = IBTF_DEBUG_BUF_SIZE; /* Sz of Debug buf */
68 int ibtf_allow_intr_msgs = 0; /* log "intr" messages */
69 char *ibtf_debug_buf = NULL; /* The Debug Buf */
70 char *ibtf_buf_sptr, *ibtf_buf_eptr; /* debug buffer temp pointer */
71 int ibtf_clear_debug_buf_flag = 0; /* Clear debug buffer */
72 _NOTE(SCHEME_PROTECTS_DATA("inconsistency OK", ibtf_debug_buf_size))
73
74 longlong_t ibtl_ib2usec_tbl[64]; /* time conversion table */
75 _NOTE(SCHEME_PROTECTS_DATA("inconsistency OK", ibtl_ib2usec_tbl))
76
77 _NOTE(MUTEX_PROTECTS_DATA(ibtf_print_mutex, ibtf_buf_sptr ibtf_buf_eptr))
78
79 /*
80 * Function:
81 * ibtl_ib2usec_init
82 * Input:
83 * none
84 * Output:
85 * none
86 * Returns:
87 * none
88 * Description:
89 * Initialize ibtl_ib2usec_tbl[64] for use by ibt_usec2ib and ibt_ib2usec.
90 */
91 void
92 ibtl_ib2usec_init(void)
93 {
94 int i;
95
96 for (i = 0; i < 64; i++) {
97 if (i < 51) { /* shift first to avoid underflow */
98 ibtl_ib2usec_tbl[i] = ((1LL << i) << 12LL) / 1000LL;
|
52 uint_t ibtl_errlevel = IBTF_LOG_L2;
53 uint_t ibcm_errlevel = IBTF_LOG_L2;
54 uint_t ibdm_errlevel = IBTF_LOG_L2;
55 uint_t ibnex_errlevel = IBTF_LOG_L2;
56
57 #define IBTF_DEBUG_SIZE_EXTRA_ALLOC 8
58 #define IBTF_MIN_DEBUG_BUF_SIZE 0x1000
59 #ifdef DEBUG
60 #define IBTF_DEBUG_BUF_SIZE 0x10000
61 #else
62 #define IBTF_DEBUG_BUF_SIZE 0x2000
63 #endif /* DEBUG */
64
65 int ibtf_suppress_dprintf; /* Suppress debug printing */
66 int ibtf_buffer_dprintf = 1; /* Use a debug print buffer */
67 int ibtf_debug_buf_size = IBTF_DEBUG_BUF_SIZE; /* Sz of Debug buf */
68 int ibtf_allow_intr_msgs = 0; /* log "intr" messages */
69 char *ibtf_debug_buf = NULL; /* The Debug Buf */
70 char *ibtf_buf_sptr, *ibtf_buf_eptr; /* debug buffer temp pointer */
71 int ibtf_clear_debug_buf_flag = 0; /* Clear debug buffer */
72
73 longlong_t ibtl_ib2usec_tbl[64]; /* time conversion table */
74
75 /*
76 * Function:
77 * ibtl_ib2usec_init
78 * Input:
79 * none
80 * Output:
81 * none
82 * Returns:
83 * none
84 * Description:
85 * Initialize ibtl_ib2usec_tbl[64] for use by ibt_usec2ib and ibt_ib2usec.
86 */
87 void
88 ibtl_ib2usec_init(void)
89 {
90 int i;
91
92 for (i = 0; i < 64; i++) {
93 if (i < 51) { /* shift first to avoid underflow */
94 ibtl_ib2usec_tbl[i] = ((1LL << i) << 12LL) / 1000LL;
|