Lines Matching refs:cp
119 * cp - ptr to the callb_cpr_t structure for this kernel thread
131 * Note: lockp is the lock to protect the callb_cpr_t (cp) structure
134 #define CALLB_CPR_INIT(cp, lockp, func, name) { \
135 bzero((caddr_t)(cp), sizeof (callb_cpr_t)); \
136 (cp)->cc_lockp = lockp; \
137 (cp)->cc_id = callb_add(func, (void *)(cp), \
142 #define CALLB_CPR_ASSERT(cp) ASSERT(MUTEX_HELD((cp)->cc_lockp));
144 #define CALLB_CPR_ASSERT(cp)
162 * The lock to protect cp's content must be held before
168 #define CALLB_CPR_SAFE_BEGIN(cp) { \
169 CALLB_CPR_ASSERT(cp) \
170 (cp)->cc_events |= CALLB_CPR_SAFE; \
171 if ((cp)->cc_events & CALLB_CPR_START) \
172 cv_signal(&(cp)->cc_callb_cv); \
174 #define CALLB_CPR_SAFE_END(cp, lockp) { \
175 CALLB_CPR_ASSERT(cp) \
176 while ((cp)->cc_events & CALLB_CPR_START) \
177 cv_wait(&(cp)->cc_stop_cv, lockp); \
178 (cp)->cc_events &= ~CALLB_CPR_SAFE; \
183 #define CALLB_CPR_EXIT(cp) { \
184 CALLB_CPR_ASSERT(cp) \
185 (cp)->cc_events |= CALLB_CPR_SAFE; \
186 if ((cp)->cc_events & CALLB_CPR_START) \
187 cv_signal(&(cp)->cc_callb_cv); \
188 mutex_exit((cp)->cc_lockp); \
189 (void) callb_delete((cp)->cc_id); \
190 cv_destroy(&(cp)->cc_callb_cv); \
191 cv_destroy(&(cp)->cc_stop_cv); \