OSDN Git Service

target/riscv/cpu.c: add .instance_post_init()
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Mon, 25 Sep 2023 17:56:55 +0000 (14:56 -0300)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 12 Oct 2023 02:00:09 +0000 (12:00 +1000)
commit977bbb04525682fd7a2ed8d28c0590bc2873db06
tree12f7a767e853dffbad53da6becb9386c0403e443
parente7443334a87b1cc43d20daacd72db44b530b7a28
target/riscv/cpu.c: add .instance_post_init()

All generic CPUs call riscv_cpu_add_user_properties(). The 'max' CPU
calls riscv_init_max_cpu_extensions(). Both can be moved to a common
instance_post_init() callback, implemented in riscv_cpu_post_init(),
called by all CPUs. The call order then becomes:

riscv_cpu_init() -> cpu_init() of each CPU -> .instance_post_init()

In the near future riscv_cpu_post_init() will call the init() function
of the current accelerator, providing a hook for KVM and TCG accel
classes to change the init() process of the CPU.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20230925175709.35696-6-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.c