forked from Minki/linux
c0b79a90b1
Since commit [e58aa3d2
: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a
: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
51 lines
1.0 KiB
C
51 lines
1.0 KiB
C
/*
|
|
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com)
|
|
* Licensed under the GPL
|
|
*/
|
|
|
|
#include <linux/interrupt.h>
|
|
#include "irq_kern.h"
|
|
#include "os.h"
|
|
#include "sigio.h"
|
|
|
|
/* Protected by sigio_lock() called from write_sigio_workaround */
|
|
static int sigio_irq_fd = -1;
|
|
|
|
static irqreturn_t sigio_interrupt(int irq, void *data)
|
|
{
|
|
char c;
|
|
|
|
os_read_file(sigio_irq_fd, &c, sizeof(c));
|
|
reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
|
|
return IRQ_HANDLED;
|
|
}
|
|
|
|
int write_sigio_irq(int fd)
|
|
{
|
|
int err;
|
|
|
|
err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
|
|
IRQF_SAMPLE_RANDOM, "write sigio",
|
|
NULL);
|
|
if (err) {
|
|
printk(KERN_ERR "write_sigio_irq : um_request_irq failed, "
|
|
"err = %d\n", err);
|
|
return -1;
|
|
}
|
|
sigio_irq_fd = fd;
|
|
return 0;
|
|
}
|
|
|
|
/* These are called from os-Linux/sigio.c to protect its pollfds arrays. */
|
|
static DEFINE_SPINLOCK(sigio_spinlock);
|
|
|
|
void sigio_lock(void)
|
|
{
|
|
spin_lock(&sigio_spinlock);
|
|
}
|
|
|
|
void sigio_unlock(void)
|
|
{
|
|
spin_unlock(&sigio_spinlock);
|
|
}
|