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

Function intr_isrc_register

freebsd/kern/subr_intr.c:456–487  ·  view source on GitHub ↗

* Initialize interrupt source and register it into global interrupt table. */

Source from the content-addressed store, hash-verified

454 * Initialize interrupt source and register it into global interrupt table.
455 */
456int
457intr_isrc_register(struct intr_irqsrc *isrc, device_t dev, u_int flags,
458 const char *fmt, ...)
459{
460 int error;
461 va_list ap;
462
463 bzero(isrc, sizeof(struct intr_irqsrc));
464 isrc->isrc_dev = dev;
465 isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */
466 isrc->isrc_flags = flags;
467
468 va_start(ap, fmt);
469 vsnprintf(isrc->isrc_name, INTR_ISRC_NAMELEN, fmt, ap);
470 va_end(ap);
471
472 mtx_lock(&isrc_table_lock);
473 error = isrc_alloc_irq(isrc);
474 if (error != 0) {
475 mtx_unlock(&isrc_table_lock);
476 return (error);
477 }
478 /*
479 * Setup interrupt counters, but not for IPI sources. Those are setup
480 * later and only for used ones (up to INTR_IPI_COUNT) to not exhaust
481 * our counter pool.
482 */
483 if ((isrc->isrc_flags & INTR_ISRCF_IPI) == 0)
484 isrc_setup_counters(isrc);
485 mtx_unlock(&isrc_table_lock);
486 return (0);
487}
488
489/*
490 * Deregister interrupt source from global interrupt table.

Callers 15

apb_pic_register_isrcsFunction · 0.85
mips_pic_register_isrcsFunction · 0.85
mtk_pic_register_isrcsFunction · 0.85
mtk_pic_register_isrcsFunction · 0.85
mtk_pic_register_isrcsFunction · 0.85
mtk_pic_register_isrcsFunction · 0.85
mtk_gic_register_isrcsFunction · 0.85
beripic_attachFunction · 0.85
bcm_mips_register_isrcsFunction · 0.85
gic_v3_attachFunction · 0.85

Calls 6

bzeroFunction · 0.85
vsnprintfFunction · 0.85
isrc_alloc_irqFunction · 0.85
isrc_setup_countersFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected