aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/sigio.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-07-10 07:45:13 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 16:24:24 -0400
commit1d3468a6643a6a5905e2ac9ae1fa1aefc06d882a (patch)
tree9f605490ab72b8027e9f5e0d4c9626516d8a73c5 /arch/um/kernel/sigio.c
parent469226a431f553a7b3ec17d87ce3c2d1c6c25fb2 (diff)
[PATCH] uml: move _kern.c files
Move most *_kern.c files in arch/um/kernel to *.c. This makes UML somewhat more closely resemble the other arches. [akpm@osdl.org: use the new INTF_* flags] Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/sigio.c')
-rw-r--r--arch/um/kernel/sigio.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/um/kernel/sigio.c b/arch/um/kernel/sigio.c
new file mode 100644
index 000000000000..0ad755ceb212
--- /dev/null
+++ b/arch/um/kernel/sigio.c
@@ -0,0 +1,55 @@
1/*
2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
5
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"
15#include "os.h"
16
17/* Protected by sigio_lock() called from write_sigio_workaround */
18static int sigio_irq_fd = -1;
19
20static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused)
21{
22 char c;
23
24 os_read_file(sigio_irq_fd, &c, sizeof(c));
25 reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
26 return(IRQ_HANDLED);
27}
28
29int write_sigio_irq(int fd)
30{
31 int err;
32
33 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
34 IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio",
35 NULL);
36 if(err){
37 printk("write_sigio_irq : um_request_irq failed, err = %d\n",
38 err);
39 return(-1);
40 }
41 sigio_irq_fd = fd;
42 return(0);
43}
44
45static DEFINE_SPINLOCK(sigio_spinlock);
46
47void sigio_lock(void)
48{
49 spin_lock(&sigio_spinlock);
50}
51
52void sigio_unlock(void)
53{
54 spin_unlock(&sigio_spinlock);
55}