FreeBSD/sys/kern/kern_intr.c
/*
 * Regenerate the full name of an interrupt event and update its priority.
 */
Regenerate the full name of an interrupt event and update its priority.
Regenerate the full name of an interrupt event and update its priority .
static void
intr_event_update(struct intr_event *ie)
{
	struct intr_handler *ih;
	char *last;
	int missed, space;
	mtx_assert(&ie->ie_lock, MA_OWNED);
	strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname));
	ie->ie_flags &= ~IE_ENTROPY;
	missed = 0;
	space = 1;
	TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
		if (strlen(ie->ie_fullname) + strlen(ih->ih_name) + 1 <
		    sizeof(ie->ie_fullname)) {
			strcat(ie->ie_fullname, " ");
			strcat(ie->ie_fullname, ih->ih_name);
			space = 0;
		} else
			missed++;
		if (ih->ih_flags & IH_ENTROPY)
			ie->ie_flags |= IE_ENTROPY;
	}
	last = &ie->ie_fullname[sizeof(ie->ie_fullname) - 2];
	while (missed-- > 0) {
		if (strlen(ie->ie_fullname) + 1 == sizeof(ie->ie_fullname)) {
			if (*last == '+') {
				*last = '*';
				break;
			} else
				*last = '+';
		} else if (space) {
			strcat(ie->ie_fullname, " +");
			space = 0;
		} else
			strcat(ie->ie_fullname, "+");
	}
	if (ie->ie_thread != NULL)
		ithread_update(ie->ie_thread);
	CTR2(KTR_INTR, "%s: updated %s", __func__, ie->ie_fullname);
}
static void intr_event_update ( struct intr_event * ie ) { struct intr_handler * ih ; char * last ; int missed , space ; mtx_assert ( & ie -> ie_lock , MA_OWNED ) ; strlcpy ( ie -> ie_fullname , ie -> ie_name , sizeof ( ie -> ie_fullname ) ) ; ie -> ie_flags &= ~ IE_ENTROPY ; missed = 0 ; space = 1 ; TAILQ_FOREACH ( ih , & ie -> ie_handlers , ih_next ) { if ( strlen ( ie -> ie_fullname ) + strlen ( ih -> ih_name ) + 1 < sizeof ( ie -> ie_fullname ) ) { strcat ( ie -> ie_fullname , " " ) ; strcat ( ie -> ie_fullname , ih -> ih_name ) ; space = 0 ; } else missed ++ ; if ( ih -> ih_flags & IH_ENTROPY ) ie -> ie_flags |= IE_ENTROPY ; } last = & ie -> ie_fullname [ sizeof ( ie -> ie_fullname ) - 2 ] ; while ( missed -- > 0 ) { if ( strlen ( ie -> ie_fullname ) + 1 == sizeof ( ie -> ie_fullname ) ) { if ( * last == ' ' ) { * last = ' ' ; break ; } else * last = ' ' ; } else if ( space ) { strcat ( ie -> ie_fullname , " " ) ; space = 0 ; } else strcat ( ie -> ie_fullname , " " ) ; } if ( ie -> ie_thread != NULL ) ithread_update ( ie -> ie_thread ) ; CTR2 ( KTR_INTR , " " , __func__ , ie -> ie_fullname ) ; }
Regenerate the full name of an interrupt event and update its priority.
Regenerate the full name of an interrupt event and update its priority .
/* Start off with no entropy and just the name of the event. */ /* Run through all the handlers updating values. */ /*
	 * If the handler names were too long, add +'s to indicate missing
	 * names. If we run out of room and still have +'s to add, change
	 * the last character from a + to a *.
	 */ /*
	 * If this event has an ithread, update it's priority and
	 * name.
	 */