summaryrefslogtreecommitdiffstats
path: root/include/hw/i386
diff options
context:
space:
mode:
authorEduardo Habkost2020-08-31 23:07:33 +0200
committerEduardo Habkost2020-09-09 15:27:09 +0200
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /include/hw/i386
parentMove QOM typedefs and add missing includes (diff)
downloadqemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.gz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.xz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.zip
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/i386')
-rw-r--r--include/hw/i386/apic_internal.h8
-rw-r--r--include/hw/i386/ich9.h4
-rw-r--r--include/hw/i386/intel_iommu.h4
-rw-r--r--include/hw/i386/ioapic_internal.h8
-rw-r--r--include/hw/i386/microvm.h8
-rw-r--r--include/hw/i386/pc.h8
-rw-r--r--include/hw/i386/x86-iommu.h8
-rw-r--r--include/hw/i386/x86.h8
8 files changed, 16 insertions, 40 deletions
diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 124f1fad6f..da38541627 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -127,12 +127,8 @@ typedef struct APICCommonState APICCommonState;
#define TYPE_APIC_COMMON "apic-common"
typedef struct APICCommonClass APICCommonClass;
-#define APIC_COMMON(obj) \
- OBJECT_CHECK(APICCommonState, (obj), TYPE_APIC_COMMON)
-#define APIC_COMMON_CLASS(klass) \
- OBJECT_CLASS_CHECK(APICCommonClass, (klass), TYPE_APIC_COMMON)
-#define APIC_COMMON_GET_CLASS(obj) \
- OBJECT_GET_CLASS(APICCommonClass, (obj), TYPE_APIC_COMMON)
+DECLARE_OBJ_CHECKERS(APICCommonState, APICCommonClass,
+ APIC_COMMON, TYPE_APIC_COMMON)
struct APICCommonClass {
DeviceClass parent_class;
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index 8fdac227f2..e750d67975 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -25,8 +25,8 @@ void ich9_generate_smi(void);
#define TYPE_ICH9_LPC_DEVICE "ICH9-LPC"
typedef struct ICH9LPCState ICH9LPCState;
-#define ICH9_LPC_DEVICE(obj) \
- OBJECT_CHECK(ICH9LPCState, (obj), TYPE_ICH9_LPC_DEVICE)
+DECLARE_INSTANCE_CHECKER(ICH9LPCState, ICH9_LPC_DEVICE,
+ TYPE_ICH9_LPC_DEVICE)
struct ICH9LPCState {
/* ICH9 LPC PCI to ISA bridge */
diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
index 53e5d32d54..98cfc77723 100644
--- a/include/hw/i386/intel_iommu.h
+++ b/include/hw/i386/intel_iommu.h
@@ -28,8 +28,8 @@
#define TYPE_INTEL_IOMMU_DEVICE "intel-iommu"
typedef struct IntelIOMMUState IntelIOMMUState;
-#define INTEL_IOMMU_DEVICE(obj) \
- OBJECT_CHECK(IntelIOMMUState, (obj), TYPE_INTEL_IOMMU_DEVICE)
+DECLARE_INSTANCE_CHECKER(IntelIOMMUState, INTEL_IOMMU_DEVICE,
+ TYPE_INTEL_IOMMU_DEVICE)
#define TYPE_INTEL_IOMMU_MEMORY_REGION "intel-iommu-iommu-memory-region"
diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h
index 29ae150727..e9cc2eaf54 100644
--- a/include/hw/i386/ioapic_internal.h
+++ b/include/hw/i386/ioapic_internal.h
@@ -86,12 +86,8 @@ typedef struct IOAPICCommonState IOAPICCommonState;
#define TYPE_IOAPIC_COMMON "ioapic-common"
typedef struct IOAPICCommonClass IOAPICCommonClass;
-#define IOAPIC_COMMON(obj) \
- OBJECT_CHECK(IOAPICCommonState, (obj), TYPE_IOAPIC_COMMON)
-#define IOAPIC_COMMON_CLASS(klass) \
- OBJECT_CLASS_CHECK(IOAPICCommonClass, (klass), TYPE_IOAPIC_COMMON)
-#define IOAPIC_COMMON_GET_CLASS(obj) \
- OBJECT_GET_CLASS(IOAPICCommonClass, (obj), TYPE_IOAPIC_COMMON)
+DECLARE_OBJ_CHECKERS(IOAPICCommonState, IOAPICCommonClass,
+ IOAPIC_COMMON, TYPE_IOAPIC_COMMON)
struct IOAPICCommonClass {
SysBusDeviceClass parent_class;
diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h
index 0556f64206..36dbcdd123 100644
--- a/include/hw/i386/microvm.h
+++ b/include/hw/i386/microvm.h
@@ -64,11 +64,7 @@ struct MicrovmMachineState {
typedef struct MicrovmMachineState MicrovmMachineState;
#define TYPE_MICROVM_MACHINE MACHINE_TYPE_NAME("microvm")
-#define MICROVM_MACHINE(obj) \
- OBJECT_CHECK(MicrovmMachineState, (obj), TYPE_MICROVM_MACHINE)
-#define MICROVM_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(MicrovmMachineClass, obj, TYPE_MICROVM_MACHINE)
-#define MICROVM_MACHINE_CLASS(class) \
- OBJECT_CLASS_CHECK(MicrovmMachineClass, class, TYPE_MICROVM_MACHINE)
+DECLARE_OBJ_CHECKERS(MicrovmMachineState, MicrovmMachineClass,
+ MICROVM_MACHINE, TYPE_MICROVM_MACHINE)
#endif
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 602b57dc5d..421a77acc2 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -123,12 +123,8 @@ struct PCMachineClass {
typedef struct PCMachineClass PCMachineClass;
#define TYPE_PC_MACHINE "generic-pc-machine"
-#define PC_MACHINE(obj) \
- OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
-#define PC_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
-#define PC_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
+DECLARE_OBJ_CHECKERS(PCMachineState, PCMachineClass,
+ PC_MACHINE, TYPE_PC_MACHINE)
/* ioapic.c */
diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h
index dae2eab800..bbfaf44e79 100644
--- a/include/hw/i386/x86-iommu.h
+++ b/include/hw/i386/x86-iommu.h
@@ -28,12 +28,8 @@
#define TYPE_X86_IOMMU_DEVICE ("x86-iommu")
typedef struct X86IOMMUClass X86IOMMUClass;
typedef struct X86IOMMUState X86IOMMUState;
-#define X86_IOMMU_DEVICE(obj) \
- OBJECT_CHECK(X86IOMMUState, (obj), TYPE_X86_IOMMU_DEVICE)
-#define X86_IOMMU_DEVICE_CLASS(klass) \
- OBJECT_CLASS_CHECK(X86IOMMUClass, (klass), TYPE_X86_IOMMU_DEVICE)
-#define X86_IOMMU_DEVICE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(X86IOMMUClass, obj, TYPE_X86_IOMMU_DEVICE)
+DECLARE_OBJ_CHECKERS(X86IOMMUState, X86IOMMUClass,
+ X86_IOMMU_DEVICE, TYPE_X86_IOMMU_DEVICE)
#define X86_IOMMU_SID_INVALID (0xffff)
diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index 42d46cc404..1a188a7dea 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -77,12 +77,8 @@ typedef struct X86MachineState X86MachineState;
#define X86_MACHINE_ACPI "acpi"
#define TYPE_X86_MACHINE MACHINE_TYPE_NAME("x86")
-#define X86_MACHINE(obj) \
- OBJECT_CHECK(X86MachineState, (obj), TYPE_X86_MACHINE)
-#define X86_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(X86MachineClass, obj, TYPE_X86_MACHINE)
-#define X86_MACHINE_CLASS(class) \
- OBJECT_CLASS_CHECK(X86MachineClass, class, TYPE_X86_MACHINE)
+DECLARE_OBJ_CHECKERS(X86MachineState, X86MachineClass,
+ X86_MACHINE, TYPE_X86_MACHINE)
void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86ms);