diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-01-26 22:19:57 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-26 22:19:57 -0500 |
commit | 97309d1a0bbdcb0813ea08574b4473d8e5416012 (patch) | |
tree | 0dcbcf5aa5146147e0ac1d0c4b73b868a67d333b /arch/um/include | |
parent | b4ea75b649417606fd6b38710a2962ec9770e772 (diff) | |
parent | efd51b5c6798d103e3aa683464aebb2019b62119 (diff) |
Merge branch 'upstream-fixes'
Diffstat (limited to 'arch/um/include')
-rw-r--r-- | arch/um/include/kern_util.h | 4 | ||||
-rw-r--r-- | arch/um/include/longjmp.h | 19 | ||||
-rw-r--r-- | arch/um/include/mode_kern.h | 15 | ||||
-rw-r--r-- | arch/um/include/os.h | 58 | ||||
-rw-r--r-- | arch/um/include/skas/mm_id.h | 17 | ||||
-rw-r--r-- | arch/um/include/skas/mmu-skas.h | 24 | ||||
-rw-r--r-- | arch/um/include/skas/mode-skas.h | 19 | ||||
-rw-r--r-- | arch/um/include/skas/mode_kern_skas.h | 40 | ||||
-rw-r--r-- | arch/um/include/skas/proc_mm.h | 44 | ||||
-rw-r--r-- | arch/um/include/skas/skas.h | 26 | ||||
-rw-r--r-- | arch/um/include/skas/stub-data.h | 18 | ||||
-rw-r--r-- | arch/um/include/skas/uaccess-skas.h | 21 | ||||
-rw-r--r-- | arch/um/include/time_user.h | 19 | ||||
-rw-r--r-- | arch/um/include/tt/debug.h | 18 | ||||
-rw-r--r-- | arch/um/include/tt/mmu-tt.h | 12 | ||||
-rw-r--r-- | arch/um/include/tt/mode-tt.h | 23 | ||||
-rw-r--r-- | arch/um/include/tt/mode_kern_tt.h | 41 | ||||
-rw-r--r-- | arch/um/include/tt/tt.h | 36 | ||||
-rw-r--r-- | arch/um/include/tt/uaccess-tt.h | 48 | ||||
-rw-r--r-- | arch/um/include/user.h | 1 | ||||
-rw-r--r-- | arch/um/include/user_util.h | 18 |
21 files changed, 469 insertions, 52 deletions
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index 8f4e46d677ab..c649108a9e9f 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
@@ -120,8 +120,10 @@ extern void machine_halt(void); | |||
120 | extern int is_syscall(unsigned long addr); | 120 | extern int is_syscall(unsigned long addr); |
121 | extern void arch_switch(void); | 121 | extern void arch_switch(void); |
122 | extern void free_irq(unsigned int, void *); | 122 | extern void free_irq(unsigned int, void *); |
123 | extern int um_in_interrupt(void); | ||
124 | extern int cpu(void); | 123 | extern int cpu(void); |
124 | |||
125 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ | ||
126 | extern int __cant_sleep(void); | ||
125 | extern void segv_handler(int sig, union uml_pt_regs *regs); | 127 | extern void segv_handler(int sig, union uml_pt_regs *regs); |
126 | extern void sigio_handler(int sig, union uml_pt_regs *regs); | 128 | extern void sigio_handler(int sig, union uml_pt_regs *regs); |
127 | 129 | ||
diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h new file mode 100644 index 000000000000..018b3819ab0b --- /dev/null +++ b/arch/um/include/longjmp.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef __UML_LONGJMP_H | ||
2 | #define __UML_LONGJMP_H | ||
3 | |||
4 | #include <setjmp.h> | ||
5 | #include "os.h" | ||
6 | |||
7 | #define UML_SIGLONGJMP(buf, val) do { \ | ||
8 | longjmp(*buf, val); \ | ||
9 | } while(0) | ||
10 | |||
11 | #define UML_SIGSETJMP(buf, enable) ({ \ | ||
12 | int n; \ | ||
13 | enable = get_signals(); \ | ||
14 | n = setjmp(*buf); \ | ||
15 | if(n != 0) \ | ||
16 | set_signals(enable); \ | ||
17 | n; }) | ||
18 | |||
19 | #endif | ||
diff --git a/arch/um/include/mode_kern.h b/arch/um/include/mode_kern.h index 2d88afd0cf16..e7539a8451ef 100644 --- a/arch/um/include/mode_kern.h +++ b/arch/um/include/mode_kern.h | |||
@@ -9,22 +9,11 @@ | |||
9 | #include "linux/config.h" | 9 | #include "linux/config.h" |
10 | 10 | ||
11 | #ifdef CONFIG_MODE_TT | 11 | #ifdef CONFIG_MODE_TT |
12 | #include "mode_kern-tt.h" | 12 | #include "mode_kern_tt.h" |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #ifdef CONFIG_MODE_SKAS | 15 | #ifdef CONFIG_MODE_SKAS |
16 | #include "mode_kern-skas.h" | 16 | #include "mode_kern_skas.h" |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #endif | 19 | #endif |
20 | |||
21 | /* | ||
22 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
23 | * Emacs will notice this stuff at the end of the file and automatically | ||
24 | * adjust the settings for this buffer only. This must remain at the end | ||
25 | * of the file. | ||
26 | * --------------------------------------------------------------------------- | ||
27 | * Local variables: | ||
28 | * c-file-style: "linux" | ||
29 | * End: | ||
30 | */ | ||
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index dd72d66cf0ed..eb1710b81255 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "../os/include/file.h" | 11 | #include "../os/include/file.h" |
12 | #include "sysdep/ptrace.h" | 12 | #include "sysdep/ptrace.h" |
13 | #include "kern_util.h" | 13 | #include "kern_util.h" |
14 | #include "skas/mm_id.h" | ||
14 | 15 | ||
15 | #define OS_TYPE_FILE 1 | 16 | #define OS_TYPE_FILE 1 |
16 | #define OS_TYPE_DIR 2 | 17 | #define OS_TYPE_DIR 2 |
@@ -190,11 +191,12 @@ extern int os_protect_memory(void *addr, unsigned long len, | |||
190 | int r, int w, int x); | 191 | int r, int w, int x); |
191 | extern int os_unmap_memory(void *addr, int len); | 192 | extern int os_unmap_memory(void *addr, int len); |
192 | extern void os_flush_stdout(void); | 193 | extern void os_flush_stdout(void); |
193 | extern unsigned long long os_usecs(void); | ||
194 | 194 | ||
195 | /* tt.c | 195 | /* tt.c |
196 | * for tt mode only (will be deleted in future...) | 196 | * for tt mode only (will be deleted in future...) |
197 | */ | 197 | */ |
198 | extern void stop(void); | ||
199 | extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); | ||
198 | extern int protect_memory(unsigned long addr, unsigned long len, | 200 | extern int protect_memory(unsigned long addr, unsigned long len, |
199 | int r, int w, int x, int must_succeed); | 201 | int r, int w, int x, int must_succeed); |
200 | extern void forward_pending_sigio(int target); | 202 | extern void forward_pending_sigio(int target); |
@@ -230,9 +232,63 @@ extern void block_signals(void); | |||
230 | extern void unblock_signals(void); | 232 | extern void unblock_signals(void); |
231 | extern int get_signals(void); | 233 | extern int get_signals(void); |
232 | extern int set_signals(int enable); | 234 | extern int set_signals(int enable); |
235 | extern void os_usr1_signal(int on); | ||
233 | 236 | ||
234 | /* trap.c */ | 237 | /* trap.c */ |
235 | extern void os_fill_handlinfo(struct kern_handlers h); | 238 | extern void os_fill_handlinfo(struct kern_handlers h); |
236 | extern void do_longjmp(void *p, int val); | 239 | extern void do_longjmp(void *p, int val); |
237 | 240 | ||
241 | /* util.c */ | ||
242 | extern void stack_protections(unsigned long address); | ||
243 | extern void task_protections(unsigned long address); | ||
244 | extern int raw(int fd); | ||
245 | extern void setup_machinename(char *machine_out); | ||
246 | extern void setup_hostinfo(void); | ||
247 | extern int setjmp_wrapper(void (*proc)(void *, void *), ...); | ||
248 | |||
249 | /* time.c */ | ||
250 | #define BILLION (1000 * 1000 * 1000) | ||
251 | |||
252 | extern void switch_timers(int to_real); | ||
253 | extern void idle_sleep(int secs); | ||
254 | extern void enable_timer(void); | ||
255 | extern void disable_timer(void); | ||
256 | extern void user_time_init(void); | ||
257 | extern void uml_idle_timer(void); | ||
258 | extern unsigned long long os_nsecs(void); | ||
259 | |||
260 | /* skas/mem.c */ | ||
261 | extern long run_syscall_stub(struct mm_id * mm_idp, | ||
262 | int syscall, unsigned long *args, long expected, | ||
263 | void **addr, int done); | ||
264 | extern long syscall_stub_data(struct mm_id * mm_idp, | ||
265 | unsigned long *data, int data_count, | ||
266 | void **addr, void **stub_addr); | ||
267 | extern int map(struct mm_id * mm_idp, unsigned long virt, | ||
268 | unsigned long len, int r, int w, int x, int phys_fd, | ||
269 | unsigned long long offset, int done, void **data); | ||
270 | extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len, | ||
271 | int done, void **data); | ||
272 | extern int protect(struct mm_id * mm_idp, unsigned long addr, | ||
273 | unsigned long len, int r, int w, int x, int done, | ||
274 | void **data); | ||
275 | |||
276 | /* skas/process.c */ | ||
277 | extern int is_skas_winch(int pid, int fd, void *data); | ||
278 | extern int start_userspace(unsigned long stub_stack); | ||
279 | extern int copy_context_skas0(unsigned long stack, int pid); | ||
280 | extern void userspace(union uml_pt_regs *regs); | ||
281 | extern void map_stub_pages(int fd, unsigned long code, | ||
282 | unsigned long data, unsigned long stack); | ||
283 | extern void new_thread(void *stack, void **switch_buf_ptr, | ||
284 | void **fork_buf_ptr, void (*handler)(int)); | ||
285 | extern void thread_wait(void *sw, void *fb); | ||
286 | extern void switch_threads(void *me, void *next); | ||
287 | extern int start_idle_thread(void *stack, void *switch_buf_ptr, | ||
288 | void **fork_buf_ptr); | ||
289 | extern void initial_thread_cb_skas(void (*proc)(void *), | ||
290 | void *arg); | ||
291 | extern void halt_skas(void); | ||
292 | extern void reboot_skas(void); | ||
293 | |||
238 | #endif | 294 | #endif |
diff --git a/arch/um/include/skas/mm_id.h b/arch/um/include/skas/mm_id.h new file mode 100644 index 000000000000..48dd0989ddaa --- /dev/null +++ b/arch/um/include/skas/mm_id.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MM_ID_H | ||
7 | #define __MM_ID_H | ||
8 | |||
9 | struct mm_id { | ||
10 | union { | ||
11 | int mm_fd; | ||
12 | int pid; | ||
13 | } u; | ||
14 | unsigned long stack; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/arch/um/include/skas/mmu-skas.h b/arch/um/include/skas/mmu-skas.h new file mode 100644 index 000000000000..d8869a6ef1b4 --- /dev/null +++ b/arch/um/include/skas/mmu-skas.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SKAS_MMU_H | ||
7 | #define __SKAS_MMU_H | ||
8 | |||
9 | #include "linux/config.h" | ||
10 | #include "mm_id.h" | ||
11 | #include "asm/ldt.h" | ||
12 | |||
13 | struct mmu_context_skas { | ||
14 | struct mm_id id; | ||
15 | unsigned long last_page_table; | ||
16 | #ifdef CONFIG_3_LEVEL_PGTABLES | ||
17 | unsigned long last_pmd; | ||
18 | #endif | ||
19 | uml_ldt_t ldt; | ||
20 | }; | ||
21 | |||
22 | extern void switch_mm_skas(struct mm_id * mm_idp); | ||
23 | |||
24 | #endif | ||
diff --git a/arch/um/include/skas/mode-skas.h b/arch/um/include/skas/mode-skas.h new file mode 100644 index 000000000000..260065cfeef1 --- /dev/null +++ b/arch/um/include/skas/mode-skas.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MODE_SKAS_H__ | ||
7 | #define __MODE_SKAS_H__ | ||
8 | |||
9 | #include <sysdep/ptrace.h> | ||
10 | |||
11 | extern unsigned long exec_regs[]; | ||
12 | extern unsigned long exec_fp_regs[]; | ||
13 | extern unsigned long exec_fpx_regs[]; | ||
14 | extern int have_fpx_regs; | ||
15 | |||
16 | extern void sig_handler_common_skas(int sig, void *sc_ptr); | ||
17 | extern void kill_off_processes_skas(void); | ||
18 | |||
19 | #endif | ||
diff --git a/arch/um/include/skas/mode_kern_skas.h b/arch/um/include/skas/mode_kern_skas.h new file mode 100644 index 000000000000..63c58739bde0 --- /dev/null +++ b/arch/um/include/skas/mode_kern_skas.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SKAS_MODE_KERN_H__ | ||
7 | #define __SKAS_MODE_KERN_H__ | ||
8 | |||
9 | #include "linux/sched.h" | ||
10 | #include "asm/page.h" | ||
11 | #include "asm/ptrace.h" | ||
12 | |||
13 | extern void flush_thread_skas(void); | ||
14 | extern void switch_to_skas(void *prev, void *next); | ||
15 | extern void start_thread_skas(struct pt_regs *regs, unsigned long eip, | ||
16 | unsigned long esp); | ||
17 | extern int copy_thread_skas(int nr, unsigned long clone_flags, | ||
18 | unsigned long sp, unsigned long stack_top, | ||
19 | struct task_struct *p, struct pt_regs *regs); | ||
20 | extern void release_thread_skas(struct task_struct *task); | ||
21 | extern void init_idle_skas(void); | ||
22 | extern void flush_tlb_kernel_range_skas(unsigned long start, | ||
23 | unsigned long end); | ||
24 | extern void flush_tlb_kernel_vm_skas(void); | ||
25 | extern void __flush_tlb_one_skas(unsigned long addr); | ||
26 | extern void flush_tlb_range_skas(struct vm_area_struct *vma, | ||
27 | unsigned long start, unsigned long end); | ||
28 | extern void flush_tlb_mm_skas(struct mm_struct *mm); | ||
29 | extern void force_flush_all_skas(void); | ||
30 | extern long execute_syscall_skas(void *r); | ||
31 | extern void before_mem_skas(unsigned long unused); | ||
32 | extern unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, | ||
33 | unsigned long *task_size_out); | ||
34 | extern int start_uml_skas(void); | ||
35 | extern int external_pid_skas(struct task_struct *task); | ||
36 | extern int thread_pid_skas(struct task_struct *task); | ||
37 | |||
38 | #define kmem_end_skas (host_task_size - 1024 * 1024) | ||
39 | |||
40 | #endif | ||
diff --git a/arch/um/include/skas/proc_mm.h b/arch/um/include/skas/proc_mm.h new file mode 100644 index 000000000000..902809209603 --- /dev/null +++ b/arch/um/include/skas/proc_mm.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SKAS_PROC_MM_H | ||
7 | #define __SKAS_PROC_MM_H | ||
8 | |||
9 | #define MM_MMAP 54 | ||
10 | #define MM_MUNMAP 55 | ||
11 | #define MM_MPROTECT 56 | ||
12 | #define MM_COPY_SEGMENTS 57 | ||
13 | |||
14 | struct mm_mmap { | ||
15 | unsigned long addr; | ||
16 | unsigned long len; | ||
17 | unsigned long prot; | ||
18 | unsigned long flags; | ||
19 | unsigned long fd; | ||
20 | unsigned long offset; | ||
21 | }; | ||
22 | |||
23 | struct mm_munmap { | ||
24 | unsigned long addr; | ||
25 | unsigned long len; | ||
26 | }; | ||
27 | |||
28 | struct mm_mprotect { | ||
29 | unsigned long addr; | ||
30 | unsigned long len; | ||
31 | unsigned int prot; | ||
32 | }; | ||
33 | |||
34 | struct proc_mm_op { | ||
35 | int op; | ||
36 | union { | ||
37 | struct mm_mmap mmap; | ||
38 | struct mm_munmap munmap; | ||
39 | struct mm_mprotect mprotect; | ||
40 | int copy_segments; | ||
41 | } u; | ||
42 | }; | ||
43 | |||
44 | #endif | ||
diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h new file mode 100644 index 000000000000..86357282d681 --- /dev/null +++ b/arch/um/include/skas/skas.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SKAS_H | ||
7 | #define __SKAS_H | ||
8 | |||
9 | #include "mm_id.h" | ||
10 | #include "sysdep/ptrace.h" | ||
11 | |||
12 | extern int userspace_pid[]; | ||
13 | extern int proc_mm, ptrace_faultinfo, ptrace_ldt; | ||
14 | extern int skas_needs_stub; | ||
15 | |||
16 | extern int user_thread(unsigned long stack, int flags); | ||
17 | extern void new_thread_proc(void *stack, void (*handler)(int sig)); | ||
18 | extern void new_thread_handler(int sig); | ||
19 | extern void handle_syscall(union uml_pt_regs *regs); | ||
20 | extern void user_signal(int sig, union uml_pt_regs *regs, int pid); | ||
21 | extern int new_mm(unsigned long stack); | ||
22 | extern void get_skas_faultinfo(int pid, struct faultinfo * fi); | ||
23 | extern long execute_syscall_skas(void *r); | ||
24 | extern unsigned long current_stub_stack(void); | ||
25 | |||
26 | #endif | ||
diff --git a/arch/um/include/skas/stub-data.h b/arch/um/include/skas/stub-data.h new file mode 100644 index 000000000000..f6ed92c3727d --- /dev/null +++ b/arch/um/include/skas/stub-data.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __STUB_DATA_H | ||
7 | #define __STUB_DATA_H | ||
8 | |||
9 | #include <sys/time.h> | ||
10 | |||
11 | struct stub_data { | ||
12 | long offset; | ||
13 | int fd; | ||
14 | struct itimerval timer; | ||
15 | long err; | ||
16 | }; | ||
17 | |||
18 | #endif | ||
diff --git a/arch/um/include/skas/uaccess-skas.h b/arch/um/include/skas/uaccess-skas.h new file mode 100644 index 000000000000..224a75f4c025 --- /dev/null +++ b/arch/um/include/skas/uaccess-skas.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SKAS_UACCESS_H | ||
7 | #define __SKAS_UACCESS_H | ||
8 | |||
9 | #include "asm/errno.h" | ||
10 | |||
11 | /* No SKAS-specific checking. */ | ||
12 | #define access_ok_skas(type, addr, size) 0 | ||
13 | |||
14 | extern int copy_from_user_skas(void *to, const void __user *from, int n); | ||
15 | extern int copy_to_user_skas(void __user *to, const void *from, int n); | ||
16 | extern int strncpy_from_user_skas(char *dst, const char __user *src, int count); | ||
17 | extern int __clear_user_skas(void __user *mem, int len); | ||
18 | extern int clear_user_skas(void __user *mem, int len); | ||
19 | extern int strnlen_user_skas(const void __user *str, int len); | ||
20 | |||
21 | #endif | ||
diff --git a/arch/um/include/time_user.h b/arch/um/include/time_user.h deleted file mode 100644 index 17d7ef2141f4..000000000000 --- a/arch/um/include/time_user.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TIME_USER_H__ | ||
7 | #define __TIME_USER_H__ | ||
8 | |||
9 | extern void timer(void); | ||
10 | extern void switch_timers(int to_real); | ||
11 | extern void idle_sleep(int secs); | ||
12 | extern void enable_timer(void); | ||
13 | extern void prepare_timer(void * ptr); | ||
14 | extern void disable_timer(void); | ||
15 | extern unsigned long time_lock(void); | ||
16 | extern void time_unlock(unsigned long); | ||
17 | extern void user_time_init(void); | ||
18 | |||
19 | #endif | ||
diff --git a/arch/um/include/tt/debug.h b/arch/um/include/tt/debug.h new file mode 100644 index 000000000000..9778fa838296 --- /dev/null +++ b/arch/um/include/tt/debug.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) and | ||
3 | * Lars Brinkhoff. | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __UML_TT_DEBUG_H | ||
8 | #define __UML_TT_DEBUG_H | ||
9 | |||
10 | extern int debugger_proxy(int status, pid_t pid); | ||
11 | extern void child_proxy(pid_t pid, int status); | ||
12 | extern void init_proxy (pid_t pid, int waiting, int status); | ||
13 | extern int start_debugger(char *prog, int startup, int stop, int *debugger_fd); | ||
14 | extern void fake_child_exit(void); | ||
15 | extern int gdb_config(char *str); | ||
16 | extern int gdb_remove(int unused); | ||
17 | |||
18 | #endif | ||
diff --git a/arch/um/include/tt/mmu-tt.h b/arch/um/include/tt/mmu-tt.h new file mode 100644 index 000000000000..572a78b22587 --- /dev/null +++ b/arch/um/include/tt/mmu-tt.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_MMU_H | ||
7 | #define __TT_MMU_H | ||
8 | |||
9 | struct mmu_context_tt { | ||
10 | }; | ||
11 | |||
12 | #endif | ||
diff --git a/arch/um/include/tt/mode-tt.h b/arch/um/include/tt/mode-tt.h new file mode 100644 index 000000000000..2823cd56eea2 --- /dev/null +++ b/arch/um/include/tt/mode-tt.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MODE_TT_H__ | ||
7 | #define __MODE_TT_H__ | ||
8 | |||
9 | #include "sysdep/ptrace.h" | ||
10 | |||
11 | enum { OP_NONE, OP_EXEC, OP_FORK, OP_TRACE_ON, OP_REBOOT, OP_HALT, OP_CB }; | ||
12 | |||
13 | extern int tracing_pid; | ||
14 | |||
15 | extern int tracer(int (*init_proc)(void *), void *sp); | ||
16 | extern void sig_handler_common_tt(int sig, void *sc); | ||
17 | extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); | ||
18 | extern void reboot_tt(void); | ||
19 | extern void halt_tt(void); | ||
20 | extern int is_tracer_winch(int pid, int fd, void *data); | ||
21 | extern void kill_off_processes_tt(void); | ||
22 | |||
23 | #endif | ||
diff --git a/arch/um/include/tt/mode_kern_tt.h b/arch/um/include/tt/mode_kern_tt.h new file mode 100644 index 000000000000..efa0012550d0 --- /dev/null +++ b/arch/um/include/tt/mode_kern_tt.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_MODE_KERN_H__ | ||
7 | #define __TT_MODE_KERN_H__ | ||
8 | |||
9 | #include "linux/sched.h" | ||
10 | #include "asm/page.h" | ||
11 | #include "asm/ptrace.h" | ||
12 | #include "asm/uaccess.h" | ||
13 | |||
14 | extern void switch_to_tt(void *prev, void *next); | ||
15 | extern void flush_thread_tt(void); | ||
16 | extern void start_thread_tt(struct pt_regs *regs, unsigned long eip, | ||
17 | unsigned long esp); | ||
18 | extern int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp, | ||
19 | unsigned long stack_top, struct task_struct *p, | ||
20 | struct pt_regs *regs); | ||
21 | extern void release_thread_tt(struct task_struct *task); | ||
22 | extern void initial_thread_cb_tt(void (*proc)(void *), void *arg); | ||
23 | extern void init_idle_tt(void); | ||
24 | extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end); | ||
25 | extern void flush_tlb_kernel_vm_tt(void); | ||
26 | extern void __flush_tlb_one_tt(unsigned long addr); | ||
27 | extern void flush_tlb_range_tt(struct vm_area_struct *vma, | ||
28 | unsigned long start, unsigned long end); | ||
29 | extern void flush_tlb_mm_tt(struct mm_struct *mm); | ||
30 | extern void force_flush_all_tt(void); | ||
31 | extern long execute_syscall_tt(void *r); | ||
32 | extern void before_mem_tt(unsigned long brk_start); | ||
33 | extern unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, | ||
34 | unsigned long *task_size_out); | ||
35 | extern int start_uml_tt(void); | ||
36 | extern int external_pid_tt(struct task_struct *task); | ||
37 | extern int thread_pid_tt(struct task_struct *task); | ||
38 | |||
39 | #define kmem_end_tt (host_task_size - ABOVE_KMEM) | ||
40 | |||
41 | #endif | ||
diff --git a/arch/um/include/tt/tt.h b/arch/um/include/tt/tt.h new file mode 100644 index 000000000000..808521980186 --- /dev/null +++ b/arch/um/include/tt/tt.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_H__ | ||
7 | #define __TT_H__ | ||
8 | |||
9 | #include "sysdep/ptrace.h" | ||
10 | |||
11 | extern int gdb_pid; | ||
12 | extern int debug; | ||
13 | extern int debug_stop; | ||
14 | extern int debug_trace; | ||
15 | |||
16 | extern int honeypot; | ||
17 | |||
18 | extern int fork_tramp(void *sig_stack); | ||
19 | extern int do_proc_op(void *t, int proc_id); | ||
20 | extern int tracer(int (*init_proc)(void *), void *sp); | ||
21 | extern void attach_process(int pid); | ||
22 | extern void tracer_panic(char *format, ...); | ||
23 | extern void set_init_pid(int pid); | ||
24 | extern int set_user_mode(void *task); | ||
25 | extern void set_tracing(void *t, int tracing); | ||
26 | extern int is_tracing(void *task); | ||
27 | extern void syscall_handler(int sig, union uml_pt_regs *regs); | ||
28 | extern void exit_kernel(int pid, void *task); | ||
29 | extern void do_syscall(void *task, int pid, int local_using_sysemu); | ||
30 | extern void do_sigtrap(void *task); | ||
31 | extern int is_valid_pid(int pid); | ||
32 | extern void remap_data(void *segment_start, void *segment_end, int w); | ||
33 | extern long execute_syscall_tt(void *r); | ||
34 | |||
35 | #endif | ||
36 | |||
diff --git a/arch/um/include/tt/uaccess-tt.h b/arch/um/include/tt/uaccess-tt.h new file mode 100644 index 000000000000..b19645f32f24 --- /dev/null +++ b/arch/um/include/tt/uaccess-tt.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_UACCESS_H | ||
7 | #define __TT_UACCESS_H | ||
8 | |||
9 | #include "linux/string.h" | ||
10 | #include "linux/sched.h" | ||
11 | #include "asm/processor.h" | ||
12 | #include "asm/errno.h" | ||
13 | #include "asm/current.h" | ||
14 | #include "asm/a.out.h" | ||
15 | #include "uml_uaccess.h" | ||
16 | |||
17 | #define ABOVE_KMEM (16 * 1024 * 1024) | ||
18 | |||
19 | extern unsigned long end_vm; | ||
20 | extern unsigned long uml_physmem; | ||
21 | |||
22 | #define is_stack(addr, size) \ | ||
23 | (((unsigned long) (addr) < STACK_TOP) && \ | ||
24 | ((unsigned long) (addr) >= STACK_TOP - ABOVE_KMEM) && \ | ||
25 | (((unsigned long) (addr) + (size)) <= STACK_TOP)) | ||
26 | |||
27 | #define access_ok_tt(type, addr, size) \ | ||
28 | (is_stack(addr, size)) | ||
29 | |||
30 | extern unsigned long get_fault_addr(void); | ||
31 | |||
32 | extern int __do_copy_from_user(void *to, const void *from, int n, | ||
33 | void **fault_addr, void **fault_catcher); | ||
34 | extern int __do_strncpy_from_user(char *dst, const char *src, size_t n, | ||
35 | void **fault_addr, void **fault_catcher); | ||
36 | extern int __do_clear_user(void *mem, size_t len, void **fault_addr, | ||
37 | void **fault_catcher); | ||
38 | extern int __do_strnlen_user(const char *str, unsigned long n, | ||
39 | void **fault_addr, void **fault_catcher); | ||
40 | |||
41 | extern int copy_from_user_tt(void *to, const void __user *from, int n); | ||
42 | extern int copy_to_user_tt(void __user *to, const void *from, int n); | ||
43 | extern int strncpy_from_user_tt(char *dst, const char __user *src, int count); | ||
44 | extern int __clear_user_tt(void __user *mem, int len); | ||
45 | extern int clear_user_tt(void __user *mem, int len); | ||
46 | extern int strnlen_user_tt(const void __user *str, int len); | ||
47 | |||
48 | #endif | ||
diff --git a/arch/um/include/user.h b/arch/um/include/user.h index 0f865ef46918..91b0ac4ad88c 100644 --- a/arch/um/include/user.h +++ b/arch/um/include/user.h | |||
@@ -18,6 +18,7 @@ extern int open_gdb_chan(void); | |||
18 | extern unsigned long strlcpy(char *, const char *, unsigned long); | 18 | extern unsigned long strlcpy(char *, const char *, unsigned long); |
19 | extern unsigned long strlcat(char *, const char *, unsigned long); | 19 | extern unsigned long strlcat(char *, const char *, unsigned long); |
20 | extern void *um_vmalloc(int size); | 20 | extern void *um_vmalloc(int size); |
21 | extern void *um_vmalloc_atomic(int size); | ||
21 | extern void vfree(void *ptr); | 22 | extern void vfree(void *ptr); |
22 | 23 | ||
23 | #endif | 24 | #endif |
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h index c1dbd77b073f..a6f1f176cf84 100644 --- a/arch/um/include/user_util.h +++ b/arch/um/include/user_util.h | |||
@@ -44,10 +44,6 @@ extern unsigned long brk_start; | |||
44 | extern int pty_output_sigio; | 44 | extern int pty_output_sigio; |
45 | extern int pty_close_sigio; | 45 | extern int pty_close_sigio; |
46 | 46 | ||
47 | extern void stop(void); | ||
48 | extern void stack_protections(unsigned long address); | ||
49 | extern void task_protections(unsigned long address); | ||
50 | extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); | ||
51 | extern void *add_signal_handler(int sig, void (*handler)(int)); | 47 | extern void *add_signal_handler(int sig, void (*handler)(int)); |
52 | extern int linux_main(int argc, char **argv); | 48 | extern int linux_main(int argc, char **argv); |
53 | extern void set_cmdline(char *cmd); | 49 | extern void set_cmdline(char *cmd); |
@@ -55,8 +51,6 @@ extern void input_cb(void (*proc)(void *), void *arg, int arg_len); | |||
55 | extern int get_pty(void); | 51 | extern int get_pty(void); |
56 | extern void *um_kmalloc(int size); | 52 | extern void *um_kmalloc(int size); |
57 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); | 53 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); |
58 | extern void setup_machinename(char *machine_out); | ||
59 | extern void setup_hostinfo(void); | ||
60 | extern void do_exec(int old_pid, int new_pid); | 54 | extern void do_exec(int old_pid, int new_pid); |
61 | extern void tracer_panic(char *msg, ...); | 55 | extern void tracer_panic(char *msg, ...); |
62 | extern int detach(int pid, int sig); | 56 | extern int detach(int pid, int sig); |
@@ -70,18 +64,6 @@ extern int cpu_feature(char *what, char *buf, int len); | |||
70 | extern int arch_handle_signal(int sig, union uml_pt_regs *regs); | 64 | extern int arch_handle_signal(int sig, union uml_pt_regs *regs); |
71 | extern int arch_fixup(unsigned long address, void *sc_ptr); | 65 | extern int arch_fixup(unsigned long address, void *sc_ptr); |
72 | extern void arch_init_thread(void); | 66 | extern void arch_init_thread(void); |
73 | extern int setjmp_wrapper(void (*proc)(void *, void *), ...); | ||
74 | extern int raw(int fd); | 67 | extern int raw(int fd); |
75 | 68 | ||
76 | #endif | 69 | #endif |
77 | |||
78 | /* | ||
79 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
80 | * Emacs will notice this stuff at the end of the file and automatically | ||
81 | * adjust the settings for this buffer only. This must remain at the end | ||
82 | * of the file. | ||
83 | * --------------------------------------------------------------------------- | ||
84 | * Local variables: | ||
85 | * c-file-style: "linux" | ||
86 | * End: | ||
87 | */ | ||