Changes in kernel/arch/arm32/include/barrier.h [2a8f38a:7dc8bf1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/barrier.h
r2a8f38a r7dc8bf1 39 39 /* 40 40 * TODO: implement true ARM memory barriers for macros below. 41 * ARMv6 introduced user access of the following commands: 42 * • Prefetch flush 43 * • Data synchronization barrier 44 * • Data memory barrier 45 * • Clean and prefetch range operations. 46 * ARM Architecture Reference Manual version I ch. B.3.2.1 p. B3-4 41 47 */ 42 48 #define CS_ENTER_BARRIER() asm volatile ("" ::: "memory") … … 54 60 #define read_barrier() asm volatile ("dsb" ::: "memory") 55 61 #define write_barrier() asm volatile ("dsb st" ::: "memory") 56 #elif defined PROCESSOR_ARCH_armv657 /* ARMv6- use system control coprocessor (CP15) for memory barrier instructions.58 * Although at least mcr p15, 0, r0, c7, c10, 4 is mentioned in earlier archs,59 * CP15 implementation is mandatory only for armv6+.60 */61 #define memory_barrier() asm volatile ("ldr r0, =0\nmcr p15, 0, r0, c7, c10, 5" ::: "r0", "memory")62 #define read_barrier() asm volatile ("ldr r0, =0\nmcr p15, 0, r0, c7, c10, 4" ::: "r0", "memory")63 #define write_barrier() read_barrier()64 62 #else 65 /* Older manuals mention syscalls as a way to implement cache coherency and66 * barriers. See for example ARM Architecture Reference Manual Version D67 * chapter 2.7.4 Prefetching and self-modifying code (p. A2-28)68 */69 // TODO implement on per PROCESSOR basis70 63 #define memory_barrier() asm volatile ("" ::: "memory") 71 64 #define read_barrier() asm volatile ("" ::: "memory") 72 65 #define write_barrier() asm volatile ("" ::: "memory") 73 66 #endif 74 75 67 /* 76 68 * There are multiple ways ICache can be implemented on ARM machines. Namely … … 88 80 */ 89 81 90 /* Available on both all supported arms, 82 #ifdef PROCESSOR_ARCH_armv7_a 83 #define smc_coherence(a) asm volatile ( "isb" ::: "memory") 84 #define smc_coherence_block(a, l) smc_coherence(a) 85 #else 86 /* Available on all supported arms, 91 87 * invalidates entire ICache so the written value does not matter. */ 88 //TODO might be PL1 only on armv5 - 92 89 #define smc_coherence(a) asm volatile ( "mcr p15, 0, r0, c7, c5, 0") 93 90 #define smc_coherence_block(a, l) smc_coherence(a) 91 #endif 94 92 95 93
Note:
See TracChangeset
for help on using the changeset viewer.