Commit f206aabb authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: move sigio_user.c to os-Linux/sigio.c

The serial UML OS-abstraction layer patch (um/kernel dir).

This moves sigio_user.c to os-Linux dir
Signed-off-by: default avatarGennady Sharapov <Gennady.V.Sharapov@intel.com>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8e367065
...@@ -311,4 +311,9 @@ extern void os_set_pollfd(int i, int fd); ...@@ -311,4 +311,9 @@ extern void os_set_pollfd(int i, int fd);
extern void os_set_ioignore(void); extern void os_set_ioignore(void);
extern void init_irq_signals(int on_sigstack); extern void init_irq_signals(int on_sigstack);
/* sigio.c */
extern void write_sigio_workaround(void);
extern int add_sigio_fd(int fd, int read);
extern int ignore_sigio_fd(int fd);
#endif #endif
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
extern int write_sigio_irq(int fd); extern int write_sigio_irq(int fd);
extern int register_sigio_fd(int fd); extern int register_sigio_fd(int fd);
extern int add_sigio_fd(int fd, int read);
extern int ignore_sigio_fd(int fd);
extern void sigio_lock(void); extern void sigio_lock(void);
extern void sigio_unlock(void); extern void sigio_unlock(void);
......
...@@ -58,7 +58,6 @@ extern int attach(int pid); ...@@ -58,7 +58,6 @@ extern int attach(int pid);
extern void kill_child_dead(int pid); extern void kill_child_dead(int pid);
extern int cont(int pid); extern int cont(int pid);
extern void check_sigio(void); extern void check_sigio(void);
extern void write_sigio_workaround(void);
extern void arch_check_bugs(void); extern void arch_check_bugs(void);
extern int cpu_feature(char *what, char *buf, int len); extern int cpu_feature(char *what, char *buf, int len);
extern int arch_handle_signal(int sig, union uml_pt_regs *regs); extern int arch_handle_signal(int sig, union uml_pt_regs *regs);
......
...@@ -8,7 +8,7 @@ clean-files := ...@@ -8,7 +8,7 @@ clean-files :=
obj-y = config.o exec_kern.o exitcode.o \ obj-y = config.o exec_kern.o exitcode.o \
init_task.o irq.o ksyms.o mem.o physmem.o \ init_task.o irq.o ksyms.o mem.o physmem.o \
process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \ process_kern.o ptrace.o reboot.o resource.o sigio_kern.o \
signal_kern.o smp.o syscall_kern.o sysrq.o \ signal_kern.o smp.o syscall_kern.o sysrq.o \
time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o
......
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
# Licensed under the GPL # Licensed under the GPL
# #
obj-y = aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o signal.o \ obj-y = aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o sigio.o \
start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o user_syms.o \ signal.o start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o \
util.o drivers/ sys-$(SUBARCH)/ user_syms.o util.o drivers/ sys-$(SUBARCH)/
obj-$(CONFIG_MODE_SKAS) += skas/ obj-$(CONFIG_MODE_SKAS) += skas/
USER_OBJS := aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o \ USER_OBJS := aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o \
signal.o start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o util.o sigio.o signal.o start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o \
util.o
elf_aux.o: $(ARCH_DIR)/kernel-offsets.h elf_aux.o: $(ARCH_DIR)/kernel-offsets.h
CFLAGS_elf_aux.o += -I$(objtree)/arch/um CFLAGS_elf_aux.o += -I$(objtree)/arch/um
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "sigio.h" #include "sigio.h"
#include "os.h" #include "os.h"
/* Protected by sigio_lock(), also used by sigio_cleanup, which is an /* Protected by sigio_lock(), also used by sigio_cleanup, which is an
* exitcall. * exitcall.
*/ */
static int write_sigio_pid = -1; static int write_sigio_pid = -1;
...@@ -143,7 +143,7 @@ static void update_thread(void) ...@@ -143,7 +143,7 @@ static void update_thread(void)
return; return;
fail: fail:
/* Critical section start */ /* Critical section start */
if(write_sigio_pid != -1) if(write_sigio_pid != -1)
os_kill_process(write_sigio_pid, 1); os_kill_process(write_sigio_pid, 1);
write_sigio_pid = -1; write_sigio_pid = -1;
close(sigio_private[0]); close(sigio_private[0]);
...@@ -160,13 +160,13 @@ int add_sigio_fd(int fd, int read) ...@@ -160,13 +160,13 @@ int add_sigio_fd(int fd, int read)
sigio_lock(); sigio_lock();
for(i = 0; i < current_poll.used; i++){ for(i = 0; i < current_poll.used; i++){
if(current_poll.poll[i].fd == fd) if(current_poll.poll[i].fd == fd)
goto out; goto out;
} }
n = current_poll.used + 1; n = current_poll.used + 1;
err = need_poll(n); err = need_poll(n);
if(err) if(err)
goto out; goto out;
for(i = 0; i < current_poll.used; i++) for(i = 0; i < current_poll.used; i++)
...@@ -195,7 +195,7 @@ int ignore_sigio_fd(int fd) ...@@ -195,7 +195,7 @@ int ignore_sigio_fd(int fd)
} }
if(i == current_poll.used) if(i == current_poll.used)
goto out; goto out;
err = need_poll(current_poll.used - 1); err = need_poll(current_poll.used - 1);
if(err) if(err)
goto out; goto out;
...@@ -216,7 +216,7 @@ int ignore_sigio_fd(int fd) ...@@ -216,7 +216,7 @@ int ignore_sigio_fd(int fd)
return(err); return(err);
} }
static struct pollfd* setup_initial_poll(int fd) static struct pollfd *setup_initial_poll(int fd)
{ {
struct pollfd *p; struct pollfd *p;
...@@ -256,7 +256,7 @@ void write_sigio_workaround(void) ...@@ -256,7 +256,7 @@ void write_sigio_workaround(void)
} }
err = os_pipe(l_sigio_private, 1, 1); err = os_pipe(l_sigio_private, 1, 1);
if(err < 0){ if(err < 0){
printk("write_sigio_workaround - os_pipe 1 failed, " printk("write_sigio_workaround - os_pipe 2 failed, "
"err = %d\n", -err); "err = %d\n", -err);
goto out_close1; goto out_close1;
} }
...@@ -317,7 +317,7 @@ void write_sigio_workaround(void) ...@@ -317,7 +317,7 @@ void write_sigio_workaround(void)
void sigio_cleanup(void) void sigio_cleanup(void)
{ {
if (write_sigio_pid != -1) { if(write_sigio_pid != -1){
os_kill_process(write_sigio_pid, 1); os_kill_process(write_sigio_pid, 1);
write_sigio_pid = -1; write_sigio_pid = -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment