- 论坛徽章:
- 9
|
回复 18# arm-linux-gcc
恩,回贴时只看了wiki, 没有去研究代码,ARM Linux对cache alias 确实在软件层面做了处理,令虚拟地址的index一致。在如下代码里arch_get_unmapped_area里就有反映。- #ifdef CONFIG_CPU_V6
- unsigned int cache_type;
- int do_align = 0, aliasing = 0;
- /*
- * We only need to do colour alignment if either the I or D
- * caches alias. This is indicated by bits 9 and 21 of the
- * cache type register.
- */
- cache_type = read_cpuid(CPUID_CACHETYPE);
- if (cache_type != read_cpuid(CPUID_ID)) {
- aliasing = (cache_type | cache_type >> 12) & (1 << 11);
- if (aliasing)
- do_align = filp || flags & MAP_SHARED;
- }
- #else
- #define do_align 0
- #define aliasing 0
- #endif
复制代码 在文件映射或MAP_SHARED共享映射下,都会对返回的虚拟地下做颜色对齐。
要对cache深入了解了不少。{:3_189:}
另外,X86应该是属于VIPT的吧。X86的手册上浏览了一下,没有直接的说明,但下如的网页里有描述:
http://stackoverflow.com/questio ... 64-for-caching-in-t
http://www.motherboardpoint.com/ ... hes-and-mmu.152345/
不知arm-linux-gcc兄能不能找到官方的出处呢。
PPC家里没有手册,没法查。 |
|