-#define _EVENTHANDLER_INVOKE(name, list, ...) do { \
- struct eventhandler_entry *_ep; \
- struct eventhandler_entry_ ## name *_t; \
- \
- VERIFY((list)->el_flags & EHL_INITTED); \
- EHL_LOCK_ASSERT((list), LCK_MTX_ASSERT_OWNED); \
- (list)->el_runcount++; \
- VERIFY((list)->el_runcount > 0); \
- evhlog((LOG_DEBUG, "eventhandler_invoke(\"" __STRING(name) "\")")); \
- TAILQ_FOREACH(_ep, &((list)->el_entries), ee_link) { \
- if (_ep->ee_priority != EHE_DEAD_PRIORITY) { \
- EHL_UNLOCK((list)); \
- _t = (struct eventhandler_entry_ ## name *)_ep; \
- evhlog((LOG_DEBUG, "eventhandler_invoke: executing %p", \
- VM_KERNEL_UNSLIDE((void *)_t->eh_func))); \
- _t->eh_func(_ep->ee_arg , ## __VA_ARGS__); \
- EHL_LOCK((list)); \
- } \
- } \
- KASSERT((list)->el_runcount > 0, \
- ("eventhandler_invoke: runcount underflow")); \
- (list)->el_runcount--; \
- if ((list)->el_runcount == 0) \
- eventhandler_prune_list(list); \
- EHL_UNLOCK((list)); \
+#define _EVENTHANDLER_INVOKE(name, list, ...) do { \
+ struct eventhandler_entry *_ep; \
+ struct eventhandler_entry_ ## name *_t; \
+ \
+ VERIFY((list)->el_flags & EHL_INITTED); \
+ EHL_LOCK_ASSERT((list), LCK_MTX_ASSERT_OWNED); \
+ (list)->el_runcount++; \
+ VERIFY((list)->el_runcount > 0); \
+ evhlog((LOG_DEBUG, "eventhandler_invoke(\"" __STRING(name) "\")")); \
+ TAILQ_FOREACH(_ep, &((list)->el_entries), ee_link) { \
+ if (_ep->ee_priority != EHE_DEAD_PRIORITY) { \
+ EHL_UNLOCK((list)); \
+ _t = (struct eventhandler_entry_ ## name *)_ep; \
+ evhlog((LOG_DEBUG, "eventhandler_invoke: executing %p", \
+ (void *)VM_KERNEL_UNSLIDE((void *)_t->eh_func))); \
+ _t->eh_func(_ep->ee_arg , ## __VA_ARGS__); \
+ EHL_LOCK_SPIN((list)); \
+ } \
+ } \
+ VERIFY((list)->el_runcount > 0); \
+ (list)->el_runcount--; \
+ if ((list)->el_runcount == 0) { \
+ EHL_LOCK_CONVERT((list)); \
+ eventhandler_prune_list(list); \
+ } \
+ EHL_UNLOCK((list)); \