Subversion Repositories HelenOS

Rev

Rev 2927 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2927 Rev 3153
Line 55... Line 55...
55
#define read_barrier()      \
55
#define read_barrier()      \
56
    asm volatile ("membar #LoadLoad\n" ::: "memory")
56
    asm volatile ("membar #LoadLoad\n" ::: "memory")
57
#define write_barrier()     \
57
#define write_barrier()     \
58
    asm volatile ("membar #StoreStore\n" ::: "memory")
58
    asm volatile ("membar #StoreStore\n" ::: "memory")
59
 
59
 
-
 
60
#define flush(a)        \
-
 
61
    asm volatile ("flush %0\n" :: "r" ((a)) : "memory")
-
 
62
 
60
/** Flush Instruction Memory instruction. */
63
/** Flush Instruction pipeline. */
61
static inline void flush(void)
64
static inline void flush_pipeline(void)
62
{
65
{
63
    /*
66
    /*
64
     * The FLUSH instruction takes address parameter.
67
     * The FLUSH instruction takes address parameter.
65
     * As such, it may trap if the address is not found in DTLB.
68
     * As such, it may trap if the address is not found in DTLB.
66
     *
69
     *
Line 77... Line 80...
77
static inline void membar(void)
80
static inline void membar(void)
78
{
81
{
79
    asm volatile ("membar #Sync\n");
82
    asm volatile ("membar #Sync\n");
80
}
83
}
81
 
84
 
-
 
85
#define smc_coherence(a)    \
-
 
86
{               \
-
 
87
    write_barrier();    \
-
 
88
    flush((a));     \
-
 
89
}
-
 
90
 
-
 
91
#define FLUSH_INVAL_MIN     4
-
 
92
#define smc_coherence_block(a, l)           \
-
 
93
{                           \
-
 
94
    unsigned long i;                \
-
 
95
    write_barrier();                \
-
 
96
    for (i = 0; i < (l); i += FLUSH_INVAL_MIN)  \
-
 
97
        flush((void *)(a) + i);         \
-
 
98
}
-
 
99
 
82
#endif
100
#endif
83
 
101
 
84
/** @}
102
/** @}
85
 */
103
 */