Skip to content

Commit 0003ced

Browse files
Russell KingRussell King
authored andcommitted
Merge nommu tree
Fix merge conflict in arch/arm/mm/proc-xscale.S Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2 parents 3ee357f + c76b6b4 commit 0003ced

25 files changed

Lines changed: 189 additions & 131 deletions

‎arch/arm/boot/compressed/head.S‎

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size
358358
str r1, [r0]
359359
mov pc, lr
360360

361-
__armv4_cache_on:
361+
__armv4_mmu_cache_on:
362362
mov r12, lr
363363
bl __setup_mmu
364364
mov r0, #0
@@ -367,24 +367,24 @@ __armv4_cache_on:
367367
mrc p15, 0, r0, c1, c0, 0 @ read control reg
368368
orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
369369
orr r0, r0, #0x0030
370-
bl __common_cache_on
370+
bl __common_mmu_cache_on
371371
mov r0, #0
372372
mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
373373
mov pc, r12
374374

375-
__arm6_cache_on:
375+
__arm6_mmu_cache_on:
376376
mov r12, lr
377377
bl __setup_mmu
378378
mov r0, #0
379379
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
380380
mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
381381
mov r0, #0x30
382-
bl __common_cache_on
382+
bl __common_mmu_cache_on
383383
mov r0, #0
384384
mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
385385
mov pc, r12
386386

387-
__common_cache_on:
387+
__common_mmu_cache_on:
388388
#ifndef DEBUG
389389
orr r0, r0, #0x000d @ Write buffer, mmu
390390
#endif
@@ -471,12 +471,12 @@ call_cache_fn: adr r12, proc_types
471471
proc_types:
472472
.word 0x41560600 @ ARM6/610
473473
.word 0xffffffe0
474-
b __arm6_cache_off @ works, but slow
475-
b __arm6_cache_off
474+
b __arm6_mmu_cache_off @ works, but slow
475+
b __arm6_mmu_cache_off
476476
mov pc, lr
477-
@ b __arm6_cache_on @ untested
478-
@ b __arm6_cache_off
479-
@ b __armv3_cache_flush
477+
@ b __arm6_mmu_cache_on @ untested
478+
@ b __arm6_mmu_cache_off
479+
@ b __armv3_mmu_cache_flush
480480

481481
.word 0x00000000 @ old ARM ID
482482
.word 0x0000f000
@@ -486,14 +486,14 @@ proc_types:
486486

487487
.word 0x41007000 @ ARM7/710
488488
.word 0xfff8fe00
489-
b __arm7_cache_off
490-
b __arm7_cache_off
489+
b __arm7_mmu_cache_off
490+
b __arm7_mmu_cache_off
491491
mov pc, lr
492492

493493
.word 0x41807200 @ ARM720T (writethrough)
494494
.word 0xffffff00
495-
b __armv4_cache_on
496-
b __armv4_cache_off
495+
b __armv4_mmu_cache_on
496+
b __armv4_mmu_cache_off
497497
mov pc, lr
498498

499499
.word 0x00007000 @ ARM7 IDs
@@ -506,41 +506,41 @@ proc_types:
506506

507507
.word 0x4401a100 @ sa110 / sa1100
508508
.word 0xffffffe0
509-
b __armv4_cache_on
510-
b __armv4_cache_off
511-
b __armv4_cache_flush
509+
b __armv4_mmu_cache_on
510+
b __armv4_mmu_cache_off
511+
b __armv4_mmu_cache_flush
512512

513513
.word 0x6901b110 @ sa1110
514514
.word 0xfffffff0
515-
b __armv4_cache_on
516-
b __armv4_cache_off
517-
b __armv4_cache_flush
515+
b __armv4_mmu_cache_on
516+
b __armv4_mmu_cache_off
517+
b __armv4_mmu_cache_flush
518518

519519
@ These match on the architecture ID
520520

521521
.word 0x00020000 @ ARMv4T
522522
.word 0x000f0000
523-
b __armv4_cache_on
524-
b __armv4_cache_off
525-
b __armv4_cache_flush
523+
b __armv4_mmu_cache_on
524+
b __armv4_mmu_cache_off
525+
b __armv4_mmu_cache_flush
526526

527527
.word 0x00050000 @ ARMv5TE
528528
.word 0x000f0000
529-
b __armv4_cache_on
530-
b __armv4_cache_off
531-
b __armv4_cache_flush
529+
b __armv4_mmu_cache_on
530+
b __armv4_mmu_cache_off
531+
b __armv4_mmu_cache_flush
532532

