diff options
Diffstat (limited to 'arch/um/include/kern_util.h')
-rw-r--r-- | arch/um/include/kern_util.h | 120 |
1 files changed, 37 insertions, 83 deletions
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index 74ce8e5370a6..3c341222d252 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
@@ -9,107 +9,61 @@ | |||
9 | #include "sysdep/ptrace.h" | 9 | #include "sysdep/ptrace.h" |
10 | #include "sysdep/faultinfo.h" | 10 | #include "sysdep/faultinfo.h" |
11 | 11 | ||
12 | typedef void (*kern_hndl)(int, struct uml_pt_regs *); | 12 | extern int uml_exitcode; |
13 | |||
14 | struct 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 | |||
23 | extern const struct kern_handlers handlinfo_kern; | ||
24 | 13 | ||
25 | extern int ncpus; | 14 | extern int ncpus; |
26 | extern char *gdb_init; | ||
27 | extern int kmalloc_ok; | 15 | extern int kmalloc_ok; |
28 | extern int jail; | ||
29 | extern int nsyscalls; | ||
30 | 16 | ||
31 | #define UML_ROUND_DOWN(addr) ((void *)(((unsigned long) addr) & PAGE_MASK)) | ||
32 | #define UML_ROUND_UP(addr) \ | 17 | #define UML_ROUND_UP(addr) \ |
33 | UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1) | 18 | ((((unsigned long) addr) + PAGE_SIZE - 1) & PAGE_MASK) |
34 | 19 | ||
35 | extern int kernel_fork(unsigned long flags, int (*fn)(void *), void * arg); | ||
36 | extern int kernel_thread_proc(void *data); | ||
37 | extern void syscall_segv(int sig); | ||
38 | extern int current_pid(void); | ||
39 | extern unsigned long alloc_stack(int order, int atomic); | 20 | extern unsigned long alloc_stack(int order, int atomic); |
21 | extern void free_stack(unsigned long stack, int order); | ||
22 | |||
40 | extern int do_signal(void); | 23 | extern int do_signal(void); |
41 | extern int is_stack_fault(unsigned long sp); | 24 | extern void copy_sc(struct uml_pt_regs *regs, void *from); |
25 | extern void interrupt_end(void); | ||
26 | extern void relay_signal(int sig, struct uml_pt_regs *regs); | ||
27 | |||
42 | extern unsigned long segv(struct faultinfo fi, unsigned long ip, | 28 | extern unsigned long segv(struct faultinfo fi, unsigned long ip, |
43 | int is_user, struct uml_pt_regs *regs); | 29 | int is_user, struct uml_pt_regs *regs); |
44 | extern int handle_page_fault(unsigned long address, unsigned long ip, | 30 | extern int handle_page_fault(unsigned long address, unsigned long ip, |
45 | int is_write, int is_user, int *code_out); | 31 | int is_write, int is_user, int *code_out); |
46 | extern void syscall_ready(void); | 32 | |
47 | extern void set_tracing(void *t, int tracing); | ||
48 | extern int is_tracing(void *task); | ||
49 | extern int segv_syscall(void); | ||
50 | extern void kern_finish_exec(void *task, int new_pid, unsigned long stack); | ||
51 | extern unsigned long page_mask(void); | ||
52 | extern int need_finish_fork(void); | ||
53 | extern void free_stack(unsigned long stack, int order); | ||
54 | extern void add_input_request(int op, void (*proc)(int), void *arg); | ||
55 | extern char *current_cmd(void); | ||
56 | extern void timer_handler(int sig, struct uml_pt_regs *regs); | ||
57 | extern int set_signals(int enable); | ||
58 | extern int pid_to_processor_id(int pid); | ||
59 | extern void deliver_signals(void *t); | ||
60 | extern int next_trap_index(int max); | ||
61 | extern void default_idle(void); | ||
62 | extern void finish_fork(void); | ||
63 | extern void paging_init(void); | ||
64 | extern void init_flush_vm(void); | ||
65 | extern void *syscall_sp(void *t); | ||
66 | extern void syscall_trace(struct uml_pt_regs *regs, int entryexit); | ||
67 | extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs); | 33 | extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs); |
68 | extern void interrupt_end(void); | ||
69 | extern void initial_thread_cb(void (*proc)(void *), void *arg); | ||
70 | extern int debugger_signal(int status, int pid); | ||
71 | extern void debugger_parent_signal(int status, int pid); | ||
72 | extern void child_signal(int pid, int status); | ||
73 | extern int init_ptrace_proxy(int idle_pid, int startup, int stop); | ||
74 | extern int init_parent_proxy(int pid); | ||
75 | extern int singlestepping(void *t); | ||
76 | extern void check_stack_overflow(void *ptr); | ||
77 | extern void relay_signal(int sig, struct uml_pt_regs *regs); | ||
78 | extern int user_context(unsigned long sp); | ||
79 | extern void timer_irq(struct uml_pt_regs *regs); | ||
80 | extern void do_uml_exitcalls(void); | ||
81 | extern int attach_debugger(int idle_pid, int pid, int stop); | ||
82 | extern int config_gdb(char *str); | ||
83 | extern int remove_gdb(void); | ||
84 | extern char *uml_strdup(char *string); | ||
85 | extern void unprotect_kernel_mem(void); | ||
86 | extern void protect_kernel_mem(void); | ||
87 | extern void uml_cleanup(void); | ||
88 | extern void lock_signalled_task(void *t); | ||
89 | extern void IPI_handler(int cpu); | ||
90 | extern int jail_setup(char *line, int *add); | ||
91 | extern void *get_init_task(void); | ||
92 | extern int clear_user_proc(void *buf, int size); | ||
93 | extern int copy_to_user_proc(void *to, void *from, int size); | ||
94 | extern int copy_from_user_proc(void *to, void *from, int size); | ||
95 | extern int strlen_user_proc(char *str); | ||
96 | extern long execute_syscall(void *r); | ||
97 | extern int smp_sigio_handler(void); | 34 | extern int smp_sigio_handler(void); |
98 | extern void *get_current(void); | 35 | extern void initial_thread_cb(void (*proc)(void *), void *arg); |
99 | extern struct task_struct *get_task(int pid, int require); | ||
100 | extern void machine_halt(void); | ||
101 | extern int is_syscall(unsigned long addr); | 36 | extern int is_syscall(unsigned long addr); |
37 | extern void timer_handler(int sig, struct uml_pt_regs *regs); | ||
102 | 38 | ||
103 | extern void free_irq(unsigned int, void *); | 39 | extern void timer_handler(int sig, struct uml_pt_regs *regs); |
104 | extern int cpu(void); | ||
105 | 40 | ||
106 | extern void time_init_kern(void); | 41 | extern int start_uml(void); |
42 | extern void paging_init(void); | ||
107 | 43 | ||
108 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ | 44 | extern void uml_cleanup(void); |
45 | extern void do_uml_exitcalls(void); | ||
46 | |||
47 | /* | ||
48 | * Are we disallowed to sleep? Used to choose between GFP_KERNEL and | ||
49 | * GFP_ATOMIC. | ||
50 | */ | ||
109 | extern int __cant_sleep(void); | 51 | extern int __cant_sleep(void); |
110 | extern void sigio_handler(int sig, struct uml_pt_regs *regs); | 52 | extern void *get_current(void); |
111 | extern void copy_sc(struct uml_pt_regs *regs, void *from); | 53 | extern int copy_from_user_proc(void *to, void *from, int size); |
54 | extern int cpu(void); | ||
55 | extern char *uml_strdup(const char *string); | ||
56 | |||
112 | extern unsigned long to_irq_stack(unsigned long *mask_out); | 57 | extern unsigned long to_irq_stack(unsigned long *mask_out); |
113 | unsigned long from_irq_stack(int nested); | 58 | extern unsigned long from_irq_stack(int nested); |
114 | extern int start_uml(void); | 59 | |
60 | extern void syscall_trace(struct uml_pt_regs *regs, int entryexit); | ||
61 | extern int singlestepping(void *t); | ||
62 | |||
63 | extern void segv_handler(int sig, struct uml_pt_regs *regs); | ||
64 | extern void bus_handler(int sig, struct uml_pt_regs *regs); | ||
65 | extern void winch(int sig, struct uml_pt_regs *regs); | ||
66 | extern void fatal_sigsegv(void) __attribute__ ((noreturn)); | ||
67 | |||
68 | |||
115 | #endif | 69 | #endif |