* Start softclock threads. */
| 367 | * Start softclock threads. |
| 368 | */ |
| 369 | static void |
| 370 | start_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 | } |
| 397 | SYSINIT(start_softclock, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softclock, NULL); |
| 398 | |
| 399 | #define CC_HASH_SHIFT 8 |
nothing calls this directly
no test coverage detected