Skip to contentSkip to conversation

add atomic operations for Blackfin parts

PATCH In review Mike Frysinger 3 participants 5 messages Jan 17, 2010 – Jan 18, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add atomic operations for Blackfin parts

---
 include/iatomic.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
include/iatomic.h +23 -0
index 8f6ec22..e92dbfd 100644
@@ -1079,6 +1079,29 @@ static __inline__ int atomic_sub_return(int i, volatile atomic_t *v)
 
 #endif /* __sh__ */
 
+#ifdef __bfin__
+
+#include <bfin_fixed_code.h>
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i)   { (i) }
+
+#define atomic_read(v)   ((v)->counter)
+#define atomic_set(v,i)  (((v)->counter) = (i))
+#define atomic_add(i,v)  bfin_atomic_add32(&(v)->counter, i)
+#define atomic_sub(i,v)  bfin_atomic_sub32(&(v)->counter, i)
+#define atomic_inc(v)    bfin_atomic_inc32(&(v)->counter);
+#define atomic_dec(v)    bfin_atomic_dec32(&(v)->counter);
+
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define rmb() mb()
+#define wmb() mb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __bfin__ */
+
 #ifndef IATOMIC_DEFINED
 /*
  * non supported architecture.
Signature · 1 line
1.6.6
#2 lore raw
Quoted 4 lines · On Sunday 17 January 2010 17:36:59 Mark Brown wrote:
Quoted 1 line · Mike Frysinger

You've sent this to alsa-devel which I'm guessing was a typo? :)

the alsa wiki page says that alsa-devel is for the driver, lib, and alsa apps. if this isnt the right mailing list for alsa-lib, then where should i be sending this ?

http://www.alsa-project.org/main/index.php/Mailing-lists
-mike

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 2 lines · Mike Frysinger

if this isnt the right mailing list for alsa-lib, then where should i be sending this ?

Oh, sorry - my mistake. It looked like a kernel change at first glance (your subject didn't say what you were adding atomic operations to).

#4 lore raw
In reply to Mike Frysinger

At Sun, 17 Jan 2010 16:55:03 -0500,

Quoted 2 lines · Mike Frysinger

Applied now. Thanks.

Takashi

Quoted 46 lines
---
 include/iatomic.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
include/iatomic.h +23 -0
index 8f6ec22..e92dbfd 100644
@@ -1079,6 +1079,29 @@ static __inline__ int atomic_sub_return(int i, volatile atomic_t *v)
 
 #endif /* __sh__ */
 
+#ifdef __bfin__
+
+#include <bfin_fixed_code.h>
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i)   { (i) }
+
+#define atomic_read(v)   ((v)->counter)
+#define atomic_set(v,i)  (((v)->counter) = (i))
+#define atomic_add(i,v)  bfin_atomic_add32(&(v)->counter, i)
+#define atomic_sub(i,v)  bfin_atomic_sub32(&(v)->counter, i)
+#define atomic_inc(v)    bfin_atomic_inc32(&(v)->counter);
+#define atomic_dec(v)    bfin_atomic_dec32(&(v)->counter);
+
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define rmb() mb()
+#define wmb() mb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __bfin__ */
+
 #ifndef IATOMIC_DEFINED
 /*
  * non supported architecture.
Signature · 6 lines
1.6.6

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel