BUS_CONFIG_INTR(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸŽ€ BUS_CONFIG_INTR(9) β€” configure interrupt polarity and trigger mode πŸ’…

okay so bestie, this one's a kernel section 9 manual page, and it's genuinely so useful β€” it's all about telling a parent bus "hey, here's how this interrupt wants to be wired up." manual name is BUS_CONFIG_INTR, function alias bus_config_intr. let's get into it πŸ¦‹


✨ NAME ✨

BUS_CONFIG_INTR, bus_config_intr β€” configure interrupt polarity and trigger mode πŸ’–


🌸 SYNOPSIS 🌸

like, literal copy-paste energy, here's the include situation:

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

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

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

πŸ’« DESCRIPTION πŸ’«

The BUS_CONFIG_INTR() method is literally the glow-up channel where bus or device drivers get to hand their interrupt polarity and trigger mode up to the parent buses. 🫢

And the way this works? It typically bubbles all the way up to the root bus (like nexus, iykyk) where the actual necessary actions get taken to actually program the hardware. main character bus fr fr πŸ‘‘

ngl, since the BUS_CONFIG_INTR() method takes an interrupt number, it's assumed β€” but not necessarily required, no cap β€” that it gets called prior to BUS_SETUP_INTR(9). 🫑

The bus_config_intr() function is a simple little wrapper around BUS_CONFIG_INTR() β€” lowkey just a convenience bestie. πŸ’…


⭐ the trig argument ⭐

so the trig argument can be one of these three, and they're all about when the interrupt fires:

  • INTR_TRIGGER_CONFORM β€” the interrupt trigger mode is standard for the bus to which the device is attached. (basically "do whatever's normal here" πŸ’)
  • 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 the original state so as to cause a spike. ⚑ (imagine a little blip, a spike, a moment β€” that's the whole vibe)
  • INTR_TRIGGER_LEVEL β€” the interrupt is level triggered. This means the interrupt is raised when the signal on the interrupt line transitions and remains unchanged after that until the interrupt has been serviced, after which the signal transitions back. πŸ”₯ (it's giving "holding the door open until someone lets you through")

πŸ¦‹ the pol argument πŸ¦‹

and the pol argument can be any one of these three β€” this one's about what voltage activates it:

  • INTR_POLARITY_CONFORM β€” the interrupt polarity is standard for the bus to which the device is attached. (again with the "just do the normal thing" energy ✨)
  • 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 is returned on success β€” slay β€” otherwise an appropriate error is returned. 😭 that's it, that's the whole vibe check.


🧚 SEE ALSO 🧚

go read those too bestie, they're the rest of the saga πŸ“–πŸ’–


🌈 HISTORY 🌈

The BUS_CONFIG_INTR() method first appeared in FreeBSD 5.2. iconic behavior honestly, she's been around πŸ‘‘


πŸ“ AUTHORS πŸ“

This manual page was written by Marcel Moolenaar <marcel@xcllnt.net>. ty legend 🫢


ok that's the whole page!! every flag, every value, every path β€” nothing skipped, no cap πŸ’…βœ¨

alright bestie, that's a wrap β€” this page is from the Debian crew, dated January 16, 2025, and it's the BUS_CONFIG_INTR(9) kernel developer's manual page. love that for us πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from