Contributors: 7
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Jeff Dike |
124 |
85.52% |
7 |
50.00% |
Johannes Berg |
8 |
5.52% |
2 |
14.29% |
Paolo 'Blaisorblade' Giarrusso |
4 |
2.76% |
1 |
7.14% |
Thomas Gleixner |
3 |
2.07% |
1 |
7.14% |
Al Viro |
3 |
2.07% |
1 |
7.14% |
Alex Dewar |
2 |
1.38% |
1 |
7.14% |
Theodore Y. Ts'o |
1 |
0.69% |
1 |
7.14% |
Total |
145 |
|
14 |
|
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com)
*/
#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));
return IRQ_HANDLED;
}
int write_sigio_irq(int fd)
{
int err;
err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
0, "write sigio", NULL);
if (err < 0) {
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_MUTEX(sigio_mutex);
void sigio_lock(void)
{
mutex_lock(&sigio_mutex);
}
void sigio_unlock(void)
{
mutex_unlock(&sigio_mutex);
}