Ignore:
Timestamp:
2006-12-14T21:19:37Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
771cd22
Parents:
9a8baed
Message:

Convert sparc64 critical section barriers to RMO memory model.
More portable, no confusion from documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/barrier.h

    r9a8baed r1ecdbb0  
    3737
    3838/*
    39  * We assume TSO memory model in which only reads can pass earlier stores
    40  * (but not earlier reads). Therefore, CS_ENTER_BARRIER() and CS_LEAVE_BARRIER()
    41  * can be empty.
     39 * Our critical section barriers are prepared for the weakest RMO memory model.
    4240 */
    43 #define CS_ENTER_BARRIER()      __asm__ volatile ("" ::: "memory")
    44 #define CS_LEAVE_BARRIER()      __asm__ volatile ("" ::: "memory")
     41#define CS_ENTER_BARRIER()                              \
     42        __asm__ volatile (                              \
     43                "membar #LoadLoad | #LoadStore\n"       \
     44                ::: "memory"                            \
     45        )
     46#define CS_LEAVE_BARRIER()                              \
     47        __asm__ volatile (                              \
     48                "membar #StoreStore\n"                  \
     49                "membar #LoadStore\n"                   \
     50                ::: "memory"                            \
     51        )
    4552
    46 #define memory_barrier()        __asm__ volatile ("membar #LoadLoad | #StoreStore\n" ::: "memory")
    47 #define read_barrier()          __asm__ volatile ("membar #LoadLoad\n" ::: "memory")
    48 #define write_barrier()         __asm__ volatile ("membar #StoreStore\n" ::: "memory")
     53#define memory_barrier()        \
     54        __asm__ volatile ("membar #LoadLoad | #StoreStore\n" ::: "memory")
     55#define read_barrier()          \
     56        __asm__ volatile ("membar #LoadLoad\n" ::: "memory")
     57#define write_barrier()         \
     58        __asm__ volatile ("membar #StoreStore\n" ::: "memory")
    4959
    5060/** Flush Instruction Memory instruction. */
Note: See TracChangeset for help on using the changeset viewer.