aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/armksyms.c4
-rw-r--r--arch/arm/kernel/bios32.c2
-rw-r--r--arch/arm/kernel/crunch.c2
-rw-r--r--arch/arm/kernel/debug.S5
-rw-r--r--arch/arm/kernel/dma-isa.c3
-rw-r--r--arch/arm/kernel/ecard.c6
-rw-r--r--arch/arm/kernel/elf.c79
-rw-r--r--arch/arm/kernel/entry-armv.S16
-rw-r--r--arch/arm/kernel/entry-common.S25
-rw-r--r--arch/arm/kernel/fiq.c1
-rw-r--r--arch/arm/kernel/head-common.S19
-rw-r--r--arch/arm/kernel/head-nommu.S4
-rw-r--r--arch/arm/kernel/head.S12
-rw-r--r--arch/arm/kernel/init_task.c2
-rw-r--r--arch/arm/kernel/io.c3
-rw-r--r--arch/arm/kernel/irq.c11
-rw-r--r--arch/arm/kernel/kgdb.c2
-rw-r--r--arch/arm/kernel/kprobes-decode.c4
-rw-r--r--arch/arm/kernel/kprobes.c5
-rw-r--r--arch/arm/kernel/machine_kexec.c2
-rw-r--r--arch/arm/kernel/module.c2
-rw-r--r--arch/arm/kernel/process.c33
-rw-r--r--arch/arm/kernel/ptrace.c10
-rw-r--r--arch/arm/kernel/setup.c279
-rw-r--r--arch/arm/kernel/signal.c2
-rw-r--r--arch/arm/kernel/smp.c1
-rw-r--r--arch/arm/kernel/sys_arm.c3
-rw-r--r--arch/arm/kernel/sys_oabi-compat.c2
-rw-r--r--arch/arm/kernel/time.c2
-rw-r--r--arch/arm/kernel/traps.c18
-rw-r--r--arch/arm/kernel/xscale-cp0.c2
32 files changed, 237 insertions, 326 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 1d296fc8494e..4305345987d3 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -10,7 +10,7 @@ endif
10 10
11# Object file lists. 11# Object file lists.
12 12
13obj-y := compat.o entry-armv.o entry-common.o irq.o \ 13obj-y := compat.o elf.o entry-armv.o entry-common.o irq.o \
14 process.o ptrace.o setup.o signal.o \ 14 process.o ptrace.o setup.o signal.o \
15 sys_arm.o stacktrace.o time.o traps.o 15 sys_arm.o stacktrace.o time.o traps.o
16 16
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index cc7b246e9652..2357b1cf1cf9 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -13,11 +13,11 @@
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/in6.h> 14#include <linux/in6.h>
15#include <linux/syscalls.h> 15#include <linux/syscalls.h>
16#include <linux/uaccess.h>
17#include <linux/io.h>
16 18
17#include <asm/checksum.h> 19#include <asm/checksum.h>
18#include <asm/io.h>
19#include <asm/system.h> 20#include <asm/system.h>
20#include <asm/uaccess.h>
21#include <asm/ftrace.h> 21#include <asm/ftrace.h>
22 22
23/* 23/*
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index e5747547b44c..17a59b6e521f 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -10,8 +10,8 @@
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/io.h>
13 14
14#include <asm/io.h>
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <asm/mach/pci.h> 16#include <asm/mach/pci.h>
17 17
diff --git a/arch/arm/kernel/crunch.c b/arch/arm/kernel/crunch.c
index 3b6a1c293ee4..99995c2b2312 100644
--- a/arch/arm/kernel/crunch.c
+++ b/arch/arm/kernel/crunch.c
@@ -15,9 +15,9 @@
15#include <linux/signal.h> 15#include <linux/signal.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/io.h>
18#include <mach/ep93xx-regs.h> 19#include <mach/ep93xx-regs.h>
19#include <asm/thread_notify.h> 20#include <asm/thread_notify.h>
20#include <asm/io.h>
21 21
22struct crunch_state *crunch_owner; 22struct crunch_state *crunch_owner;
23 23
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index 9550ff0ddde4..f53c58290543 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -89,10 +89,12 @@
89ENTRY(printhex8) 89ENTRY(printhex8)
90 mov r1, #8 90 mov r1, #8
91 b printhex 91 b printhex
92ENDPROC(printhex8)
92 93
93ENTRY(printhex4) 94ENTRY(printhex4)
94 mov r1, #4 95 mov r1, #4
95 b printhex 96 b printhex
97ENDPROC(printhex4)
96 98
97ENTRY(printhex2) 99ENTRY(printhex2)
98 mov r1, #2 100 mov r1, #2
@@ -110,6 +112,7 @@ printhex: adr r2, hexbuf
110 bne 1b 112 bne 1b
111 mov r0, r2 113 mov r0, r2
112 b printascii 114 b printascii
115ENDPROC(printhex2)
113 116
114 .ltorg 117 .ltorg
115 118
@@ -127,11 +130,13 @@ ENTRY(printascii)
127 teqne r1, #0 130 teqne r1, #0
128 bne 1b 131 bne 1b
129 mov pc, lr 132 mov pc, lr
133ENDPROC(printascii)
130 134
131ENTRY(printch) 135ENTRY(printch)
132 addruart r3 136 addruart r3
133 mov r1, r0 137 mov r1, r0
134 mov r0, #0 138 mov r0, #0
135 b 1b 139 b 1b
140ENDPROC(printch)
136 141
137hexbuf: .space 16 142hexbuf: .space 16
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c
index 2f080a35a2d9..4a3a50495c60 100644
--- a/arch/arm/kernel/dma-isa.c
+++ b/arch/arm/kernel/dma-isa.c
@@ -19,10 +19,9 @@
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
22#include <linux/io.h>
22 23
23#include <asm/dma.h> 24#include <asm/dma.h>
24#include <asm/io.h>
25
26#include <asm/mach/dma.h> 25#include <asm/mach/dma.h>
27 26
28#define ISA_DMA_MODE_READ 0x44 27#define ISA_DMA_MODE_READ 0x44
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 7a50575a8d4d..60c079d85355 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -587,8 +587,7 @@ ecard_irq_handler(unsigned int irq, struct irq_desc *desc)
587 pending = ecard_default_ops.irqpending(ec); 587 pending = ecard_default_ops.irqpending(ec);
588 588
589 if (pending) { 589 if (pending) {
590 struct irq_desc *d = irq_desc + ec->irq; 590 generic_handle_irq(ec->irq);
591 desc_handle_irq(ec->irq, d);
592 called ++; 591 called ++;
593 } 592 }
594 } 593 }
@@ -622,7 +621,6 @@ ecard_irqexp_handler(unsigned int irq, struct irq_desc *desc)
622 ecard_t *ec = slot_to_ecard(slot); 621 ecard_t *ec = slot_to_ecard(slot);
623 622
624 if (ec->claimed) { 623 if (ec->claimed) {
625 struct irq_desc *d = irq_desc + ec->irq;
626 /* 624 /*
627 * this ugly code is so that we can operate a 625 * this ugly code is so that we can operate a
628 * prioritorising system: 626 * prioritorising system:
@@ -635,7 +633,7 @@ ecard_irqexp_handler(unsigned int irq, struct irq_desc *desc)
635 * Serial cards should go in 0/1, ethernet/scsi in 2/3 633 * Serial cards should go in 0/1, ethernet/scsi in 2/3
636 * otherwise you will lose serial data at high speeds! 634 * otherwise you will lose serial data at high speeds!
637 */ 635 */
638 desc_handle_irq(ec->irq, d); 636 generic_handle_irq(ec->irq);
639 } else { 637 } else {
640 printk(KERN_WARNING "card%d: interrupt from unclaimed " 638 printk(KERN_WARNING "card%d: interrupt from unclaimed "
641 "card???\n", slot); 639 "card???\n", slot);
diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c
new file mode 100644
index 000000000000..513f332f040d
--- /dev/null
+++ b/arch/arm/kernel/elf.c
@@ -0,0 +1,79 @@
1#include <linux/module.h>
2#include <linux/sched.h>
3#include <linux/personality.h>
4#include <linux/binfmts.h>
5#include <linux/elf.h>
6
7int elf_check_arch(const struct elf32_hdr *x)
8{
9 unsigned int eflags;
10
11 /* Make sure it's an ARM executable */
12 if (x->e_machine != EM_ARM)
13 return 0;
14
15 /* Make sure the entry address is reasonable */
16 if (x->e_entry & 1) {
17 if (!(elf_hwcap & HWCAP_THUMB))
18 return 0;
19 } else if (x->e_entry & 3)
20 return 0;
21
22 eflags = x->e_flags;
23 if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN) {
24 /* APCS26 is only allowed if the CPU supports it */
25 if ((eflags & EF_ARM_APCS_26) && !(elf_hwcap & HWCAP_26BIT))
26 return 0;
27
28 /* VFP requires the supporting code */
29 if ((eflags & EF_ARM_VFP_FLOAT) && !(elf_hwcap & HWCAP_VFP))
30 return 0;
31 }
32 return 1;
33}
34EXPORT_SYMBOL(elf_check_arch);
35
36void elf_set_personality(const struct elf32_hdr *x)
37{
38 unsigned int eflags = x->e_flags;
39 unsigned int personality = PER_LINUX_32BIT;
40
41 /*
42 * APCS-26 is only valid for OABI executables
43 */
44 if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN) {
45 if (eflags & EF_ARM_APCS_26)
46 personality = PER_LINUX;
47 }
48
49 set_personality(personality);
50
51 /*
52 * Since the FPA coprocessor uses CP1 and CP2, and iWMMXt uses CP0
53 * and CP1, we only enable access to the iWMMXt coprocessor if the
54 * binary is EABI or softfloat (and thus, guaranteed not to use
55 * FPA instructions.)
56 */
57 if (elf_hwcap & HWCAP_IWMMXT &&
58 eflags & (EF_ARM_EABI_MASK | EF_ARM_SOFT_FLOAT)) {
59 set_thread_flag(TIF_USING_IWMMXT);
60 } else {
61 clear_thread_flag(TIF_USING_IWMMXT);
62 }
63}
64EXPORT_SYMBOL(elf_set_personality);
65
66/*
67 * Set READ_IMPLIES_EXEC if:
68 * - the binary requires an executable stack
69 * - we're running on a CPU which doesn't support NX.
70 */
71int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack)
72{
73 if (executable_stack != EXSTACK_ENABLE_X)
74 return 1;
75 if (cpu_architecture() <= CPU_ARCH_ARMv6)
76 return 1;
77 return 0;
78}
79EXPORT_SYMBOL(arm_elf_read_implies_exec);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 617e509d60df..77b047475539 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -76,14 +76,17 @@
76__pabt_invalid: 76__pabt_invalid:
77 inv_entry BAD_PREFETCH 77 inv_entry BAD_PREFETCH
78 b common_invalid 78 b common_invalid
79ENDPROC(__pabt_invalid)
79 80
80__dabt_invalid: 81__dabt_invalid:
81 inv_entry BAD_DATA 82 inv_entry BAD_DATA
82 b common_invalid 83 b common_invalid
84ENDPROC(__dabt_invalid)
83 85
84__irq_invalid: 86__irq_invalid:
85 inv_entry BAD_IRQ 87 inv_entry BAD_IRQ
86 b common_invalid 88 b common_invalid
89ENDPROC(__irq_invalid)
87 90
88__und_invalid: 91__und_invalid:
89 inv_entry BAD_UNDEFINSTR 92 inv_entry BAD_UNDEFINSTR
@@ -107,6 +110,7 @@ common_invalid:
107 110
108 mov r0, sp 111 mov r0, sp
109 b bad_mode 112 b bad_mode
113ENDPROC(__und_invalid)
110 114
111/* 115/*
112 * SVC mode handlers 116 * SVC mode handlers
@@ -192,6 +196,7 @@ __dabt_svc:
192 ldr r0, [sp, #S_PSR] 196 ldr r0, [sp, #S_PSR]
193 msr spsr_cxsf, r0 197 msr spsr_cxsf, r0
194 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 198 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
199ENDPROC(__dabt_svc)
195 200
196 .align 5 201 .align 5
197__irq_svc: 202__irq_svc:
@@ -223,6 +228,7 @@ __irq_svc:
223 bleq trace_hardirqs_on 228 bleq trace_hardirqs_on
224#endif 229#endif
225 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 230 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
231ENDPROC(__irq_svc)
226 232
227 .ltorg 233 .ltorg
228 234
@@ -272,6 +278,7 @@ __und_svc:
272 ldr lr, [sp, #S_PSR] @ Get SVC cpsr 278 ldr lr, [sp, #S_PSR] @ Get SVC cpsr
273 msr spsr_cxsf, lr 279 msr spsr_cxsf, lr
274 ldmia sp, {r0 - pc}^ @ Restore SVC registers 280 ldmia sp, {r0 - pc}^ @ Restore SVC registers
281ENDPROC(__und_svc)
275 282
276 .align 5 283 .align 5
277__pabt_svc: 284__pabt_svc:
@@ -313,6 +320,7 @@ __pabt_svc:
313 ldr r0, [sp, #S_PSR] 320 ldr r0, [sp, #S_PSR]
314 msr spsr_cxsf, r0 321 msr spsr_cxsf, r0
315 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 322 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
323ENDPROC(__pabt_svc)
316 324
317 .align 5 325 .align 5
318.LCcralign: 326.LCcralign:
@@ -412,6 +420,7 @@ __dabt_usr:
412 mov r2, sp 420 mov r2, sp
413 adr lr, ret_from_exception 421 adr lr, ret_from_exception
414 b do_DataAbort 422 b do_DataAbort
423ENDPROC(__dabt_usr)
415 424
416 .align 5 425 .align 5
417__irq_usr: 426__irq_usr:
@@ -441,6 +450,7 @@ __irq_usr:
441 450
442 mov why, #0 451 mov why, #0
443 b ret_to_user 452 b ret_to_user
453ENDPROC(__irq_usr)
444 454
445 .ltorg 455 .ltorg
446 456
@@ -474,6 +484,7 @@ __und_usr:
474#else 484#else
475 b __und_usr_unknown 485 b __und_usr_unknown
476#endif 486#endif
487ENDPROC(__und_usr)
477 488
478 @ 489 @
479 @ fallthrough to call_fpe 490 @ fallthrough to call_fpe
@@ -642,6 +653,7 @@ __und_usr_unknown:
642 mov r0, sp 653 mov r0, sp
643 adr lr, ret_from_exception 654 adr lr, ret_from_exception
644 b do_undefinstr 655 b do_undefinstr
656ENDPROC(__und_usr_unknown)
645 657
646 .align 5 658 .align 5
647__pabt_usr: 659__pabt_usr:
@@ -666,6 +678,8 @@ ENTRY(ret_from_exception)
666 get_thread_info tsk 678 get_thread_info tsk
667 mov why, #0 679 mov why, #0
668 b ret_to_user 680 b ret_to_user
681ENDPROC(__pabt_usr)
682ENDPROC(ret_from_exception)
669 683
670/* 684/*
671 * Register switch for ARMv3 and ARMv4 processors 685 * Register switch for ARMv3 and ARMv4 processors
@@ -702,6 +716,7 @@ ENTRY(__switch_to)
702 bl atomic_notifier_call_chain 716 bl atomic_notifier_call_chain
703 mov r0, r5 717 mov r0, r5
704 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously 718 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously
719ENDPROC(__switch_to)
705 720
706 __INIT 721 __INIT
707 722
@@ -1029,6 +1044,7 @@ vector_\name:
1029 mov r0, sp 1044 mov r0, sp
1030 ldr lr, [pc, lr, lsl #2] 1045 ldr lr, [pc, lr, lsl #2]
1031 movs pc, lr @ branch to handler in SVC mode 1046 movs pc, lr @ branch to handler in SVC mode
1047ENDPROC(vector_\name)
1032 .endm 1048 .endm
1033 1049
1034 .globl __stubs_start 1050 .globl __stubs_start
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 060d7e2e9f64..3aa14dcc5bab 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -77,6 +77,7 @@ no_work_pending:
77 mov r0, r0 77 mov r0, r0
78 add sp, sp, #S_FRAME_SIZE - S_PC 78 add sp, sp, #S_FRAME_SIZE - S_PC
79 movs pc, lr @ return & move spsr_svc into cpsr 79 movs pc, lr @ return & move spsr_svc into cpsr
80ENDPROC(ret_to_user)
80 81
81/* 82/*
82 * This is how we return from a fork. 83 * This is how we return from a fork.
@@ -92,7 +93,7 @@ ENTRY(ret_from_fork)
92 mov r0, #1 @ trace exit [IP = 1] 93 mov r0, #1 @ trace exit [IP = 1]
93 bl syscall_trace 94 bl syscall_trace
94 b ret_slow_syscall 95 b ret_slow_syscall
95 96ENDPROC(ret_from_fork)
96 97
97 .equ NR_syscalls,0 98 .equ NR_syscalls,0
98#define CALL(x) .equ NR_syscalls,NR_syscalls+1 99#define CALL(x) .equ NR_syscalls,NR_syscalls+1
@@ -269,6 +270,7 @@ ENTRY(vector_swi)
269 eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back 270 eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back
270 bcs arm_syscall 271 bcs arm_syscall
271 b sys_ni_syscall @ not private func 272 b sys_ni_syscall @ not private func
273ENDPROC(vector_swi)
272 274
273 /* 275 /*
274 * This is the really slow path. We're going to be doing 276 * This is the really slow path. We're going to be doing
@@ -326,7 +328,6 @@ ENTRY(sys_call_table)
326 */ 328 */
327@ r0 = syscall number 329@ r0 = syscall number
328@ r8 = syscall table 330@ r8 = syscall table
329 .type sys_syscall, #function
330sys_syscall: 331sys_syscall:
331 bic scno, r0, #__NR_OABI_SYSCALL_BASE 332 bic scno, r0, #__NR_OABI_SYSCALL_BASE
332 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE 333 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE
@@ -338,53 +339,65 @@ sys_syscall:
338 movlo r3, r4 339 movlo r3, r4
339 ldrlo pc, [tbl, scno, lsl #2] 340 ldrlo pc, [tbl, scno, lsl #2]
340 b sys_ni_syscall 341 b sys_ni_syscall
342ENDPROC(sys_syscall)
341 343
342sys_fork_wrapper: 344sys_fork_wrapper:
343 add r0, sp, #S_OFF 345 add r0, sp, #S_OFF
344 b sys_fork 346 b sys_fork
347ENDPROC(sys_fork_wrapper)
345 348
346sys_vfork_wrapper: 349sys_vfork_wrapper:
347 add r0, sp, #S_OFF 350 add r0, sp, #S_OFF
348 b sys_vfork 351 b sys_vfork
352ENDPROC(sys_vfork_wrapper)
349 353
350sys_execve_wrapper: 354sys_execve_wrapper:
351 add r3, sp, #S_OFF 355 add r3, sp, #S_OFF
352 b sys_execve 356 b sys_execve
357ENDPROC(sys_execve_wrapper)
353 358
354sys_clone_wrapper: 359sys_clone_wrapper:
355 add ip, sp, #S_OFF 360 add ip, sp, #S_OFF
356 str ip, [sp, #4] 361 str ip, [sp, #4]
357 b sys_clone 362 b sys_clone
363ENDPROC(sys_clone_wrapper)
358 364
359sys_sigsuspend_wrapper: 365sys_sigsuspend_wrapper:
360 add r3, sp, #S_OFF 366 add r3, sp, #S_OFF
361 b sys_sigsuspend 367 b sys_sigsuspend
368ENDPROC(sys_sigsuspend_wrapper)
362 369
363sys_rt_sigsuspend_wrapper: 370sys_rt_sigsuspend_wrapper:
364 add r2, sp, #S_OFF 371 add r2, sp, #S_OFF
365 b sys_rt_sigsuspend 372 b sys_rt_sigsuspend
373ENDPROC(sys_rt_sigsuspend_wrapper)
366 374
367sys_sigreturn_wrapper: 375sys_sigreturn_wrapper:
368 add r0, sp, #S_OFF 376 add r0, sp, #S_OFF
369 b sys_sigreturn 377 b sys_sigreturn
378ENDPROC(sys_sigreturn_wrapper)
370 379
371sys_rt_sigreturn_wrapper: 380sys_rt_sigreturn_wrapper:
372 add r0, sp, #S_OFF 381 add r0, sp, #S_OFF
373 b sys_rt_sigreturn 382 b sys_rt_sigreturn
383ENDPROC(sys_rt_sigreturn_wrapper)
374 384
375sys_sigaltstack_wrapper: 385sys_sigaltstack_wrapper:
376 ldr r2, [sp, #S_OFF + S_SP] 386 ldr r2, [sp, #S_OFF + S_SP]
377 b do_sigaltstack 387 b do_sigaltstack
388ENDPROC(sys_sigaltstack_wrapper)
378 389
379sys_statfs64_wrapper: 390sys_statfs64_wrapper:
380 teq r1, #88 391 teq r1, #88
381 moveq r1, #84 392 moveq r1, #84
382 b sys_statfs64 393 b sys_statfs64
394ENDPROC(sys_statfs64_wrapper)
383 395
384sys_fstatfs64_wrapper: 396sys_fstatfs64_wrapper:
385 teq r1, #88 397 teq r1, #88
386 moveq r1, #84 398 moveq r1, #84
387 b sys_fstatfs64 399 b sys_fstatfs64
400ENDPROC(sys_fstatfs64_wrapper)
388 401
389/* 402/*
390 * Note: off_4k (r5) is always units of 4K. If we can't do the requested 403 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
@@ -402,11 +415,14 @@ sys_mmap2:
402 str r5, [sp, #4] 415 str r5, [sp, #4]
403 b do_mmap2 416 b do_mmap2
404#endif 417#endif
418ENDPROC(sys_mmap2)
405 419
406ENTRY(pabort_ifar) 420ENTRY(pabort_ifar)
407 mrc p15, 0, r0, cr6, cr0, 2 421 mrc p15, 0, r0, cr6, cr0, 2
408ENTRY(pabort_noifar) 422ENTRY(pabort_noifar)
409 mov pc, lr 423 mov pc, lr
424ENDPROC(pabort_ifar)
425ENDPROC(pabort_noifar)
410 426
411#ifdef CONFIG_OABI_COMPAT 427#ifdef CONFIG_OABI_COMPAT
412 428
@@ -417,26 +433,31 @@ ENTRY(pabort_noifar)
417sys_oabi_pread64: 433sys_oabi_pread64:
418 stmia sp, {r3, r4} 434 stmia sp, {r3, r4}
419 b sys_pread64 435 b sys_pread64
436ENDPROC(sys_oabi_pread64)
420 437
421sys_oabi_pwrite64: 438sys_oabi_pwrite64:
422 stmia sp, {r3, r4} 439 stmia sp, {r3, r4}
423 b sys_pwrite64 440 b sys_pwrite64
441ENDPROC(sys_oabi_pwrite64)
424 442
425sys_oabi_truncate64: 443sys_oabi_truncate64:
426 mov r3, r2 444 mov r3, r2
427 mov r2, r1 445 mov r2, r1
428 b sys_truncate64 446 b sys_truncate64
447ENDPROC(sys_oabi_truncate64)
429 448
430sys_oabi_ftruncate64: 449sys_oabi_ftruncate64:
431 mov r3, r2 450 mov r3, r2
432 mov r2, r1 451 mov r2, r1
433 b sys_ftruncate64 452 b sys_ftruncate64
453ENDPROC(sys_oabi_ftruncate64)
434 454
435sys_oabi_readahead: 455sys_oabi_readahead:
436 str r3, [sp] 456 str r3, [sp]
437 mov r3, r2 457 mov r3, r2
438 mov r2, r1 458 mov r2, r1
439 b sys_readahead 459 b sys_readahead
460ENDPROC(sys_oabi_readahead)
440 461
441/* 462/*
442 * Let's declare a second syscall table for old ABI binaries 463 * Let's declare a second syscall table for old ABI binaries
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index e8e90346f11c..36f81d967979 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -45,7 +45,6 @@
45#include <asm/fiq.h> 45#include <asm/fiq.h>
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/system.h> 47#include <asm/system.h>
48#include <asm/uaccess.h>
49 48
50static unsigned long no_fiq_insn; 49static unsigned long no_fiq_insn;
51 50
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 1c3c6ea5f9e7..bde52df1c668 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -36,7 +36,6 @@ __switch_data:
36 * r2 = atags pointer 36 * r2 = atags pointer
37 * r9 = processor ID 37 * r9 = processor ID
38 */ 38 */
39 .type __mmap_switched, %function
40__mmap_switched: 39__mmap_switched:
41 adr r3, __switch_data + 4 40 adr r3, __switch_data + 4
42 41
@@ -59,6 +58,7 @@ __mmap_switched:
59 bic r4, r0, #CR_A @ Clear 'A' bit 58 bic r4, r0, #CR_A @ Clear 'A' bit
60 stmia r7, {r0, r4} @ Save control register values 59 stmia r7, {r0, r4} @ Save control register values
61 b start_kernel 60 b start_kernel
61ENDPROC(__mmap_switched)
62 62
63/* 63/*
64 * Exception handling. Something went wrong and we can't proceed. We 64 * Exception handling. Something went wrong and we can't proceed. We
@@ -69,8 +69,6 @@ __mmap_switched:
69 * and hope for the best (useful if bootloader fails to pass a proper 69 * and hope for the best (useful if bootloader fails to pass a proper
70 * machine ID for example). 70 * machine ID for example).
71 */ 71 */
72
73 .type __error_p, %function
74__error_p: 72__error_p:
75#ifdef CONFIG_DEBUG_LL 73#ifdef CONFIG_DEBUG_LL
76 adr r0, str_p1 74 adr r0, str_p1
@@ -84,8 +82,8 @@ str_p1: .asciz "\nError: unrecognized/unsupported processor variant (0x"
84str_p2: .asciz ").\n" 82str_p2: .asciz ").\n"
85 .align 83 .align
86#endif 84#endif
85ENDPROC(__error_p)
87 86
88 .type __error_a, %function
89__error_a: 87__error_a:
90#ifdef CONFIG_DEBUG_LL 88#ifdef CONFIG_DEBUG_LL
91 mov r4, r1 @ preserve machine ID 89 mov r4, r1 @ preserve machine ID
@@ -115,13 +113,14 @@ __error_a:
115 adr r0, str_a3 113 adr r0, str_a3
116 bl printascii 114 bl printascii
117 b __error 115 b __error
116ENDPROC(__error_a)
117
118str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x" 118str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
119str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n" 119str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
120str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n" 120str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
121 .align 121 .align
122#endif 122#endif
123 123
124 .type __error, %function
125__error: 124__error:
126#ifdef CONFIG_ARCH_RPC 125#ifdef CONFIG_ARCH_RPC
127/* 126/*
@@ -138,6 +137,7 @@ __error:
138#endif 137#endif
1391: mov r0, r0 1381: mov r0, r0
140 b 1b 139 b 1b
140ENDPROC(__error)
141 141
142 142
143/* 143/*
@@ -153,7 +153,6 @@ __error:
153 * r5 = proc_info pointer in physical address space 153 * r5 = proc_info pointer in physical address space
154 * r9 = cpuid (preserved) 154 * r9 = cpuid (preserved)
155 */ 155 */
156 .type __lookup_processor_type, %function
157__lookup_processor_type: 156__lookup_processor_type:
158 adr r3, 3f 157 adr r3, 3f
159 ldmda r3, {r5 - r7} 158 ldmda r3, {r5 - r7}
@@ -169,6 +168,7 @@ __lookup_processor_type:
169 blo 1b 168 blo 1b
170 mov r5, #0 @ unknown processor 169 mov r5, #0 @ unknown processor
1712: mov pc, lr 1702: mov pc, lr
171ENDPROC(__lookup_processor_type)
172 172
173/* 173/*
174 * This provides a C-API version of the above function. 174 * This provides a C-API version of the above function.
@@ -179,6 +179,7 @@ ENTRY(lookup_processor_type)
179 bl __lookup_processor_type 179 bl __lookup_processor_type
180 mov r0, r5 180 mov r0, r5
181 ldmfd sp!, {r4 - r7, r9, pc} 181 ldmfd sp!, {r4 - r7, r9, pc}
182ENDPROC(lookup_processor_type)
182 183
183/* 184/*
184 * Look in <asm/procinfo.h> and arch/arm/kernel/arch.[ch] for 185 * Look in <asm/procinfo.h> and arch/arm/kernel/arch.[ch] for
@@ -201,7 +202,6 @@ ENTRY(lookup_processor_type)
201 * r3, r4, r6 corrupted 202 * r3, r4, r6 corrupted
202 * r5 = mach_info pointer in physical address space 203 * r5 = mach_info pointer in physical address space
203 */ 204 */
204 .type __lookup_machine_type, %function
205__lookup_machine_type: 205__lookup_machine_type:
206 adr r3, 3b 206 adr r3, 3b
207 ldmia r3, {r4, r5, r6} 207 ldmia r3, {r4, r5, r6}
@@ -216,6 +216,7 @@ __lookup_machine_type:
216 blo 1b 216 blo 1b
217 mov r5, #0 @ unknown machine 217 mov r5, #0 @ unknown machine
2182: mov pc, lr 2182: mov pc, lr
219ENDPROC(__lookup_machine_type)
219 220
220/* 221/*
221 * This provides a C-API version of the above function. 222 * This provides a C-API version of the above function.
@@ -226,6 +227,7 @@ ENTRY(lookup_machine_type)
226 bl __lookup_machine_type 227 bl __lookup_machine_type
227 mov r0, r5 228 mov r0, r5
228 ldmfd sp!, {r4 - r6, pc} 229 ldmfd sp!, {r4 - r6, pc}
230ENDPROC(lookup_machine_type)
229 231
230/* Determine validity of the r2 atags pointer. The heuristic requires 232/* Determine validity of the r2 atags pointer. The heuristic requires
231 * that the pointer be aligned, in the first 16k of physical RAM and 233 * that the pointer be aligned, in the first 16k of physical RAM and
@@ -239,8 +241,6 @@ ENTRY(lookup_machine_type)
239 * r2 either valid atags pointer, or zero 241 * r2 either valid atags pointer, or zero
240 * r5, r6 corrupted 242 * r5, r6 corrupted
241 */ 243 */
242
243 .type __vet_atags, %function
244__vet_atags: 244__vet_atags:
245 tst r2, #0x3 @ aligned? 245 tst r2, #0x3 @ aligned?
246 bne 1f 246 bne 1f
@@ -257,3 +257,4 @@ __vet_atags:
257 257
2581: mov r2, #0 2581: mov r2, #0
259 mov pc, lr 259 mov pc, lr
260ENDPROC(__vet_atags)
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 27329bd32037..cc87e1765ed2 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -33,7 +33,6 @@
33 * 33 *
34 */ 34 */
35 .section ".text.head", "ax" 35 .section ".text.head", "ax"
36 .type stext, %function
37ENTRY(stext) 36ENTRY(stext)
38 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode 37 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
39 @ and irqs disabled 38 @ and irqs disabled
@@ -53,11 +52,11 @@ ENTRY(stext)
53 @ the initialization is done 52 @ the initialization is done
54 adr lr, __after_proc_init @ return (PIC) address 53 adr lr, __after_proc_init @ return (PIC) address
55 add pc, r10, #PROCINFO_INITFUNC 54 add pc, r10, #PROCINFO_INITFUNC
55ENDPROC(stext)
56 56
57/* 57/*
58 * Set the Control Register and Read the process ID. 58 * Set the Control Register and Read the process ID.
59 */ 59 */
60 .type __after_proc_init, %function
61__after_proc_init: 60__after_proc_init:
62#ifdef CONFIG_CPU_CP15 61#ifdef CONFIG_CPU_CP15
63 mrc p15, 0, r0, c1, c0, 0 @ read control reg 62 mrc p15, 0, r0, c1, c0, 0 @ read control reg
@@ -85,6 +84,7 @@ __after_proc_init:
85 84
86 mov pc, r13 @ clear the BSS and jump 85 mov pc, r13 @ clear the BSS and jump
87 @ to start_kernel 86 @ to start_kernel
87ENDPROC(__after_proc_init)
88 .ltorg 88 .ltorg
89 89
90#include "head-common.S" 90#include "head-common.S"
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index bff4c6e90dd5..21e17dc94cb5 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -75,7 +75,6 @@
75 * circumstances, zImage) is for. 75 * circumstances, zImage) is for.
76 */ 76 */
77 .section ".text.head", "ax" 77 .section ".text.head", "ax"
78 .type stext, %function
79ENTRY(stext) 78ENTRY(stext)
80 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode 79 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
81 @ and irqs disabled 80 @ and irqs disabled
@@ -100,9 +99,9 @@ ENTRY(stext)
100 @ mmu has been enabled 99 @ mmu has been enabled
101 adr lr, __enable_mmu @ return (PIC) address 100 adr lr, __enable_mmu @ return (PIC) address
102 add pc, r10, #PROCINFO_INITFUNC 101 add pc, r10, #PROCINFO_INITFUNC
102ENDPROC(stext)
103 103
104#if defined(CONFIG_SMP) 104#if defined(CONFIG_SMP)
105 .type secondary_startup, #function
106ENTRY(secondary_startup) 105ENTRY(secondary_startup)
107 /* 106 /*
108 * Common entry point for secondary CPUs. 107 * Common entry point for secondary CPUs.
@@ -128,6 +127,7 @@ ENTRY(secondary_startup)
128 adr lr, __enable_mmu @ return address 127 adr lr, __enable_mmu @ return address
129 add pc, r10, #PROCINFO_INITFUNC @ initialise processor 128 add pc, r10, #PROCINFO_INITFUNC @ initialise processor
130 @ (return control reg) 129 @ (return control reg)
130ENDPROC(secondary_startup)
131 131
132 /* 132 /*
133 * r6 = &secondary_data 133 * r6 = &secondary_data
@@ -136,6 +136,7 @@ ENTRY(__secondary_switched)
136 ldr sp, [r7, #4] @ get secondary_data.stack 136 ldr sp, [r7, #4] @ get secondary_data.stack
137 mov fp, #0 137 mov fp, #0
138 b secondary_start_kernel 138 b secondary_start_kernel
139ENDPROC(__secondary_switched)
139 140
140 .type __secondary_data, %object 141 .type __secondary_data, %object
141__secondary_data: 142__secondary_data:
@@ -151,7 +152,6 @@ __secondary_data:
151 * this is just loading the page table pointer and domain access 152 * this is just loading the page table pointer and domain access
152 * registers. 153 * registers.
153 */ 154 */
154 .type __enable_mmu, %function
155__enable_mmu: 155__enable_mmu:
156#ifdef CONFIG_ALIGNMENT_TRAP 156#ifdef CONFIG_ALIGNMENT_TRAP
157 orr r0, r0, #CR_A 157 orr r0, r0, #CR_A
@@ -174,6 +174,7 @@ __enable_mmu:
174 mcr p15, 0, r5, c3, c0, 0 @ load domain access register 174 mcr p15, 0, r5, c3, c0, 0 @ load domain access register
175 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer 175 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
176 b __turn_mmu_on 176 b __turn_mmu_on
177ENDPROC(__enable_mmu)
177 178
178/* 179/*
179 * Enable the MMU. This completely changes the structure of the visible 180 * Enable the MMU. This completely changes the structure of the visible
@@ -187,7 +188,6 @@ __enable_mmu:
187 * other registers depend on the function called upon completion 188 * other registers depend on the function called upon completion
188 */ 189 */
189 .align 5 190 .align 5
190 .type __turn_mmu_on, %function
191__turn_mmu_on: 191__turn_mmu_on:
192 mov r0, r0 192 mov r0, r0
193 mcr p15, 0, r0, c1, c0, 0 @ write control reg 193 mcr p15, 0, r0, c1, c0, 0 @ write control reg
@@ -195,7 +195,7 @@ __turn_mmu_on:
195 mov r3, r3 195 mov r3, r3
196 mov r3, r3 196 mov r3, r3
197 mov pc, r13 197 mov pc, r13
198 198ENDPROC(__turn_mmu_on)
199 199
200 200
201/* 201/*
@@ -211,7 +211,6 @@ __turn_mmu_on:
211 * r0, r3, r6, r7 corrupted 211 * r0, r3, r6, r7 corrupted
212 * r4 = physical page table address 212 * r4 = physical page table address
213 */ 213 */
214 .type __create_page_tables, %function
215__create_page_tables: 214__create_page_tables:
216 pgtbl r4 @ page table address 215 pgtbl r4 @ page table address
217 216
@@ -325,6 +324,7 @@ __create_page_tables:
325#endif 324#endif
326#endif 325#endif
327 mov pc, lr 326 mov pc, lr
327ENDPROC(__create_page_tables)
328 .ltorg 328 .ltorg
329 329
330#include "head-common.S" 330#include "head-common.S"
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index 8b8c9d38a761..0bbf80625395 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -8,8 +8,8 @@
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/init_task.h> 9#include <linux/init_task.h>
10#include <linux/mqueue.h> 10#include <linux/mqueue.h>
11#include <linux/uaccess.h>
11 12
12#include <asm/uaccess.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable.h>
14 14
15static struct fs_struct init_fs = INIT_FS; 15static struct fs_struct init_fs = INIT_FS;
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
index 1f6822dfae74..f4470307edb8 100644
--- a/arch/arm/kernel/io.c
+++ b/arch/arm/kernel/io.c
@@ -1,7 +1,6 @@
1#include <linux/module.h> 1#include <linux/module.h>
2#include <linux/types.h> 2#include <linux/types.h>
3 3#include <linux/io.h>
4#include <asm/io.h>
5 4
6/* 5/*
7 * Copy data from IO memory space to "real" memory space. 6 * Copy data from IO memory space to "real" memory space.
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index f88efb135b70..2f3eb795fa6e 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -112,18 +112,17 @@ static struct irq_desc bad_irq_desc = {
112asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs) 112asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
113{ 113{
114 struct pt_regs *old_regs = set_irq_regs(regs); 114 struct pt_regs *old_regs = set_irq_regs(regs);
115 struct irq_desc *desc = irq_desc + irq; 115
116 irq_enter();
116 117
117 /* 118 /*
118 * Some hardware gives randomly wrong interrupts. Rather 119 * Some hardware gives randomly wrong interrupts. Rather
119 * than crashing, do something sensible. 120 * than crashing, do something sensible.
120 */ 121 */
121 if (irq >= NR_IRQS) 122 if (irq >= NR_IRQS)
122 desc = &bad_irq_desc; 123 handle_bad_irq(irq, &bad_irq_desc);
123 124 else
124 irq_enter(); 125 generic_handle_irq(irq);
125
126 desc_handle_irq(irq, desc);
127 126
128 /* AT91 specific workaround */ 127 /* AT91 specific workaround */
129 irq_finish(irq); 128 irq_finish(irq);
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c
index aaffaecffcd1..ba8ccfede964 100644
--- a/arch/arm/kernel/kgdb.c
+++ b/arch/arm/kernel/kgdb.c
@@ -111,8 +111,6 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,
111 case 'D': 111 case 'D':
112 case 'k': 112 case 'k':
113 case 'c': 113 case 'c':
114 kgdb_contthread = NULL;
115
116 /* 114 /*
117 * Try to read optional parameter, pc unchanged if no parm. 115 * Try to read optional parameter, pc unchanged if no parm.
118 * If this was a compiled breakpoint, we need to move 116 * If this was a compiled breakpoint, we need to move
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index b4565bb133c1..da1f94906a4e 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -488,7 +488,7 @@ static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs)
488 488
489 if (!ubit) 489 if (!ubit)
490 addr -= reg_count; 490 addr -= reg_count;
491 addr += (!pbit ^ !ubit); 491 addr += (!pbit == !ubit);
492 492
493 reg_bit_vector = insn & 0xffff; 493 reg_bit_vector = insn & 0xffff;
494 while (reg_bit_vector) { 494 while (reg_bit_vector) {
@@ -503,7 +503,7 @@ static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs)
503 if (wbit) { 503 if (wbit) {
504 if (!ubit) 504 if (!ubit)
505 addr -= reg_count; 505 addr -= reg_count;
506 addr -= (!pbit ^ !ubit); 506 addr -= (!pbit == !ubit);
507 regs->uregs[rn] = (long)addr; 507 regs->uregs[rn] = (long)addr;
508 } 508 }
509} 509}
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index d28513f14d05..3f9abe0e9aff 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -200,9 +200,12 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
200 } 200 }
201} 201}
202 202
203int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr) 203static int __kprobes kprobe_trap_handler(struct pt_regs *regs, unsigned int instr)
204{ 204{
205 unsigned long flags;
206 local_irq_save(flags);
205 kprobe_handler(regs); 207 kprobe_handler(regs);
208 local_irq_restore(flags);
206 return 0; 209 return 0;
207} 210}
208 211
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index fae5beb3c3d6..440dc62cdc3a 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -6,10 +6,10 @@
6#include <linux/kexec.h> 6#include <linux/kexec.h>
7#include <linux/delay.h> 7#include <linux/delay.h>
8#include <linux/reboot.h> 8#include <linux/reboot.h>
9#include <linux/io.h>
9#include <asm/pgtable.h> 10#include <asm/pgtable.h>
10#include <asm/pgalloc.h> 11#include <asm/pgalloc.h>
11#include <asm/mmu_context.h> 12#include <asm/mmu_context.h>
12#include <asm/io.h>
13#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15 15
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index a68259a0cccd..9203ba7d58ee 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -47,7 +47,7 @@ void *module_alloc(unsigned long size)
47 if (!area) 47 if (!area)
48 return NULL; 48 return NULL;
49 49
50 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL); 50 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
51} 51}
52#else /* CONFIG_MMU */ 52#else /* CONFIG_MMU */
53void *module_alloc(unsigned long size) 53void *module_alloc(unsigned long size)
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 3fd882337064..d3ea6fa89521 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -28,12 +28,12 @@
28#include <linux/pm.h> 28#include <linux/pm.h>
29#include <linux/tick.h> 29#include <linux/tick.h>
30#include <linux/utsname.h> 30#include <linux/utsname.h>
31#include <linux/uaccess.h>
31 32
32#include <asm/leds.h> 33#include <asm/leds.h>
33#include <asm/processor.h> 34#include <asm/processor.h>
34#include <asm/system.h> 35#include <asm/system.h>
35#include <asm/thread_notify.h> 36#include <asm/thread_notify.h>
36#include <asm/uaccess.h>
37#include <asm/mach/time.h> 37#include <asm/mach/time.h>
38 38
39static const char *processor_modes[] = { 39static const char *processor_modes[] = {
@@ -267,35 +267,6 @@ void show_regs(struct pt_regs * regs)
267 __backtrace(); 267 __backtrace();
268} 268}
269 269
270void show_fpregs(struct user_fp *regs)
271{
272 int i;
273
274 for (i = 0; i < 8; i++) {
275 unsigned long *p;
276 char type;
277
278 p = (unsigned long *)(regs->fpregs + i);
279
280 switch (regs->ftype[i]) {
281 case 1: type = 'f'; break;
282 case 2: type = 'd'; break;
283 case 3: type = 'e'; break;
284 default: type = '?'; break;
285 }
286 if (regs->init_flag)
287 type = '?';
288
289 printk(" f%d(%c): %08lx %08lx %08lx%c",
290 i, type, p[0], p[1], p[2], i & 1 ? '\n' : ' ');
291 }
292
293
294 printk("FPSR: %08lx FPCR: %08lx\n",
295 (unsigned long)regs->fpsr,
296 (unsigned long)regs->fpcr);
297}
298
299/* 270/*
300 * Free current thread data structures etc.. 271 * Free current thread data structures etc..
301 */ 272 */
@@ -414,7 +385,7 @@ unsigned long get_wchan(struct task_struct *p)
414 do { 385 do {
415 if (fp < stack_start || fp > stack_end) 386 if (fp < stack_start || fp > stack_end)
416 return 0; 387 return 0;
417 lr = pc_pointer (((unsigned long *)fp)[-1]); 388 lr = ((unsigned long *)fp)[-1];
418 if (!in_sched_functions(lr)) 389 if (!in_sched_functions(lr))
419 return lr; 390 return lr;
420 fp = *(unsigned long *) (fp - 12); 391 fp = *(unsigned long *) (fp - 12);
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 4b05dc5c1023..df653ea59250 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -18,8 +18,8 @@
18#include <linux/security.h> 18#include <linux/security.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/signal.h> 20#include <linux/signal.h>
21#include <linux/uaccess.h>
21 22
22#include <asm/uaccess.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/traps.h> 25#include <asm/traps.h>
@@ -126,7 +126,7 @@ ptrace_getrn(struct task_struct *child, unsigned long insn)
126 126
127 val = get_user_reg(child, reg); 127 val = get_user_reg(child, reg);
128 if (reg == 15) 128 if (reg == 15)
129 val = pc_pointer(val + 8); 129 val += 8;
130 130
131 return val; 131 return val;
132} 132}
@@ -278,8 +278,7 @@ get_branch_address(struct task_struct *child, unsigned long pc, unsigned long in
278 else 278 else
279 base -= aluop2; 279 base -= aluop2;
280 } 280 }
281 if (read_u32(child, base, &alt) == 0) 281 read_u32(child, base, &alt);
282 alt = pc_pointer(alt);
283 } 282 }
284 break; 283 break;
285 284
@@ -305,8 +304,7 @@ get_branch_address(struct task_struct *child, unsigned long pc, unsigned long in
305 304
306 base = ptrace_getrn(child, insn); 305 base = ptrace_getrn(child, insn);
307 306
308 if (read_u32(child, base + nr_regs, &alt) == 0) 307 read_u32(child, base + nr_regs, &alt);
309 alt = pc_pointer(alt);
310 break; 308 break;
311 } 309 }
312 break; 310 break;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 2ca7038b67a7..1f1eecca7f55 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -26,11 +26,13 @@
26#include <linux/fs.h> 26#include <linux/fs.h>
27 27
28#include <asm/cpu.h> 28#include <asm/cpu.h>
29#include <asm/cputype.h>
29#include <asm/elf.h> 30#include <asm/elf.h>
30#include <asm/procinfo.h> 31#include <asm/procinfo.h>
31#include <asm/setup.h> 32#include <asm/setup.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
35#include <asm/cachetype.h>
34#include <asm/tlbflush.h> 36#include <asm/tlbflush.h>
35 37
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -59,13 +61,14 @@ __setup("fpe=", fpe_setup);
59 61
60extern void paging_init(struct meminfo *, struct machine_desc *desc); 62extern void paging_init(struct meminfo *, struct machine_desc *desc);
61extern void reboot_setup(char *str); 63extern void reboot_setup(char *str);
62extern int root_mountflags; 64extern void _text, _etext, __data_start, _edata, _end;
63extern void _stext, _text, _etext, __data_start, _edata, _end;
64 65
65unsigned int processor_id; 66unsigned int processor_id;
66EXPORT_SYMBOL(processor_id); 67EXPORT_SYMBOL(processor_id);
67unsigned int __machine_arch_type; 68unsigned int __machine_arch_type;
68EXPORT_SYMBOL(__machine_arch_type); 69EXPORT_SYMBOL(__machine_arch_type);
70unsigned int cacheid;
71EXPORT_SYMBOL(cacheid);
69 72
70unsigned int __atags_pointer __initdata; 73unsigned int __atags_pointer __initdata;
71 74
@@ -81,8 +84,6 @@ EXPORT_SYMBOL(system_serial_high);
81unsigned int elf_hwcap; 84unsigned int elf_hwcap;
82EXPORT_SYMBOL(elf_hwcap); 85EXPORT_SYMBOL(elf_hwcap);
83 86
84unsigned long __initdata vmalloc_reserve = 128 << 20;
85
86 87
87#ifdef MULTI_CPU 88#ifdef MULTI_CPU
88struct processor processor; 89struct processor processor;
@@ -111,9 +112,6 @@ static struct stack stacks[NR_CPUS];
111char elf_platform[ELF_PLATFORM_SIZE]; 112char elf_platform[ELF_PLATFORM_SIZE];
112EXPORT_SYMBOL(elf_platform); 113EXPORT_SYMBOL(elf_platform);
113 114
114unsigned long phys_initrd_start __initdata = 0;
115unsigned long phys_initrd_size __initdata = 0;
116
117static struct meminfo meminfo __initdata = { 0, }; 115static struct meminfo meminfo __initdata = { 0, };
118static const char *cpu_name; 116static const char *cpu_name;
119static const char *machine_name; 117static const char *machine_name;
@@ -178,63 +176,6 @@ static struct resource io_res[] = {
178#define lp1 io_res[1] 176#define lp1 io_res[1]
179#define lp2 io_res[2] 177#define lp2 io_res[2]
180 178
181static const char *cache_types[16] = {
182 "write-through",
183 "write-back",
184 "write-back",
185 "undefined 3",
186 "undefined 4",
187 "undefined 5",
188 "write-back",
189 "write-back",
190 "undefined 8",
191 "undefined 9",
192 "undefined 10",
193 "undefined 11",
194 "undefined 12",
195 "undefined 13",
196 "write-back",
197 "undefined 15",
198};
199
200static const char *cache_clean[16] = {
201 "not required",
202 "read-block",
203 "cp15 c7 ops",
204 "undefined 3",
205 "undefined 4",
206 "undefined 5",
207 "cp15 c7 ops",
208 "cp15 c7 ops",
209 "undefined 8",
210 "undefined 9",
211 "undefined 10",
212 "undefined 11",
213 "undefined 12",
214 "undefined 13",
215 "cp15 c7 ops",
216 "undefined 15",
217};
218
219static const char *cache_lockdown[16] = {
220 "not supported",
221 "not supported",
222 "not supported",
223 "undefined 3",
224 "undefined 4",
225 "undefined 5",
226 "format A",
227 "format B",
228 "undefined 8",
229 "undefined 9",
230 "undefined 10",
231 "undefined 11",
232 "undefined 12",
233 "undefined 13",
234 "format C",
235 "undefined 15",
236};
237
238static const char *proc_arch[] = { 179static const char *proc_arch[] = {
239 "undefined/unknown", 180 "undefined/unknown",
240 "3", 181 "3",
@@ -255,61 +196,19 @@ static const char *proc_arch[] = {
255 "?(17)", 196 "?(17)",
256}; 197};
257 198
258#define CACHE_TYPE(x) (((x) >> 25) & 15)
259#define CACHE_S(x) ((x) & (1 << 24))
260#define CACHE_DSIZE(x) (((x) >> 12) & 4095) /* only if S=1 */
261#define CACHE_ISIZE(x) ((x) & 4095)
262
263#define CACHE_SIZE(y) (((y) >> 6) & 7)
264#define CACHE_ASSOC(y) (((y) >> 3) & 7)
265#define CACHE_M(y) ((y) & (1 << 2))
266#define CACHE_LINE(y) ((y) & 3)
267
268static inline void dump_cache(const char *prefix, int cpu, unsigned int cache)
269{
270 unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0);
271
272 printk("CPU%u: %s: %d bytes, associativity %d, %d byte lines, %d sets\n",
273 cpu, prefix,
274 mult << (8 + CACHE_SIZE(cache)),
275 (mult << CACHE_ASSOC(cache)) >> 1,
276 8 << CACHE_LINE(cache),
277 1 << (6 + CACHE_SIZE(cache) - CACHE_ASSOC(cache) -
278 CACHE_LINE(cache)));
279}
280
281static void __init dump_cpu_info(int cpu)
282{
283 unsigned int info = read_cpuid(CPUID_CACHETYPE);
284
285 if (info != processor_id) {
286 printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT",
287 cache_types[CACHE_TYPE(info)]);
288 if (CACHE_S(info)) {
289 dump_cache("I cache", cpu, CACHE_ISIZE(info));
290 dump_cache("D cache", cpu, CACHE_DSIZE(info));
291 } else {
292 dump_cache("cache", cpu, CACHE_ISIZE(info));
293 }
294 }
295
296 if (arch_is_coherent())
297 printk("Cache coherency enabled\n");
298}
299
300int cpu_architecture(void) 199int cpu_architecture(void)
301{ 200{
302 int cpu_arch; 201 int cpu_arch;
303 202
304 if ((processor_id & 0x0008f000) == 0) { 203 if ((read_cpuid_id() & 0x0008f000) == 0) {
305 cpu_arch = CPU_ARCH_UNKNOWN; 204 cpu_arch = CPU_ARCH_UNKNOWN;
306 } else if ((processor_id & 0x0008f000) == 0x00007000) { 205 } else if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
307 cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3; 206 cpu_arch = (read_cpuid_id() & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
308 } else if ((processor_id & 0x00080000) == 0x00000000) { 207 } else if ((read_cpuid_id() & 0x00080000) == 0x00000000) {
309 cpu_arch = (processor_id >> 16) & 7; 208 cpu_arch = (read_cpuid_id() >> 16) & 7;
310 if (cpu_arch) 209 if (cpu_arch)
311 cpu_arch += CPU_ARCH_ARMv3; 210 cpu_arch += CPU_ARCH_ARMv3;
312 } else if ((processor_id & 0x000f0000) == 0x000f0000) { 211 } else if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) {
313 unsigned int mmfr0; 212 unsigned int mmfr0;
314 213
315 /* Revised CPUID format. Read the Memory Model Feature 214 /* Revised CPUID format. Read the Memory Model Feature
@@ -330,6 +229,34 @@ int cpu_architecture(void)
330 return cpu_arch; 229 return cpu_arch;
331} 230}
332 231
232static void __init cacheid_init(void)
233{
234 unsigned int cachetype = read_cpuid_cachetype();
235 unsigned int arch = cpu_architecture();
236
237 if (arch >= CPU_ARCH_ARMv7) {
238 cacheid = CACHEID_VIPT_NONALIASING;
239 if ((cachetype & (3 << 14)) == 1 << 14)
240 cacheid |= CACHEID_ASID_TAGGED;
241 } else if (arch >= CPU_ARCH_ARMv6) {
242 if (cachetype & (1 << 23))
243 cacheid = CACHEID_VIPT_ALIASING;
244 else
245 cacheid = CACHEID_VIPT_NONALIASING;
246 } else {
247 cacheid = CACHEID_VIVT;
248 }
249
250 printk("CPU: %s data cache, %s instruction cache\n",
251 cache_is_vivt() ? "VIVT" :
252 cache_is_vipt_aliasing() ? "VIPT aliasing" :
253 cache_is_vipt_nonaliasing() ? "VIPT nonaliasing" : "unknown",
254 cache_is_vivt() ? "VIVT" :
255 icache_is_vivt_asid_tagged() ? "VIVT ASID tagged" :
256 cache_is_vipt_aliasing() ? "VIPT aliasing" :
257 cache_is_vipt_nonaliasing() ? "VIPT nonaliasing" : "unknown");
258}
259
333/* 260/*
334 * These functions re-use the assembly code in head.S, which 261 * These functions re-use the assembly code in head.S, which
335 * already provide the required functionality. 262 * already provide the required functionality.
@@ -346,10 +273,10 @@ static void __init setup_processor(void)
346 * types. The linker builds this table for us from the 273 * types. The linker builds this table for us from the
347 * entries in arch/arm/mm/proc-*.S 274 * entries in arch/arm/mm/proc-*.S
348 */ 275 */
349 list = lookup_processor_type(processor_id); 276 list = lookup_processor_type(read_cpuid_id());
350 if (!list) { 277 if (!list) {
351 printk("CPU configuration botched (ID %08x), unable " 278 printk("CPU configuration botched (ID %08x), unable "
352 "to continue.\n", processor_id); 279 "to continue.\n", read_cpuid_id());
353 while (1); 280 while (1);
354 } 281 }
355 282
@@ -369,7 +296,7 @@ static void __init setup_processor(void)
369#endif 296#endif
370 297
371 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 298 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
372 cpu_name, processor_id, (int)processor_id & 15, 299 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
373 proc_arch[cpu_architecture()], cr_alignment); 300 proc_arch[cpu_architecture()], cr_alignment);
374 301
375 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS); 302 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS);
@@ -379,14 +306,14 @@ static void __init setup_processor(void)
379 elf_hwcap &= ~HWCAP_THUMB; 306 elf_hwcap &= ~HWCAP_THUMB;
380#endif 307#endif
381 308
309 cacheid_init();
382 cpu_proc_init(); 310 cpu_proc_init();
383} 311}
384 312
385/* 313/*
386 * cpu_init - initialise one CPU. 314 * cpu_init - initialise one CPU.
387 * 315 *
388 * cpu_init dumps the cache information, initialises SMP specific 316 * cpu_init sets up the per-CPU stacks.
389 * information, and sets up the per-CPU stacks.
390 */ 317 */
391void cpu_init(void) 318void cpu_init(void)
392{ 319{
@@ -398,9 +325,6 @@ void cpu_init(void)
398 BUG(); 325 BUG();
399 } 326 }
400 327
401 if (system_state == SYSTEM_BOOTING)
402 dump_cpu_info(cpu);
403
404 /* 328 /*
405 * setup stacks for re-entrant exception handlers 329 * setup stacks for re-entrant exception handlers
406 */ 330 */
@@ -443,20 +367,6 @@ static struct machine_desc * __init setup_machine(unsigned int nr)
443 return list; 367 return list;
444} 368}
445 369
446static void __init early_initrd(char **p)
447{
448 unsigned long start, size;
449
450 start = memparse(*p, p);
451 if (**p == ',') {
452 size = memparse((*p) + 1, p);
453
454 phys_initrd_start = start;
455 phys_initrd_size = size;
456 }
457}
458__early_param("initrd=", early_initrd);
459
460static void __init arm_add_memory(unsigned long start, unsigned long size) 370static void __init arm_add_memory(unsigned long start, unsigned long size)
461{ 371{
462 struct membank *bank; 372 struct membank *bank;
@@ -503,17 +413,6 @@ static void __init early_mem(char **p)
503__early_param("mem=", early_mem); 413__early_param("mem=", early_mem);
504 414
505/* 415/*
506 * vmalloc=size forces the vmalloc area to be exactly 'size'
507 * bytes. This can be used to increase (or decrease) the vmalloc
508 * area - the default is 128m.
509 */
510static void __init early_vmalloc(char **arg)
511{
512 vmalloc_reserve = memparse(*arg, arg);
513}
514__early_param("vmalloc=", early_vmalloc);
515
516/*
517 * Initial parsing of the command line. 416 * Initial parsing of the command line.
518 */ 417 */
519static void __init parse_cmdline(char **cmdline_p, char *from) 418static void __init parse_cmdline(char **cmdline_p, char *from)
@@ -527,12 +426,12 @@ static void __init parse_cmdline(char **cmdline_p, char *from)
527 struct early_params *p; 426 struct early_params *p;
528 427
529 for (p = &__early_begin; p < &__early_end; p++) { 428 for (p = &__early_begin; p < &__early_end; p++) {
530 int len = strlen(p->arg); 429 int arglen = strlen(p->arg);
531 430
532 if (memcmp(from, p->arg, len) == 0) { 431 if (memcmp(from, p->arg, arglen) == 0) {
533 if (to != command_line) 432 if (to != command_line)
534 to -= 1; 433 to -= 1;
535 from += len; 434 from += arglen;
536 p->fn(&from); 435 p->fn(&from);
537 436
538 while (*from != ' ' && *from != '\0') 437 while (*from != ' ' && *from != '\0')
@@ -579,18 +478,13 @@ request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
579 kernel_data.end = virt_to_phys(&_end - 1); 478 kernel_data.end = virt_to_phys(&_end - 1);
580 479
581 for (i = 0; i < mi->nr_banks; i++) { 480 for (i = 0; i < mi->nr_banks; i++) {
582 unsigned long virt_start, virt_end;
583
584 if (mi->bank[i].size == 0) 481 if (mi->bank[i].size == 0)
585 continue; 482 continue;
586 483
587 virt_start = __phys_to_virt(mi->bank[i].start);
588 virt_end = virt_start + mi->bank[i].size - 1;
589
590 res = alloc_bootmem_low(sizeof(*res)); 484 res = alloc_bootmem_low(sizeof(*res));
591 res->name = "System RAM"; 485 res->name = "System RAM";
592 res->start = __virt_to_phys(virt_start); 486 res->start = mi->bank[i].start;
593 res->end = __virt_to_phys(virt_end); 487 res->end = mi->bank[i].start + mi->bank[i].size - 1;
594 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; 488 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
595 489
596 request_resource(&iomem_resource, res); 490 request_resource(&iomem_resource, res);
@@ -694,26 +588,6 @@ static int __init parse_tag_ramdisk(const struct tag *tag)
694 588
695__tagtable(ATAG_RAMDISK, parse_tag_ramdisk); 589__tagtable(ATAG_RAMDISK, parse_tag_ramdisk);
696 590
697static int __init parse_tag_initrd(const struct tag *tag)
698{
699 printk(KERN_WARNING "ATAG_INITRD is deprecated; "
700 "please update your bootloader.\n");
701 phys_initrd_start = __virt_to_phys(tag->u.initrd.start);
702 phys_initrd_size = tag->u.initrd.size;
703 return 0;
704}
705
706__tagtable(ATAG_INITRD, parse_tag_initrd);
707
708static int __init parse_tag_initrd2(const struct tag *tag)
709{
710 phys_initrd_start = tag->u.initrd.start;
711 phys_initrd_size = tag->u.initrd.size;
712 return 0;
713}
714
715__tagtable(ATAG_INITRD2, parse_tag_initrd2);
716
717static int __init parse_tag_serialnr(const struct tag *tag) 591static int __init parse_tag_serialnr(const struct tag *tag)
718{ 592{
719 system_serial_low = tag->u.serialnr.low; 593 system_serial_low = tag->u.serialnr.low;
@@ -901,28 +775,12 @@ static const char *hwcap_str[] = {
901 NULL 775 NULL
902}; 776};
903 777
904static void
905c_show_cache(struct seq_file *m, const char *type, unsigned int cache)
906{
907 unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0);
908
909 seq_printf(m, "%s size\t\t: %d\n"
910 "%s assoc\t\t: %d\n"
911 "%s line length\t: %d\n"
912 "%s sets\t\t: %d\n",
913 type, mult << (8 + CACHE_SIZE(cache)),
914 type, (mult << CACHE_ASSOC(cache)) >> 1,
915 type, 8 << CACHE_LINE(cache),
916 type, 1 << (6 + CACHE_SIZE(cache) - CACHE_ASSOC(cache) -
917 CACHE_LINE(cache)));
918}
919
920static int c_show(struct seq_file *m, void *v) 778static int c_show(struct seq_file *m, void *v)
921{ 779{
922 int i; 780 int i;
923 781
924 seq_printf(m, "Processor\t: %s rev %d (%s)\n", 782 seq_printf(m, "Processor\t: %s rev %d (%s)\n",
925 cpu_name, (int)processor_id & 15, elf_platform); 783 cpu_name, read_cpuid_id() & 15, elf_platform);
926 784
927#if defined(CONFIG_SMP) 785#if defined(CONFIG_SMP)
928 for_each_online_cpu(i) { 786 for_each_online_cpu(i) {
@@ -949,47 +807,26 @@ static int c_show(struct seq_file *m, void *v)
949 if (elf_hwcap & (1 << i)) 807 if (elf_hwcap & (1 << i))
950 seq_printf(m, "%s ", hwcap_str[i]); 808 seq_printf(m, "%s ", hwcap_str[i]);
951 809
952 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", processor_id >> 24); 810 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
953 seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]); 811 seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
954 812
955 if ((processor_id & 0x0008f000) == 0x00000000) { 813 if ((read_cpuid_id() & 0x0008f000) == 0x00000000) {
956 /* pre-ARM7 */ 814 /* pre-ARM7 */
957 seq_printf(m, "CPU part\t: %07x\n", processor_id >> 4); 815 seq_printf(m, "CPU part\t: %07x\n", read_cpuid_id() >> 4);
958 } else { 816 } else {
959 if ((processor_id & 0x0008f000) == 0x00007000) { 817 if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
960 /* ARM7 */ 818 /* ARM7 */
961 seq_printf(m, "CPU variant\t: 0x%02x\n", 819 seq_printf(m, "CPU variant\t: 0x%02x\n",
962 (processor_id >> 16) & 127); 820 (read_cpuid_id() >> 16) & 127);
963 } else { 821 } else {
964 /* post-ARM7 */ 822 /* post-ARM7 */
965 seq_printf(m, "CPU variant\t: 0x%x\n", 823 seq_printf(m, "CPU variant\t: 0x%x\n",
966 (processor_id >> 20) & 15); 824 (read_cpuid_id() >> 20) & 15);
967 } 825 }
968 seq_printf(m, "CPU part\t: 0x%03x\n", 826 seq_printf(m, "CPU part\t: 0x%03x\n",
969 (processor_id >> 4) & 0xfff); 827 (read_cpuid_id() >> 4) & 0xfff);
970 }
971 seq_printf(m, "CPU revision\t: %d\n", processor_id & 15);
972
973 {
974 unsigned int cache_info = read_cpuid(CPUID_CACHETYPE);
975 if (cache_info != processor_id) {
976 seq_printf(m, "Cache type\t: %s\n"
977 "Cache clean\t: %s\n"
978 "Cache lockdown\t: %s\n"
979 "Cache format\t: %s\n",
980 cache_types[CACHE_TYPE(cache_info)],
981 cache_clean[CACHE_TYPE(cache_info)],
982 cache_lockdown[CACHE_TYPE(cache_info)],
983 CACHE_S(cache_info) ? "Harvard" : "Unified");
984
985 if (CACHE_S(cache_info)) {
986 c_show_cache(m, "I", CACHE_ISIZE(cache_info));
987 c_show_cache(m, "D", CACHE_DSIZE(cache_info));
988 } else {
989 c_show_cache(m, "Cache", CACHE_ISIZE(cache_info));
990 }
991 }
992 } 828 }
829 seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
993 830
994 seq_puts(m, "\n"); 831 seq_puts(m, "\n");
995 832
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index ef2f86a5e78a..80b8b5c7e07a 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -11,11 +11,11 @@
11#include <linux/signal.h> 11#include <linux/signal.h>
12#include <linux/personality.h> 12#include <linux/personality.h>
13#include <linux/freezer.h> 13#include <linux/freezer.h>
14#include <linux/uaccess.h>
14 15
15#include <asm/elf.h> 16#include <asm/elf.h>
16#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
17#include <asm/ucontext.h> 18#include <asm/ucontext.h>
18#include <asm/uaccess.h>
19#include <asm/unistd.h> 19#include <asm/unistd.h>
20 20
21#include "ptrace.h" 21#include "ptrace.h"
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index e9842f6767f9..e42a749a56dd 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -277,6 +277,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
277 /* 277 /*
278 * Enable local interrupts. 278 * Enable local interrupts.
279 */ 279 */
280 notify_cpu_starting(cpu);
280 local_irq_enable(); 281 local_irq_enable();
281 local_fiq_enable(); 282 local_fiq_enable();
282 283
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 0128687ba0f7..b3ec641b5cf8 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -27,8 +27,7 @@
27#include <linux/file.h> 27#include <linux/file.h>
28#include <linux/utsname.h> 28#include <linux/utsname.h>
29#include <linux/ipc.h> 29#include <linux/ipc.h>
30 30#include <linux/uaccess.h>
31#include <asm/uaccess.h>
32 31
33extern unsigned long do_mremap(unsigned long addr, unsigned long old_len, 32extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
34 unsigned long new_len, unsigned long flags, 33 unsigned long new_len, unsigned long flags,
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index 96ab5f52949c..42623db7f870 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -82,7 +82,7 @@
82#include <linux/socket.h> 82#include <linux/socket.h>
83#include <linux/net.h> 83#include <linux/net.h>
84#include <linux/ipc.h> 84#include <linux/ipc.h>
85#include <asm/uaccess.h> 85#include <linux/uaccess.h>
86 86
87struct oldabi_stat64 { 87struct oldabi_stat64 {
88 unsigned long long st_dev; 88 unsigned long long st_dev;
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 368d171754cf..c68b44aa88d2 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -59,7 +59,7 @@ unsigned long profile_pc(struct pt_regs *regs)
59 59
60 if (in_lock_functions(pc)) { 60 if (in_lock_functions(pc)) {
61 fp = regs->ARM_fp; 61 fp = regs->ARM_fp;
62 pc = pc_pointer(((unsigned long *)fp)[-1]); 62 pc = ((unsigned long *)fp)[-1];
63 } 63 }
64 64
65 return pc; 65 return pc;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 872f1f8fbb57..57e6874d0b80 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -19,15 +19,13 @@
19#include <linux/kallsyms.h> 19#include <linux/kallsyms.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/kprobes.h> 22#include <linux/uaccess.h>
23 23
24#include <asm/atomic.h> 24#include <asm/atomic.h>
25#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/uaccess.h>
28#include <asm/unistd.h> 27#include <asm/unistd.h>
29#include <asm/traps.h> 28#include <asm/traps.h>
30#include <asm/io.h>
31 29
32#include "ptrace.h" 30#include "ptrace.h"
33#include "signal.h" 31#include "signal.h"
@@ -69,7 +67,8 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long
69 */ 67 */
70static int verify_stack(unsigned long sp) 68static int verify_stack(unsigned long sp)
71{ 69{
72 if (sp < PAGE_OFFSET || (sp > (unsigned long)high_memory && high_memory != 0)) 70 if (sp < PAGE_OFFSET ||
71 (sp > (unsigned long)high_memory && high_memory != NULL))
73 return -EFAULT; 72 return -EFAULT;
74 73
75 return 0; 74 return 0;
@@ -328,17 +327,6 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
328 get_user(instr, (u32 __user *)pc); 327 get_user(instr, (u32 __user *)pc);
329 } 328 }
330 329
331#ifdef CONFIG_KPROBES
332 /*
333 * It is possible to have recursive kprobes, so we can't call
334 * the kprobe trap handler with the undef_lock held.
335 */
336 if (instr == KPROBE_BREAKPOINT_INSTRUCTION && !user_mode(regs)) {
337 kprobe_trap_handler(regs, instr);
338 return;
339 }
340#endif
341
342 if (call_undef_hook(regs, instr) == 0) 330 if (call_undef_hook(regs, instr) == 0)
343 return; 331 return;
344 332
diff --git a/arch/arm/kernel/xscale-cp0.c b/arch/arm/kernel/xscale-cp0.c
index 180000bfdc8f..17127db906fa 100644
--- a/arch/arm/kernel/xscale-cp0.c
+++ b/arch/arm/kernel/xscale-cp0.c
@@ -14,8 +14,8 @@
14#include <linux/signal.h> 14#include <linux/signal.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/io.h>
17#include <asm/thread_notify.h> 18#include <asm/thread_notify.h>
18#include <asm/io.h>
19 19
20static inline void dsp_save_state(u32 *state) 20static inline void dsp_save_state(u32 *state)
21{ 21{