diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-03 17:31:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-03 17:31:24 -0400 |
commit | be82ae0238b0453afcf4a76f0512b7dde34ba500 (patch) | |
tree | aaa3f5f11fd51fd73365ee1a2164aad9a03de060 /arch/arm/kernel/traps.c | |
parent | 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 (diff) | |
parent | 7b70c4275f28702b76b273c8534c38f8313812e9 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (291 commits)
ARM: AMBA: Add pclk support to AMBA bus infrastructure
ARM: 6278/2: fix regression in RealView after the introduction of pclk
ARM: 6277/1: mach-shmobile: Allow users to select HZ, default to 128
ARM: 6276/1: mach-shmobile: remove duplicate NR_IRQS_LEGACY
ARM: 6246/1: mmci: support larger MMCIDATALENGTH register
ARM: 6245/1: mmci: enable hardware flow control on Ux500 variants
ARM: 6244/1: mmci: add variant data and default MCICLOCK support
ARM: 6243/1: mmci: pass power_mode to the translate_vdd callback
ARM: 6274/1: add global control registers definition header file for nuc900
mx2_camera: fix type of dma buffer virtual address pointer
mx2_camera: Add soc_camera support for i.MX25/i.MX27
arm/imx/gpio: add spinlock protection
ARM: Add support for the LPC32XX arch
ARM: LPC32XX: Arch config menu supoport and makefiles
ARM: LPC32XX: Phytec 3250 platform support
ARM: LPC32XX: Misc support functions
ARM: LPC32XX: Serial support code
ARM: LPC32XX: System suspend support
ARM: LPC32XX: GPIO, timer, and IRQ drivers
ARM: LPC32XX: Clock driver
...
Diffstat (limited to 'arch/arm/kernel/traps.c')
-rw-r--r-- | arch/arm/kernel/traps.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 1621e5327b2a..cda78d59aa31 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/unistd.h> | 30 | #include <asm/unistd.h> |
31 | #include <asm/traps.h> | 31 | #include <asm/traps.h> |
32 | #include <asm/unwind.h> | 32 | #include <asm/unwind.h> |
33 | #include <asm/tls.h> | ||
33 | 34 | ||
34 | #include "ptrace.h" | 35 | #include "ptrace.h" |
35 | #include "signal.h" | 36 | #include "signal.h" |
@@ -518,17 +519,20 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
518 | 519 | ||
519 | case NR(set_tls): | 520 | case NR(set_tls): |
520 | thread->tp_value = regs->ARM_r0; | 521 | thread->tp_value = regs->ARM_r0; |
521 | #if defined(CONFIG_HAS_TLS_REG) | 522 | if (tls_emu) |
522 | asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (regs->ARM_r0) ); | 523 | return 0; |
523 | #elif !defined(CONFIG_TLS_REG_EMUL) | 524 | if (has_tls_reg) { |
524 | /* | 525 | asm ("mcr p15, 0, %0, c13, c0, 3" |
525 | * User space must never try to access this directly. | 526 | : : "r" (regs->ARM_r0)); |
526 | * Expect your app to break eventually if you do so. | 527 | } else { |
527 | * The user helper at 0xffff0fe0 must be used instead. | 528 | /* |
528 | * (see entry-armv.S for details) | 529 | * User space must never try to access this directly. |
529 | */ | 530 | * Expect your app to break eventually if you do so. |
530 | *((unsigned int *)0xffff0ff0) = regs->ARM_r0; | 531 | * The user helper at 0xffff0fe0 must be used instead. |
531 | #endif | 532 | * (see entry-armv.S for details) |
533 | */ | ||
534 | *((unsigned int *)0xffff0ff0) = regs->ARM_r0; | ||
535 | } | ||
532 | return 0; | 536 | return 0; |
533 | 537 | ||
534 | #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG | 538 | #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG |
@@ -743,6 +747,16 @@ void __init trap_init(void) | |||
743 | return; | 747 | return; |
744 | } | 748 | } |
745 | 749 | ||
750 | static void __init kuser_get_tls_init(unsigned long vectors) | ||
751 | { | ||
752 | /* | ||
753 | * vectors + 0xfe0 = __kuser_get_tls | ||
754 | * vectors + 0xfe8 = hardware TLS instruction at 0xffff0fe8 | ||
755 | */ | ||
756 | if (tls_emu || has_tls_reg) | ||
757 | memcpy((void *)vectors + 0xfe0, (void *)vectors + 0xfe8, 4); | ||
758 | } | ||
759 | |||
746 | void __init early_trap_init(void) | 760 | void __init early_trap_init(void) |
747 | { | 761 | { |
748 | unsigned long vectors = CONFIG_VECTORS_BASE; | 762 | unsigned long vectors = CONFIG_VECTORS_BASE; |
@@ -761,6 +775,11 @@ void __init early_trap_init(void) | |||
761 | memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz); | 775 | memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz); |
762 | 776 | ||
763 | /* | 777 | /* |
778 | * Do processor specific fixups for the kuser helpers | ||
779 | */ | ||
780 | kuser_get_tls_init(vectors); | ||
781 | |||
782 | /* | ||
764 | * Copy signal return handlers into the vector page, and | 783 | * Copy signal return handlers into the vector page, and |
765 | * set sigreturn to be a pointer to these. | 784 | * set sigreturn to be a pointer to these. |
766 | */ | 785 | */ |