summary refs log tree commit diff stats
path: root/include/hw/ssi/aspeed_smc.h
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/ssi/aspeed_smc.h
parentdb96605a49b334eeb2a5d1cc12981778f7d792aa (diff)
downloadfocaccia-qemu-b84a9482a3c9e3b6fbdf1fd4b0477e4a7a51683e.tar.gz
focaccia-qemu-b84a9482a3c9e3b6fbdf1fd4b0477e4a7a51683e.zip
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/ssi/aspeed_smc.h')
-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 2d5f8f3d8f..8e1dda556b 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;