diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 35 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 15 | ||||
-rw-r--r-- | arch/arm/kernel/head-common.S | 2 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 9 | ||||
-rw-r--r-- | arch/arm/kernel/signal.c | 41 | ||||
-rw-r--r-- | arch/arm/kernel/signal.h | 4 | ||||
-rw-r--r-- | arch/arm/kernel/smp_scu.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/traps.c | 8 | ||||
-rw-r--r-- | arch/arm/kernel/unwind.c | 9 |
9 files changed, 81 insertions, 46 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 322410be573c..d2903e3bc861 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <mach/entry-macro.S> | 21 | #include <mach/entry-macro.S> |
22 | #include <asm/thread_notify.h> | 22 | #include <asm/thread_notify.h> |
23 | #include <asm/unwind.h> | 23 | #include <asm/unwind.h> |
24 | #include <asm/unistd.h> | ||
24 | 25 | ||
25 | #include "entry-header.S" | 26 | #include "entry-header.S" |
26 | 27 | ||
@@ -608,33 +609,33 @@ call_fpe: | |||
608 | THUMB( add pc, r8 ) | 609 | THUMB( add pc, r8 ) |
609 | nop | 610 | nop |
610 | 611 | ||
611 | W(mov) pc, lr @ CP#0 | 612 | movw_pc lr @ CP#0 |
612 | W(b) do_fpe @ CP#1 (FPE) | 613 | W(b) do_fpe @ CP#1 (FPE) |
613 | W(b) do_fpe @ CP#2 (FPE) | 614 | W(b) do_fpe @ CP#2 (FPE) |
614 | W(mov) pc, lr @ CP#3 | 615 | movw_pc lr @ CP#3 |
615 | #ifdef CONFIG_CRUNCH | 616 | #ifdef CONFIG_CRUNCH |
616 | b crunch_task_enable @ CP#4 (MaverickCrunch) | 617 | b crunch_task_enable @ CP#4 (MaverickCrunch) |
617 | b crunch_task_enable @ CP#5 (MaverickCrunch) | 618 | b crunch_task_enable @ CP#5 (MaverickCrunch) |
618 | b crunch_task_enable @ CP#6 (MaverickCrunch) | 619 | b crunch_task_enable @ CP#6 (MaverickCrunch) |
619 | #else | 620 | #else |
620 | W(mov) pc, lr @ CP#4 | 621 | movw_pc lr @ CP#4 |
621 | W(mov) pc, lr @ CP#5 | 622 | movw_pc lr @ CP#5 |
622 | W(mov) pc, lr @ CP#6 | 623 | movw_pc lr @ CP#6 |
623 | #endif | 624 | #endif |
624 | W(mov) pc, lr @ CP#7 | 625 | movw_pc lr @ CP#7 |
625 | W(mov) pc, lr @ CP#8 | 626 | movw_pc lr @ CP#8 |
626 | W(mov) pc, lr @ CP#9 | 627 | movw_pc lr @ CP#9 |
627 | #ifdef CONFIG_VFP | 628 | #ifdef CONFIG_VFP |
628 | W(b) do_vfp @ CP#10 (VFP) | 629 | W(b) do_vfp @ CP#10 (VFP) |
629 | W(b) do_vfp @ CP#11 (VFP) | 630 | W(b) do_vfp @ CP#11 (VFP) |
630 | #else | 631 | #else |
631 | W(mov) pc, lr @ CP#10 (VFP) | 632 | movw_pc lr @ CP#10 (VFP) |
632 | W(mov) pc, lr @ CP#11 (VFP) | 633 | movw_pc lr @ CP#11 (VFP) |
633 | #endif | 634 | #endif |
634 | W(mov) pc, lr @ CP#12 | 635 | movw_pc lr @ CP#12 |
635 | W(mov) pc, lr @ CP#13 | 636 | movw_pc lr @ CP#13 |
636 | W(mov) pc, lr @ CP#14 (Debug) | 637 | movw_pc lr @ CP#14 (Debug) |
637 | W(mov) pc, lr @ CP#15 (Control) | 638 | movw_pc lr @ CP#15 (Control) |
638 | 639 | ||
639 | #ifdef CONFIG_NEON | 640 | #ifdef CONFIG_NEON |
640 | .align 6 | 641 | .align 6 |
@@ -908,10 +909,10 @@ __kuser_cmpxchg: @ 0xffff0fc0 | |||
908 | * A special ghost syscall is used for that (see traps.c). | 909 | * A special ghost syscall is used for that (see traps.c). |
909 | */ | 910 | */ |
910 | stmfd sp!, {r7, lr} | 911 | stmfd sp!, {r7, lr} |
911 | mov r7, #0xff00 @ 0xfff0 into r7 for EABI | 912 | ldr r7, =1f @ it's 20 bits |
912 | orr r7, r7, #0xf0 | 913 | swi __ARM_NR_cmpxchg |
913 | swi #0x9ffff0 | ||
914 | ldmfd sp!, {r7, pc} | 914 | ldmfd sp!, {r7, pc} |
915 | 1: .word __ARM_NR_cmpxchg | ||
915 | 916 | ||
916 | #elif __LINUX_ARM_ARCH__ < 6 | 917 | #elif __LINUX_ARM_ARCH__ < 6 |
917 | 918 | ||
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index ac34c0d9384b..7e9ed1eea40a 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -110,6 +110,13 @@ | |||
110 | mov \rd, sp, lsr #13 | 110 | mov \rd, sp, lsr #13 |
111 | mov \rd, \rd, lsl #13 | 111 | mov \rd, \rd, lsl #13 |
112 | .endm | 112 | .endm |
113 | |||
114 | @ | ||
115 | @ 32-bit wide "mov pc, reg" | ||
116 | @ | ||
117 | .macro movw_pc, reg | ||
118 | mov pc, \reg | ||
119 | .endm | ||
113 | #else /* CONFIG_THUMB2_KERNEL */ | 120 | #else /* CONFIG_THUMB2_KERNEL */ |
114 | .macro svc_exit, rpsr | 121 | .macro svc_exit, rpsr |
115 | clrex @ clear the exclusive monitor | 122 | clrex @ clear the exclusive monitor |
@@ -146,6 +153,14 @@ | |||
146 | lsr \rd, \rd, #13 | 153 | lsr \rd, \rd, #13 |
147 | mov \rd, \rd, lsl #13 | 154 | mov \rd, \rd, lsl #13 |
148 | .endm | 155 | .endm |
156 | |||
157 | @ | ||
158 | @ 32-bit wide "mov pc, reg" | ||
159 | @ | ||
160 | .macro movw_pc, reg | ||
161 | mov pc, \reg | ||
162 | nop | ||
163 | .endm | ||
149 | #endif /* !CONFIG_THUMB2_KERNEL */ | 164 | #endif /* !CONFIG_THUMB2_KERNEL */ |
150 | 165 | ||
151 | /* | 166 | /* |
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S index 885a7214418d..b9505aa267c0 100644 --- a/arch/arm/kernel/head-common.S +++ b/arch/arm/kernel/head-common.S | |||
@@ -97,7 +97,7 @@ __error_a: | |||
97 | bl printhex8 | 97 | bl printhex8 |
98 | adr r0, str_a2 | 98 | adr r0, str_a2 |
99 | bl printascii | 99 | bl printascii |
100 | adr r3, 3f | 100 | adr r3, 4f |
101 | ldmia r3, {r4, r5, r6} @ get machine desc list | 101 | ldmia r3, {r4, r5, r6} @ get machine desc list |
102 | sub r4, r3, r4 @ get offset between virt&phys | 102 | sub r4, r3, r4 @ get offset between virt&phys |
103 | add r5, r5, r4 @ convert virt addresses to | 103 | add r5, r5, r4 @ convert virt addresses to |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 790fbee92ec5..0d96d0171c05 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -328,6 +328,15 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
328 | } | 328 | } |
329 | 329 | ||
330 | /* | 330 | /* |
331 | * Fill in the task's elfregs structure for a core dump. | ||
332 | */ | ||
333 | int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs) | ||
334 | { | ||
335 | elf_core_copy_regs(elfregs, task_pt_regs(t)); | ||
336 | return 1; | ||
337 | } | ||
338 | |||
339 | /* | ||
331 | * fill in the fpe structure for a core dump... | 340 | * fill in the fpe structure for a core dump... |
332 | */ | 341 | */ |
333 | int dump_fpu (struct pt_regs *regs, struct user_fp *fp) | 342 | int dump_fpu (struct pt_regs *regs, struct user_fp *fp) |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 1423a3419789..2a573d4fea24 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/kernel/signal.c | 2 | * linux/arch/arm/kernel/signal.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995-2002 Russell King | 4 | * Copyright (C) 1995-2009 Russell King |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | #define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE)) | 30 | #define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE)) |
31 | #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE)) | 31 | #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE)) |
32 | #define SWI_SYS_RESTART (0xef000000|__NR_restart_syscall|__NR_OABI_SYSCALL_BASE) | ||
32 | 33 | ||
33 | /* | 34 | /* |
34 | * With EABI, the syscall number has to be loaded into r7. | 35 | * With EABI, the syscall number has to be loaded into r7. |
@@ -49,6 +50,18 @@ const unsigned long sigreturn_codes[7] = { | |||
49 | }; | 50 | }; |
50 | 51 | ||
51 | /* | 52 | /* |
53 | * Either we support OABI only, or we have EABI with the OABI | ||
54 | * compat layer enabled. In the later case we don't know if | ||
55 | * user space is EABI or not, and if not we must not clobber r7. | ||
56 | * Always using the OABI syscall solves that issue and works for | ||
57 | * all those cases. | ||
58 | */ | ||
59 | const unsigned long syscall_restart_code[2] = { | ||
60 | SWI_SYS_RESTART, /* swi __NR_restart_syscall */ | ||
61 | 0xe49df004, /* ldr pc, [sp], #4 */ | ||
62 | }; | ||
63 | |||
64 | /* | ||
52 | * atomically swap in the new signal mask, and wait for a signal. | 65 | * atomically swap in the new signal mask, and wait for a signal. |
53 | */ | 66 | */ |
54 | asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask) | 67 | asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask) |
@@ -645,32 +658,12 @@ static void do_signal(struct pt_regs *regs, int syscall) | |||
645 | regs->ARM_pc -= 4; | 658 | regs->ARM_pc -= 4; |
646 | #else | 659 | #else |
647 | u32 __user *usp; | 660 | u32 __user *usp; |
648 | u32 swival = __NR_restart_syscall; | ||
649 | 661 | ||
650 | regs->ARM_sp -= 12; | 662 | regs->ARM_sp -= 4; |
651 | usp = (u32 __user *)regs->ARM_sp; | 663 | usp = (u32 __user *)regs->ARM_sp; |
652 | 664 | ||
653 | /* | 665 | put_user(regs->ARM_pc, usp); |
654 | * Either we supports OABI only, or we have | 666 | regs->ARM_pc = KERN_RESTART_CODE; |
655 | * EABI with the OABI compat layer enabled. | ||
656 | * In the later case we don't know if user | ||
657 | * space is EABI or not, and if not we must | ||
658 | * not clobber r7. Always using the OABI | ||
659 | * syscall solves that issue and works for | ||
660 | * all those cases. | ||
661 | */ | ||
662 | swival = swival - __NR_SYSCALL_BASE + __NR_OABI_SYSCALL_BASE; | ||
663 | |||
664 | put_user(regs->ARM_pc, &usp[0]); | ||
665 | /* swi __NR_restart_syscall */ | ||
666 | put_user(0xef000000 | swival, &usp[1]); | ||
667 | /* ldr pc, [sp], #12 */ | ||
668 | put_user(0xe49df00c, &usp[2]); | ||
669 | |||
670 | flush_icache_range((unsigned long)usp, | ||
671 | (unsigned long)(usp + 3)); | ||
672 | |||
673 | regs->ARM_pc = regs->ARM_sp + 4; | ||
674 | #endif | 667 | #endif |
675 | } | 668 | } |
676 | } | 669 | } |
diff --git a/arch/arm/kernel/signal.h b/arch/arm/kernel/signal.h index 27beece15502..6fcfe8398aa4 100644 --- a/arch/arm/kernel/signal.h +++ b/arch/arm/kernel/signal.h | |||
@@ -1,12 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/kernel/signal.h | 2 | * linux/arch/arm/kernel/signal.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Russell King. | 4 | * Copyright (C) 2005-2009 Russell King. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #define KERN_SIGRETURN_CODE (CONFIG_VECTORS_BASE + 0x00000500) | 10 | #define KERN_SIGRETURN_CODE (CONFIG_VECTORS_BASE + 0x00000500) |
11 | #define KERN_RESTART_CODE (KERN_SIGRETURN_CODE + sizeof(sigreturn_codes)) | ||
11 | 12 | ||
12 | extern const unsigned long sigreturn_codes[7]; | 13 | extern const unsigned long sigreturn_codes[7]; |
14 | extern const unsigned long syscall_restart_code[2]; | ||
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c index d3831f616ee9..9ab4149bd983 100644 --- a/arch/arm/kernel/smp_scu.c +++ b/arch/arm/kernel/smp_scu.c | |||
@@ -37,6 +37,10 @@ void __init scu_enable(void __iomem *scu_base) | |||
37 | u32 scu_ctrl; | 37 | u32 scu_ctrl; |
38 | 38 | ||
39 | scu_ctrl = __raw_readl(scu_base + SCU_CTRL); | 39 | scu_ctrl = __raw_readl(scu_base + SCU_CTRL); |
40 | /* already enabled? */ | ||
41 | if (scu_ctrl & 1) | ||
42 | return; | ||
43 | |||
40 | scu_ctrl |= 1; | 44 | scu_ctrl |= 1; |
41 | __raw_writel(scu_ctrl, scu_base + SCU_CTRL); | 45 | __raw_writel(scu_ctrl, scu_base + SCU_CTRL); |
42 | 46 | ||
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index f838f36eb702..3f361a783f43 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/kernel/traps.c | 2 | * linux/arch/arm/kernel/traps.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995-2002 Russell King | 4 | * Copyright (C) 1995-2009 Russell King |
5 | * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds | 5 | * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -528,7 +528,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
528 | * __kuser_cmpxchg code in entry-armv.S should be aware of its | 528 | * __kuser_cmpxchg code in entry-armv.S should be aware of its |
529 | * existence. Don't ever use this from user code. | 529 | * existence. Don't ever use this from user code. |
530 | */ | 530 | */ |
531 | case 0xfff0: | 531 | case NR(cmpxchg): |
532 | for (;;) { | 532 | for (;;) { |
533 | extern void do_DataAbort(unsigned long addr, unsigned int fsr, | 533 | extern void do_DataAbort(unsigned long addr, unsigned int fsr, |
534 | struct pt_regs *regs); | 534 | struct pt_regs *regs); |
@@ -573,7 +573,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
573 | if not implemented, rather than raising SIGILL. This | 573 | if not implemented, rather than raising SIGILL. This |
574 | way the calling program can gracefully determine whether | 574 | way the calling program can gracefully determine whether |
575 | a feature is supported. */ | 575 | a feature is supported. */ |
576 | if (no <= 0x7ff) | 576 | if ((no & 0xffff) <= 0x7ff) |
577 | return -ENOSYS; | 577 | return -ENOSYS; |
578 | break; | 578 | break; |
579 | } | 579 | } |
@@ -751,6 +751,8 @@ void __init early_trap_init(void) | |||
751 | */ | 751 | */ |
752 | memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, | 752 | memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, |
753 | sizeof(sigreturn_codes)); | 753 | sizeof(sigreturn_codes)); |
754 | memcpy((void *)KERN_RESTART_CODE, syscall_restart_code, | ||
755 | sizeof(syscall_restart_code)); | ||
754 | 756 | ||
755 | flush_icache_range(vectors, vectors + PAGE_SIZE); | 757 | flush_icache_range(vectors, vectors + PAGE_SIZE); |
756 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); | 758 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); |
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 39baf1128bfa..786ac2b6914a 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c | |||
@@ -26,6 +26,15 @@ | |||
26 | * http://infocenter.arm.com/help/topic/com.arm.doc.subset.swdev.abi/index.html | 26 | * http://infocenter.arm.com/help/topic/com.arm.doc.subset.swdev.abi/index.html |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #if !defined (__ARM_EABI__) | ||
30 | #warning Your compiler does not have EABI support. | ||
31 | #warning ARM unwind is known to compile only with EABI compilers. | ||
32 | #warning Change compiler or disable ARM_UNWIND option. | ||
33 | #elif (__GNUC__ == 4 && __GNUC_MINOR__ <= 2) | ||
34 | #warning Your compiler is too buggy; it is known to not compile ARM unwind support. | ||
35 | #warning Change compiler or disable ARM_UNWIND option. | ||
36 | #endif | ||
37 | |||
29 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
30 | #include <linux/init.h> | 39 | #include <linux/init.h> |
31 | #include <linux/module.h> | 40 | #include <linux/module.h> |