aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2022-10-24 11:20:15 +0200
committerCédric Le Goater <clg@kaod.org>2022-10-24 11:20:15 +0200
commitb84a9482a3c9e3b6fbdf1fd4b0477e4a7a51683e (patch)
tree3059a9ebf45c60cab849ad5504abdf3d39fc3241 /include/hw
parentdb96605a49b334eeb2a5d1cc12981778f7d792aa (diff)
downloadqemu-b84a9482a3c9e3b6fbdf1fd4b0477e4a7a51683e.zip
qemu-b84a9482a3c9e3b6fbdf1fd4b0477e4a7a51683e.tar.gz
qemu-b84a9482a3c9e3b6fbdf1fd4b0477e4a7a51683e.tar.bz2
aspeed/smc: Cache AspeedSMCClass
Store a reference on the AspeedSMC class under the flash object and use it when accessing the flash contents. Avoiding the class cast checkers in these hot paths improves performance by 10% when running the aspeed avocado tests. Message-Id: <20220923084803.498337-7-clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/ssi/aspeed_smc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h
index 2d5f8f3..8e1dda5 100644
--- a/include/hw/ssi/aspeed_smc.h
+++ b/include/hw/ssi/aspeed_smc.h
@@ -30,6 +30,7 @@
#include "qom/object.h"
struct AspeedSMCState;
+struct AspeedSMCClass;
#define TYPE_ASPEED_SMC_FLASH "aspeed.smc.flash"
OBJECT_DECLARE_SIMPLE_TYPE(AspeedSMCFlash, ASPEED_SMC_FLASH)
@@ -37,6 +38,7 @@ struct AspeedSMCFlash {
SysBusDevice parent_obj;
struct AspeedSMCState *controller;
+ struct AspeedSMCClass *asc;
uint8_t cs;
MemoryRegion mmio;