aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-12-01 02:16:22 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2009-12-01 02:16:22 -0500
commit838632438145ac6863377eb12d8b8eef9c55d288 (patch)
treefbb0757df837f3c75a99c518a3596c38daef162d /arch/um
parent9996508b3353063f2d6c48c1a28a84543d72d70b (diff)
parent29e553631b2a0d4eebd23db630572e1027a9967a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/Makefile9
-rw-r--r--arch/um/drivers/line.c1
-rw-r--r--arch/um/drivers/net_kern.c2
-rw-r--r--arch/um/drivers/port_kern.c1
-rw-r--r--arch/um/drivers/ubd_kern.c2
-rw-r--r--arch/um/include/asm/common.lds.S29
-rw-r--r--arch/um/include/asm/hardirq.h26
-rw-r--r--arch/um/include/asm/mmu_context.h4
-rw-r--r--arch/um/include/shared/ptrace_user.h2
-rw-r--r--arch/um/kernel/Makefile3
-rw-r--r--arch/um/kernel/dyn.lds.S9
-rw-r--r--arch/um/kernel/init_task.c5
-rw-r--r--arch/um/kernel/irq.c1
-rw-r--r--arch/um/kernel/mem.c2
-rw-r--r--arch/um/kernel/skas/mmu.c4
-rw-r--r--arch/um/kernel/smp.c2
-rw-r--r--arch/um/kernel/uml.lds.S26
-rw-r--r--arch/um/kernel/vmlinux.lds.S3
-rw-r--r--arch/um/os-Linux/helper.c1
19 files changed, 39 insertions, 93 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 0728def32234..fc633dbacf84 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -96,11 +96,10 @@ CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,)
96 $(call cc-option, -fno-stack-protector,) \ 96 $(call cc-option, -fno-stack-protector,) \
97 $(call cc-option, -fno-stack-protector-all,) 97 $(call cc-option, -fno-stack-protector-all,)
98 98
99CONFIG_KERNEL_STACK_ORDER ?= 2 99# Options used by linker script
100STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 100export LDS_START := $(START)
101 101export LDS_ELF_ARCH := $(ELF_ARCH)
102CPPFLAGS_vmlinux.lds = -U$(SUBARCH) -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ 102export LDS_ELF_FORMAT := $(ELF_FORMAT)
103 -DELF_FORMAT="$(ELF_FORMAT)" -DKERNEL_STACK_SIZE=$(STACK_SIZE)
104 103
105# The wrappers will select whether using "malloc" or the kernel allocator. 104# The wrappers will select whether using "malloc" or the kernel allocator.
106LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 105LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 14a102e877d6..cf8a97f34518 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -5,6 +5,7 @@
5 5
6#include "linux/irqreturn.h" 6#include "linux/irqreturn.h"
7#include "linux/kd.h" 7#include "linux/kd.h"
8#include "linux/sched.h"
8#include "chan_kern.h" 9#include "chan_kern.h"
9#include "irq_kern.h" 10#include "irq_kern.h"
10#include "irq_user.h" 11#include "irq_user.h"
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index f114813ae258..a74245ae3a84 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -533,7 +533,7 @@ static int eth_parse(char *str, int *index_out, char **str_out,
533 char **error_out) 533 char **error_out)
534{ 534{
535 char *end; 535 char *end;
536 int n, err = -EINVAL;; 536 int n, err = -EINVAL;
537 537
538 n = simple_strtoul(str, &end, 0); 538 n = simple_strtoul(str, &end, 0);
539 if (end == str) { 539 if (end == str) {
diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c
index 19930081d3d8..4ebc8a34738f 100644
--- a/arch/um/drivers/port_kern.c
+++ b/arch/um/drivers/port_kern.c
@@ -7,6 +7,7 @@
7#include "linux/interrupt.h" 7#include "linux/interrupt.h"
8#include "linux/list.h" 8#include "linux/list.h"
9#include "linux/mutex.h" 9#include "linux/mutex.h"
10#include "linux/workqueue.h"
10#include "asm/atomic.h" 11#include "asm/atomic.h"
11#include "init.h" 12#include "init.h"
12#include "irq_kern.h" 13#include "irq_kern.h"
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 8f05d4d9da12..635d16d90a80 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -106,7 +106,7 @@ static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
106 106
107#define MAX_DEV (16) 107#define MAX_DEV (16)
108 108
109static struct block_device_operations ubd_blops = { 109static const struct block_device_operations ubd_blops = {
110 .owner = THIS_MODULE, 110 .owner = THIS_MODULE,
111 .open = ubd_open, 111 .open = ubd_open,
112 .release = ubd_release, 112 .release = ubd_release,
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
index 37ecc5577a9a..ac55b9efa1ce 100644
--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -16,11 +16,7 @@
16 16
17 . = ALIGN(4096); 17 . = ALIGN(4096);
18 .note : { *(.note.*) } 18 .note : { *(.note.*) }
19 __ex_table : { 19 EXCEPTION_TABLE(0)
20 __start___ex_table = .;
21 *(__ex_table)
22 __stop___ex_table = .;
23 }
24 20
25 BUG_TABLE 21 BUG_TABLE
26 22
@@ -43,28 +39,17 @@
43 } 39 }
44 40
45 .init.setup : { 41 .init.setup : {
46 __setup_start = .; 42 INIT_SETUP(0)
47 *(.init.setup)
48 __setup_end = .;
49 } 43 }
50 44
51 . = ALIGN(32); 45 PERCPU(32)
52 .data.percpu : {
53 __per_cpu_start = . ;
54 *(.data.percpu)
55 __per_cpu_end = . ;
56 }
57 46
58 .initcall.init : { 47 .initcall.init : {
59 __initcall_start = .; 48 INIT_CALLS
60 INITCALLS
61 __initcall_end = .;
62 } 49 }
63 50
64 .con_initcall.init : { 51 .con_initcall.init : {
65 __con_initcall_start = .; 52 CON_INITCALL
66 *(.con_initcall.init)
67 __con_initcall_end = .;
68 } 53 }
69 54
70 .uml.initcall.init : { 55 .uml.initcall.init : {
@@ -118,8 +103,6 @@
118 103
119 . = ALIGN(4096); 104 . = ALIGN(4096);
120 .init.ramfs : { 105 .init.ramfs : {
121 __initramfs_start = .; 106 INIT_RAM_FS
122 *(.init.ramfs)
123 __initramfs_end = .;
124 } 107 }
125 108
diff --git a/arch/um/include/asm/hardirq.h b/arch/um/include/asm/hardirq.h
index 313ebb8a2566..fb3c05a0cbbf 100644
--- a/arch/um/include/asm/hardirq.h
+++ b/arch/um/include/asm/hardirq.h
@@ -1,25 +1 @@
1/* (c) 2004 cw@f00f.org, GPLv2 blah blah */ #include <asm-generic/hardirq.h>
2
3#ifndef __ASM_UM_HARDIRQ_H
4#define __ASM_UM_HARDIRQ_H
5
6#include <linux/threads.h>
7#include <linux/irq.h>
8
9/* NOTE: When SMP works again we might want to make this
10 * ____cacheline_aligned or maybe use per_cpu state? --cw */
11typedef struct {
12 unsigned int __softirq_pending;
13} irq_cpustat_t;
14
15#include <linux/irq_cpustat.h>
16
17/* As this would be very strange for UML to get we BUG() after the
18 * printk. */
19static inline void ack_bad_irq(unsigned int irq)
20{
21 printk(KERN_ERR "unexpected IRQ %02x\n", irq);
22 BUG();
23}
24
25#endif /* __ASM_UM_HARDIRQ_H */
diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h
index 54f42e8b0105..34d813011b7a 100644
--- a/arch/um/include/asm/mmu_context.h
+++ b/arch/um/include/asm/mmu_context.h
@@ -35,8 +35,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
35 unsigned cpu = smp_processor_id(); 35 unsigned cpu = smp_processor_id();
36 36
37 if(prev != next){ 37 if(prev != next){
38 cpu_clear(cpu, prev->cpu_vm_mask); 38 cpumask_clear_cpu(cpu, mm_cpumask(prev));
39 cpu_set(cpu, next->cpu_vm_mask); 39 cpumask_set_cpu(cpu, mm_cpumask(next));
40 if(next != &init_mm) 40 if(next != &init_mm)
41 __switch_mm(&next->context.id); 41 __switch_mm(&next->context.id);
42 } 42 }
diff --git a/arch/um/include/shared/ptrace_user.h b/arch/um/include/shared/ptrace_user.h
index 4bce6e012889..7fd8539bc19a 100644
--- a/arch/um/include/shared/ptrace_user.h
+++ b/arch/um/include/shared/ptrace_user.h
@@ -29,7 +29,7 @@ extern int ptrace_setregs(long pid, unsigned long *regs_in);
29 * recompilation. So, we use PTRACE_OLDSETOPTIONS in UML. 29 * recompilation. So, we use PTRACE_OLDSETOPTIONS in UML.
30 * We also want to be able to build the kernel on 2.4, which doesn't 30 * We also want to be able to build the kernel on 2.4, which doesn't
31 * have PTRACE_OLDSETOPTIONS. So, if it is missing, we declare 31 * have PTRACE_OLDSETOPTIONS. So, if it is missing, we declare
32 * PTRACE_OLDSETOPTIONS to to be the same as PTRACE_SETOPTIONS. 32 * PTRACE_OLDSETOPTIONS to be the same as PTRACE_SETOPTIONS.
33 * 33 *
34 * On architectures, that start to support PTRACE_O_TRACESYSGOOD on 34 * On architectures, that start to support PTRACE_O_TRACESYSGOOD on
35 * linux 2.6, PTRACE_OLDSETOPTIONS never is defined, and also isn't 35 * linux 2.6, PTRACE_OLDSETOPTIONS never is defined, and also isn't
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 388ec0a3ea9b..1119233597a1 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -3,6 +3,9 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6CPPFLAGS_vmlinux.lds := -U$(SUBARCH) -DSTART=$(LDS_START) \
7 -DELF_ARCH=$(LDS_ELF_ARCH) \
8 -DELF_FORMAT=$(LDS_ELF_FORMAT)
6extra-y := vmlinux.lds 9extra-y := vmlinux.lds
7clean-files := 10clean-files :=
8 11
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 715a188c0472..7fcad58e216d 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -16,11 +16,7 @@ SECTIONS
16 _text = .; 16 _text = .;
17 _stext = .; 17 _stext = .;
18 __init_begin = .; 18 __init_begin = .;
19 .init.text : { 19 INIT_TEXT_SECTION(PAGE_SIZE)
20 _sinittext = .;
21 INIT_TEXT
22 _einittext = .;
23 }
24 20
25 . = ALIGN(PAGE_SIZE); 21 . = ALIGN(PAGE_SIZE);
26 22
@@ -96,8 +92,7 @@ SECTIONS
96 .init_array : { *(.init_array) } 92 .init_array : { *(.init_array) }
97 .fini_array : { *(.fini_array) } 93 .fini_array : { *(.fini_array) }
98 .data : { 94 .data : {
99 . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ 95 INIT_TASK_DATA(KERNEL_STACK_SIZE)
100 *(.data.init_task)
101 . = ALIGN(KERNEL_STACK_SIZE); 96 . = ALIGN(KERNEL_STACK_SIZE);
102 *(.data.init_irqstack) 97 *(.data.init_irqstack)
103 DATA_DATA 98 DATA_DATA
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index b25121b537d8..8aa77b61a5ff 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -30,9 +30,8 @@ EXPORT_SYMBOL(init_task);
30 * "init_task" linker map entry.. 30 * "init_task" linker map entry..
31 */ 31 */
32 32
33union thread_union init_thread_union 33union thread_union init_thread_union __init_task_data =
34 __attribute__((__section__(".data.init_task"))) = 34 { INIT_THREAD_INFO(init_task) };
35 { INIT_THREAD_INFO(init_task) };
36 35
37union thread_union cpu0_irqstack 36union thread_union cpu0_irqstack
38 __attribute__((__section__(".data.init_irqstack"))) = 37 __attribute__((__section__(".data.init_irqstack"))) =
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 454cdb43e351..039270b9b73b 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -10,6 +10,7 @@
10#include "linux/interrupt.h" 10#include "linux/interrupt.h"
11#include "linux/kernel_stat.h" 11#include "linux/kernel_stat.h"
12#include "linux/module.h" 12#include "linux/module.h"
13#include "linux/sched.h"
13#include "linux/seq_file.h" 14#include "linux/seq_file.h"
14#include "as-layout.h" 15#include "as-layout.h"
15#include "kern_util.h" 16#include "kern_util.h"
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 61d7e6138ff5..a5d5e70cf6f5 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -77,7 +77,7 @@ void __init mem_init(void)
77 num_physpages = totalram_pages; 77 num_physpages = totalram_pages;
78 max_pfn = totalram_pages; 78 max_pfn = totalram_pages;
79 printk(KERN_INFO "Memory: %luk available\n", 79 printk(KERN_INFO "Memory: %luk available\n",
80 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10)); 80 nr_free_pages() << (PAGE_SHIFT-10));
81 kmalloc_ok = 1; 81 kmalloc_ok = 1;
82 82
83#ifdef CONFIG_HIGHMEM 83#ifdef CONFIG_HIGHMEM
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 0cd9a7a05e77..8bfd1e905812 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -38,10 +38,10 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
38 *pte = pte_mkread(*pte); 38 *pte = pte_mkread(*pte);
39 return 0; 39 return 0;
40 40
41 out_pmd:
42 pud_free(mm, pud);
43 out_pte: 41 out_pte:
44 pmd_free(mm, pmd); 42 pmd_free(mm, pmd);
43 out_pmd:
44 pud_free(mm, pud);
45 out: 45 out:
46 return -ENOMEM; 46 return -ENOMEM;
47} 47}
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 98351c78bc81..106bf27e2a9a 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -111,7 +111,7 @@ void smp_prepare_cpus(unsigned int maxcpus)
111 int i; 111 int i;
112 112
113 for (i = 0; i < ncpus; ++i) 113 for (i = 0; i < ncpus; ++i)
114 cpu_set(i, cpu_possible_map); 114 set_cpu_possible(i, true);
115 115
116 cpu_clear(me, cpu_online_map); 116 cpu_clear(me, cpu_online_map);
117 cpu_set(me, cpu_online_map); 117 cpu_set(me, cpu_online_map);
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 2ebd39765db8..e7a6cca667aa 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -22,11 +22,7 @@ SECTIONS
22 _text = .; 22 _text = .;
23 _stext = .; 23 _stext = .;
24 __init_begin = .; 24 __init_begin = .;
25 .init.text : { 25 INIT_TEXT_SECTION(PAGE_SIZE)
26 _sinittext = .;
27 INIT_TEXT
28 _einittext = .;
29 }
30 . = ALIGN(PAGE_SIZE); 26 . = ALIGN(PAGE_SIZE);
31 27
32 .text : 28 .text :
@@ -52,8 +48,7 @@ SECTIONS
52 init.data : { INIT_DATA } 48 init.data : { INIT_DATA }
53 .data : 49 .data :
54 { 50 {
55 . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ 51 INIT_TASK_DATA(KERNEL_STACK_SIZE)
56 *(.data.init_task)
57 . = ALIGN(KERNEL_STACK_SIZE); 52 . = ALIGN(KERNEL_STACK_SIZE);
58 *(.data.init_irqstack) 53 *(.data.init_irqstack)
59 DATA_DATA 54 DATA_DATA
@@ -81,19 +76,10 @@ SECTIONS
81 _edata = .; 76 _edata = .;
82 PROVIDE (edata = .); 77 PROVIDE (edata = .);
83 . = ALIGN(PAGE_SIZE); 78 . = ALIGN(PAGE_SIZE);
84 .sbss : 79 __bss_start = .;
85 { 80 PROVIDE(_bss_start = .);
86 __bss_start = .; 81 SBSS(0)
87 PROVIDE(_bss_start = .); 82 BSS(0)
88 *(.sbss)
89 *(.scommon)
90 }
91 .bss :
92 {
93 *(.dynbss)
94 *(.bss)
95 *(COMMON)
96 }
97 _end = .; 83 _end = .;
98 PROVIDE (end = .); 84 PROVIDE (end = .);
99 85
diff --git a/arch/um/kernel/vmlinux.lds.S b/arch/um/kernel/vmlinux.lds.S
index f8aeb448aab6..16e49bfa2b42 100644
--- a/arch/um/kernel/vmlinux.lds.S
+++ b/arch/um/kernel/vmlinux.lds.S
@@ -1,3 +1,6 @@
1
2KERNEL_STACK_SIZE = 4096 * (1 << CONFIG_KERNEL_STACK_ORDER);
3
1#ifdef CONFIG_LD_SCRIPT_STATIC 4#ifdef CONFIG_LD_SCRIPT_STATIC
2#include "uml.lds.S" 5#include "uml.lds.S"
3#else 6#else
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index 30860b89ec58..b6b1096152aa 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -15,7 +15,6 @@
15#include "os.h" 15#include "os.h"
16#include "um_malloc.h" 16#include "um_malloc.h"
17#include "user.h" 17#include "user.h"
18#include <linux/limits.h>
19 18
20struct helper_data { 19struct helper_data {
21 void (*pre_exec)(void*); 20 void (*pre_exec)(void*);