aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/kernel/exitcode.c31
-rw-r--r--arch/um/kernel/gmon_syms.c11
-rw-r--r--arch/um/kernel/gprof_syms.c13
-rw-r--r--arch/um/kernel/process.c41
-rw-r--r--arch/um/kernel/reboot.c6
-rw-r--r--arch/um/kernel/sigio.c18
-rw-r--r--arch/um/kernel/signal.c16
-rw-r--r--arch/um/kernel/smp.c7
-rw-r--r--arch/um/kernel/sysrq.c44
-rw-r--r--arch/um/kernel/time.c14
-rw-r--r--arch/um/kernel/tlb.c2
-rw-r--r--arch/um/kernel/uaccess.c11
-rw-r--r--arch/um/kernel/um_arch.c26
-rw-r--r--arch/um/kernel/umid.c15
14 files changed, 122 insertions, 133 deletions
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index c716b5a6db13..984f80e668ca 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -1,15 +1,17 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/kernel.h" 6#include <linux/ctype.h>
7#include "linux/init.h" 7#include <linux/init.h>
8#include "linux/ctype.h" 8#include <linux/kernel.h>
9#include "linux/proc_fs.h" 9#include <linux/proc_fs.h>
10#include "asm/uaccess.h" 10#include <linux/types.h>
11#include <asm/uaccess.h>
11 12
12/* If read and write race, the read will still atomically read a valid 13/*
14 * If read and write race, the read will still atomically read a valid
13 * value. 15 * value.
14 */ 16 */
15int uml_exitcode = 0; 17int uml_exitcode = 0;
@@ -19,18 +21,19 @@ static int read_proc_exitcode(char *page, char **start, off_t off,
19{ 21{
20 int len, val; 22 int len, val;
21 23
22 /* Save uml_exitcode in a local so that we don't need to guarantee 24 /*
25 * Save uml_exitcode in a local so that we don't need to guarantee
23 * that sprintf accesses it atomically. 26 * that sprintf accesses it atomically.
24 */ 27 */
25 val = uml_exitcode; 28 val = uml_exitcode;
26 len = sprintf(page, "%d\n", val); 29 len = sprintf(page, "%d\n", val);
27 len -= off; 30 len -= off;
28 if(len <= off+count) 31 if (len <= off+count)
29 *eof = 1; 32 *eof = 1;
30 *start = page + off; 33 *start = page + off;
31 if(len > count) 34 if (len > count)
32 len = count; 35 len = count;
33 if(len < 0) 36 if (len < 0)
34 len = 0; 37 len = 0;
35 return len; 38 return len;
36} 39}
@@ -41,11 +44,11 @@ static int write_proc_exitcode(struct file *file, const char __user *buffer,
41 char *end, buf[sizeof("nnnnn\0")]; 44 char *end, buf[sizeof("nnnnn\0")];
42 int tmp; 45 int tmp;
43 46
44 if(copy_from_user(buf, buffer, count)) 47 if (copy_from_user(buf, buffer, count))
45 return -EFAULT; 48 return -EFAULT;
46 49
47 tmp = simple_strtol(buf, &end, 0); 50 tmp = simple_strtol(buf, &end, 0);
48 if((*end != '\0') && !isspace(*end)) 51 if ((*end != '\0') && !isspace(*end))
49 return -EINVAL; 52 return -EINVAL;
50 53
51 uml_exitcode = tmp; 54 uml_exitcode = tmp;
@@ -57,7 +60,7 @@ static int make_proc_exitcode(void)
57 struct proc_dir_entry *ent; 60 struct proc_dir_entry *ent;
58 61
59 ent = create_proc_entry("exitcode", 0600, &proc_root); 62 ent = create_proc_entry("exitcode", 0600, &proc_root);
60 if(ent == NULL){ 63 if (ent == NULL) {
61 printk(KERN_WARNING "make_proc_exitcode : Failed to register " 64 printk(KERN_WARNING "make_proc_exitcode : Failed to register "
62 "/proc/exitcode\n"); 65 "/proc/exitcode\n");
63 return 0; 66 return 0;
diff --git a/arch/um/kernel/gmon_syms.c b/arch/um/kernel/gmon_syms.c
index 734f873cab12..72eccd2a4113 100644
--- a/arch/um/kernel/gmon_syms.c
+++ b/arch/um/kernel/gmon_syms.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -8,12 +8,13 @@
8extern void __bb_init_func(void *) __attribute__((weak)); 8extern void __bb_init_func(void *) __attribute__((weak));
9EXPORT_SYMBOL(__bb_init_func); 9EXPORT_SYMBOL(__bb_init_func);
10 10
11/* This is defined (and referred to in profiling stub code) only by some GCC 11/*
12 * This is defined (and referred to in profiling stub code) only by some GCC
12 * versions in libgcov. 13 * versions in libgcov.
13 * 14 *
14 * Since SuSE backported the fix, we cannot handle it depending on GCC version. 15 * Since SuSE backported the fix, we cannot handle it depending on GCC version.
15 * So, unconditionally export it. But also give it a weak declaration, which will 16 * So, unconditionally export it. But also give it a weak declaration, which
16 * be overridden by any other one. 17 * will be overridden by any other one.
17 */ 18 */
18 19
19extern void __gcov_init(void *) __attribute__((weak)); 20extern void __gcov_init(void *) __attribute__((weak));
diff --git a/arch/um/kernel/gprof_syms.c b/arch/um/kernel/gprof_syms.c
index 9244f018d44c..e2f043d0de6c 100644
--- a/arch/um/kernel/gprof_syms.c
+++ b/arch/um/kernel/gprof_syms.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -7,14 +7,3 @@
7 7
8extern void mcount(void); 8extern void mcount(void);
9EXPORT_SYMBOL(mcount); 9EXPORT_SYMBOL(mcount);
10
11/*
12 * Overrides for Emacs so that we follow Linus's tabbing style.
13 * Emacs will notice this stuff at the end of the file and automatically
14 * adjust the settings for this buffer only. This must remain at the end
15 * of the file.
16 * ---------------------------------------------------------------------------
17 * Local variables:
18 * c-file-style: "linux"
19 * End:
20 */
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index e6d89ad10a71..c07961bedb75 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -4,19 +4,21 @@
4 * Licensed under the GPL 4 * Licensed under the GPL
5 */ 5 */
6 6
7#include "linux/stddef.h" 7#include <linux/stddef.h>
8#include "linux/err.h" 8#include <linux/err.h>
9#include "linux/hardirq.h" 9#include <linux/hardirq.h>
10#include "linux/mm.h" 10#include <linux/gfp.h>
11#include "linux/personality.h" 11#include <linux/mm.h>
12#include "linux/proc_fs.h" 12#include <linux/personality.h>
13#include "linux/ptrace.h" 13#include <linux/proc_fs.h>
14#include "linux/random.h" 14#include <linux/ptrace.h>
15#include "linux/sched.h" 15#include <linux/random.h>
16#include "linux/tick.h" 16#include <linux/sched.h>
17#include "linux/threads.h" 17#include <linux/tick.h>
18#include "asm/pgtable.h" 18#include <linux/threads.h>
19#include "asm/uaccess.h" 19#include <asm/current.h>
20#include <asm/pgtable.h>
21#include <asm/uaccess.h>
20#include "as-layout.h" 22#include "as-layout.h"
21#include "kern_util.h" 23#include "kern_util.h"
22#include "os.h" 24#include "os.h"
@@ -40,7 +42,7 @@ int pid_to_processor_id(int pid)
40{ 42{
41 int i; 43 int i;
42 44
43 for(i = 0; i < ncpus; i++) { 45 for (i = 0; i < ncpus; i++) {
44 if (cpu_tasks[i].pid == pid) 46 if (cpu_tasks[i].pid == pid)
45 return i; 47 return i;
46 } 48 }
@@ -94,14 +96,15 @@ void *_switch_to(void *prev, void *next, void *last)
94 do { 96 do {
95 current->thread.saved_task = NULL; 97 current->thread.saved_task = NULL;
96 98
97 switch_threads(&from->thread.switch_buf, &to->thread.switch_buf); 99 switch_threads(&from->thread.switch_buf,
100 &to->thread.switch_buf);
98 101
99 arch_switch_to(current); 102 arch_switch_to(current);
100 103
101 if (current->thread.saved_task) 104 if (current->thread.saved_task)
102 show_regs(&(current->thread.regs)); 105 show_regs(&(current->thread.regs));
103 next = current->thread.saved_task; 106 to = current->thread.saved_task;
104 prev = current; 107 from = current;
105 } while (current->thread.saved_task); 108 } while (current->thread.saved_task);
106 109
107 return current->thread.prev_sched; 110 return current->thread.prev_sched;
@@ -232,7 +235,7 @@ void default_idle(void)
232{ 235{
233 unsigned long long nsecs; 236 unsigned long long nsecs;
234 237
235 while(1) { 238 while (1) {
236 /* endless idle loop with no priority at all */ 239 /* endless idle loop with no priority at all */
237 240
238 /* 241 /*
@@ -387,7 +390,7 @@ int singlestepping(void * t)
387{ 390{
388 struct task_struct *task = t ? t : current; 391 struct task_struct *task = t ? t : current;
389 392
390 if ( ! (task->ptrace & PT_DTRACE) ) 393 if (!(task->ptrace & PT_DTRACE))
391 return 0; 394 return 0;
392 395
393 if (task->thread.singlestep_syscall) 396 if (task->thread.singlestep_syscall)
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index 1ce49cd8aca3..00197d3d21ec 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -12,7 +12,7 @@ void (*pm_power_off)(void);
12 12
13static void kill_off_processes(void) 13static void kill_off_processes(void)
14{ 14{
15 if(proc_mm) 15 if (proc_mm)
16 /* 16 /*
17 * FIXME: need to loop over userspace_pids 17 * FIXME: need to loop over userspace_pids
18 */ 18 */
@@ -22,8 +22,8 @@ static void kill_off_processes(void)
22 int pid, me; 22 int pid, me;
23 23
24 me = os_getpid(); 24 me = os_getpid();
25 for_each_process(p){ 25 for_each_process(p) {
26 if(p->mm == NULL) 26 if (p->mm == NULL)
27 continue; 27 continue;
28 28
29 pid = p->mm->context.id.u.pid; 29 pid = p->mm->context.id.u.pid;
diff --git a/arch/um/kernel/sigio.c b/arch/um/kernel/sigio.c
index 89f9866a1354..2b272b63b514 100644
--- a/arch/um/kernel/sigio.c
+++ b/arch/um/kernel/sigio.c
@@ -1,18 +1,12 @@
1/* 1/*
2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com) 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/kernel.h" 6#include <linux/interrupt.h>
7#include "linux/list.h"
8#include "linux/slab.h"
9#include "linux/signal.h"
10#include "linux/interrupt.h"
11#include "init.h"
12#include "sigio.h"
13#include "irq_user.h"
14#include "irq_kern.h" 7#include "irq_kern.h"
15#include "os.h" 8#include "os.h"
9#include "sigio.h"
16 10
17/* Protected by sigio_lock() called from write_sigio_workaround */ 11/* Protected by sigio_lock() called from write_sigio_workaround */
18static int sigio_irq_fd = -1; 12static int sigio_irq_fd = -1;
@@ -33,9 +27,9 @@ int write_sigio_irq(int fd)
33 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt, 27 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
34 IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio", 28 IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio",
35 NULL); 29 NULL);
36 if(err){ 30 if (err) {
37 printk("write_sigio_irq : um_request_irq failed, err = %d\n", 31 printk(KERN_ERR "write_sigio_irq : um_request_irq failed, "
38 err); 32 "err = %d\n", err);
39 return -1; 33 return -1;
40 } 34 }
41 sigio_irq_fd = fd; 35 sigio_irq_fd = fd;
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index 19cb97733937..b0fce720c4d0 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -3,12 +3,12 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/module.h" 6#include <linux/module.h>
7#include "linux/ptrace.h" 7#include <linux/ptrace.h>
8#include "linux/sched.h" 8#include <linux/sched.h>
9#include "asm/siginfo.h" 9#include <asm/siginfo.h>
10#include "asm/signal.h" 10#include <asm/signal.h>
11#include "asm/unistd.h" 11#include <asm/unistd.h>
12#include "frame_kern.h" 12#include "frame_kern.h"
13#include "kern_util.h" 13#include "kern_util.h"
14#include "sigcontext.h" 14#include "sigcontext.h"
@@ -36,7 +36,7 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
36 /* Did we come from a system call? */ 36 /* Did we come from a system call? */
37 if (PT_REGS_SYSCALL_NR(regs) >= 0) { 37 if (PT_REGS_SYSCALL_NR(regs) >= 0) {
38 /* If so, check system call restarting.. */ 38 /* If so, check system call restarting.. */
39 switch(PT_REGS_SYSCALL_RET(regs)) { 39 switch (PT_REGS_SYSCALL_RET(regs)) {
40 case -ERESTART_RESTARTBLOCK: 40 case -ERESTART_RESTARTBLOCK:
41 case -ERESTARTNOHAND: 41 case -ERESTARTNOHAND:
42 PT_REGS_SYSCALL_RET(regs) = -EINTR; 42 PT_REGS_SYSCALL_RET(regs) = -EINTR;
@@ -116,7 +116,7 @@ static int kern_do_signal(struct pt_regs *regs)
116 /* Did we come from a system call? */ 116 /* Did we come from a system call? */
117 if (!handled_sig && (PT_REGS_SYSCALL_NR(regs) >= 0)) { 117 if (!handled_sig && (PT_REGS_SYSCALL_NR(regs) >= 0)) {
118 /* Restart the system call - no handlers present */ 118 /* Restart the system call - no handlers present */
119 switch(PT_REGS_SYSCALL_RET(regs)) { 119 switch (PT_REGS_SYSCALL_RET(regs)) {
120 case -ERESTARTNOHAND: 120 case -ERESTARTNOHAND:
121 case -ERESTARTSYS: 121 case -ERESTARTSYS:
122 case -ERESTARTNOINTR: 122 case -ERESTARTNOINTR:
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 869ac6802209..e1062ec36d40 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -60,7 +60,7 @@ void smp_send_stop(void)
60 continue; 60 continue;
61 os_write_file(cpu_data[i].ipi_pipe[1], "S", 1); 61 os_write_file(cpu_data[i].ipi_pipe[1], "S", 1);
62 } 62 }
63 printk(KERN_INFO "done\n"); 63 printk(KERN_CONT "done\n");
64} 64}
65 65
66static cpumask_t smp_commenced_mask = CPU_MASK_NONE; 66static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
@@ -140,9 +140,8 @@ void smp_prepare_cpus(unsigned int maxcpus)
140 while (waittime-- && !cpu_isset(cpu, cpu_callin_map)) 140 while (waittime-- && !cpu_isset(cpu, cpu_callin_map))
141 cpu_relax(); 141 cpu_relax();
142 142
143 if (cpu_isset(cpu, cpu_callin_map)) 143 printk(KERN_INFO "%s\n",
144 printk(KERN_INFO "done\n"); 144 cpu_isset(cpu, cpu_calling_map) ? "done" : "failed");
145 else printk(KERN_INFO "failed\n");
146 } 145 }
147} 146}
148 147
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index 93263571d813..56d43d0a3960 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -1,38 +1,37 @@
1/* 1/*
2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/sched.h" 6#include <linux/kallsyms.h>
7#include "linux/kernel.h" 7#include <linux/kernel.h>
8#include "linux/module.h" 8#include <linux/module.h>
9#include "linux/kallsyms.h" 9#include <linux/sched.h>
10#include "asm/page.h"
11#include "asm/processor.h"
12#include "sysrq.h" 10#include "sysrq.h"
13 11
14/* Catch non-i386 SUBARCH's. */ 12/* Catch non-i386 SUBARCH's. */
15#if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT) 13#if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT)
16void show_trace(struct task_struct *task, unsigned long * stack) 14void show_trace(struct task_struct *task, unsigned long * stack)
17{ 15{
18 unsigned long addr; 16 unsigned long addr;
19 17
20 if (!stack) { 18 if (!stack) {
21 stack = (unsigned long*) &stack; 19 stack = (unsigned long*) &stack;
22 WARN_ON(1); 20 WARN_ON(1);
23 } 21 }
24 22
25 printk("Call Trace: \n"); 23 printk(KERN_INFO "Call Trace: \n");
26 while (((long) stack & (THREAD_SIZE-1)) != 0) { 24 while (((long) stack & (THREAD_SIZE-1)) != 0) {
27 addr = *stack; 25 addr = *stack;
28 if (__kernel_text_address(addr)) { 26 if (__kernel_text_address(addr)) {
29 printk("%08lx: [<%08lx>]", (unsigned long) stack, addr); 27 printk(KERN_INFO "%08lx: [<%08lx>]",
30 print_symbol(" %s", addr); 28 (unsigned long) stack, addr);
31 printk("\n"); 29 print_symbol(KERN_CONT " %s", addr);
32 } 30 printk(KERN_CONT "\n");
33 stack++; 31 }
34 } 32 stack++;
35 printk("\n"); 33 }
34 printk(KERN_INFO "\n");
36} 35}
37#endif 36#endif
38 37
@@ -67,14 +66,13 @@ void show_stack(struct task_struct *task, unsigned long *esp)
67 } 66 }
68 67
69 stack = esp; 68 stack = esp;
70 for(i = 0; i < kstack_depth_to_print; i++) { 69 for (i = 0; i < kstack_depth_to_print; i++) {
71 if (kstack_end(stack)) 70 if (kstack_end(stack))
72 break; 71 break;
73 if (i && ((i % 8) == 0)) 72 if (i && ((i % 8) == 0))
74 printk("\n "); 73 printk("\n" KERN_INFO " ");
75 printk("%08lx ", *stack++); 74 printk("%08lx ", *stack++);
76 } 75 }
77 76
78 printk("Call Trace: \n");
79 show_trace(task, esp); 77 show_trace(task, esp);
80} 78}
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 1ac746a9eae1..e066e84493b1 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -3,12 +3,12 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/clockchips.h" 6#include <linux/clockchips.h>
7#include "linux/interrupt.h" 7#include <linux/interrupt.h>
8#include "linux/jiffies.h" 8#include <linux/jiffies.h>
9#include "linux/threads.h" 9#include <linux/threads.h>
10#include "asm/irq.h" 10#include <asm/irq.h>
11#include "asm/param.h" 11#include <asm/param.h>
12#include "kern_util.h" 12#include "kern_util.h"
13#include "os.h" 13#include "os.h"
14 14
@@ -32,7 +32,7 @@ void timer_handler(int sig, struct uml_pt_regs *regs)
32static void itimer_set_mode(enum clock_event_mode mode, 32static void itimer_set_mode(enum clock_event_mode mode,
33 struct clock_event_device *evt) 33 struct clock_event_device *evt)
34{ 34{
35 switch(mode) { 35 switch (mode) {
36 case CLOCK_EVT_MODE_PERIODIC: 36 case CLOCK_EVT_MODE_PERIODIC:
37 set_interval(); 37 set_interval();
38 break; 38 break;
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 0b6a77def311..d175d0566af0 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -57,7 +57,7 @@ static int do_ops(struct host_vm_change *hvc, int end,
57 57
58 for (i = 0; i < end && !ret; i++) { 58 for (i = 0; i < end && !ret; i++) {
59 op = &hvc->ops[i]; 59 op = &hvc->ops[i];
60 switch(op->type) { 60 switch (op->type) {
61 case MMAP: 61 case MMAP:
62 ret = map(hvc->id, op->u.mmap.addr, op->u.mmap.len, 62 ret = map(hvc->id, op->u.mmap.addr, op->u.mmap.len,
63 op->u.mmap.prot, op->u.mmap.fd, 63 op->u.mmap.prot, op->u.mmap.fd,
diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c
index d7436aacd26f..f0f4b040d7c5 100644
--- a/arch/um/kernel/uaccess.c
+++ b/arch/um/kernel/uaccess.c
@@ -1,10 +1,11 @@
1/* 1/*
2 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) 2 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
3 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) 3 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
4 * Licensed under the GPL 4 * Licensed under the GPL
5 */ 5 */
6 6
7/* These are here rather than tt/uaccess.c because skas mode needs them in 7/*
8 * These are here rather than tt/uaccess.c because skas mode needs them in
8 * order to do SIGBUS recovery when a tmpfs mount runs out of room. 9 * order to do SIGBUS recovery when a tmpfs mount runs out of room.
9 */ 10 */
10 11
@@ -25,6 +26,8 @@ int __do_copy_to_user(void *to, const void *from, int n,
25 26
26 fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, 27 fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,
27 __do_copy, &faulted); 28 __do_copy, &faulted);
28 if(!faulted) return(0); 29 if (!faulted)
29 else return(n - (fault - (unsigned long) to)); 30 return 0;
31 else
32 return n - (fault - (unsigned long) to);
30} 33}
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index cb7eef833bc8..468aba990dbd 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -3,23 +3,23 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/delay.h" 6#include <linux/delay.h>
7#include "linux/mm.h" 7#include <linux/init.h>
8#include "linux/module.h" 8#include <linux/mm.h>
9#include "linux/seq_file.h" 9#include <linux/module.h>
10#include "linux/string.h" 10#include <linux/seq_file.h>
11#include "linux/utsname.h" 11#include <linux/string.h>
12#include "asm/pgtable.h" 12#include <linux/utsname.h>
13#include "asm/processor.h" 13#include <asm/pgtable.h>
14#include "asm/setup.h" 14#include <asm/processor.h>
15#include "arch.h" 15#include <asm/setup.h>
16#include "as-layout.h" 16#include "as-layout.h"
17#include "arch.h"
17#include "init.h" 18#include "init.h"
18#include "kern.h" 19#include "kern.h"
19#include "kern_util.h" 20#include "kern_util.h"
20#include "mem_user.h" 21#include "mem_user.h"
21#include "os.h" 22#include "os.h"
22#include "skas.h"
23 23
24#define DEFAULT_COMMAND_LINE "root=98:0" 24#define DEFAULT_COMMAND_LINE "root=98:0"
25 25
@@ -201,7 +201,7 @@ static void __init uml_checksetup(char *line, int *add)
201 struct uml_param *p; 201 struct uml_param *p;
202 202
203 p = &__uml_setup_start; 203 p = &__uml_setup_start;
204 while(p < &__uml_setup_end) { 204 while (p < &__uml_setup_end) {
205 int n; 205 int n;
206 206
207 n = strlen(p->str); 207 n = strlen(p->str);
@@ -216,7 +216,7 @@ static void __init uml_postsetup(void)
216 initcall_t *p; 216 initcall_t *p;
217 217
218 p = &__uml_postsetup_start; 218 p = &__uml_postsetup_start;
219 while(p < &__uml_postsetup_end) { 219 while (p < &__uml_postsetup_end) {
220 (*p)(); 220 (*p)();
221 p++; 221 p++;
222 } 222 }
diff --git a/arch/um/kernel/umid.c b/arch/um/kernel/umid.c
index 039e16efcd55..81e07e2be3ae 100644
--- a/arch/um/kernel/umid.c
+++ b/arch/um/kernel/umid.c
@@ -1,13 +1,12 @@
1/* 1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "asm/errno.h" 6#include <asm/errno.h>
7#include "init.h" 7#include "init.h"
8#include "os.h"
9#include "kern.h" 8#include "kern.h"
10#include "linux/kernel.h" 9#include "os.h"
11 10
12/* Changed by set_umid_arg */ 11/* Changed by set_umid_arg */
13static int umid_inited = 0; 12static int umid_inited = 0;
@@ -16,16 +15,16 @@ static int __init set_umid_arg(char *name, int *add)
16{ 15{
17 int err; 16 int err;
18 17
19 if(umid_inited){ 18 if (umid_inited) {
20 printf("umid already set\n"); 19 printf("umid already set\n");
21 return 0; 20 return 0;
22 } 21 }
23 22
24 *add = 0; 23 *add = 0;
25 err = set_umid(name); 24 err = set_umid(name);
26 if(err == -EEXIST) 25 if (err == -EEXIST)
27 printf("umid '%s' already in use\n", name); 26 printf("umid '%s' already in use\n", name);
28 else if(!err) 27 else if (!err)
29 umid_inited = 1; 28 umid_inited = 1;
30 29
31 return 0; 30 return 0;