MCPcopy Create free account
hub / github.com/F-Stack/f-stack / doconfigtimer

Function doconfigtimer

freebsd/kern/kern_clocksource.c:443–473  ·  view source on GitHub ↗

* Reconfigure specified per-CPU timer on other CPU. Called from IPI handler. */

Source from the content-addressed store, hash-verified

441 * Reconfigure specified per-CPU timer on other CPU. Called from IPI handler.
442 */
443static int
444doconfigtimer(void)
445{
446 sbintime_t now;
447 struct pcpu_state *state;
448
449 state = DPCPU_PTR(timerstate);
450 switch (atomic_load_acq_int(&state->action)) {
451 case 1:
452 now = sbinuptime();
453 ET_HW_LOCK(state);
454 loadtimer(now, 1);
455 ET_HW_UNLOCK(state);
456 state->handle = 0;
457 atomic_store_rel_int(&state->action, 0);
458 return (1);
459 case 2:
460 ET_HW_LOCK(state);
461 et_stop(timer);
462 ET_HW_UNLOCK(state);
463 state->handle = 0;
464 atomic_store_rel_int(&state->action, 0);
465 return (1);
466 }
467 if (atomic_readandclear_int(&state->handle) && !busy) {
468 now = sbinuptime();
469 handleevents(now, 0);
470 return (1);
471 }
472 return (0);
473}
474
475/*
476 * Reconfigure specified timer.

Callers 1

hardclockintrFunction · 0.85

Calls 4

sbinuptimeFunction · 0.85
loadtimerFunction · 0.85
et_stopFunction · 0.85
handleeventsFunction · 0.85

Tested by

no test coverage detected