summaryrefslogtreecommitdiffstats
path: root/include/hw/misc/aspeed_scu.h
diff options
context:
space:
mode:
authorEduardo Habkost2020-09-03 22:43:22 +0200
committerEduardo Habkost2020-09-09 15:26:43 +0200
commitdb1015e92e04835c9eb50c29625fe566d1202dbd (patch)
tree41fbc0bf3e3f29b7ecb339224a049e3f2a7db8fa /include/hw/misc/aspeed_scu.h
parentDelete duplicate QOM typedefs (diff)
downloadqemu-db1015e92e04835c9eb50c29625fe566d1202dbd.tar.gz
qemu-db1015e92e04835c9eb50c29625fe566d1202dbd.tar.xz
qemu-db1015e92e04835c9eb50c29625fe566d1202dbd.zip
Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE. Patch generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]') which will: - move the typedefs and #defines above the type check macros - add missing #include "qom/object.h" lines if necessary Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/misc/aspeed_scu.h')
-rw-r--r--include/hw/misc/aspeed_scu.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
index 9cd530afa2..feebb1baf6 100644
--- a/include/hw/misc/aspeed_scu.h
+++ b/include/hw/misc/aspeed_scu.h
@@ -12,8 +12,11 @@
#define ASPEED_SCU_H
#include "hw/sysbus.h"
+#include "qom/object.h"
#define TYPE_ASPEED_SCU "aspeed.scu"
+typedef struct AspeedSCUClass AspeedSCUClass;
+typedef struct AspeedSCUState AspeedSCUState;
#define ASPEED_SCU(obj) OBJECT_CHECK(AspeedSCUState, (obj), TYPE_ASPEED_SCU)
#define TYPE_ASPEED_2400_SCU TYPE_ASPEED_SCU "-ast2400"
#define TYPE_ASPEED_2500_SCU TYPE_ASPEED_SCU "-ast2500"
@@ -22,7 +25,7 @@
#define ASPEED_SCU_NR_REGS (0x1A8 >> 2)
#define ASPEED_AST2600_SCU_NR_REGS (0xE20 >> 2)
-typedef struct AspeedSCUState {
+struct AspeedSCUState {
/*< private >*/
SysBusDevice parent_obj;
@@ -34,7 +37,7 @@ typedef struct AspeedSCUState {
uint32_t hw_strap1;
uint32_t hw_strap2;
uint32_t hw_prot_key;
-} AspeedSCUState;
+};
#define AST2400_A0_SILICON_REV 0x02000303U
#define AST2400_A1_SILICON_REV 0x02010303U
@@ -52,7 +55,7 @@ extern bool is_supported_silicon_rev(uint32_t silicon_rev);
#define ASPEED_SCU_GET_CLASS(obj) \
OBJECT_GET_CLASS(AspeedSCUClass, (obj), TYPE_ASPEED_SCU)
-typedef struct AspeedSCUClass {
+struct AspeedSCUClass {
SysBusDeviceClass parent_class;
const uint32_t *resets;
@@ -60,7 +63,7 @@ typedef struct AspeedSCUClass {
uint32_t apb_divider;
uint32_t nr_regs;
const MemoryRegionOps *ops;
-} AspeedSCUClass;
+};
#define ASPEED_SCU_PROT_KEY 0x1688A8A8