diff options
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/exec.c | 5 | ||||
-rw-r--r-- | arch/um/kernel/ksyms.c | 10 | ||||
-rw-r--r-- | arch/um/kernel/physmem.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 19 | ||||
-rw-r--r-- | arch/um/kernel/reboot.c | 7 | ||||
-rw-r--r-- | arch/um/kernel/skas/uaccess.c | 12 | ||||
-rw-r--r-- | arch/um/kernel/syscall.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/time.c | 4 | ||||
-rw-r--r-- | arch/um/kernel/tlb.c | 17 | ||||
-rw-r--r-- | arch/um/kernel/um_arch.c | 13 |
10 files changed, 36 insertions, 54 deletions
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 84d77a0d138c..8f774c25b765 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -18,18 +18,17 @@ | |||
18 | #include "irq_user.h" | 18 | #include "irq_user.h" |
19 | #include "tlb.h" | 19 | #include "tlb.h" |
20 | #include "os.h" | 20 | #include "os.h" |
21 | #include "choose-mode.h" | ||
22 | #include "mode_kern.h" | 21 | #include "mode_kern.h" |
23 | 22 | ||
24 | void flush_thread(void) | 23 | void flush_thread(void) |
25 | { | 24 | { |
26 | arch_flush_thread(¤t->thread.arch); | 25 | arch_flush_thread(¤t->thread.arch); |
27 | CHOOSE_MODE(flush_thread_tt(), flush_thread_skas()); | 26 | flush_thread_skas(); |
28 | } | 27 | } |
29 | 28 | ||
30 | void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) | 29 | void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) |
31 | { | 30 | { |
32 | CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp); | 31 | start_thread_skas(regs, eip, esp); |
33 | } | 32 | } |
34 | 33 | ||
35 | #ifdef CONFIG_TTY_LOG | 34 | #ifdef CONFIG_TTY_LOG |
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index 59e22d27b239..996412c0bb47 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c | |||
@@ -37,11 +37,11 @@ EXPORT_SYMBOL(um_virt_to_phys); | |||
37 | EXPORT_SYMBOL(handle_page_fault); | 37 | EXPORT_SYMBOL(handle_page_fault); |
38 | EXPORT_SYMBOL(find_iomem); | 38 | EXPORT_SYMBOL(find_iomem); |
39 | 39 | ||
40 | EXPORT_SYMBOL(strnlen_user_skas); | 40 | EXPORT_SYMBOL(strnlen_user); |
41 | EXPORT_SYMBOL(strncpy_from_user_skas); | 41 | EXPORT_SYMBOL(strncpy_from_user); |
42 | EXPORT_SYMBOL(copy_to_user_skas); | 42 | EXPORT_SYMBOL(copy_to_user); |
43 | EXPORT_SYMBOL(copy_from_user_skas); | 43 | EXPORT_SYMBOL(copy_from_user); |
44 | EXPORT_SYMBOL(clear_user_skas); | 44 | EXPORT_SYMBOL(clear_user); |
45 | EXPORT_SYMBOL(uml_strdup); | 45 | EXPORT_SYMBOL(uml_strdup); |
46 | 46 | ||
47 | EXPORT_SYMBOL(os_stat_fd); | 47 | EXPORT_SYMBOL(os_stat_fd); |
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index fb695e48fad7..f7b2f3594793 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c | |||
@@ -61,7 +61,7 @@ static unsigned long kmem_top = 0; | |||
61 | unsigned long get_kmem_end(void) | 61 | unsigned long get_kmem_end(void) |
62 | { | 62 | { |
63 | if (kmem_top == 0) | 63 | if (kmem_top == 0) |
64 | kmem_top = CHOOSE_MODE(kmem_end_tt, kmem_end_skas); | 64 | kmem_top = kmem_end_skas; |
65 | return kmem_top; | 65 | return kmem_top; |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 005ed44d4a8e..22ad46fd2c08 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include "os.h" | 45 | #include "os.h" |
46 | #include "mode.h" | 46 | #include "mode.h" |
47 | #include "mode_kern.h" | 47 | #include "mode_kern.h" |
48 | #include "choose-mode.h" | ||
49 | 48 | ||
50 | /* This is a per-cpu array. A processor only modifies its entry and it only | 49 | /* This is a per-cpu array. A processor only modifies its entry and it only |
51 | * cares about its entry, so it's OK if another processor is modifying its | 50 | * cares about its entry, so it's OK if another processor is modifying its |
@@ -55,7 +54,7 @@ struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } }; | |||
55 | 54 | ||
56 | static inline int external_pid(struct task_struct *task) | 55 | static inline int external_pid(struct task_struct *task) |
57 | { | 56 | { |
58 | return CHOOSE_MODE_PROC(external_pid_tt, external_pid_skas, task); | 57 | return external_pid_skas(task); |
59 | } | 58 | } |
60 | 59 | ||
61 | int pid_to_processor_id(int pid) | 60 | int pid_to_processor_id(int pid) |
@@ -114,8 +113,8 @@ void *_switch_to(void *prev, void *next, void *last) | |||
114 | set_current(to); | 113 | set_current(to); |
115 | 114 | ||
116 | do { | 115 | do { |
117 | current->thread.saved_task = NULL ; | 116 | current->thread.saved_task = NULL; |
118 | CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next); | 117 | switch_to_skas(prev, next); |
119 | if(current->thread.saved_task) | 118 | if(current->thread.saved_task) |
120 | show_regs(&(current->thread.regs)); | 119 | show_regs(&(current->thread.regs)); |
121 | next= current->thread.saved_task; | 120 | next= current->thread.saved_task; |
@@ -136,7 +135,7 @@ void interrupt_end(void) | |||
136 | 135 | ||
137 | void release_thread(struct task_struct *task) | 136 | void release_thread(struct task_struct *task) |
138 | { | 137 | { |
139 | CHOOSE_MODE(release_thread_tt(task), release_thread_skas(task)); | 138 | release_thread_skas(task); |
140 | } | 139 | } |
141 | 140 | ||
142 | void exit_thread(void) | 141 | void exit_thread(void) |
@@ -155,8 +154,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
155 | int ret; | 154 | int ret; |
156 | 155 | ||
157 | p->thread = (struct thread_struct) INIT_THREAD; | 156 | p->thread = (struct thread_struct) INIT_THREAD; |
158 | ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr, | 157 | ret = copy_thread_skas(nr, clone_flags, sp, stack_top, p, regs); |
159 | clone_flags, sp, stack_top, p, regs); | ||
160 | 158 | ||
161 | if (ret || !current->thread.forking) | 159 | if (ret || !current->thread.forking) |
162 | goto out; | 160 | goto out; |
@@ -178,15 +176,12 @@ void initial_thread_cb(void (*proc)(void *), void *arg) | |||
178 | int save_kmalloc_ok = kmalloc_ok; | 176 | int save_kmalloc_ok = kmalloc_ok; |
179 | 177 | ||
180 | kmalloc_ok = 0; | 178 | kmalloc_ok = 0; |
181 | CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc, | 179 | initial_thread_cb_skas(proc, arg); |
182 | arg); | ||
183 | kmalloc_ok = save_kmalloc_ok; | 180 | kmalloc_ok = save_kmalloc_ok; |
184 | } | 181 | } |
185 | 182 | ||
186 | void default_idle(void) | 183 | void default_idle(void) |
187 | { | 184 | { |
188 | CHOOSE_MODE(uml_idle_timer(), (void) 0); | ||
189 | |||
190 | while(1){ | 185 | while(1){ |
191 | /* endless idle loop with no priority at all */ | 186 | /* endless idle loop with no priority at all */ |
192 | 187 | ||
@@ -203,7 +198,7 @@ void default_idle(void) | |||
203 | 198 | ||
204 | void cpu_idle(void) | 199 | void cpu_idle(void) |
205 | { | 200 | { |
206 | CHOOSE_MODE(init_idle_tt(), init_idle_skas()); | 201 | init_idle_skas(); |
207 | } | 202 | } |
208 | 203 | ||
209 | void *um_virt_to_phys(struct task_struct *task, unsigned long addr, | 204 | void *um_virt_to_phys(struct task_struct *task, unsigned long addr, |
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 93df0672d022..4a0def32e323 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c | |||
@@ -10,13 +10,12 @@ | |||
10 | #include "kern.h" | 10 | #include "kern.h" |
11 | #include "os.h" | 11 | #include "os.h" |
12 | #include "mode.h" | 12 | #include "mode.h" |
13 | #include "choose-mode.h" | ||
14 | 13 | ||
15 | void (*pm_power_off)(void); | 14 | void (*pm_power_off)(void); |
16 | 15 | ||
17 | static void kill_off_processes(void) | 16 | static void kill_off_processes(void) |
18 | { | 17 | { |
19 | CHOOSE_MODE(kill_off_processes_tt(), kill_off_processes_skas()); | 18 | kill_off_processes_skas(); |
20 | } | 19 | } |
21 | 20 | ||
22 | void uml_cleanup(void) | 21 | void uml_cleanup(void) |
@@ -29,13 +28,13 @@ void uml_cleanup(void) | |||
29 | void machine_restart(char * __unused) | 28 | void machine_restart(char * __unused) |
30 | { | 29 | { |
31 | uml_cleanup(); | 30 | uml_cleanup(); |
32 | CHOOSE_MODE(reboot_tt(), reboot_skas()); | 31 | reboot_skas(); |
33 | } | 32 | } |
34 | 33 | ||
35 | void machine_power_off(void) | 34 | void machine_power_off(void) |
36 | { | 35 | { |
37 | uml_cleanup(); | 36 | uml_cleanup(); |
38 | CHOOSE_MODE(halt_tt(), halt_skas()); | 37 | halt_skas(); |
39 | } | 38 | } |
40 | 39 | ||
41 | void machine_halt(void) | 40 | void machine_halt(void) |
diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c index 8912cec0fe43..b14422e2c07c 100644 --- a/arch/um/kernel/skas/uaccess.c +++ b/arch/um/kernel/skas/uaccess.c | |||
@@ -139,7 +139,7 @@ static int copy_chunk_from_user(unsigned long from, int len, void *arg) | |||
139 | return(0); | 139 | return(0); |
140 | } | 140 | } |
141 | 141 | ||
142 | int copy_from_user_skas(void *to, const void __user *from, int n) | 142 | int copy_from_user(void *to, const void __user *from, int n) |
143 | { | 143 | { |
144 | if(segment_eq(get_fs(), KERNEL_DS)){ | 144 | if(segment_eq(get_fs(), KERNEL_DS)){ |
145 | memcpy(to, (__force void*)from, n); | 145 | memcpy(to, (__force void*)from, n); |
@@ -160,7 +160,7 @@ static int copy_chunk_to_user(unsigned long to, int len, void *arg) | |||
160 | return(0); | 160 | return(0); |
161 | } | 161 | } |
162 | 162 | ||
163 | int copy_to_user_skas(void __user *to, const void *from, int n) | 163 | int copy_to_user(void __user *to, const void *from, int n) |
164 | { | 164 | { |
165 | if(segment_eq(get_fs(), KERNEL_DS)){ | 165 | if(segment_eq(get_fs(), KERNEL_DS)){ |
166 | memcpy((__force void*)to, from, n); | 166 | memcpy((__force void*)to, from, n); |
@@ -186,7 +186,7 @@ static int strncpy_chunk_from_user(unsigned long from, int len, void *arg) | |||
186 | return(0); | 186 | return(0); |
187 | } | 187 | } |
188 | 188 | ||
189 | int strncpy_from_user_skas(char *dst, const char __user *src, int count) | 189 | int strncpy_from_user(char *dst, const char __user *src, int count) |
190 | { | 190 | { |
191 | int n; | 191 | int n; |
192 | char *ptr = dst; | 192 | char *ptr = dst; |
@@ -212,12 +212,12 @@ static int clear_chunk(unsigned long addr, int len, void *unused) | |||
212 | return(0); | 212 | return(0); |
213 | } | 213 | } |
214 | 214 | ||
215 | int __clear_user_skas(void __user *mem, int len) | 215 | int __clear_user(void __user *mem, int len) |
216 | { | 216 | { |
217 | return(buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL)); | 217 | return(buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL)); |
218 | } | 218 | } |
219 | 219 | ||
220 | int clear_user_skas(void __user *mem, int len) | 220 | int clear_user(void __user *mem, int len) |
221 | { | 221 | { |
222 | if(segment_eq(get_fs(), KERNEL_DS)){ | 222 | if(segment_eq(get_fs(), KERNEL_DS)){ |
223 | memset((__force void*)mem, 0, len); | 223 | memset((__force void*)mem, 0, len); |
@@ -240,7 +240,7 @@ static int strnlen_chunk(unsigned long str, int len, void *arg) | |||
240 | return(0); | 240 | return(0); |
241 | } | 241 | } |
242 | 242 | ||
243 | int strnlen_user_skas(const void __user *str, int len) | 243 | int strnlen_user(const void __user *str, int len) |
244 | { | 244 | { |
245 | int count = 0, n; | 245 | int count = 0, n; |
246 | 246 | ||
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index 7b3b67333ff3..138bcb43b997 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include "kern_util.h" | 21 | #include "kern_util.h" |
22 | #include "sysdep/syscalls.h" | 22 | #include "sysdep/syscalls.h" |
23 | #include "mode_kern.h" | 23 | #include "mode_kern.h" |
24 | #include "choose-mode.h" | ||
25 | 24 | ||
26 | /* Unlocked, I don't care if this is a bit off */ | 25 | /* Unlocked, I don't care if this is a bit off */ |
27 | int nsyscalls = 0; | 26 | int nsyscalls = 0; |
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 259c49da7ff5..3571703a7cb4 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c | |||
@@ -181,9 +181,7 @@ void timer_handler(int sig, union uml_pt_regs *regs) | |||
181 | timer_irq(regs); | 181 | timer_irq(regs); |
182 | local_irq_disable(); | 182 | local_irq_disable(); |
183 | irq_enter(); | 183 | irq_enter(); |
184 | update_process_times(CHOOSE_MODE( | 184 | update_process_times((regs)->skas.is_user); |
185 | (UPT_SC(regs) && user_context(UPT_SP(regs))), | ||
186 | (regs)->skas.is_user)); | ||
187 | irq_exit(); | 185 | irq_exit(); |
188 | local_irq_enable(); | 186 | local_irq_enable(); |
189 | } | 187 | } |
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index 8a8d52851443..312e8ba30cd3 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c | |||
@@ -8,7 +8,6 @@ | |||
8 | #include "asm/pgalloc.h" | 8 | #include "asm/pgalloc.h" |
9 | #include "asm/pgtable.h" | 9 | #include "asm/pgtable.h" |
10 | #include "asm/tlbflush.h" | 10 | #include "asm/tlbflush.h" |
11 | #include "choose-mode.h" | ||
12 | #include "mode_kern.h" | 11 | #include "mode_kern.h" |
13 | #include "as-layout.h" | 12 | #include "as-layout.h" |
14 | #include "tlb.h" | 13 | #include "tlb.h" |
@@ -378,35 +377,31 @@ void flush_tlb_all(void) | |||
378 | 377 | ||
379 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | 378 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) |
380 | { | 379 | { |
381 | CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt, | 380 | flush_tlb_kernel_range_common(start, end); |
382 | flush_tlb_kernel_range_common, start, end); | ||
383 | } | 381 | } |
384 | 382 | ||
385 | void flush_tlb_kernel_vm(void) | 383 | void flush_tlb_kernel_vm(void) |
386 | { | 384 | { |
387 | CHOOSE_MODE(flush_tlb_kernel_vm_tt(), | 385 | flush_tlb_kernel_range_common(start_vm, end_vm); |
388 | flush_tlb_kernel_range_common(start_vm, end_vm)); | ||
389 | } | 386 | } |
390 | 387 | ||
391 | void __flush_tlb_one(unsigned long addr) | 388 | void __flush_tlb_one(unsigned long addr) |
392 | { | 389 | { |
393 | CHOOSE_MODE_PROC(__flush_tlb_one_tt, __flush_tlb_one_skas, addr); | 390 | __flush_tlb_one_skas(addr); |
394 | } | 391 | } |
395 | 392 | ||
396 | void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | 393 | void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
397 | unsigned long end) | 394 | unsigned long end) |
398 | { | 395 | { |
399 | CHOOSE_MODE_PROC(flush_tlb_range_tt, flush_tlb_range_skas, vma, start, | 396 | flush_tlb_range_skas(vma, start, end); |
400 | end); | ||
401 | } | 397 | } |
402 | 398 | ||
403 | void flush_tlb_mm(struct mm_struct *mm) | 399 | void flush_tlb_mm(struct mm_struct *mm) |
404 | { | 400 | { |
405 | CHOOSE_MODE_PROC(flush_tlb_mm_tt, flush_tlb_mm_skas, mm); | 401 | flush_tlb_mm_skas(mm); |
406 | } | 402 | } |
407 | 403 | ||
408 | void force_flush_all(void) | 404 | void force_flush_all(void) |
409 | { | 405 | { |
410 | CHOOSE_MODE(force_flush_all_tt(), force_flush_all_skas()); | 406 | force_flush_all_skas(); |
411 | } | 407 | } |
412 | |||
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index aa7b067565d9..9f3a207eb81f 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include "initrd.h" | 35 | #include "initrd.h" |
36 | #include "init.h" | 36 | #include "init.h" |
37 | #include "os.h" | 37 | #include "os.h" |
38 | #include "choose-mode.h" | ||
39 | #include "mode_kern.h" | 38 | #include "mode_kern.h" |
40 | #include "mode.h" | 39 | #include "mode.h" |
41 | #include "skas.h" | 40 | #include "skas.h" |
@@ -68,8 +67,7 @@ struct cpuinfo_um boot_cpu_data = { | |||
68 | 67 | ||
69 | unsigned long thread_saved_pc(struct task_struct *task) | 68 | unsigned long thread_saved_pc(struct task_struct *task) |
70 | { | 69 | { |
71 | return os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas, | 70 | return os_process_pc(thread_pid_skas(task)); |
72 | task)); | ||
73 | } | 71 | } |
74 | 72 | ||
75 | /* Changed in setup_arch, which is called in early boot */ | 73 | /* Changed in setup_arch, which is called in early boot */ |
@@ -88,7 +86,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
88 | seq_printf(m, "processor\t: %d\n", index); | 86 | seq_printf(m, "processor\t: %d\n", index); |
89 | seq_printf(m, "vendor_id\t: User Mode Linux\n"); | 87 | seq_printf(m, "vendor_id\t: User Mode Linux\n"); |
90 | seq_printf(m, "model name\t: UML\n"); | 88 | seq_printf(m, "model name\t: UML\n"); |
91 | seq_printf(m, "mode\t\t: %s\n", CHOOSE_MODE("tt", "skas")); | 89 | seq_printf(m, "mode\t\t: skas\n"); |
92 | seq_printf(m, "host\t\t: %s\n", host_info); | 90 | seq_printf(m, "host\t\t: %s\n", host_info); |
93 | seq_printf(m, "bogomips\t: %lu.%02lu\n\n", | 91 | seq_printf(m, "bogomips\t: %lu.%02lu\n\n", |
94 | loops_per_jiffy/(500000/HZ), | 92 | loops_per_jiffy/(500000/HZ), |
@@ -283,8 +281,7 @@ int __init linux_main(int argc, char **argv) | |||
283 | 281 | ||
284 | printf("UML running in %s mode\n", mode); | 282 | printf("UML running in %s mode\n", mode); |
285 | 283 | ||
286 | host_task_size = CHOOSE_MODE_PROC(set_task_sizes_tt, | 284 | host_task_size = set_task_sizes_skas(&task_size); |
287 | set_task_sizes_skas, &task_size); | ||
288 | 285 | ||
289 | /* | 286 | /* |
290 | * Setting up handlers to 'sig_info' struct | 287 | * Setting up handlers to 'sig_info' struct |
@@ -292,7 +289,7 @@ int __init linux_main(int argc, char **argv) | |||
292 | os_fill_handlinfo(handlinfo_kern); | 289 | os_fill_handlinfo(handlinfo_kern); |
293 | 290 | ||
294 | brk_start = (unsigned long) sbrk(0); | 291 | brk_start = (unsigned long) sbrk(0); |
295 | CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start); | 292 | before_mem_skas(brk_start); |
296 | /* Increase physical memory size for exec-shield users | 293 | /* Increase physical memory size for exec-shield users |
297 | so they actually get what they asked for. This should | 294 | so they actually get what they asked for. This should |
298 | add zero for non-exec shield users */ | 295 | add zero for non-exec shield users */ |
@@ -357,7 +354,7 @@ int __init linux_main(int argc, char **argv) | |||
357 | stack_protections((unsigned long) &init_thread_info); | 354 | stack_protections((unsigned long) &init_thread_info); |
358 | os_flush_stdout(); | 355 | os_flush_stdout(); |
359 | 356 | ||
360 | return CHOOSE_MODE(start_uml_tt(), start_uml_skas()); | 357 | return start_uml_skas(); |
361 | } | 358 | } |
362 | 359 | ||
363 | extern int uml_exitcode; | 360 | extern int uml_exitcode; |