OSDN Git Service

hw/riscv/sifive_e: Fix inheritance of SiFiveEState
authorBernhard Beschow <shentey@gmail.com>
Thu, 22 Sep 2022 07:52:32 +0000 (09:52 +0200)
committerAlistair Francis <alistair@alistair23.me>
Mon, 26 Sep 2022 21:04:38 +0000 (07:04 +1000)
commit9dfa6c2aec299fda9946c327e889087365a715b5
tree4cd5dd763a5e45d2df9e443e8a462e5d8af31b0f
parent9e37653b5c73d8e43013ed78ee9d7644f23d146c
hw/riscv/sifive_e: Fix inheritance of SiFiveEState

SiFiveEState inherits from SysBusDevice while it's TypeInfo claims it to
inherit from TYPE_MACHINE. This is an inconsistency which can cause
undefined behavior such as memory corruption.

Change SiFiveEState to inherit from MachineState since it is registered
as a machine.

Fixes: 0869490b1c ("riscv: sifive_e: Manually define the machine")

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220922075232.33653-1-shentey@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
include/hw/riscv/sifive_e.h