Memory Fence on MIPS

Marc Lehmann schmorp at
Wed Feb 22 02:53:18 CET 2012

On Tue, Feb 21, 2012 at 05:59:39PM +0200, Anton Kirilov <akirilov at> wrote:
> I have attached my implementation of a memory fence on MIPS. Unfortunately, I have been unable to test it extensively, since I only have access to MIPS-based SoCs that are single core, but I have based it on the MIPS32 architecture manual ( 
> ), and the code is consistent with what is generated by GCC. Actually, it is the same for MIPS64.

Thanks - "not tested extensively" means that you actually did compile and run
it though? That is quite enough for me.

> +    #elif defined(__mips)
> +      #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("sync" : : : "memory")

predef lists __mips__ as preferred symbol for gcc on mips - could you see
whether this works with __mips__ as well?

(I applied it with __mips__ in the meantime).

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list