[Top] [All Lists]

Re: Moving from old-irq.c

To: Phil Thompson <>
Subject: Re: Moving from old-irq.c
From: Ralf Baechle <>
Date: Fri, 13 Jul 2001 01:30:54 +0200
Cc: "''" <>
In-reply-to: <>; from on Wed, Jul 11, 2001 at 01:16:56PM +0100
References: <>
User-agent: Mutt/1.2.5i
On Wed, Jul 11, 2001 at 01:16:56PM +0100, Phil Thompson wrote:

> Is there any documentation around that describes how to move from interrupt
> code based on old-irq.c to the new code? Or any other hints or suggestions.

First disable CONFIG_ROTTEN_IRQ if you were using that and enable
CONFIG_NEW_IRQ.  You'll probably have to hack arch/mips/ to do

Next you have to rewrite your systems irq code.  You'll have to provide
an init_IRQ() function to initialize the interrupt system.  As the
absolute minimum it'll have to do something like:

        set_except_vector(0, myasmirqhandler);

and initialize the entries for all interrupts used by your system in the
irq_desc array like:

        for (i = 0; i < NUM_MY_INTS; i++) {

                irq_desc[i].status      = IRQ_DISABLED;
                irq_desc[i].action      = 0;
                irq_desc[i].depth       = 1;
                irq_desc[i].handler     = handler;

where handler is a pointer to struct like this one:

static struct hw_interrupt_type ip22_my_irq_type = {
        "My interrupt controller",

All that's left now is to write the function references in above struct

static void enable_my_irq(unsigned int irq)
        /* enable the interrupt in the controller  */

static unsigned int startup_my_irq(unsigned int irq)

        return 0;               /* Never anything pending  */

static void disable_my_irq(unsigned int irq)
        /* Disable function in the interrupt controller  */

static void shutdown_my_irq(unsigned int irq)
         * Disable interrupt in the interrupt controller.  Often this function
         * is identical to disable_my_irq.

static void mask_and_ack_my_irq(unsigned int irq)
         * Mask and acknowledge interrupt.  Often this function is identical
         * to disable_my_irq.  Exception is for example the i8259 PICs.

static void end_my_irq (unsigned int irq)
        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))

Take a look at arch/mips/sgi/indy_int.c but there are more examples.

The plan is to nuke old-irq.c early in 2.5; at the same time also something
like arch/{i386,mips}/kernel/irq.c will become kernel/irq.c.


<Prev in Thread] Current Thread [Next in Thread>