Commit abaf6977 authored by Gennady Sharapov's avatar Gennady Sharapov Committed by Linus Torvalds

[PATCH] uml: move libc-dependent skas process handling

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

This moves all systemcalls from skas/process.c file under os-Linux dir and
join skas/process.c and skas/process_kern.c files.
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 f45d9fc9
......@@ -232,6 +232,7 @@ extern void block_signals(void);
extern void unblock_signals(void);
extern int get_signals(void);
extern int set_signals(int enable);
extern void os_usr1_signal(int on);
/* trap.c */
extern void os_fill_handlinfo(struct kern_handlers h);
......@@ -272,4 +273,22 @@ extern int protect(struct mm_id * mm_idp, unsigned long addr,
unsigned long len, int r, int w, int x, int done,
void **data);
/* skas/process.c */
extern int is_skas_winch(int pid, int fd, void *data);
extern int start_userspace(unsigned long stub_stack);
extern int copy_context_skas0(unsigned long stack, int pid);
extern void userspace(union uml_pt_regs *regs);
extern void map_stub_pages(int fd, unsigned long code,
unsigned long data, unsigned long stack);
extern void new_thread(void *stack, void **switch_buf_ptr,
void **fork_buf_ptr, void (*handler)(int));
extern void thread_wait(void *sw, void *fb);
extern void switch_threads(void *me, void *next);
extern int start_idle_thread(void *stack, void *switch_buf_ptr,
void **fork_buf_ptr);
extern void initial_thread_cb_skas(void (*proc)(void *),
void *arg);
extern void halt_skas(void);
extern void reboot_skas(void);
#endif
......@@ -14,9 +14,6 @@ extern unsigned long exec_fpx_regs[];
extern int have_fpx_regs;
extern void sig_handler_common_skas(int sig, void *sc_ptr);
extern void halt_skas(void);
extern void reboot_skas(void);
extern void kill_off_processes_skas(void);
extern int is_skas_winch(int pid, int fd, void *data);
#endif
......@@ -18,7 +18,6 @@ extern int copy_thread_skas(int nr, unsigned long clone_flags,
unsigned long sp, unsigned long stack_top,
struct task_struct *p, struct pt_regs *regs);
extern void release_thread_skas(struct task_struct *task);
extern void initial_thread_cb_skas(void (*proc)(void *), void *arg);
extern void init_idle_skas(void);
extern void flush_tlb_kernel_range_skas(unsigned long start,
unsigned long end);
......
......@@ -13,21 +13,12 @@ extern int userspace_pid[];
extern int proc_mm, ptrace_faultinfo, ptrace_ldt;
extern int skas_needs_stub;
extern void switch_threads(void *me, void *next);
extern void thread_wait(void *sw, void *fb);
extern void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
void (*handler)(int));
extern int start_idle_thread(void *stack, void *switch_buf_ptr,
void **fork_buf_ptr);
extern int user_thread(unsigned long stack, int flags);
extern void userspace(union uml_pt_regs *regs);
extern void new_thread_proc(void *stack, void (*handler)(int sig));
extern void new_thread_handler(int sig);
extern void handle_syscall(union uml_pt_regs *regs);
extern void user_signal(int sig, union uml_pt_regs *regs, int pid);
extern int new_mm(unsigned long stack);
extern int start_userspace(unsigned long stub_stack);
extern int copy_context_skas0(unsigned long stack, int pid);
extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
extern long execute_syscall_skas(void *r);
extern unsigned long current_stub_stack(void);
......
......@@ -3,10 +3,10 @@
# Licensed under the GPL
#
obj-y := clone.o exec_kern.o mem.o mmu.o process.o process_kern.o \
obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \
syscall.o tlb.o uaccess.o
USER_OBJS := process.o clone.o
USER_OBJS := clone.o
include arch/um/scripts/Makefile.rules
......
......@@ -48,7 +48,7 @@ void new_thread_handler(int sig)
fn = current->thread.request.u.thread.proc;
arg = current->thread.request.u.thread.arg;
change_sig(SIGUSR1, 1);
os_usr1_signal(1);
thread_wait(&current->thread.mode.skas.switch_buf,
current->thread.mode.skas.fork_buf);
......@@ -80,7 +80,7 @@ void release_thread_skas(struct task_struct *task)
void fork_handler(int sig)
{
change_sig(SIGUSR1, 1);
os_usr1_signal(1);
thread_wait(&current->thread.mode.skas.switch_buf,
current->thread.mode.skas.fork_buf);
......@@ -91,7 +91,7 @@ void fork_handler(int sig)
schedule_tail(current->thread.prev_sched);
current->thread.prev_sched = NULL;
/* Handle any immediate reschedules or signals */
/* Handle any immediate reschedules or signals */
interrupt_end();
userspace(&current->thread.regs.regs);
}
......@@ -121,8 +121,6 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp,
return(0);
}
extern void map_stub_pages(int fd, unsigned long code,
unsigned long data, unsigned long stack);
int new_mm(unsigned long stack)
{
int fd;
......
......@@ -194,3 +194,8 @@ int set_signals(int enable)
return(ret);
}
void os_usr1_signal(int on)
{
change_sig(SIGUSR1, on);
}
......@@ -3,8 +3,8 @@
# Licensed under the GPL
#
obj-y := mem.o trap.o
obj-y := mem.o process.o trap.o
USER_OBJS := mem.o trap.o
USER_OBJS := mem.o process.o trap.o
include arch/um/scripts/Makefile.rules
This diff is collapsed.
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