Skip to content

Commit a41622e

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 3030/2: fix permission check in the obscur cmpxchg syscall [ARM] nommu: rename compressed/head.S symbols to a new style [ARM] select TLS_REG_EMUL and NEEDS_SYSCALL_FOR_CMPXCHG [ARM] nommu: Move hardware page table definitions to pgtable-hwdef.h [ARM] Move read of processor ID out of lookup_processor_type() [ARM] Fix typo in tlbflush.h [ARM] noMMU: removes TLB codes in nommu mode [ARM] noMMU: block sys_fork in nommu mode [ARM] 3399/1: Fix link problem when CONFIG_PRINTK is disabled [ARM] 3398/1: Fix the VFP registers loading/storing base address [ARM] 3397/1: AT91RM9200 Header update [ARM] 3385/1: Battery support for sharp zaurus sl-5500 (collie) [ARM] SMP: don't set cpu_*_map in smp_prepare_boot_cpu include/linux/clk.h is betraying its ARM origins [ARM] Move enable_irq and disable_irq to assembler.h [ARM] 3391/1: use PLAT8250_DEV_PLATFORM{,1} for platform device id instead of 0/1
2 parents 0b5c59a + 2ce9804 commit a41622e

37 files changed

Lines changed: 597 additions & 168 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/entry-header.S‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,6 @@
3737
#endif
3838
.endm
3939

40-
#if __LINUX_ARM_ARCH__ >= 6
41-
.macro disable_irq
42-
cpsid i
43-
.endm
44-
45-
.macro enable_irq
46-
cpsie i
47-
.endm
48-
#else
49-
.macro disable_irq
50-
msr cpsr_c, #PSR_I_BIT | SVC_MODE
51-
.endm
52-
53-
.macro enable_irq
54-
msr cpsr_c, #SVC_MODE
55-
.endm
56-
#endif
57-
5840
.macro get_thread_info, rd
5941
mov \rd, sp, lsr #13
6042
mov \rd, \rd, lsl #13

‎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/smp.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,6 @@ void __init smp_prepare_boot_cpu(void)
337337
unsigned int cpu = smp_processor_id();
338338

339339
per_cpu(cpu_data, cpu).idle = current;
340-
341-
cpu_set(cpu, cpu_present_map);
342-
cpu_set(cpu, cpu_online_map);
343340
}
344341

345342
static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)

‎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/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
506506
if (!pmd_present(*pmd))
507507
goto bad_access;
508508
pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
509-
if (!pte_present(*pte) || !pte_write(*pte)) {
509+
if (!pte_present(*pte) || !pte_dirty(*pte)) {
510510
pte_unmap_unlock(pte, ptl);
511511
goto bad_access;
512512
}

‎arch/arm/lib/backtrace.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ENTRY(__backtrace)
2929

3030
ENTRY(c_backtrace)
3131

32-
#ifndef CONFIG_FRAME_POINTER
32+
#if !defined(CONFIG_FRAME_POINTER) || !defined(CONFIG_PRINTK)
3333
mov pc, lr
3434
#else
3535

‎arch/arm/mach-iop3xx/iop331-setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ static struct plat_serial8250_port iop33x_uart1_data[] = {
103103

104104
static struct platform_device iop33x_uart0 = {
105105
.name = "serial8250",
106-
.id = 0,
106+
.id = PLAT8250_DEV_PLATFORM,
107107
.dev.platform_data = iop33x_uart0_data,
108108
.num_resources = 2,
109109
.resource = iop33x_uart0_resources,
110110
};
111111

112112
static struct platform_device iop33x_uart1 = {
113113
.name = "serial8250",
114-
.id = 1,
114+
.id = PLAT8250_DEV_PLATFORM1,
115115
.dev.platform_data = iop33x_uart1_data,
116116
.num_resources = 2,
117117
.resource = iop33x_uart1_resources,

‎arch/arm/mach-omap2/serial.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void __init omap_serial_init()
167167

168168
static struct platform_device serial_device = {
169169
.name = "serial8250",
170-
.id = 0,
170+
.id = PLAT8250_DEV_PLATFORM,
171171
.dev = {
172172
.platform_data = serial_platform_data,
173173
},

0 commit comments

Comments
 (0)