Changeset 5265eea4 in mainline for kernel/arch/arm32/include/arch/barrier.h
- Timestamp:
- 2015-10-28T18:17:27Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77a194c, ff381a7
- Parents:
- 0328987 (diff), 5783d10 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/arch/barrier.h
r0328987 r5265eea4 38 38 39 39 #ifdef KERNEL 40 #include <arch/cache.h> 40 41 #include <arch/cp15.h> 42 #include <align.h> 41 43 #else 42 44 #include <libarch/cp15.h> … … 71 73 * CP15 implementation is mandatory only for armv6+. 72 74 */ 75 #if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a) 73 76 #define memory_barrier() CP15DMB_write(0) 74 #define read_barrier() CP15DSB_write(0) 77 #else 78 #define memory_barrier() CP15DSB_write(0) 79 #endif 80 #define read_barrier() CP15DSB_write(0) 75 81 #define write_barrier() read_barrier() 82 #if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a) 76 83 #define inst_barrier() CP15ISB_write(0) 84 #else 85 #define inst_barrier() 86 #endif 77 87 #else 78 88 /* Older manuals mention syscalls as a way to implement cache coherency and … … 103 113 104 114 #if defined PROCESSOR_ARCH_armv7_a | defined PROCESSOR_ARCH_armv6 | defined KERNEL 105 /* Available on all supported arms,106 * invalidates entire ICache so the written value does not matter. */107 115 //TODO might be PL1 only on armv5- 108 116 #define smc_coherence(a) \ 109 117 do { \ 110 DCCMVAU_write((uint32_t)(a)); /* Flush changed memory */\118 dcache_clean_mva_pou(ALIGN_DOWN((uintptr_t) a, CP15_C7_MVA_ALIGN)); \ 111 119 write_barrier(); /* Wait for completion */\ 112 ICIALLU_write(0); /* Flush ICache */\120 icache_invalidate();\ 113 121 inst_barrier(); /* Wait for Inst refetch */\ 114 122 } while (0) … … 117 125 #define smc_coherence_block(a, l) \ 118 126 do { \ 119 for (uintptr_t addr = (uintptr_t)a; addr < (uintptr_t)a + l; addr += 4)\ 127 for (uintptr_t addr = (uintptr_t) a; addr < (uintptr_t) a + l; \ 128 addr += CP15_C7_MVA_ALIGN) \ 120 129 smc_coherence(addr); \ 121 130 } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.