533533
.word 0x00060000 @ ARMv5TEJ
534534
.word 0x000f0000
535-
b __armv4_cache_on
536-
b __armv4_cache_off
537-
b __armv4_cache_flush
535+
b __armv4_mmu_cache_on
536+
b __armv4_mmu_cache_off
537+
b __armv4_mmu_cache_flush
538538

539539
.word 0x00070000 @ ARMv6
540540
.word 0x000f0000
541-
b __armv4_cache_on
542-
b __armv4_cache_off
543-
b __armv6_cache_flush
541+
b __armv4_mmu_cache_on
542+
b __armv4_mmu_cache_off
543+
b __armv6_mmu_cache_flush
544544

545545
.word 0 @ unrecognised type
546546
.word 0
@@ -562,7 +562,7 @@ proc_types:
562562
cache_off: mov r3, #12 @ cache_off function
563563
b call_cache_fn
564564

565-
__armv4_cache_off:
565+
__armv4_mmu_cache_off:
566566
mrc p15, 0, r0, c1, c0
567567
bic r0, r0, #0x000d
568568
mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
@@ -571,15 +571,15 @@ __armv4_cache_off:
571571
mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4
572572
mov pc, lr
573573

574-
__arm6_cache_off:
574+
__arm6_mmu_cache_off:
575575
mov r0, #0x00000030 @ ARM6 control reg.
576-
b __armv3_cache_off
576+
b __armv3_mmu_cache_off
577577

578-
__arm7_cache_off:
578+
__arm7_mmu_cache_off:
579579
mov r0, #0x00000070 @ ARM7 control reg.
580-
b __armv3_cache_off
580+
b __armv3_mmu_cache_off
581581

582-
__armv3_cache_off:
582+
__armv3_mmu_cache_off:
583583
mcr p15, 0, r0, c1, c0, 0 @ turn MMU and cache off
584584
mov r0, #0
585585
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
@@ -601,15 +601,15 @@ cache_clean_flush:
601601
mov r3, #16
602602
b call_cache_fn
603603

604-
__armv6_cache_flush:
604+
__armv6_mmu_cache_flush:
605605
mov r1, #0
606606
mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
607607
mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
608608
mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
609609
mcr p15, 0, r1, c7, c10, 4 @ drain WB
610610
mov pc, lr
611611

612-
__armv4_cache_flush:
612+
__armv4_mmu_cache_flush:
613613
mov r2, #64*1024 @ default: 32K dcache size (*2)
614614
mov r11, #32 @ default: 32 byte line size
615615
mrc p15, 0, r3, c0, c0, 1 @ read cache type
@@ -637,7 +637,7 @@ no_cache_id:
637637
mcr p15, 0, r1, c7, c10, 4 @ drain WB
638638
mov pc, lr
639639

640-
__armv3_cache_flush:
640+
__armv3_mmu_cache_flush:
641641
mov r1, #0
642642
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
643643
mov pc, lr

‎arch/arm/kernel/head.S‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
ENTRY(stext)
8282
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
8383
@ and irqs disabled
84+
mrc p15, 0, r9, c0, c0 @ get processor id
8485
bl __lookup_processor_type @ r5=procinfo r9=cpuid
8586
movs r10, r5 @ invalid processor (r5=0)?
8687
beq __error_p @ yes, error 'p'
@@ -155,6 +156,7 @@ ENTRY(secondary_startup)
155156
* as it has already been validated by the primary processor.
156157
*/
157158
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC
159+
mrc p15, 0, r9, c0, c0 @ get processor id
158160
bl __lookup_processor_type
159161
movs r10, r5 @ invalid processor?
160162
moveq r0, #'p' @ yes, error 'p'
@@ -449,19 +451,19 @@ __error:
449451
* (and therefore, we are not in the correct address space). We have to
450452
* calculate the offset.
451453
*
454+
* r9 = cpuid
452455
* Returns:
453456
* r3, r4, r6 corrupted
454457
* r5 = proc_info pointer in physical address space
455-
* r9 = cpuid
458+
* r9 = cpuid (preserved)
456459
*/
457460
.type __lookup_processor_type, %function
458461
__lookup_processor_type:
459462
adr r3, 3f
460-
ldmda r3, {r5, r6, r9}
461-
sub r3, r3, r9 @ get offset between virt&phys
463+
ldmda r3, {r5 - r7}
464+
sub r3, r3, r7 @ get offset between virt&phys
462465
add r5, r5, r3 @ convert virt addresses to
463466
add r6, r6, r3 @ physical address space
464-
mrc p15, 0, r9, c0, c0 @ get processor id
465467
1: ldmia r5, {r3, r4} @ value, mask
466468
and r4, r4, r9 @ mask wanted bits
467469
teq r3, r4
@@ -476,10 +478,11 @@ __lookup_processor_type:
476478
* This provides a C-API version of the above function.
477479
*/
478480
ENTRY(lookup_processor_type)
479-
stmfd sp!, {r4 - r6, r9, lr}
481+
stmfd sp!, {r4 - r7, r9, lr}
482+
mov r9, r0
480483
bl __lookup_processor_type
481484
mov r0, r5
482-
ldmfd sp!, {r4 - r6, r9, pc}
485+
ldmfd sp!, {r4 - r7, r9, pc}
483486

