aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2008-02-05 01:30:46 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:26 -0500
commitedea138584d7586a3b93b6d5ab5ec021d18e11e9 (patch)
tree0c5a5dd14256d675c8c64c8abdda86053f72abc8 /arch/um/include
parent0ba7fe03b638a084a4e15e21d2e585ba321ad9c8 (diff)
uml: tidy kern_util.h
Tidy kern_util.h. It turns out that most of the function declarations aren't used, so they can go away. os.h no longer includes kern_util.h, so files which got it through os.h now need to include it directly. A number of other files never needed it, so these includes are deleted. The structure which was used to pass signal handlers from the kernel side to the userspace side is gone. Instead, the handlers are declared here, and used directly from libc code. This allows arch/um/os-Linux/trap.c to be deleted, with its remnants being moved to arch/um/os-Linux/skas/trap.c. arch/um/os-Linux/tty.c had its inclusions changed, and it needed some style attention, so it got tidied. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/kern_util.h118
-rw-r--r--arch/um/include/os.h4
2 files changed, 35 insertions, 87 deletions
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h
index aa27eb0f458..8fadf8962e3 100644
--- a/arch/um/include/kern_util.h
+++ b/arch/um/include/kern_util.h
@@ -9,107 +9,59 @@
9#include "sysdep/ptrace.h" 9#include "sysdep/ptrace.h"
10#include "sysdep/faultinfo.h" 10#include "sysdep/faultinfo.h"
11 11
12typedef void (*kern_hndl)(int, struct uml_pt_regs *);
13
14struct kern_handlers {
15 kern_hndl relay_signal;
16 kern_hndl winch;
17 kern_hndl bus_handler;
18 kern_hndl page_fault;
19 kern_hndl sigio_handler;
20 kern_hndl timer_handler;
21};
22
23extern const struct kern_handlers handlinfo_kern;
24
25extern int ncpus; 12extern int ncpus;
26extern char *gdb_init;
27extern int kmalloc_ok; 13extern int kmalloc_ok;
28extern int jail;
29extern int nsyscalls; 14extern int nsyscalls;
30 15
31#define UML_ROUND_DOWN(addr) ((void *)(((unsigned long) addr) & PAGE_MASK))
32#define UML_ROUND_UP(addr) \ 16#define UML_ROUND_UP(addr) \
33 UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1) 17 ((((unsigned long) addr) + PAGE_SIZE - 1) & PAGE_MASK)
34 18
35extern int kernel_fork(unsigned long flags, int (*fn)(void *), void * arg);
36extern int kernel_thread_proc(void *data);
37extern void syscall_segv(int sig);
38extern int current_pid(void);
39extern unsigned long alloc_stack(int order, int atomic); 19extern unsigned long alloc_stack(int order, int atomic);
20extern void free_stack(unsigned long stack, int order);
21
40extern int do_signal(void); 22extern int do_signal(void);
41extern int is_stack_fault(unsigned long sp); 23extern void copy_sc(struct uml_pt_regs *regs, void *from);
24extern void interrupt_end(void);
25extern void relay_signal(int sig, struct uml_pt_regs *regs);
26
42extern unsigned long segv(struct faultinfo fi, unsigned long ip, 27extern unsigned long segv(struct faultinfo fi, unsigned long ip,
43 int is_user, struct uml_pt_regs *regs); 28 int is_user, struct uml_pt_regs *regs);
44extern int handle_page_fault(unsigned long address, unsigned long ip, 29extern int handle_page_fault(unsigned long address, unsigned long ip,
45 int is_write, int is_user, int *code_out); 30 int is_write, int is_user, int *code_out);
46extern void syscall_ready(void); 31
47extern void set_tracing(void *t, int tracing);
48extern int is_tracing(void *task);
49extern int segv_syscall(void);
50extern void kern_finish_exec(void *task, int new_pid, unsigned long stack);
51extern unsigned long page_mask(void);
52extern int need_finish_fork(void);
53extern void free_stack(unsigned long stack, int order);
54extern void add_input_request(int op, void (*proc)(int), void *arg);
55extern char *current_cmd(void);
56extern void timer_handler(int sig, struct uml_pt_regs *regs);
57extern int set_signals(int enable);
58extern int pid_to_processor_id(int pid);
59extern void deliver_signals(void *t);
60extern int next_trap_index(int max);
61extern void default_idle(void);
62extern void finish_fork(void);
63extern void paging_init(void);
64extern void init_flush_vm(void);
65extern void *syscall_sp(void *t);
66extern void syscall_trace(struct uml_pt_regs *regs, int entryexit);
67extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs); 32extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs);
68extern void interrupt_end(void);
69extern void initial_thread_cb(void (*proc)(void *), void *arg);
70extern int debugger_signal(int status, int pid);
71extern void debugger_parent_signal(int status, int pid);
72extern void child_signal(int pid, int status);
73extern int init_ptrace_proxy(int idle_pid, int startup, int stop);
74extern int init_parent_proxy(int pid);
75extern int singlestepping(void *t);
76extern void check_stack_overflow(void *ptr);
77extern void relay_signal(int sig, struct uml_pt_regs *regs);
78extern int user_context(unsigned long sp);
79extern void timer_irq(struct uml_pt_regs *regs);
80extern void do_uml_exitcalls(void);
81extern int attach_debugger(int idle_pid, int pid, int stop);
82extern int config_gdb(char *str);
83extern int remove_gdb(void);
84extern char *uml_strdup(const char *string);
85extern void unprotect_kernel_mem(void);
86extern void protect_kernel_mem(void);
87extern void uml_cleanup(void);
88extern void lock_signalled_task(void *t);
89extern void IPI_handler(int cpu);
90extern int jail_setup(char *line, int *add);
91extern void *get_init_task(void);
92extern int clear_user_proc(void *buf, int size);
93extern int copy_to_user_proc(void *to, void *from, int size);
94extern int copy_from_user_proc(void *to, void *from, int size);
95extern int strlen_user_proc(char *str);
96extern long execute_syscall(void *r);
97extern int smp_sigio_handler(void); 33extern int smp_sigio_handler(void);
98extern void *get_current(void); 34extern void initial_thread_cb(void (*proc)(void *), void *arg);
99extern struct task_struct *get_task(int pid, int require);
100extern void machine_halt(void);
101extern int is_syscall(unsigned long addr); 35extern int is_syscall(unsigned long addr);
36extern void timer_handler(int sig, struct uml_pt_regs *regs);
102 37
103extern void free_irq(unsigned int, void *); 38extern void timer_handler(int sig, struct uml_pt_regs *regs);
104extern int cpu(void); 39
40extern int start_uml(void);
41extern void paging_init(void);
105 42
106extern void time_init_kern(void); 43extern void uml_cleanup(void);
44extern void do_uml_exitcalls(void);
107 45
108/* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ 46/*
47 * Are we disallowed to sleep? Used to choose between GFP_KERNEL and
48 * GFP_ATOMIC.
49 */
109extern int __cant_sleep(void); 50extern int __cant_sleep(void);
110extern void sigio_handler(int sig, struct uml_pt_regs *regs); 51extern void *get_current(void);
111extern void copy_sc(struct uml_pt_regs *regs, void *from); 52extern int copy_from_user_proc(void *to, void *from, int size);
53extern int cpu(void);
54extern char *uml_strdup(const char *string);
55
112extern unsigned long to_irq_stack(unsigned long *mask_out); 56extern unsigned long to_irq_stack(unsigned long *mask_out);
113unsigned long from_irq_stack(int nested); 57extern unsigned long from_irq_stack(int nested);
114extern int start_uml(void); 58
59extern void syscall_trace(struct uml_pt_regs *regs, int entryexit);
60extern int singlestepping(void *t);
61
62extern void segv_handler(int sig, struct uml_pt_regs *regs);
63extern void bus_handler(int sig, struct uml_pt_regs *regs);
64extern void winch(int sig, struct uml_pt_regs *regs);
65
66
115#endif 67#endif
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 82e5aeae2b8..55ca073589d 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -8,7 +8,6 @@
8 8
9#include <stdarg.h> 9#include <stdarg.h>
10#include "irq_user.h" 10#include "irq_user.h"
11#include "kern_util.h"
12#include "longjmp.h" 11#include "longjmp.h"
13#include "mm_id.h" 12#include "mm_id.h"
14#include "sysdep/tls.h" 13#include "sysdep/tls.h"
@@ -237,9 +236,6 @@ extern void unblock_signals(void);
237extern int get_signals(void); 236extern int get_signals(void);
238extern int set_signals(int enable); 237extern int set_signals(int enable);
239 238
240/* trap.c */
241extern void os_fill_handlinfo(struct kern_handlers h);
242
243/* util.c */ 239/* util.c */
244extern void stack_protections(unsigned long address); 240extern void stack_protections(unsigned long address);
245extern int raw(int fd); 241extern int raw(int fd);