diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-09-03 22:57:45 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 07:06:23 (GMT) |
commit | 75e5584c89d213d6089f64f22cd899fb172e4c95 (patch) | |
tree | 22bb81b9c699e06b3c8163933654fe3f84ae469d /arch/um/kernel/irq.c | |
parent | 30f7dabb083f8ff4ce541b5ac4e5d70cc173051a (diff) | |
download | linux-75e5584c89d213d6089f64f22cd899fb172e4c95.tar.xz |
[PATCH] uml: use host AIO support
This patch makes UML use host AIO support when it (and
/usr/include/linux/aio_abi.h) are present. This is only the support, with no
consumers - a consumer is coming in the next patch.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/irq.c')
-rw-r--r-- | arch/um/kernel/irq.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 9f18061..dcd8149 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -31,7 +31,7 @@ #include "kern_util.h" #include "irq_user.h" #include "irq_kern.h" - +#include "os.h" /* * Generic, controller-independent functions: @@ -168,13 +168,32 @@ void __init init_IRQ(void) } } -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ +int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *, + struct pt_regs *)) +{ + int fds[2], err; + + err = os_pipe(fds, 1, 1); + if(err){ + printk("init_aio_irq - os_pipe failed, err = %d\n", -err); + goto out; + } + + err = um_request_irq(irq, fds[0], IRQ_READ, handler, + SA_INTERRUPT | SA_SAMPLE_RANDOM, name, + (void *) (long) fds[0]); + if(err){ + printk("init_aio_irq - : um_request_irq failed, err = %d\n", + err); + goto out_close; + } + + err = fds[1]; + goto out; + + out_close: + os_close_file(fds[0]); + os_close_file(fds[1]); + out: + return(err); +} |