aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/head.S15
-rw-r--r--arch/arm/kernel/setup.c4
-rw-r--r--arch/arm/kernel/sys_arm.c5
3 files changed, 16 insertions, 8 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 84277fe818a1..53b6901f70a6 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -81,6 +81,7 @@
81ENTRY(stext) 81ENTRY(stext)
82 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode 82 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
83 @ and irqs disabled 83 @ and irqs disabled
84 mrc p15, 0, r9, c0, c0 @ get processor id
84 bl __lookup_processor_type @ r5=procinfo r9=cpuid 85 bl __lookup_processor_type @ r5=procinfo r9=cpuid
85 movs r10, r5 @ invalid processor (r5=0)? 86 movs r10, r5 @ invalid processor (r5=0)?
86 beq __error_p @ yes, error 'p' 87 beq __error_p @ yes, error 'p'
@@ -155,6 +156,7 @@ ENTRY(secondary_startup)
155 * as it has already been validated by the primary processor. 156 * as it has already been validated by the primary processor.
156 */ 157 */
157 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC 158 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC
159 mrc p15, 0, r9, c0, c0 @ get processor id
158 bl __lookup_processor_type 160 bl __lookup_processor_type
159 movs r10, r5 @ invalid processor? 161 movs r10, r5 @ invalid processor?
160 moveq r0, #'p' @ yes, error 'p' 162 moveq r0, #'p' @ yes, error 'p'
@@ -449,19 +451,19 @@ __error:
449 * (and therefore, we are not in the correct address space). We have to 451 * (and therefore, we are not in the correct address space). We have to
450 * calculate the offset. 452 * calculate the offset.
451 * 453 *
454 * r9 = cpuid
452 * Returns: 455 * Returns:
453 * r3, r4, r6 corrupted 456 * r3, r4, r6 corrupted
454 * r5 = proc_info pointer in physical address space 457 * r5 = proc_info pointer in physical address space
455 * r9 = cpuid 458 * r9 = cpuid (preserved)
456 */ 459 */
457 .type __lookup_processor_type, %function 460 .type __lookup_processor_type, %function
458__lookup_processor_type: 461__lookup_processor_type:
459 adr r3, 3f 462 adr r3, 3f
460 ldmda r3, {r5, r6, r9} 463 ldmda r3, {r5 - r7}
461 sub r3, r3, r9 @ get offset between virt&phys 464 sub r3, r3, r7 @ get offset between virt&phys
462 add r5, r5, r3 @ convert virt addresses to 465 add r5, r5, r3 @ convert virt addresses to
463 add r6, r6, r3 @ physical address space 466 add r6, r6, r3 @ physical address space
464 mrc p15, 0, r9, c0, c0 @ get processor id
4651: ldmia r5, {r3, r4} @ value, mask 4671: ldmia r5, {r3, r4} @ value, mask
466 and r4, r4, r9 @ mask wanted bits 468 and r4, r4, r9 @ mask wanted bits
467 teq r3, r4 469 teq r3, r4
@@ -476,10 +478,11 @@ __lookup_processor_type:
476 * This provides a C-API version of the above function. 478 * This provides a C-API version of the above function.
477 */ 479 */
478ENTRY(lookup_processor_type) 480ENTRY(lookup_processor_type)
479 stmfd sp!, {r4 - r6, r9, lr} 481 stmfd sp!, {r4 - r7, r9, lr}
482 mov r9, r0
480 bl __lookup_processor_type 483 bl __lookup_processor_type
481 mov r0, r5 484 mov r0, r5
482 ldmfd sp!, {r4 - r6, r9, pc} 485 ldmfd sp!, {r4 - r7, r9, pc}
483 486
484/* 487/*
485 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for 488 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 08974cbe9824..b7cd280bfd63 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -278,7 +278,7 @@ int cpu_architecture(void)
278 * These functions re-use the assembly code in head.S, which 278 * These functions re-use the assembly code in head.S, which
279 * already provide the required functionality. 279 * already provide the required functionality.
280 */ 280 */
281extern struct proc_info_list *lookup_processor_type(void); 281extern struct proc_info_list *lookup_processor_type(unsigned int);
282extern struct machine_desc *lookup_machine_type(unsigned int); 282extern struct machine_desc *lookup_machine_type(unsigned int);
283 283
284static void __init setup_processor(void) 284static void __init setup_processor(void)
@@ -290,7 +290,7 @@ static void __init setup_processor(void)
290 * types. The linker builds this table for us from the 290 * types. The linker builds this table for us from the
291 * entries in arch/arm/mm/proc-*.S 291 * entries in arch/arm/mm/proc-*.S
292 */ 292 */
293 list = lookup_processor_type(); 293 list = lookup_processor_type(processor_id);
294 if (!list) { 294 if (!list) {
295 printk("CPU configuration botched (ID %08x), unable " 295 printk("CPU configuration botched (ID %08x), unable "
296 "to continue.\n", processor_id); 296 "to continue.\n", processor_id);
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index a491de2d9024..8170af471439 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -234,7 +234,12 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
234 */ 234 */
235asmlinkage int sys_fork(struct pt_regs *regs) 235asmlinkage int sys_fork(struct pt_regs *regs)
236{ 236{
237#ifdef CONFIG_MMU
237 return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); 238 return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
239#else
240 /* can not support in nommu mode */
241 return(-EINVAL);
242#endif
238} 243}
239 244
240/* Clone a task - this clones the calling program thread. 245/* Clone a task - this clones the calling program thread.