/* * Copy everything, then do fixups. Use memcpy() instead of *t = *s * so that GCC replaces it by __memcpy() when KASAN is active
*/
memcpy(t, s, sizeof(*t));
/* * If we are overriding a previous value derived from the real * PVR with a new value obtained using a logical PVR value, * don't modify the performance monitor fields.
*/ if (old.num_pmcs && !s->num_pmcs) {
t->num_pmcs = old.num_pmcs;
t->pmc_type = old.pmc_type;
/* * Let's ensure that the * fix for the PMAO bug is enabled on compatibility mode.
*/
t->cpu_features |= old.cpu_features & CPU_FTR_PMAO_BUG;
}
/* Set kuap ON at startup, will be disabled later if cmdline has 'nosmap' */ if (IS_ENABLED(CONFIG_PPC_KUAP) && IS_ENABLED(CONFIG_PPC32))
t->mmu_features |= MMU_FTR_KUAP;
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
/* * Set the base platform string once; assumes * we're called with real pvr first.
*/ if (*PTRRELOC(&powerpc_base_platform) == NULL)
*PTRRELOC(&powerpc_base_platform) = t->platform;
#ifdefined(CONFIG_PPC64) || defined(CONFIG_BOOKE) /* ppc64 and booke expect identify_cpu to also call setup_cpu for * that processor. I will consolidate that at a later time, for now, * just use #ifdef. We also don't need to PTRRELOC the function * pointer on ppc64 and booke as we are running at 0 in real mode * on ppc64 and reloc_offset is always 0 on booke.
*/ if (t->cpu_setup) {
t->cpu_setup(offset, t);
} #endif/* CONFIG_PPC64 || CONFIG_BOOKE */
for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) { if ((pvr & s->pvr_mask) == s->pvr_value) return setup_cpu_spec(offset, s);
}
BUG();
return NULL;
}
/* * Used by cpufeatures to get the name for CPUs with a PVR table. * If they don't hae a PVR table, cpufeatures gets the name from * cpu device-tree node.
*/ void __init identify_cpu_name(unsignedint pvr)
{ struct cpu_spec *s = cpu_specs; struct cpu_spec *t = &the_cpu_spec; int i;
s = PTRRELOC(s);
t = PTRRELOC(t);
for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) { if ((pvr & s->pvr_mask) == s->pvr_value) {
t->cpu_name = s->cpu_name; return;
}
}
}
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.