[alsa-devel] [PATCH] add atomic operations for Blackfin parts
Signed-off-by: Mike Frysinger vapier@gentoo.org --- include/iatomic.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/include/iatomic.h b/include/iatomic.h index 8f6ec22..e92dbfd 100644 --- a/include/iatomic.h +++ b/include/iatomic.h @@ -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.
On Sun, Jan 17, 2010 at 04:55:03PM -0500, Mike Frysinger wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
You've sent this to alsa-devel which I'm guessing was a typo? :)
On Sunday 17 January 2010 17:36:59 Mark Brown wrote:
On Sun, Jan 17, 2010 at 04:55:03PM -0500, Mike Frysinger wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
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
On Sun, Jan 17, 2010 at 05:48:02PM -0500, Mike Frysinger wrote:
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).
At Sun, 17 Jan 2010 16:55:03 -0500, Mike Frysinger wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
Applied now. Thanks.
Takashi
include/iatomic.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/include/iatomic.h b/include/iatomic.h index 8f6ec22..e92dbfd 100644 --- a/include/iatomic.h +++ b/include/iatomic.h @@ -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.
-- 1.6.6
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
participants (3)
-
Mark Brown
-
Mike Frysinger
-
Takashi Iwai