Re: Interrupts for userspace

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Tue, 14 Sep 1999 15:16:54 +0200


Alan Cox wrote:
> You cant do it for PCI. You have to write a custom irq handler that does
> all that is needed to clear the IRQ then posts something out

Actually Pavel's i2sig.c works fine for development on x86 as long as
the interrupt is not shared, it's just a bit slow that's all. If
no-one's got a fast one I guess I will improve i2sig.c

Here is the method, edited for brevity:

MODULE_AUTHOR("Pavel Machek <pavel@ucw.cz>");
static int pid = 0;
MODULE_PARM(pid, "i");
static int irq = 3;
MODULE_PARM(irq, "i");

void reenable (unsigned long unused) { enable_irq(irq); }

struct timer_list reenable_timer = {NULL, NULL, 0, 0, reenable};

void interrupt( int irq, void *dev_id, struct pt_regs *regs )
{
kill_proc(pid, SIGUSR1, 1);
disable_irq(irq);
reenable_timer.expires = jiffies + HZ / 50;
reenable_timer.prev = reenable_timer.next = NULL;
add_timer(&reenable_timer);
}

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/