diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-06-18 04:33:31 -0400 |
---|---|---|
committer | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-06-18 04:33:31 -0400 |
commit | e65f38ed0bb7af367ff919c573cf29643fc5f9e8 (patch) | |
tree | 2b89f5f0a9175cf1107bc52c7302eb1acf8aa1a1 /arch/arm/kernel/head.S | |
parent | 5ab6091db0b644f59c2f16c5e41028496b709160 (diff) |
[PATCH] ARM SMP: Add support for startup of secondary processors
Create a temporary page table to startup secondary processors. This
page table must have a 1:1 virtual/physical mapping for the kernel
in addition to the standard mappings to ensure that the secondary
CPU can enable its MMU safely.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/head.S')
-rw-r--r-- | arch/arm/kernel/head.S | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 4733877296d4..bd4823c74645 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -2,6 +2,8 @@ | |||
2 | * linux/arch/arm/kernel/head.S | 2 | * linux/arch/arm/kernel/head.S |
3 | * | 3 | * |
4 | * Copyright (C) 1994-2002 Russell King | 4 | * Copyright (C) 1994-2002 Russell King |
5 | * Copyright (c) 2003 ARM Limited | ||
6 | * All Rights Reserved | ||
5 | * | 7 | * |
6 | * This program is free software; you can redistribute it and/or modify | 8 | * 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 | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -165,6 +167,48 @@ __mmap_switched: | |||
165 | stmia r6, {r0, r4} @ Save control register values | 167 | stmia r6, {r0, r4} @ Save control register values |
166 | b start_kernel | 168 | b start_kernel |
167 | 169 | ||
170 | #if defined(CONFIG_SMP) | ||
171 | .type secondary_startup, #function | ||
172 | ENTRY(secondary_startup) | ||
173 | /* | ||
174 | * Common entry point for secondary CPUs. | ||
175 | * | ||
176 | * Ensure that we're in SVC mode, and IRQs are disabled. Lookup | ||
177 | * the processor type - there is no need to check the machine type | ||
178 | * as it has already been validated by the primary processor. | ||
179 | */ | ||
180 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC | ||
181 | bl __lookup_processor_type | ||
182 | movs r10, r5 @ invalid processor? | ||
183 | moveq r0, #'p' @ yes, error 'p' | ||
184 | beq __error | ||
185 | |||
186 | /* | ||
187 | * Use the page tables supplied from __cpu_up. | ||
188 | */ | ||
189 | adr r4, __secondary_data | ||
190 | ldmia r4, {r5, r6, r13} @ address to jump to after | ||
191 | sub r4, r4, r5 @ mmu has been enabled | ||
192 | ldr r4, [r6, r4] @ get secondary_data.pgdir | ||
193 | adr lr, __enable_mmu @ return address | ||
194 | add pc, r10, #12 @ initialise processor | ||
195 | @ (return control reg) | ||
196 | |||
197 | /* | ||
198 | * r6 = &secondary_data | ||
199 | */ | ||
200 | ENTRY(__secondary_switched) | ||
201 | ldr sp, [r6, #4] @ get secondary_data.stack | ||
202 | mov fp, #0 | ||
203 | b secondary_start_kernel | ||
204 | |||
205 | .type __secondary_data, %object | ||
206 | __secondary_data: | ||
207 | .long . | ||
208 | .long secondary_data | ||
209 | .long __secondary_switched | ||
210 | #endif /* defined(CONFIG_SMP) */ | ||
211 | |||
168 | 212 | ||
169 | 213 | ||
170 | /* | 214 | /* |