[patch] Zero and Shark improved ARM memory barrier implementation

Gary Benson gbenson at redhat.com
Thu Apr 23 03:43:57 PDT 2009


Xerxes Rånby wrote:
> +#ifdef ARM
> +    make_function(
> +      0xffff0fa0,
> +      type,
> +      "__kernel_dmb"));
> +#else

Can you add a little "// __kernel_dmb" after the 0xffff0fa0?

>  inline void OrderAccess::acquire()
>  {
> +#ifdef ARM
> +  __kernel_dmb();
> +#else
>    READ_MEM_BARRIER;
> +#endif // ARM
>  }
>  
>  inline void OrderAccess::release()
>  {
> +#ifdef ARM
> +  __kernel_dmb();
> +#else
>    WRITE_MEM_BARRIER;
> +#endif // ARM
>  }

For these two I'd prefer if you did something like:

  #ifdef ARM
  #define READ_MEM_BARRIER  __kernel_dmb()
  #define WRITE_MEM_BARRIER __kernel_dmb()
  #else
  ... PPC, etc

>  inline void OrderAccess::fence()
>  {
> +#ifdef ARM
> +  __kernel_dmb();
> +#else
>    __sync_synchronize();
> +#endif // ARM
>  }

For this one, can we do it like acquire() and release()?  Define
FULL_MEM_BARRIER as either __kernel_dmb() or __sync_synchronize()
in the same block that defines the other barrier macros?

Cheers,
Gary

-- 
http://gbenson.net/



More information about the distro-pkg-dev mailing list