*参照元 [#ee6ba5e6] #backlinks *説明 [#m940acc0] -パス: [[linux-4.4.1/arch/arm/kernel/setup.c]] -FIXME: これは何? --説明 **引数 [#i91d9862] -なし **返り値 [#d0aa9208] -なし **参考 [#nbc85b48] *実装 [#zf1f77c8] static void __init cacheid_init(void) { unsigned int arch = cpu_architecture(); - --[[linux-4.4.1/cpu_architecture()]] if (arch == CPU_ARCH_ARMv7M) { cacheid = 0; - --[[linux-4.4.1/CPU_ARCH_ARMv7M]] } else if (arch >= CPU_ARCH_ARMv6) { unsigned int cachetype = read_cpuid_cachetype(); if ((cachetype & (7 << 29)) == 4 << 29) { /* ARMv7 register format */ arch = CPU_ARCH_ARMv7; cacheid = CACHEID_VIPT_NONALIASING; switch (cachetype & (3 << 14)) { case (1 << 14): cacheid |= CACHEID_ASID_TAGGED; break; case (3 << 14): cacheid |= CACHEID_PIPT; break; } - --[[linux-4.4.1/read_cpuid_cachetype()]] --[[linux-4.4.1/CPU_ARCH_ARMv7]] --[[linux-4.4.1/CACHEID_VIPT_NONALIASING]] --[[linux-4.4.1/CACHEID_ASID_TAGGED]] --[[linux-4.4.1/CACHEID_PIPT]] } else { arch = CPU_ARCH_ARMv6; if (cachetype & (1 << 23)) cacheid = CACHEID_VIPT_ALIASING; else cacheid = CACHEID_VIPT_NONALIASING; } if (cpu_has_aliasing_icache(arch)) cacheid |= CACHEID_VIPT_I_ALIASING; - --[[linux-4.4.1/CPU_ARCH_ARMv6]] --[[linux-4.4.1/CACHEID_VIPT_ALIASING]] --[[linux-4.4.1/CACHEID_VIPT_NONALIASING]] --[[linux-4.4.1/cpu_has_aliasing_icache()]] --[[linux-4.4.1/CACHEID_VIPT_I_ALIASING]] } else { cacheid = CACHEID_VIVT; -ARMv6 より前は VIVT キャッシュ。 --[[linux-4.4.1/CACHEID_VIVT]] } pr_info("CPU: %s data cache, %s instruction cache\n", cache_is_vivt() ? "VIVT" : cache_is_vipt_aliasing() ? "VIPT aliasing" : cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown", cache_is_vivt() ? "VIVT" : icache_is_vivt_asid_tagged() ? "VIVT ASID tagged" : icache_is_vipt_aliasing() ? "VIPT aliasing" : icache_is_pipt() ? "PIPT" : cache_is_vipt_nonaliasing() ? "VIPT nonaliasing" : "unknown"); - --[[linux-4.4.1/pr_info()]] --[[linux-4.4.1/cache_is_vivt()]] --[[linux-4.4.1/cache_is_vipt_aliasing()]] --[[linux-4.4.1/cache_is_vipt_nonaliasing()]] --[[linux-4.4.1/cache_is_vivt()]] --[[linux-4.4.1/icache_is_vivt_asid_tagged()]] --[[linux-4.4.1/icache_is_vipt_aliasing()]] --[[linux-4.4.1/icache_is_pipt()]] } *コメント [#re9abadd]