Old Style Processing

In the discussion of how AMD64 calls the flow control handler, it was mentioned that the code ends up in generic_handle_irq, which selects and activates the proper handle_irq function from the IRQ database irq_desc. However, generic_handle_irq is a little more complicated in practice:

static inline void generic_handle_irq(unsigned int irq) {


desc->handle_irq(irq, desc);

#else if (likely(desc->handle_irq))

desc->handle_irq(irq, desc);


Before the generic IRQ rework, the kernel used a colorful mixture of architecture-dependent approaches to IRQ handling. Most important, there was no separation between flow handling and ISR handling: Both tasks were performed simultaneously in a single architecture-specific routine usually called_do_IRQ.

Modern code should activate the configuration option genric_hardirqs_no_do_irq and implement flow handling as shown in the preceding discussions. In this case, generic_handle_irq really boils down to just calling irq_desc[irq]->handle_irq.

What if this option is not set? The kernel provides a default implementation of_do_iRQ that combines flow handling for all interrupt types, and also calls the required ISRs.15 Basically, there are three possibilities of how to use this function and implement flow handling:

1. Use generic flow handlers for some IRQs, and leave the handlers for others undefined. For these,_do_iRQ is employed to handle both flow and high-level processing. It is required to call generic_handle_IRQ from do_IRQ in this case.

2. Call_do_iRQ directly from do_iRQ. This bypasses the flow separation completely. Some off-mainstream architectures like M32R, H8300, SuperH, and Cris still use this approach.

3. Handle IRQs in a completely architecture-dependent way without reusing any of the existing frameworks. Clearly, this is not the brightest idea — to say the least.

Since it is needless to say that the long-term goal for all architectures is to convert to the generic IRQ framework,_do_iRQ is not discussed in detail.

15The implementation is based on the version used on IA-32 systems before the generic IRQ framework was introduced.

Continue reading here: Calling the Highlevel ISR

Was this article helpful?

0 0