diff options
author | Gennady Sharapov <Gennady.V.Sharapov@intel.com> | 2006-01-18 20:42:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-18 22:20:19 -0500 |
commit | 4abfbf4034b419736de5797a3860ab0bcf5c5c8d (patch) | |
tree | 4cc593f696c92dc2f3db63f9c89bc5862ea73801 /arch/um/include/skas | |
parent | 2c332a251302873cf8301c2aad27737b6df70255 (diff) |
[PATCH] uml: move headers to arch/um/include
The serial UML OS-abstraction layer patch (um/kernel dir).
This moves skas headers to arch/um/include.
Signed-off-by: Gennady Sharapov <Gennady.V.Sharapov@intel.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/include/skas')
-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 | 22 | ||||
-rw-r--r-- | arch/um/include/skas/mode_kern_skas.h | 41 | ||||
-rw-r--r-- | arch/um/include/skas/proc_mm.h | 44 | ||||
-rw-r--r-- | arch/um/include/skas/skas.h | 49 | ||||
-rw-r--r-- | arch/um/include/skas/stub-data.h | 18 | ||||
-rw-r--r-- | arch/um/include/skas/uaccess-skas.h | 21 |
8 files changed, 236 insertions, 0 deletions
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..64b960006f1e --- /dev/null +++ b/arch/um/include/skas/mode-skas.h | |||
@@ -0,0 +1,22 @@ | |||
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 halt_skas(void); | ||
18 | extern void reboot_skas(void); | ||
19 | extern void kill_off_processes_skas(void); | ||
20 | extern int is_skas_winch(int pid, int fd, void *data); | ||
21 | |||
22 | #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..dd9f2d722fb9 --- /dev/null +++ b/arch/um/include/skas/mode_kern_skas.h | |||
@@ -0,0 +1,41 @@ | |||
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 initial_thread_cb_skas(void (*proc)(void *), void *arg); | ||
22 | extern void init_idle_skas(void); | ||
23 | extern void flush_tlb_kernel_range_skas(unsigned long start, | ||
24 | unsigned long end); | ||
25 | extern void flush_tlb_kernel_vm_skas(void); | ||
26 | extern void __flush_tlb_one_skas(unsigned long addr); | ||
27 | extern void flush_tlb_range_skas(struct vm_area_struct *vma, | ||
28 | unsigned long start, unsigned long end); | ||
29 | extern void flush_tlb_mm_skas(struct mm_struct *mm); | ||
30 | extern void force_flush_all_skas(void); | ||
31 | extern long execute_syscall_skas(void *r); | ||
32 | extern void before_mem_skas(unsigned long unused); | ||
33 | extern unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, | ||
34 | unsigned long *task_size_out); | ||
35 | extern int start_uml_skas(void); | ||
36 | extern int external_pid_skas(struct task_struct *task); | ||
37 | extern int thread_pid_skas(struct task_struct *task); | ||
38 | |||
39 | #define kmem_end_skas (host_task_size - 1024 * 1024) | ||
40 | |||
41 | #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..158f322248e3 --- /dev/null +++ b/arch/um/include/skas/skas.h | |||
@@ -0,0 +1,49 @@ | |||
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 void switch_threads(void *me, void *next); | ||
17 | extern void thread_wait(void *sw, void *fb); | ||
18 | extern void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | ||
19 | void (*handler)(int)); | ||
20 | extern int start_idle_thread(void *stack, void *switch_buf_ptr, | ||
21 | void **fork_buf_ptr); | ||
22 | extern int user_thread(unsigned long stack, int flags); | ||
23 | extern void userspace(union uml_pt_regs *regs); | ||
24 | extern void new_thread_proc(void *stack, void (*handler)(int sig)); | ||
25 | extern void new_thread_handler(int sig); | ||
26 | extern void handle_syscall(union uml_pt_regs *regs); | ||
27 | extern int map(struct mm_id * mm_idp, unsigned long virt, | ||
28 | unsigned long len, int r, int w, int x, int phys_fd, | ||
29 | unsigned long long offset, int done, void **data); | ||
30 | extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len, | ||
31 | int done, void **data); | ||
32 | extern int protect(struct mm_id * mm_idp, unsigned long addr, | ||
33 | unsigned long len, int r, int w, int x, int done, | ||
34 | void **data); | ||
35 | extern void user_signal(int sig, union uml_pt_regs *regs, int pid); | ||
36 | extern int new_mm(unsigned long stack); | ||
37 | extern int start_userspace(unsigned long stub_stack); | ||
38 | extern int copy_context_skas0(unsigned long stack, int pid); | ||
39 | extern void get_skas_faultinfo(int pid, struct faultinfo * fi); | ||
40 | extern long execute_syscall_skas(void *r); | ||
41 | extern unsigned long current_stub_stack(void); | ||
42 | extern long run_syscall_stub(struct mm_id * mm_idp, | ||
43 | int syscall, unsigned long *args, long expected, | ||
44 | void **addr, int done); | ||
45 | extern long syscall_stub_data(struct mm_id * mm_idp, | ||
46 | unsigned long *data, int data_count, | ||
47 | void **addr, void **stub_addr); | ||
48 | |||
49 | #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 | ||