On Thu, 23 Sept 2021 at 18:17, Philippe Mathieu-Daudé <f4...@amsat.org> wrote:
> Since we provide info->class_init as arm_v7m_class_init(), only
> tcg_ops and gdb_core_xml_file from CPUClass are set:
>
> static void arm_v7m_class_init(ObjectClass *oc, void *data)
> {
>      ARMCPUClass *acc = ARM_CPU_CLASS(oc);
>      CPUClass *cc = CPU_CLASS(oc);
>
>      acc->info = data;
> #ifdef CONFIG_TCG
>      cc->tcg_ops = &arm_v7m_tcg_ops;
> #endif /* CONFIG_TCG */
>
>      cc->gdb_core_xml_file = "arm-m-profile.xml";
> }

This class's parent type is TYPE_ARM_CPU; so TYPE_ARM_CPU's class_init
runs first and sets up most of the class fields. This function only
needs to set the ones which must be different on a M-profile core.

-- PMM

Reply via email to