2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
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"
17 /* Protected by sigio_lock() called from write_sigio_workaround */
18 static int sigio_irq_fd = -1;
20 static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused)
24 os_read_file(sigio_irq_fd, &c, sizeof(c));
25 reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
29 int write_sigio_irq(int fd)
33 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
34 IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio",
37 printk("write_sigio_irq : um_request_irq failed, err = %d\n",
45 static DEFINE_SPINLOCK(sigio_spinlock);
49 spin_lock(&sigio_spinlock);
52 void sigio_unlock(void)
54 spin_unlock(&sigio_spinlock);