diff options
Diffstat (limited to 'arch/um/include/kern_util.h')
-rw-r--r-- | arch/um/include/kern_util.h | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h new file mode 100644 index 000000000000..15389c886b41 --- /dev/null +++ b/arch/um/include/kern_util.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __KERN_UTIL_H__ | ||
7 | #define __KERN_UTIL_H__ | ||
8 | |||
9 | #include "linux/threads.h" | ||
10 | #include "sysdep/ptrace.h" | ||
11 | |||
12 | extern int ncpus; | ||
13 | extern char *linux_prog; | ||
14 | extern char *gdb_init; | ||
15 | extern int kmalloc_ok; | ||
16 | extern int timer_irq_inited; | ||
17 | extern int jail; | ||
18 | extern int nsyscalls; | ||
19 | |||
20 | extern struct task_struct *idle_threads[NR_CPUS]; | ||
21 | |||
22 | #define UML_ROUND_DOWN(addr) ((void *)(((unsigned long) addr) & PAGE_MASK)) | ||
23 | #define UML_ROUND_UP(addr) \ | ||
24 | UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1) | ||
25 | |||
26 | extern int kernel_fork(unsigned long flags, int (*fn)(void *), void * arg); | ||
27 | extern unsigned long stack_sp(unsigned long page); | ||
28 | extern int kernel_thread_proc(void *data); | ||
29 | extern void syscall_segv(int sig); | ||
30 | extern int current_pid(void); | ||
31 | extern unsigned long alloc_stack(int order, int atomic); | ||
32 | extern int do_signal(void); | ||
33 | extern int is_stack_fault(unsigned long sp); | ||
34 | extern unsigned long segv(unsigned long address, unsigned long ip, | ||
35 | int is_write, int is_user, void *sc); | ||
36 | extern int handle_page_fault(unsigned long address, unsigned long ip, | ||
37 | int is_write, int is_user, int *code_out); | ||
38 | extern void syscall_ready(void); | ||
39 | extern void set_tracing(void *t, int tracing); | ||
40 | extern int is_tracing(void *task); | ||
41 | extern int segv_syscall(void); | ||
42 | extern void kern_finish_exec(void *task, int new_pid, unsigned long stack); | ||
43 | extern int page_size(void); | ||
44 | extern unsigned long page_mask(void); | ||
45 | extern int need_finish_fork(void); | ||
46 | extern void free_stack(unsigned long stack, int order); | ||
47 | extern void add_input_request(int op, void (*proc)(int), void *arg); | ||
48 | extern char *current_cmd(void); | ||
49 | extern void timer_handler(int sig, union uml_pt_regs *regs); | ||
50 | extern int set_signals(int enable); | ||
51 | extern void force_sigbus(void); | ||
52 | extern int pid_to_processor_id(int pid); | ||
53 | extern void block_signals(void); | ||
54 | extern void unblock_signals(void); | ||
55 | extern void deliver_signals(void *t); | ||
56 | extern int next_syscall_index(int max); | ||
57 | extern int next_trap_index(int max); | ||
58 | extern void default_idle(void); | ||
59 | extern void finish_fork(void); | ||
60 | extern void paging_init(void); | ||
61 | extern void init_flush_vm(void); | ||
62 | extern void *syscall_sp(void *t); | ||
63 | extern void syscall_trace(union uml_pt_regs *regs, int entryexit); | ||
64 | extern int hz(void); | ||
65 | extern void uml_idle_timer(void); | ||
66 | extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs); | ||
67 | extern int external_pid(void *t); | ||
68 | extern void boot_timer_handler(int sig); | ||
69 | extern void interrupt_end(void); | ||
70 | extern void initial_thread_cb(void (*proc)(void *), void *arg); | ||
71 | extern int debugger_signal(int status, int pid); | ||
72 | extern void debugger_parent_signal(int status, int pid); | ||
73 | extern void child_signal(int pid, int status); | ||
74 | extern int init_ptrace_proxy(int idle_pid, int startup, int stop); | ||
75 | extern int init_parent_proxy(int pid); | ||
76 | extern int singlestepping(void *t); | ||
77 | extern void check_stack_overflow(void *ptr); | ||
78 | extern void relay_signal(int sig, union uml_pt_regs *regs); | ||
79 | extern void not_implemented(void); | ||
80 | extern int user_context(unsigned long sp); | ||
81 | extern void timer_irq(union uml_pt_regs *regs); | ||
82 | extern void unprotect_stack(unsigned long stack); | ||
83 | extern void do_uml_exitcalls(void); | ||
84 | extern int attach_debugger(int idle_pid, int pid, int stop); | ||
85 | extern void bad_segv(unsigned long address, unsigned long ip, int is_write); | ||
86 | extern int config_gdb(char *str); | ||
87 | extern int remove_gdb(void); | ||
88 | extern char *uml_strdup(char *string); | ||
89 | extern void unprotect_kernel_mem(void); | ||
90 | extern void protect_kernel_mem(void); | ||
91 | extern void uml_cleanup(void); | ||
92 | extern void set_current(void *t); | ||
93 | extern void lock_signalled_task(void *t); | ||
94 | extern void IPI_handler(int cpu); | ||
95 | extern int jail_setup(char *line, int *add); | ||
96 | extern void *get_init_task(void); | ||
97 | extern int clear_user_proc(void *buf, int size); | ||
98 | extern int copy_to_user_proc(void *to, void *from, int size); | ||
99 | extern int copy_from_user_proc(void *to, void *from, int size); | ||
100 | extern int strlen_user_proc(char *str); | ||
101 | extern void bus_handler(int sig, union uml_pt_regs *regs); | ||
102 | extern void winch(int sig, union uml_pt_regs *regs); | ||
103 | extern long execute_syscall(void *r); | ||
104 | extern int smp_sigio_handler(void); | ||
105 | extern void *get_current(void); | ||
106 | extern struct task_struct *get_task(int pid, int require); | ||
107 | extern void machine_halt(void); | ||
108 | extern int is_syscall(unsigned long addr); | ||
109 | extern void arch_switch(void); | ||
110 | extern void free_irq(unsigned int, void *); | ||
111 | extern int um_in_interrupt(void); | ||
112 | extern int cpu(void); | ||
113 | |||
114 | #endif | ||
115 | |||
116 | /* | ||
117 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
118 | * Emacs will notice this stuff at the end of the file and automatically | ||
119 | * adjust the settings for this buffer only. This must remain at the end | ||
120 | * of the file. | ||
121 | * --------------------------------------------------------------------------- | ||
122 | * Local variables: | ||
123 | * c-file-style: "linux" | ||
124 | * End: | ||
125 | */ | ||