diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-09-28 17:20:39 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-28 17:20:39 -0400 |
commit | 250d375d1da45a5e08ab8baf5eaa7eb258afd82b (patch) | |
tree | fb5dc6df00065f11578f837835c6d5a99530b223 /arch/arm/kernel | |
parent | 84904d0ead0a8c419abd45c7b2ac8d76d50a0d48 (diff) | |
parent | 6afd6fae1d5f7e7129a10c4f3e32018966eeac1c (diff) |
Merge nommu branch
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/head-nommu.S | 12 | ||||
-rw-r--r-- | arch/arm/kernel/module.c | 8 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 22 |
3 files changed, 35 insertions, 7 deletions
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index ac9eb3d30518..f359a189dcf2 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
@@ -9,7 +9,6 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | * | 10 | * |
11 | * Common kernel startup code (non-paged MM) | 11 | * Common kernel startup code (non-paged MM) |
12 | * for 32-bit CPUs which has a process ID register(CP15). | ||
13 | * | 12 | * |
14 | */ | 13 | */ |
15 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
@@ -40,7 +39,11 @@ | |||
40 | ENTRY(stext) | 39 | ENTRY(stext) |
41 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode | 40 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode |
42 | @ and irqs disabled | 41 | @ and irqs disabled |
42 | #ifndef CONFIG_CPU_CP15 | ||
43 | ldr r9, =CONFIG_PROCESSOR_ID | ||
44 | #else | ||
43 | mrc p15, 0, r9, c0, c0 @ get processor id | 45 | mrc p15, 0, r9, c0, c0 @ get processor id |
46 | #endif | ||
44 | bl __lookup_processor_type @ r5=procinfo r9=cpuid | 47 | bl __lookup_processor_type @ r5=procinfo r9=cpuid |
45 | movs r10, r5 @ invalid processor (r5=0)? | 48 | movs r10, r5 @ invalid processor (r5=0)? |
46 | beq __error_p @ yes, error 'p' | 49 | beq __error_p @ yes, error 'p' |
@@ -58,6 +61,7 @@ ENTRY(stext) | |||
58 | */ | 61 | */ |
59 | .type __after_proc_init, %function | 62 | .type __after_proc_init, %function |
60 | __after_proc_init: | 63 | __after_proc_init: |
64 | #ifdef CONFIG_CPU_CP15 | ||
61 | mrc p15, 0, r0, c1, c0, 0 @ read control reg | 65 | mrc p15, 0, r0, c1, c0, 0 @ read control reg |
62 | #ifdef CONFIG_ALIGNMENT_TRAP | 66 | #ifdef CONFIG_ALIGNMENT_TRAP |
63 | orr r0, r0, #CR_A | 67 | orr r0, r0, #CR_A |
@@ -73,7 +77,13 @@ __after_proc_init: | |||
73 | #ifdef CONFIG_CPU_ICACHE_DISABLE | 77 | #ifdef CONFIG_CPU_ICACHE_DISABLE |
74 | bic r0, r0, #CR_I | 78 | bic r0, r0, #CR_I |
75 | #endif | 79 | #endif |
80 | #ifdef CONFIG_CPU_HIGH_VECTOR | ||
81 | orr r0, r0, #CR_V | ||
82 | #else | ||
83 | bic r0, r0, #CR_V | ||
84 | #endif | ||
76 | mcr p15, 0, r0, c1, c0, 0 @ write control reg | 85 | mcr p15, 0, r0, c1, c0, 0 @ write control reg |
86 | #endif /* CONFIG_CPU_CP15 */ | ||
77 | 87 | ||
78 | mov pc, r13 @ clear the BSS and jump | 88 | mov pc, r13 @ clear the BSS and jump |
79 | @ to start_kernel | 89 | @ to start_kernel |
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 298363d97047..1b061583408e 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/kernel/module.c | 2 | * linux/arch/arm/kernel/module.c |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Russell King. | 4 | * Copyright (C) 2002 Russell King. |
5 | * Modified for nommu by Hyok S. Choi | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -32,6 +33,7 @@ extern void _etext; | |||
32 | #define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK) | 33 | #define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK) |
33 | #endif | 34 | #endif |
34 | 35 | ||
36 | #ifdef CONFIG_MMU | ||
35 | void *module_alloc(unsigned long size) | 37 | void *module_alloc(unsigned long size) |
36 | { | 38 | { |
37 | struct vm_struct *area; | 39 | struct vm_struct *area; |
@@ -46,6 +48,12 @@ void *module_alloc(unsigned long size) | |||
46 | 48 | ||
47 | return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL); | 49 | return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL); |
48 | } | 50 | } |
51 | #else /* CONFIG_MMU */ | ||
52 | void *module_alloc(unsigned long size) | ||
53 | { | ||
54 | return size == 0 ? NULL : vmalloc(size); | ||
55 | } | ||
56 | #endif /* !CONFIG_MMU */ | ||
49 | 57 | ||
50 | void module_free(struct module *module, void *region) | 58 | void module_free(struct module *module, void *region) |
51 | { | 59 | { |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 3079535afccd..bf35c178a877 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -221,16 +221,26 @@ void __show_regs(struct pt_regs *regs) | |||
221 | processor_modes[processor_mode(regs)], | 221 | processor_modes[processor_mode(regs)], |
222 | thumb_mode(regs) ? " (T)" : "", | 222 | thumb_mode(regs) ? " (T)" : "", |
223 | get_fs() == get_ds() ? "kernel" : "user"); | 223 | get_fs() == get_ds() ? "kernel" : "user"); |
224 | #if CONFIG_CPU_CP15 | ||
224 | { | 225 | { |
225 | unsigned int ctrl, transbase, dac; | 226 | unsigned int ctrl; |
226 | __asm__ ( | 227 | __asm__ ( |
227 | " mrc p15, 0, %0, c1, c0\n" | 228 | " mrc p15, 0, %0, c1, c0\n" |
228 | " mrc p15, 0, %1, c2, c0\n" | 229 | : "=r" (ctrl)); |
229 | " mrc p15, 0, %2, c3, c0\n" | 230 | printk("Control: %04X\n", ctrl); |
230 | : "=r" (ctrl), "=r" (transbase), "=r" (dac)); | ||
231 | printk("Control: %04X Table: %08X DAC: %08X\n", | ||
232 | ctrl, transbase, dac); | ||
233 | } | 231 | } |
232 | #ifdef CONFIG_CPU_CP15_MMU | ||
233 | { | ||
234 | unsigned int transbase, dac; | ||
235 | __asm__ ( | ||
236 | " mrc p15, 0, %0, c2, c0\n" | ||
237 | " mrc p15, 0, %1, c3, c0\n" | ||
238 | : "=r" (transbase), "=r" (dac)); | ||
239 | printk("Table: %08X DAC: %08X\n", | ||
240 | transbase, dac); | ||
241 | } | ||
242 | #endif | ||
243 | #endif | ||
234 | } | 244 | } |
235 | 245 | ||
236 | void show_regs(struct pt_regs * regs) | 246 | void show_regs(struct pt_regs * regs) |