Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372123
b: refs/heads/master
c: 4fd7591
h: refs/heads/master
i:
  372121: 5700e00
  372119: b64dbfe
v: v3
  • Loading branch information
Will Deacon authored and Russell King committed Apr 3, 2013
1 parent 2d60dba commit b006571
Show file tree
Hide file tree
Showing 2 changed files with 25 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: 029baf14a027a44b3ac8a9fe5cb1e516cbb9007e
refs/heads/master: 4fd75911f6970478444eece952dacb2db9d1e5a5
24 changes: 24 additions & 0 deletions trunk/arch/arm/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,29 @@ typedef struct {

#define ATOMIC64_INIT(i) { (i) }

#ifdef CONFIG_ARM_LPAE
static inline u64 atomic64_read(const atomic64_t *v)
{
u64 result;

__asm__ __volatile__("@ atomic64_read\n"
" ldrd %0, %H0, [%1]"
: "=&r" (result)
: "r" (&v->counter), "Qo" (v->counter)
);

return result;
}

static inline void atomic64_set(atomic64_t *v, u64 i)
{
__asm__ __volatile__("@ atomic64_set\n"
" strd %2, %H2, [%1]"
: "=Qo" (v->counter)
: "r" (&v->counter), "r" (i)
);
}
#else
static inline u64 atomic64_read(const atomic64_t *v)
{
u64 result;
Expand All @@ -269,6 +292,7 @@ static inline void atomic64_set(atomic64_t *v, u64 i)
: "r" (&v->counter), "r" (i)
: "cc");
}
#endif

static inline void atomic64_add(u64 i, atomic64_t *v)
{
Expand Down

0 comments on commit b006571

Please sign in to comment.