shared_fooの不要ディレクトリ削除前のもの
Révision | 4e9090810a8b6f08dc600d31149aa3c4bb95fb1e (tree) |
---|---|
l'heure | 2018-03-11 16:51:09 |
Auteur | takemasa <suikan@user...> |
Commiter | takemasa |
Cache coherency funciton is now architecture dependent.
@@ -103,9 +103,21 @@ static inline bool IsTaskContext() | ||
103 | 103 | |
104 | 104 | } |
105 | 105 | |
106 | - | |
106 | +/** | |
107 | + * @brief Clean and Flush the specific region of data cache. | |
108 | + * @param address Start address of region | |
109 | + * @param size Size of region | |
110 | + * @details | |
111 | + * Keep coherency between the L2 memory and d-cache, between specific region. | |
112 | + * | |
113 | + * The region is specified by address and size. If address si not 32byte aligned, | |
114 | + * it is truncated to the 32byte alighment, and size is adjusted to follow this alighment. | |
115 | + * | |
116 | + * Once this funciton is returned, the specific region is coherent. | |
117 | + */ | |
107 | 118 | static inline void InvalidateDataCacheByAddress(void * address, size_t size) |
108 | 119 | { |
120 | +#ifdef __CORE_CM7_H_GENERIC | |
109 | 121 | unsigned int aligned_address = reinterpret_cast<unsigned int>(address); |
110 | 122 | |
111 | 123 | // extract modulo 32. The address have to be aligned to 32byte. |
@@ -115,6 +127,11 @@ static inline void InvalidateDataCacheByAddress(void * address, size_t size) | ||
115 | 127 | size += adjustment; // Because the start address is lower, the size is bigger. |
116 | 128 | |
117 | 129 | ::SCB_InvalidateDCache_by_Addr(reinterpret_cast<long unsigned int *>(aligned_address), size); |
130 | +#elif defined ( __CORE_CM0_H_GENERIC ) ||defined ( __CORE_CM0PLUS_H_GENERIC ) ||defined ( __CORE_CM3_H_GENERIC ) ||defined ( __CORE_CM4_H_GENERIC ) || | |
131 | + // Do nothing. These core doesn't have d-cache. | |
132 | +#else | |
133 | +#error "Unknown core" | |
134 | +#endif | |
118 | 135 | } |
119 | 136 | |
120 | 137 | /** |