BUS_CONFIG_INTR(9)

✨ BUS_CONFIG_INTR ✨

okay bestie, welcome to BUS_CONFIG_INTR(9) β€” it's a Kernel Developer's Manual page, section 9, and it's literally the glow-up your interrupts needed. we're talking interrupt polarity and trigger mode, and no cap, it's giving "let the parents handle it." πŸ’…


🌸 NAME 🌸

BUS_CONFIG_INTR β€” configure interrupt polarity and trigger mode

okay so that's the whole vibe: you tell the bus how your interrupt wants to be treated. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/param.h>
#include <sys/bus.h>

int
BUS_CONFIG_INTR(device_t dev, int irq, enum intr_trigger trig,
    enum intr_polarity pol);

πŸ’– DESCRIPTION πŸ’–

so the BUS_CONFIG_INTR() method is how bus drivers or device drivers slide the interrupt polarity and trigger mode info over to their parent buses. 🫢 and the way that this typically bubbles all the way up to the root bus (think nexus, the main character) where the actual hardware gets programmed β€” like, that's where the real work happens.

and since BUS_CONFIG_INTR() takes an interrupt number, it's assumed β€” but not necessarily required, bestie, read the fine print β€” that you call it before BUS_SETUP_INTR(9). πŸ¦‹

the trig argument can be one of these three icons:

  • INTR_TRIGGER_CONFORM β€” the interrupt trigger mode is standard for the bus the device is attached to. just go with the flow, iykyk.
  • INTR_TRIGGER_EDGE β€” the interrupt is edge triggered. this means the interrupt is raised by the rising edge of the signal on the interrupt line. the signal typically reverts to its original state so it can cause a spike. ✨ dramatic lil spike energy ✨
  • INTR_TRIGGER_LEVEL β€” the interrupt is level triggered. this means the interrupt is raised when the signal on the interrupt line transitions, and then it just… stays there, unchanged, until the interrupt has been serviced. after that the signal transitions back. πŸ’€ commitment issues? no. commitment. periodt.

and the pol argument can be any one of these:

  • INTR_POLARITY_CONFORM β€” the interrupt polarity is standard for the bus the device is attached to. again, matching the group chat's vibe. 🌈
  • INTR_POLARITY_HIGH β€” the interrupt is activated by a high voltage on the interrupt line. πŸ”₯
  • INTR_POLARITY_LOW β€” the interrupt is activated by a low voltage on the interrupt line. πŸ™ˆ

⭐ RETURN VALUES ⭐

zero gets returned on success. otherwise, an appropriate error is returned. that's it, that's the whole thing β€” success is 0, anything else is the kernel telling you something. 😭


πŸ‘‘ SEE ALSO πŸ‘‘


🧚 HISTORY 🧚

the BUS_CONFIG_INTR() method first appeared in FreeBSD 5.2. an icon from the jump, fr fr. πŸ’œ


πŸ’œ AUTHORS πŸ’œ

this manual page was written by Marcel Moolenaar <marcel@xcllnt.net>. king behavior, we love to see it. πŸ‘‘


and that's the page!! this was a Debian release, dated January 15, 2017, section BUS_CONFIG_INTR(9) of the Kernel Developer's Manual β€” mwah, thanks for reading, slay, go configure some interrupts responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from