/* CLIDR is not present before ARMv7/v7m */ if (cpu_architecture() < CPU_ARCH_ARMv7) return -EOPNOTSUPP;
/* Don't try reading CLIDR if CTR declares old format */
ctr = read_cpuid_cachetype();
format = FIELD_GET(CTR_FORMAT_MASK, ctr); if (format != CTR_FORMAT_ARMV7) return -EOPNOTSUPP;
for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) {
ctype = get_cache_type(level); if (ctype == CACHE_TYPE_NOCACHE) {
level--; break;
} /* Separate instruction and data caches */
leaves += (ctype == CACHE_TYPE_SEPARATE) ? 2 : 1;
}
*level_p = level;
*leaves_p = leaves;
return 0;
}
int early_cache_level(unsignedint cpu)
{ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
int init_cache_level(unsignedint cpu)
{ unsignedint level, leaves; struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); int fw_level; int ret;
ret = detect_cache_level(&level, &leaves); if (ret) return ret;
fw_level = of_find_last_cache_level(cpu);
if (level < fw_level) { /* * some external caches not specified in CLIDR_EL1 * the information may be available in the device tree * only unified external caches are considered here
*/
leaves += (fw_level - level);
level = fw_level;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.