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

Function mips_pic_activate_intr

freebsd/mips/mips/mips_pic.c:551–581  ·  view source on GitHub ↗

* If @p r references a MIPS interrupt mapped by the MIPS32 interrupt * controller, handle interrupt activation internally. * * Otherwise, delegate directly to intr_activate_irq(). */

Source from the content-addressed store, hash-verified

549 * Otherwise, delegate directly to intr_activate_irq().
550 */
551int
552mips_pic_activate_intr(device_t child, struct resource *r)
553{
554 struct mips_pic_intr *intr;
555 int error;
556
557 /* Is this one of our shared MIPS interrupts? */
558 if ((intr = mips_pic_find_intr(r)) == NULL) {
559 /* Delegate to standard INTRNG activation */
560 return (intr_activate_irq(child, r));
561 }
562
563 /* Bump consumer count and request activation if required */
564 mtx_lock(&mips_pic_mtx);
565 if (intr->consumers == UINT_MAX) {
566 mtx_unlock(&mips_pic_mtx);
567 return (ENOMEM);
568 }
569
570 if (intr->consumers == 0) {
571 if ((error = intr_activate_irq(child, r))) {
572 mtx_unlock(&mips_pic_mtx);
573 return (error);
574 }
575 }
576
577 intr->consumers++;
578 mtx_unlock(&mips_pic_mtx);
579
580 return (0);
581}
582
583/**
584 * If @p r references a MIPS interrupt mapped by the MIPS32 interrupt

Callers 1

nexus_activate_resourceFunction · 0.85

Calls 4

mips_pic_find_intrFunction · 0.85
intr_activate_irqFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected