Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7036
b: refs/heads/master
c: 75e5584
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Sep 5, 2005
1 parent d36e0e2 commit 539ebc1
Show file tree
Hide file tree
Showing 7 changed files with 476 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30f7dabb083f8ff4ce541b5ac4e5d70cc173051a
refs/heads/master: 75e5584c89d213d6089f64f22cd899fb172e4c95
28 changes: 28 additions & 0 deletions trunk/arch/um/include/aio.h
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion trunk/arch/um/include/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/um/include/irq_kern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
41 changes: 30 additions & 11 deletions trunk/arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "kern_util.h"
#include "irq_user.h"
#include "irq_kern.h"

#include "os.h"

/*
* Generic, controller-independent functions:
Expand Down Expand Up @@ -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);
}
10 changes: 7 additions & 3 deletions trunk/arch/um/os-Linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
# Licensed under the GPL
#

obj-y = elf_aux.o file.o process.o signal.o time.o tty.o user_syms.o drivers/ \
sys-$(SUBARCH)/
obj-y = aio.o elf_aux.o file.o process.o signal.o time.o tty.o user_syms.o \
drivers/ sys-$(SUBARCH)/

USER_OBJS := elf_aux.o file.o process.o signal.o time.o tty.o
USER_OBJS := aio.o elf_aux.o file.o process.o signal.o time.o tty.o

CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)

HAVE_AIO_ABI := $(shell [ -r /usr/include/linux/aio_abi.h ] && \
echo -DHAVE_AIO_ABI )
CFLAGS_aio.o += $(HAVE_AIO_ABI)

include arch/um/scripts/Makefile.rules
Loading

0 comments on commit 539ebc1

Please sign in to comment.