Rev 2927 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2927 | Rev 3153 | ||
---|---|---|---|
Line 43... | Line 43... | ||
43 | 43 | ||
44 | #define memory_barrier() asm volatile ("mf\n" ::: "memory") |
44 | #define memory_barrier() asm volatile ("mf\n" ::: "memory") |
45 | #define read_barrier() memory_barrier() |
45 | #define read_barrier() memory_barrier() |
46 | #define write_barrier() memory_barrier() |
46 | #define write_barrier() memory_barrier() |
47 | 47 | ||
- | 48 | #define srlz_i() \ |
|
48 | #define srlz_i() asm volatile (";; srlz.i ;;\n" ::: "memory") |
49 | asm volatile (";; srlz.i ;;\n" ::: "memory") |
- | 50 | #define srlz_d() \ |
|
49 | #define srlz_d() asm volatile (";; srlz.d\n" ::: "memory") |
51 | asm volatile (";; srlz.d\n" ::: "memory") |
- | 52 | ||
- | 53 | #define fc_i(a) \ |
|
- | 54 | asm volatile ("fc.i %0\n" :: "r" ((a)) : "memory") |
|
- | 55 | #define sync_i() \ |
|
- | 56 | asm volatile (";; sync.i\n" ::: "memory") |
|
- | 57 | ||
- | 58 | #define smc_coherence(a) \ |
|
- | 59 | { \ |
|
- | 60 | fc_i((a)); \ |
|
- | 61 | sync_i(); \ |
|
- | 62 | srlz_i(); \ |
|
- | 63 | } |
|
- | 64 | ||
- | 65 | #define FC_INVAL_MIN 32 |
|
- | 66 | #define smc_coherence_block(a, l) \ |
|
- | 67 | { \ |
|
- | 68 | unsigned long i; \ |
|
- | 69 | for (i = 0; i < (l); i += FC_INVAL_MIN) \ |
|
- | 70 | fc_i((void *)(a) + i); \ |
|
- | 71 | sync_i(); \ |
|
- | 72 | srlz_i(); \ |
|
- | 73 | } |
|
50 | 74 | ||
51 | #endif |
75 | #endif |
52 | 76 | ||
53 | /** @} |
77 | /** @} |
54 | */ |
78 | */ |