sys/kern/kern_cputimer.c
void
cputimer_deregister(struct cputimer *timer)
{
    struct cputimer *scan;
    struct cputimer *best;

    /*
     * Locate and remove the timer.  If the timer is our currently active
     * timer, revert to the dummy timer.
     */
    SLIST_FOREACH(scan, &cputimerhead, next) {
	    if (timer == scan) {
		if (timer == sys_cputimer)
		    cputimer_select(&dummy_cputimer, 0x7FFFFFFF);
		SLIST_REMOVE(&cputimerhead, timer, cputimer, next);
		break;
	    }
    }

    /*
     * If sys_cputimer reverted to the dummy, select the best one
     */
    if (sys_cputimer == &dummy_cputimer) {
	best = NULL;
	SLIST_FOREACH(scan, &cputimerhead, next) {
	    if (best == NULL || scan->pri > best->pri)
		best = scan;
	}
	if (best)
	    cputimer_select(best, 0x7FFFFFFF);
    }
}
/*
 * Deregister a timer.  If the timer has already been deregistered, do nothing.
 */
Deregister a timer.  If the timer has already been deregistered, do nothing.
Deregister a timer . If the timer has already been deregistered do nothing .
void
cputimer_deregister(struct cputimer *timer)
{
    struct cputimer *scan;
    struct cputimer *best;
    SLIST_FOREACH(scan, &cputimerhead, next) {
	    if (timer == scan) {
		if (timer == sys_cputimer)
		    cputimer_select(&dummy_cputimer, 0x7FFFFFFF);
		SLIST_REMOVE(&cputimerhead, timer, cputimer, next);
		break;
	    }
    }
    if (sys_cputimer == &dummy_cputimer) {
	best = NULL;
	SLIST_FOREACH(scan, &cputimerhead, next) {
	    if (best == NULL || scan->pri > best->pri)
		best = scan;
	}
	if (best)
	    cputimer_select(best, 0x7FFFFFFF);
    }
}
void cputimer_deregister ( struct cputimer * timer ) { struct cputimer * scan ; struct cputimer * best ; SLIST_FOREACH ( scan , & cputimerhead , next ) { if ( timer == scan ) { if ( timer == sys_cputimer ) cputimer_select ( & dummy_cputimer , 0x7FFFFFFF ) ; SLIST_REMOVE ( & cputimerhead , timer , cputimer , next ) ; break ; } } if ( sys_cputimer == & dummy_cputimer ) { best = NULL ; SLIST_FOREACH ( scan , & cputimerhead , next ) { if ( best == NULL || scan -> pri > best -> pri ) best = scan ; } if ( best ) cputimer_select ( best , 0x7FFFFFFF ) ; } }
Deregister a timer.
Deregister a timer .
/*
     * Locate and remove the timer.  If the timer is our currently active
     * timer, revert to the dummy timer.
     */ /*
     * If sys_cputimer reverted to the dummy, select the best one
     */