"Fossies" - the Fresh Open Source Software Archive

Member "openpa-1.0.4/src/primitives/opa_gcc_intel_32_64_barrier.h" (5 Dec 2012, 1077 Bytes) of package /linux/misc/openpa-1.0.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "opa_gcc_intel_32_64_barrier.h" see the Fossies "Dox" file reference documentation.

    1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
    2 /*
    3  *  (C) 2008 by Argonne National Laboratory.
    4  *      See COPYRIGHT in top-level directory.
    5  */
    6 
    7 #ifndef OPA_GCC_INTEL_32_64_BARRIER_H_INCLUDED
    8 #define OPA_GCC_INTEL_32_64_BARRIER_H_INCLUDED
    9 
   10 #define OPA_compiler_barrier()   __asm__ __volatile__  ( "" ::: "memory" )
   11 
   12 /* For all regular memory (write-back cacheable, not driver/graphics
   13  * memory), there is only one general ordering relaxation permitted by
   14  * x86/x86_64 processors: earlier stores may be retired after later
   15  * stores.  The "clflush" and "movnt*" instructions also don't follow
   16  * general ordering constraints, although any code using these
   17  * instructions should be responsible for ensuring proper ordering
   18  * itself.  So our read and write barriers may be implemented as simple
   19  * compiler barriers. */
   20 #define OPA_write_barrier() OPA_compiler_barrier()
   21 #define OPA_read_barrier()  OPA_compiler_barrier()
   22 
   23 #define OPA_read_write_barrier() __asm__ __volatile__  ( "mfence" ::: "memory" )
   24 
   25 #endif /* OPA_GCC_INTEL_32_64_BARRIER_H_INCLUDED */