aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/kern_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/include/kern_util.h')
-rw-r--r--arch/um/include/kern_util.h125
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
12extern int ncpus;
13extern char *linux_prog;
14extern char *gdb_init;
15extern int kmalloc_ok;
16extern int timer_irq_inited;
17extern int jail;
18extern int nsyscalls;
19
20extern 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
26extern int kernel_fork(unsigned long flags, int (*fn)(void *), void * arg);
27extern unsigned long stack_sp(unsigned long page);
28extern int kernel_thread_proc(void *data);
29extern void syscall_segv(int sig);
30extern int current_pid(void);
31extern unsigned long alloc_stack(int order, int atomic);
32extern int do_signal(void);
33extern int is_stack_fault(unsigned long sp);
34extern unsigned long segv(unsigned long address, unsigned long ip,
35 int is_write, int is_user, void *sc);
36extern int handle_page_fault(unsigned long address, unsigned long ip,
37 int is_write, int is_user, int *code_out);
38extern void syscall_ready(void);
39extern void set_tracing(void *t, int tracing);
40extern int is_tracing(void *task);
41extern int segv_syscall(void);
42extern void kern_finish_exec(void *task, int new_pid, unsigned long stack);
43extern int page_size(void);
44extern unsigned long page_mask(void);
45extern int need_finish_fork(void);
46extern void free_stack(unsigned long stack, int order);
47extern void add_input_request(int op, void (*proc)(int), void *arg);
48extern char *current_cmd(void);
49extern void timer_handler(int sig, union uml_pt_regs *regs);
50extern int set_signals(int enable);
51extern void force_sigbus(void);
52extern int pid_to_processor_id(int pid);
53extern void block_signals(void);
54extern void unblock_signals(void);
55extern void deliver_signals(void *t);
56extern int next_syscall_index(int max);
57extern int next_trap_index(int max);
58extern void default_idle(void);
59extern void finish_fork(void);
60extern void paging_init(void);
61extern void init_flush_vm(void);
62extern void *syscall_sp(void *t);
63extern void syscall_trace(union uml_pt_regs *regs, int entryexit);
64extern int hz(void);
65extern void uml_idle_timer(void);
66extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs);
67extern int external_pid(void *t);
68extern void boot_timer_handler(int sig);
69extern void interrupt_end(void);
70extern void initial_thread_cb(void (*proc)(void *), void *arg);
71extern int debugger_signal(int status, int pid);
72extern void debugger_parent_signal(int status, int pid);
73extern void child_signal(int pid, int status);
74extern int init_ptrace_proxy(int idle_pid, int startup, int stop);
75extern int init_parent_proxy(int pid);
76extern int singlestepping(void *t);
77extern void check_stack_overflow(void *ptr);
78extern void relay_signal(int sig, union uml_pt_regs *regs);
79extern void not_implemented(void);
80extern int user_context(unsigned long sp);
81extern void timer_irq(union uml_pt_regs *regs);
82extern void unprotect_stack(unsigned long stack);
83extern void do_uml_exitcalls(void);
84extern int attach_debugger(int idle_pid, int pid, int stop);
85extern void bad_segv(unsigned long address, unsigned long ip, int is_write);
86extern int config_gdb(char *str);
87extern int remove_gdb(void);
88extern char *uml_strdup(char *string);
89extern void unprotect_kernel_mem(void);
90extern void protect_kernel_mem(void);
91extern void uml_cleanup(void);
92extern void set_current(void *t);
93extern void lock_signalled_task(void *t);
94extern void IPI_handler(int cpu);
95extern int jail_setup(char *line, int *add);
96extern void *get_init_task(void);
97extern int clear_user_proc(void *buf, int size);
98extern int copy_to_user_proc(void *to, void *from, int size);
99extern int copy_from_user_proc(void *to, void *from, int size);
100extern int strlen_user_proc(char *str);
101extern void bus_handler(int sig, union uml_pt_regs *regs);
102extern void winch(int sig, union uml_pt_regs *regs);
103extern long execute_syscall(void *r);
104extern int smp_sigio_handler(void);
105extern void *get_current(void);
106extern struct task_struct *get_task(int pid, int require);
107extern void machine_halt(void);
108extern int is_syscall(unsigned long addr);
109extern void arch_switch(void);
110extern void free_irq(unsigned int, void *);
111extern int um_in_interrupt(void);
112extern 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 */