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

Function start_softclock

freebsd/kern/kern_timeout.c:369–396  ·  view source on GitHub ↗

* Start softclock threads. */

Source from the content-addressed store, hash-verified

367 * Start softclock threads.
368 */
369static void
370start_softclock(void *dummy)
371{
372 struct callout_cpu *cc;
373 char name[MAXCOMLEN];
374 int cpu;
375 bool pin_swi;
376 struct intr_event *ie;
377
378 CPU_FOREACH(cpu) {
379 cc = CC_CPU(cpu);
380 snprintf(name, sizeof(name), "clock (%d)", cpu);
381 ie = NULL;
382 if (swi_add(&ie, name, softclock, cc, SWI_CLOCK,
383 INTR_MPSAFE, &cc->cc_cookie))
384 panic("died while creating standard software ithreads");
385 if (cpu == cc_default_cpu)
386 pin_swi = pin_default_swi;
387 else
388 pin_swi = pin_pcpu_swi;
389 if (pin_swi && (intr_event_bind(ie, cpu) != 0)) {
390 printf("%s: %s clock couldn't be pinned to cpu %d\n",
391 __func__,
392 cpu == cc_default_cpu ? "default" : "per-cpu",
393 cpu);
394 }
395 }
396}
397SYSINIT(start_softclock, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softclock, NULL);
398
399#define CC_HASH_SHIFT 8

Callers

nothing calls this directly

Calls 5

snprintfFunction · 0.85
swi_addFunction · 0.70
panicFunction · 0.70
intr_event_bindFunction · 0.70
printfFunction · 0.70

Tested by

no test coverage detected