[alsa-devel] [PATCH] add atomic operations for Blackfin parts

Takashi Iwai tiwai at suse.de
Mon Jan 18 08:36:27 CET 2010


At Sun, 17 Jan 2010 16:55:03 -0500,
Mike Frysinger wrote:
> 
> Signed-off-by: Mike Frysinger <vapier at 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 at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 


More information about the Alsa-devel mailing list