484487
/*
485488
* Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for

‎arch/arm/kernel/setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ int cpu_architecture(void)
278278
* These functions re-use the assembly code in head.S, which
279279
* already provide the required functionality.
280280
*/
281-
extern struct proc_info_list *lookup_processor_type(void);
281+
extern struct proc_info_list *lookup_processor_type(unsigned int);
282282
extern struct machine_desc *lookup_machine_type(unsigned int);
283283

284284
static void __init setup_processor(void)
@@ -290,7 +290,7 @@ static void __init setup_processor(void)
290290
* types. The linker builds this table for us from the
291291
* entries in arch/arm/mm/proc-*.S
292292
*/
293-
list = lookup_processor_type();
293+
list = lookup_processor_type(processor_id);
294294
if (!list) {
295295
printk("CPU configuration botched (ID %08x), unable "
296296
"to continue.\n", processor_id);

‎arch/arm/kernel/sys_arm.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,12 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
234234
*/
235235
asmlinkage int sys_fork(struct pt_regs *regs)
236236
{
237+
#ifdef CONFIG_MMU
237238
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
238243
}
239244

240245
/* Clone a task - this clones the calling program thread.

‎arch/arm/mach-sa1100/assabet.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <asm/irq.h>
2727
#include <asm/setup.h>
2828
#include <asm/page.h>
29+
#include <asm/pgtable-hwdef.h>
2930
#include <asm/pgtable.h>
3031
#include <asm/tlbflush.h>
3132

‎arch/arm/mm/Kconfig‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,18 @@ config CPU_32v6K
266266
# This defines the compiler instruction set which depends on the machine type.
267267
config CPU_32v3
268268
bool
269+
select TLS_REG_EMUL if SMP
270+
select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
269271

270272
config CPU_32v4
271273
bool
274+
select TLS_REG_EMUL if SMP
275+
select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
272276

273277
config CPU_32v5
274278
bool
279+
select TLS_REG_EMUL if SMP
280+
select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
275281

276282
config CPU_32v6
277283
bool
@@ -417,7 +423,6 @@ config CPU_BPREDICT_DISABLE
417423

418424
config TLS_REG_EMUL
419425
bool
420-
default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
421426
help
422427
An SMP system using a pre-ARMv6 processor (there are apparently
423428
a few prototypes like that in existence) and therefore access to
@@ -436,7 +441,6 @@ config HAS_TLS_REG
436441

437442
config NEEDS_SYSCALL_FOR_CMPXCHG
438443
bool
439-
default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
440444
help
441445
SMP on a pre-ARMv6 processor? Well OK then.
442446
Forget about fast user space cmpxchg support.

‎arch/arm/mm/proc-arm1020.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/init.h>
3030
#include <asm/assembler.h>
3131
#include <asm/asm-offsets.h>
32+
#include <asm/pgtable-hwdef.h>
3233
#include <asm/pgtable.h>
3334
#include <asm/procinfo.h>
3435
#include <asm/ptrace.h>

‎arch/arm/mm/proc-arm1020e.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/init.h>
3030
#include <asm/assembler.h>
3131
#include <asm/asm-offsets.h>
32+
#include <asm/pgtable-hwdef.h>
3233
#include <asm/pgtable.h>
3334
#include <asm/procinfo.h>
3435
#include <asm/ptrace.h>

‎arch/arm/mm/proc-arm1022.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/init.h>
1919
#include <asm/assembler.h>
2020
#include <asm/asm-offsets.h>
21+
#include <asm/pgtable-hwdef.h>
2122
#include <asm/pgtable.h>
2223
#include <asm/procinfo.h>
2324
#include <asm/ptrace.h>

‎arch/arm/mm/proc-arm1026.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/init.h>
1919
#include <asm/assembler.h>
2020
#include <asm/asm-offsets.h>
21+
#include <asm/pgtable-hwdef.h>
2122
#include <asm/pgtable.h>
2223
#include <asm/procinfo.h>
2324
#include <asm/ptrace.h>

0 commit comments

Comments
 (0)