[TG3]: Set minimal hw interrupt mitigation.
[linux-2.6/verdex.git] / arch / um / kernel / sigio_kern.c
blob229988463c4c4dc22dc33cfff971d69cc0454144
1 /*
2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
6 #include "linux/kernel.h"
7 #include "linux/list.h"
8 #include "linux/slab.h"
9 #include "linux/signal.h"
10 #include "linux/interrupt.h"
11 #include "init.h"
12 #include "sigio.h"
13 #include "irq_user.h"
14 #include "irq_kern.h"
16 /* Protected by sigio_lock() called from write_sigio_workaround */
17 static int sigio_irq_fd = -1;
19 static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused)
21 read_sigio_fd(sigio_irq_fd);
22 reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
23 return(IRQ_HANDLED);
26 int write_sigio_irq(int fd)
28 int err;
30 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
31 SA_INTERRUPT | SA_SAMPLE_RANDOM, "write sigio",
32 NULL);
33 if(err){
34 printk("write_sigio_irq : um_request_irq failed, err = %d\n",
35 err);
36 return(-1);
38 sigio_irq_fd = fd;
39 return(0);
42 static DEFINE_SPINLOCK(sigio_spinlock);
44 void sigio_lock(void)
46 spin_lock(&sigio_spinlock);
49 void sigio_unlock(void)
51 spin_unlock(&sigio_spinlock);
55 * Overrides for Emacs so that we follow Linus's tabbing style.
56 * Emacs will notice this stuff at the end of the file and automatically
57 * adjust the settings for this buffer only. This must remain at the end
58 * of the file.
59 * ---------------------------------------------------------------------------
60 * Local variables:
61 * c-file-style: "linux"
62 * End: