Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15227
b: refs/heads/master
c: 7c612bf
h: refs/heads/master
i:
  15225: c874d27
  15223: b887493
v: v3
  • Loading branch information
Nicolas Pitre authored and Russell King committed Dec 19, 2005
1 parent 3f641fc commit 88c805d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 567bd98017d9c9f2ac1c148ddc78c062e8abd398
refs/heads/master: 7c612bfd4ed3064fd48a4877a114c8186547367b
49 changes: 49 additions & 0 deletions trunk/arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,47 @@ ENTRY(__switch_to)
.globl __kuser_helper_start
__kuser_helper_start:

/*
* Reference prototype:
*
* void __kernel_memory_barrier(void)
*
* Input:
*
* lr = return address
*
* Output:
*
* none
*
* Clobbered:
*
* the Z flag might be lost
*
* Definition and user space usage example:
*
* typedef void (__kernel_dmb_t)(void);
* #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
*
* Apply any needed memory barrier to preserve consistency with data modified
* manually and __kuser_cmpxchg usage.
*
* This could be used as follows:
*
* #define __kernel_dmb() \
* asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
* : : : "lr","cc" )
*/

__kuser_memory_barrier: @ 0xffff0fa0

#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
mcr p15, 0, r0, c7, c10, 5 @ dmb
#endif
mov pc, lr

.align 5

/*
* Reference prototype:
*
Expand Down Expand Up @@ -642,6 +683,8 @@ __kuser_helper_start:
* The C flag is also set if *ptr was changed to allow for assembly
* optimization in the calling code.
*
* Note: this routine already includes memory barriers as needed.
*
* For example, a user space atomic_add implementation could look like this:
*
* #define atomic_add(ptr, val) \
Expand Down Expand Up @@ -698,10 +741,16 @@ __kuser_cmpxchg: @ 0xffff0fc0

#else

#ifdef CONFIG_SMP
mcr p15, 0, r0, c7, c10, 5 @ dmb
#endif
ldrex r3, [r2]
subs r3, r3, r0
strexeq r3, r1, [r2]
rsbs r0, r3, #0
#ifdef CONFIG_SMP
mcr p15, 0, r0, c7, c10, 5 @ dmb
#endif
mov pc, lr

#endif
Expand Down

0 comments on commit 88c805d

Please sign in to comment.