Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Looking at the contents of /proc/interrupts on an x86 Linux, I see that some of the interrupts are IO-APIC-edge while others are IO-APIC-level.

I wonder what determines the interrupt type, is it the interrupt generating device, the interrupt controller (APIC), the Linux kernel or the BIOS ?

(the reason I wonder is because I moved a PCI card from a dual processor Pentium III system, where it was recognized as IO-APIC-level to a dual processor Xeon system where it was recognized as IO-APIC-edge)

share|improve this question
add comment

1 Answer

For example the 82093AA IO-APIC has I/O redirection table registers (IOREDTBL) which have a writeable bit specifying the trigger mode (which can be level or edge sensitive). These registers seem to be reflected by struct IO_APIC_route_entry in the kernel source.

Digging a bit through the 2.6.18 kernel source, one comes across a function setup_IO_APIC_irqs(..) which loops over all IO-APICs found and over all IRQ lines for each IO-APIC and calls io_apic_write(..) to write to the APIC's registers.

The trigger type seems to be determined by the function MPBIOS_trigger(..) (called by irq_trigger(..)) which in turn seems to consult a variable mp_irqs which in turn seems to be filled in arch/x86_64/kernel/mpparse.c. This file seems to read the a the MP configuration table conforming to the Intel MultiProcessor Specification.

Qouting from this specification:

The BIOS constructs the MP configuration data structures, presenting the 
hardware in a known format to the standard device drivers or to the 
hardware abstraction layer of the operating system.

So I'd say the kernel configures the interrupt trigger type based on information provided by the BIOS.

A side comment: the Wikipedia article on Interrupts mentions that

The original PCI standard mandated shareable level-triggered interrupts.

(which seems to come from the fact that edge triggered interrupts sent by multiple devices at the same time on the same line will collide). So IO-APIC-edge is a bit unexpected for PCI devices.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.