aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/entry-armv.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r--arch/arm/kernel/entry-armv.S17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index d401d908c463..964cd717506b 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -333,10 +333,14 @@ __pabt_svc:
333 @ from the exception stack 333 @ from the exception stack
334 334
335#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) 335#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
336#ifndef CONFIG_MMU
337#warning "NPTL on non MMU needs fixing"
338#else
336 @ make sure our user space atomic helper is aborted 339 @ make sure our user space atomic helper is aborted
337 cmp r2, #TASK_SIZE 340 cmp r2, #TASK_SIZE
338 bichs r3, r3, #PSR_Z_BIT 341 bichs r3, r3, #PSR_Z_BIT
339#endif 342#endif
343#endif
340 344
341 @ 345 @
342 @ We are now ready to fill in the remaining blanks on the stack: 346 @ We are now ready to fill in the remaining blanks on the stack:
@@ -705,7 +709,12 @@ __kuser_memory_barrier: @ 0xffff0fa0
705 * The C flag is also set if *ptr was changed to allow for assembly 709 * The C flag is also set if *ptr was changed to allow for assembly
706 * optimization in the calling code. 710 * optimization in the calling code.
707 * 711 *
708 * Note: this routine already includes memory barriers as needed. 712 * Notes:
713 *
714 * - This routine already includes memory barriers as needed.
715 *
716 * - A failure might be transient, i.e. it is possible, although unlikely,
717 * that "failure" be returned even if *ptr == oldval.
709 * 718 *
710 * For example, a user space atomic_add implementation could look like this: 719 * For example, a user space atomic_add implementation could look like this:
711 * 720 *
@@ -756,12 +765,18 @@ __kuser_cmpxchg: @ 0xffff0fc0
756 * exception happening just after the str instruction which would 765 * exception happening just after the str instruction which would
757 * clear the Z flag although the exchange was done. 766 * clear the Z flag although the exchange was done.
758 */ 767 */
768#ifdef CONFIG_MMU
759 teq ip, ip @ set Z flag 769 teq ip, ip @ set Z flag
760 ldr ip, [r2] @ load current val 770 ldr ip, [r2] @ load current val
761 add r3, r2, #1 @ prepare store ptr 771 add r3, r2, #1 @ prepare store ptr
762 teqeq ip, r0 @ compare with oldval if still allowed 772 teqeq ip, r0 @ compare with oldval if still allowed
763 streq r1, [r3, #-1]! @ store newval if still allowed 773 streq r1, [r3, #-1]! @ store newval if still allowed
764 subs r0, r2, r3 @ if r2 == r3 the str occured 774 subs r0, r2, r3 @ if r2 == r3 the str occured
775#else
776#warning "NPTL on non MMU needs fixing"
777 mov r0, #-1
778 adds r0, r0, #0
779#endif
765 mov pc, lr 780 mov pc, lr
766 781
767#else 782#else