Finding an IRQ mapping in APIC
alan at fromorbit.com
Tue Apr 10 11:40:45 UTC 2007
On Tue, 2007-04-10 at 15:30 +1000, Alan Garfield wrote:
> On Tue, 2007-04-10 at 12:20 +1000, Alan Garfield wrote:
> > Hello all!
> > I'm wondering if someone can point me in the direction of a solution to
> > my little problem.
> > I've been porting a Linux driver across to FreeBSD and I've come against
> > this lovely little hack in it's code.
> > I've tried to bus_alloc_resource() the IOAPIC_DEFAULT_ADDR and
> > IOAPIC_WINDOW but I never seem get allocated. Plus to my
> > knowing-little-about-kernels eye this seems like a really horrid hack to
> > figure out the IRQ.
> > Any suggestions?
Well I think I've found a much nicer way that the low-level irq bashing
the Linux driver suffered from.
DRIVER_MODULE(jnet, acpi, jnet_driver, jnet_devclass, 0, 0);
* Probes for the JNet device
// Only accept device types
if(acpi_get_type(dev) != ACPI_TYPE_DEVICE)
// Get the acpi handle and the device name
h = acpi_get_handle(dev);
handle_str = acpi_name(h);
// Compare the name looking for JNET
if(strcmp(handle_str, JNET_ACPI_NAME) != 0)
// Woo we found it, set the description so we know what we are.
I found the device was in the acpi data. I now have the interrupt and
the io ports available without any hacks (I hope).
Does this look sane to anyone??
More information about the freebsd-hackers