From 75e5584c89d213d6089f64f22cd899fb172e4c95 Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Sat, 3 Sep 2005 15:57:45 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/include/aio.h | 28 ++++++++++++++++++++++++++++ arch/um/include/init.h | 10 +++++++++- arch/um/include/irq_kern.h | 3 +++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 arch/um/include/aio.h (limited to 'arch/um/include') diff --git a/arch/um/include/aio.h b/arch/um/include/aio.h new file mode 100644 index 00000000000..423bae9153f --- /dev/null +++ b/arch/um/include/aio.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2004 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef AIO_H__ +#define AIO_H__ + +enum aio_type { AIO_READ, AIO_WRITE, AIO_MMAP }; + +struct aio_thread_reply { + void *data; + int err; +}; + +struct aio_context { + int reply_fd; + struct aio_context *next; +}; + +#define INIT_AIO_CONTEXT { .reply_fd = -1, \ + .next = NULL } + +extern int submit_aio(enum aio_type type, int fd, char *buf, int len, + unsigned long long offset, int reply_fd, + struct aio_context *aio); + +#endif diff --git a/arch/um/include/init.h b/arch/um/include/init.h index 55c2693f877..cbd79a8d213 100644 --- a/arch/um/include/init.h +++ b/arch/um/include/init.h @@ -111,7 +111,15 @@ extern struct uml_param __uml_setup_start, __uml_setup_end; #ifndef __KERNEL__ -#define __initcall(fn) static initcall_t __initcall_##fn __init_call = fn +#define __define_initcall(level,fn) \ + static initcall_t __initcall_##fn __attribute_used__ \ + __attribute__((__section__(".initcall" level ".init"))) = fn + +/* Userspace initcalls shouldn't depend on anything in the kernel, so we'll + * make them run first. + */ +#define __initcall(fn) __define_initcall("1", fn) + #define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn #define __init_call __attribute__ ((unused,__section__ (".initcall.init"))) diff --git a/arch/um/include/irq_kern.h b/arch/um/include/irq_kern.h index 3af52a634c4..c222d56b149 100644 --- a/arch/um/include/irq_kern.h +++ b/arch/um/include/irq_kern.h @@ -7,12 +7,15 @@ #define __IRQ_KERN_H__ #include "linux/interrupt.h" +#include "asm/ptrace.h" extern int um_request_irq(unsigned int irq, int fd, int type, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id); +extern int init_aio_irq(int irq, char *name, + irqreturn_t (*handler)(int, void *, struct pt_regs *)); #endif -- cgit v1.2.3