From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166455; cv=none; d=zohomail.com; s=zohoarc; b=m8mi9u+beio3ywGeTqQKPRAK1zMeCw1R4vX1pVMoW8lUYnE4sDqmcUPvODsniulDXKT9pjABgEV2ExPoCB6AMMA37bdLB3NkZYYj3POclvknUiQZ+0WAzUzz1KTMs/FVzQga/WxPD6zSWUkX/MDFzxB37kNbmeUIKALyBbqXIyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166455; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7hrteQtPb4fP2DtxnJ0f5kT2tT98m3hNbWJovhD1H8g=; b=ZVb1n+9U7RQ2omoDvxDL7ODESuzRtsiUywKfEol9+NsOj3o7wltbnrI5zphbimwj9wWej+2eNV8Bky8Xmh5zkaf6/j5/jRjQhrIB8pG1ucu9vOud7Gfb44wBfAkifWbxkfTle25jyQOj/kc468sBo5QQZEWiZ1g3eqRD71G3tks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166455962995.1935288738588; Thu, 3 Sep 2020 13:54:15 -0700 (PDT) Received: from localhost ([::1]:41878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwFK-0001rr-B1 for importer@patchew.org; Thu, 03 Sep 2020 16:54:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwE6-0000LD-1O for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:52:58 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:54456 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwE2-0006WW-Kn for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:52:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-7W868kJQOuWTe8xmm06vSw-1; Thu, 03 Sep 2020 16:52:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA3FF10BBED8; Thu, 3 Sep 2020 20:52:49 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id A75ED7EEAE; Thu, 3 Sep 2020 20:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7hrteQtPb4fP2DtxnJ0f5kT2tT98m3hNbWJovhD1H8g=; b=LEwa2yjlA19VJp/ROzCojsn6tcWxlf8hdxb0Y0Whst8sCPKhFMdCSGYo6TGVE1K9qXsFFU e3fGRX8hNAXwMJrHeQEG9SDE2dW1cLTPspeSiUjZb80on6AA1et7jsGMaLcbBF4g22Ygpf al7swY4nd9QM86AyadtYxc3HlITh7Ws= X-MC-Unique: 7W868kJQOuWTe8xmm06vSw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 01/27] qom: make object_ref/unref use a void * instead of Object *. Date: Thu, 3 Sep 2020 16:52:21 -0400 Message-Id: <20200903205247.1667472-2-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:28:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 The object_ref/unref methods are intended for use with any subclass of the base Object. Using "Object *" in the signature is not adding any meaningful level of type safety, since callers simply use "OBJECT(ptr)" and this expands to an unchecked cast "(Object *)". By using "void *" we enable the object_unref() method to be used to provide support for g_autoptr() with any subclass. Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20200723181410.3145233-2-berrange@redhat.com> Message-Id: <20200831210740.126168-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 4 ++-- qom/object.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 0f3a60617c..1f8aa2d48e 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1035,7 +1035,7 @@ GSList *object_class_get_list_sorted(const char *impl= ements_type, * as its reference count is greater than zero. * Returns: @obj */ -Object *object_ref(Object *obj); +Object *object_ref(void *obj); =20 /** * object_unref: @@ -1044,7 +1044,7 @@ Object *object_ref(Object *obj); * Decrease the reference count of a object. A object cannot be freed as = long * as its reference count is greater than zero. */ -void object_unref(Object *obj); +void object_unref(void *obj); =20 /** * object_property_try_add: diff --git a/qom/object.c b/qom/object.c index 00fdf89b3b..b1822a2ef4 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1124,8 +1124,9 @@ GSList *object_class_get_list_sorted(const char *impl= ements_type, object_class_cmp); } =20 -Object *object_ref(Object *obj) +Object *object_ref(void *objptr) { + Object *obj =3D OBJECT(objptr); if (!obj) { return NULL; } @@ -1133,8 +1134,9 @@ Object *object_ref(Object *obj) return obj; } =20 -void object_unref(Object *obj) +void object_unref(void *objptr) { + Object *obj =3D OBJECT(objptr); if (!obj) { return; } --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166460; cv=none; d=zohomail.com; s=zohoarc; b=lLugZo3dFDxqiQBoYRybscCmGzEqwvM36WKWIWChaQ5ChrkRSUM1gIssQLO5NALmBm1ftRCI16suldFD0ln3Okp9Ak6LIciiYw3TvEnktRU7w9DNkBse0WMjaRjcImUc0wFDMS4diPR4k1mbcRdB+zzDVfH4Ml+kiw45PsgdQqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166460; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LMixTdWx3xSHyeNDQd7dOf205lGXK+svHPxxgSkel34=; b=PUcHm7HprbX3UwUCRm7RQgbYcE4DBbaUZB1ZSj8P19kKUEKIWTS7TLznUTN6MZY1qzUI1FE8HHVU9EivnOkdEBHuHY26GIN3fiOxEOfnIx72ya+XM2Q8qQxsXsCRul2G41QD9I26ufQd10k0iN6fsGTEx7Kfhw9w1gDmIP2+9WY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166459997950.0633418626701; Thu, 3 Sep 2020 13:54:19 -0700 (PDT) Received: from localhost ([::1]:42270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwFP-00022h-37 for importer@patchew.org; Thu, 03 Sep 2020 16:54:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEA-0000Mb-Bn for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwE7-0006YJ-J3 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:01 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-T6CCFmEoOYG18qAr2B6wOA-1; Thu, 03 Sep 2020 16:52:51 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1F111009454; Thu, 3 Sep 2020 20:52:50 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9921C10013C4; Thu, 3 Sep 2020 20:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LMixTdWx3xSHyeNDQd7dOf205lGXK+svHPxxgSkel34=; b=E7ZfVbdgXlO0YFLbCoEZ+K10u/ocjMtgEfhOnV8YEQyKO4gy+kwlEbAAKhxg3yuE/pdttE 46X9g0pHz9SHSLTvftWFkQdGwpWPvQzvA2oN3HOAPI9bB+QUZFsvf162KrXIv8MKIvATsL /DHMjILxGNmjuZx4if0sGD1z6UNwA3Q= X-MC-Unique: T6CCFmEoOYG18qAr2B6wOA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 02/27] qom: provide convenient macros for declaring and defining types Date: Thu, 3 Sep 2020 16:52:22 -0400 Message-Id: <20200903205247.1667472-3-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:47:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation. QOM was loosely inspired by GLib's GObject, and indeed GObject suffers from the same burden of boilerplate code, but has long provided a set of macros to eliminate this burden in the source implementation. More recently it has also provided a set of macros to eliminate this burden in the header declaration. In GLib there are the G_DECLARE_* and G_DEFINE_* family of macros for the header declaration and source implementation respectively: https://developer.gnome.org/gobject/stable/chapter-gobject.html https://developer.gnome.org/gobject/stable/howto-gobject.html This patch takes inspiration from GObject to provide the equivalent functionality for QOM. In the header file, instead of: typedef struct MyDevice MyDevice; typedef struct MyDeviceClass MyDeviceClass; G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref) #define MY_DEVICE_GET_CLASS(void *obj) \ OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE) #define MY_DEVICE_CLASS(void *klass) \ OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE) #define MY_DEVICE(void *obj) OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE) struct MyDeviceClass { DeviceClass parent_class; }; We now have OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) In cases where the class needs some virtual methods, it can be left to be implemented manually using OBJECT_DECLARE_TYPE(MyDevice, my_device, MY_DEVICE) Note that these macros are including support for g_autoptr() for the object types, which is something previously only supported for variables declared as the base Object * type. Meanwhile in the source file, instead of: static void my_device_finalize(Object *obj); static void my_device_class_init(ObjectClass *oc, void *data); static void my_device_init(Object *obj); static const TypeInfo my_device_info =3D { .parent =3D TYPE_DEVICE, .name =3D TYPE_MY_DEVICE, .instance_size =3D sizeof(MyDevice), .instance_init =3D my_device_init, .instance_finalize =3D my_device_finalize, .class_size =3D sizeof(MyDeviceClass), .class_init =3D my_device_class_init, }; static void my_device_register_types(void) { type_register_static(&my_device_info); } type_init(my_device_register_types); We now have OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) Or, if a class needs to implement interfaces: OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, MY_DEVICE, DEVI= CE, { TYPE_USER_CREATABLE }, { NULL }) Or, if a class needs to be abstract OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) IOW, in both cases the maintainer now only has to think about the interesting part of the code which implements useful functionality and avoids much of the boilerplate. Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20200723181410.3145233-3-berrange@redhat.com> [ehabkost: Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC usage] Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 277 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 1f8aa2d48e..f515230f61 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -304,6 +304,119 @@ typedef struct InterfaceInfo InterfaceInfo; * * The first example of such a QOM method was #CPUClass.reset, * another example is #DeviceClass.realize. + * + * # Standard type declaration and definition macros # + * + * A lot of the code outlined above follows a standard pattern and naming + * convention. To reduce the amount of boilerplate code that needs to be + * written for a new type there are two sets of macros to generate the + * common parts in a standard format. + * + * A type is declared using the OBJECT_DECLARE macro family. In types + * which do not require any virtual functions in the class, the + * OBJECT_DECLARE_SIMPLE_TYPE macro is suitable, and is commonly placed + * in the header file: + * + * + * Declaring a simple type + * + * OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + * + * + * + * This is equivalent to the following: + * + * + * Expansion from declaring a simple type + * + * typedef struct MyDevice MyDevice; + * typedef struct MyDeviceClass MyDeviceClass; + * + * G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref) + * + * #define MY_DEVICE_GET_CLASS(void *obj) \ + * OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE) + * #define MY_DEVICE_CLASS(void *klass) \ + * OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE) + * #define MY_DEVICE(void *obj) + * OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE) + * + * struct MyDeviceClass { + * DeviceClass parent_class; + * }; + * + * + * + * The 'struct MyDevice' needs to be declared separately. + * If the type requires virtual functions to be declared in the class + * struct, then the alternative OBJECT_DECLARE_TYPE() macro can be + * used. This does the same as OBJECT_DECLARE_SIMPLE_TYPE(), but without + * the 'struct MyDeviceClass' definition. + * + * To implement the type, the OBJECT_DEFINE macro family is available. + * In the simple case the OBJECT_DEFINE_TYPE macro is suitable: + * + * + * Defining a simple type + * + * OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + * + * + * + * This is equivalent to the following: + * + * + * Expansion from defining a simple type + * + * static void my_device_finalize(Object *obj); + * static void my_device_class_init(ObjectClass *oc, void *data); + * static void my_device_init(Object *obj); + * + * static const TypeInfo my_device_info =3D { + * .parent =3D TYPE_DEVICE, + * .name =3D TYPE_MY_DEVICE, + * .instance_size =3D sizeof(MyDevice), + * .instance_init =3D my_device_init, + * .instance_finalize =3D my_device_finalize, + * .class_size =3D sizeof(MyDeviceClass), + * .class_init =3D my_device_class_init, + * }; + * + * static void + * my_device_register_types(void) + * { + * type_register_static(&my_device_info); + * } + * type_init(my_device_register_types); + * + * + * + * This is sufficient to get the type registered with the type + * system, and the three standard methods now need to be implemented + * along with any other logic required for the type. + * + * If the type needs to implement one or more interfaces, then the + * OBJECT_DEFINE_TYPE_WITH_INTERFACES() macro can be used instead. + * This accepts an array of interface type names. + * + * + * Defining a simple type implementing interfaces + * + * OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, + * MY_DEVICE, DEVICE, + * { TYPE_USER_CREATABLE }, { NULL = }) + * + * + * + * If the type is not intended to be instantiated, then then + * the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: + * + * + * Defining a simple type + * + * OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + * + * */ =20 =20 @@ -440,6 +553,170 @@ struct Object Object *parent; }; =20 +/** + * OBJECT_DECLARE_TYPE: + * @ModuleObjName: the object name with initial capitalization + * @module_obj_name: the object name in lowercase with underscore separato= rs + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs + * + * This macro is typically used in a header file, and will: + * + * - create the typedefs for the object and class structs + * - register the type for use with g_autoptr + * - provide three standard type cast functions + * + * The object struct and class struct need to be declared manually. + */ +#define OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAM= E) \ + typedef struct ModuleObjName ModuleObjName; \ + typedef struct ModuleObjName##Class ModuleObjName##Class; \ + \ + G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \ + \ + static inline G_GNUC_UNUSED ModuleObjName##Class * \ + MODULE_OBJ_NAME##_GET_CLASS(void *obj) \ + { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \ + TYPE_##MODULE_OBJ_NAME); } \ + \ + static inline G_GNUC_UNUSED ModuleObjName##Class * \ + MODULE_OBJ_NAME##_CLASS(void *klass) \ + { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \ + TYPE_##MODULE_OBJ_NAME); } \ + \ + static inline G_GNUC_UNUSED ModuleObjName * \ + MODULE_OBJ_NAME(void *obj) \ + { return OBJECT_CHECK(ModuleObjName, obj, \ + TYPE_##MODULE_OBJ_NAME); } + +/** + * OBJECT_DECLARE_SIMPLE_TYPE: + * @ModuleObjName: the object name with initial caps + * @module_obj_name: the object name in lowercase with underscore separato= rs + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs + * @ParentModuleObjName: the parent object name with initial caps + * + * This does the same as OBJECT_DECLARE_TYPE(), but also declares + * the class struct, thus only the object struct needs to be declare + * manually. + * + * This macro should be used unless the class struct needs to have + * virtual methods declared. + */ +#define OBJECT_DECLARE_SIMPLE_TYPE(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, ParentModuleObjName) \ + OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \ + struct ModuleObjName##Class { ParentModuleObjName##Class parent_class;= }; + + +/** + * OBJECT_DEFINE_TYPE_EXTENDED: + * @ModuleObjName: the object name with initial caps + * @module_obj_name: the object name in lowercase with underscore separato= rs + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs + * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with under= score + * separators + * @ABSTRACT: boolean flag to indicate whether the object can be instantia= ted + * @...: list of initializers for "InterfaceInfo" to declare implemented i= nterfaces + * + * This macro is typically used in a source file, and will: + * + * - declare prototypes for _finalize, _class_init and _init methods + * - declare the TypeInfo struct instance + * - provide the constructor to register the type + * + * After using this macro, implementations of the _finalize, _class_init, + * and _init methods need to be written. Any of these can be zero-line + * no-op impls if no special logic is required for a given type. + * + * This macro should rarely be used, instead one of the more specialized + * macros is usually a better choice. + */ +#define OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAM= E, \ + ABSTRACT, ...) \ + static void \ + module_obj_name##_finalize(Object *obj); \ + static void \ + module_obj_name##_class_init(ObjectClass *oc, void *data); \ + static void \ + module_obj_name##_init(Object *obj); \ + \ + static const TypeInfo module_obj_name##_info =3D { \ + .parent =3D TYPE_##PARENT_MODULE_OBJ_NAME, \ + .name =3D TYPE_##MODULE_OBJ_NAME, \ + .instance_size =3D sizeof(ModuleObjName), \ + .instance_init =3D module_obj_name##_init, \ + .instance_finalize =3D module_obj_name##_finalize, \ + .class_size =3D sizeof(ModuleObjName##Class), \ + .class_init =3D module_obj_name##_class_init, \ + .abstract =3D ABSTRACT, \ + .interfaces =3D (InterfaceInfo[]) { __VA_ARGS__ } , \ + }; \ + \ + static void \ + module_obj_name##_register_types(void) \ + { \ + type_register_static(&module_obj_name##_info); \ + } \ + type_init(module_obj_name##_register_types); + +/** + * OBJECT_DEFINE_TYPE: + * @ModuleObjName: the object name with initial caps + * @module_obj_name: the object name in lowercase with underscore separato= rs + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs + * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with under= score + * separators + * + * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suita= ble + * for the common case of a non-abstract type, without any interfaces. + */ +#define OBJECT_DEFINE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME= , \ + PARENT_MODULE_OBJ_NAME) \ + OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \ + false, { NULL }) + +/** + * OBJECT_DEFINE_TYPE_WITH_INTERFACES: + * @ModuleObjName: the object name with initial caps + * @module_obj_name: the object name in lowercase with underscore separato= rs + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs + * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with under= score + * separators + * @...: list of initializers for "InterfaceInfo" to declare implemented i= nterfaces + * + * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suita= ble + * for the common case of a non-abstract type, with one or more implemented + * interfaces. + * + * Note when passing the list of interfaces, be sure to include the final + * NULL entry, e.g. { TYPE_USER_CREATABLE }, { NULL } + */ +#define OBJECT_DEFINE_TYPE_WITH_INTERFACES(ModuleObjName, module_obj_name,= \ + MODULE_OBJ_NAME, \ + PARENT_MODULE_OBJ_NAME, ...) \ + OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \ + false, __VA_ARGS__) + +/** + * OBJECT_DEFINE_ABSTRACT_TYPE: + * @ModuleObjName: the object name with initial caps + * @module_obj_name: the object name in lowercase with underscore separato= rs + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs + * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with under= score + * separators + * + * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suita= ble + * for defining an abstract type, without any interfaces. + */ +#define OBJECT_DEFINE_ABSTRACT_TYPE(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAM= E) \ + OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \ + true, { NULL }) + /** * TypeInfo: * @name: The name of the type. --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166683; cv=none; d=zohomail.com; s=zohoarc; b=KyNXcdagUzoqAxP2oBzr0gKTqY5+OoTr5qBWrtBo5P1I2uotJJMnePqzzhVY34lKQoUJmNbwaa0rVLrZ4fLFTutbYh0WWUJC2XRr4SHkmEdaH+XsZ2ClmdvOnZE0Y9wH2rDXrkHjrE8y/RIc65PP/eP/2XBfSakoTKddouLioBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166683; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r9wpfpFY9cCriCCJs74ijsD+iryOC4RfWojjLq6lqRU=; b=Dlx59aLPZqrwDmyo2EmgWHmsDgCu4IR6oH3L3j1Ff7oKdBm9g24LVm8AVn3hbgSSSndllxYGr8QXBxZBsX1pCKO1xPlKP8ZjbjzyGKmybaeLmsG2VhTV0K28t+pdH75Lj+rde59nhOACVeN0xgZFTUQ2//UsH8UVJ1Eqc4EHVI4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166683826890.5342184737099; Thu, 3 Sep 2020 13:58:03 -0700 (PDT) Received: from localhost ([::1]:57818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwJ1-0008Uf-3g for importer@patchew.org; Thu, 03 Sep 2020 16:58:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwE7-0000La-Tc for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwE5-0006XM-3x for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:52:59 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-54-Lybpom90O4-M6kL0k5YN8w-1; Thu, 03 Sep 2020 16:52:52 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CD9510BBEC3; Thu, 3 Sep 2020 20:52:52 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2E2519D7D; Thu, 3 Sep 2020 20:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r9wpfpFY9cCriCCJs74ijsD+iryOC4RfWojjLq6lqRU=; b=hgaqr22ocIscFakUHCh+wU+FLMSNoT6nl0H0hIqD78R5LspoSSaIb0E++sbtudhDLTtnlR x1JEInTpmhbzIrD5J00TcFgFoCG9jN3nBi0GSqa4NJZaBWt6+0GK44TKrjFuNFyJ4dF7c/ EI5ythMqCxwQykSQIpD8jXWWj7t4i3c= X-MC-Unique: Lybpom90O4-M6kL0k5YN8w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 03/27] qom: Allow class type name to be specified in OBJECT_DECLARE* Date: Thu, 3 Sep 2020 16:52:23 -0400 Message-Id: <20200903205247.1667472-4-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Many QOM types don't follow the Type/TypeClass pattern on the instance/struct names. Let the class struct name be specified in the OBJECT_DECLARE* macros. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index f515230f61..500e7dfa99 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -555,7 +555,8 @@ struct Object =20 /** * OBJECT_DECLARE_TYPE: - * @ModuleObjName: the object name with initial capitalization + * @InstanceType: instance struct name + * @ClassType: class struct name * @module_obj_name: the object name in lowercase with underscore separato= rs * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs * @@ -567,33 +568,33 @@ struct Object * * The object struct and class struct need to be declared manually. */ -#define OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAM= E) \ - typedef struct ModuleObjName ModuleObjName; \ - typedef struct ModuleObjName##Class ModuleObjName##Class; \ +#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, module_obj_name, MODU= LE_OBJ_NAME) \ + typedef struct InstanceType InstanceType; \ + typedef struct ClassType ClassType; \ \ - G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \ + G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \ \ - static inline G_GNUC_UNUSED ModuleObjName##Class * \ + static inline G_GNUC_UNUSED ClassType * \ MODULE_OBJ_NAME##_GET_CLASS(void *obj) \ - { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \ + { return OBJECT_GET_CLASS(ClassType, obj, \ TYPE_##MODULE_OBJ_NAME); } \ \ - static inline G_GNUC_UNUSED ModuleObjName##Class * \ + static inline G_GNUC_UNUSED ClassType * \ MODULE_OBJ_NAME##_CLASS(void *klass) \ - { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \ + { return OBJECT_CLASS_CHECK(ClassType, klass, \ TYPE_##MODULE_OBJ_NAME); } \ \ - static inline G_GNUC_UNUSED ModuleObjName * \ + static inline G_GNUC_UNUSED InstanceType * \ MODULE_OBJ_NAME(void *obj) \ - { return OBJECT_CHECK(ModuleObjName, obj, \ + { return OBJECT_CHECK(InstanceType, obj, \ TYPE_##MODULE_OBJ_NAME); } =20 /** * OBJECT_DECLARE_SIMPLE_TYPE: - * @ModuleObjName: the object name with initial caps + * @InstanceType: instance struct name * @module_obj_name: the object name in lowercase with underscore separato= rs * @MODULE_OBJ_NAME: the object name in uppercase with underscore separato= rs - * @ParentModuleObjName: the parent object name with initial caps + * @ParentClassType: class struct name of parent type * * This does the same as OBJECT_DECLARE_TYPE(), but also declares * the class struct, thus only the object struct needs to be declare @@ -602,10 +603,10 @@ struct Object * This macro should be used unless the class struct needs to have * virtual methods declared. */ -#define OBJECT_DECLARE_SIMPLE_TYPE(ModuleObjName, module_obj_name, \ - MODULE_OBJ_NAME, ParentModuleObjName) \ - OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \ - struct ModuleObjName##Class { ParentModuleObjName##Class parent_class;= }; +#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, module_obj_name, \ + MODULE_OBJ_NAME, ParentClassType) \ + OBJECT_DECLARE_TYPE(InstanceType, InstanceType##Class, module_obj_name= , MODULE_OBJ_NAME) \ + struct InstanceType##Class { ParentClassType parent_class; }; =20 =20 /** --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166758; cv=none; d=zohomail.com; s=zohoarc; b=TfPLGZsZigI4wmgJIxTUuqS85QvdPu2IwTAfYQ5FKODEtK6RCFyMM6j/InkmuXtnGv1soQX5p1LJhdrOzF6OunSAspu7yY2tq0pv1Muh06mANPcqo1hQHZ3G6AUfDS/qdGlnwLRULBIDjGMb/UVHh8RVlQtoBpRWllT6L1y6F6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166758; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TzJ0fBUbaOGpIRJlrVvOmS3lXKZBwJYdPPskPKJO3e8=; b=VtND+kARzQmAeEFWi7FLjwjTyVae7bQ8Ctbpf159ZfABduAIwYgcqYS1ksVYYvyL6VX2oS8OnJOObbUVnCnd/xu0kS5ZNCptZkfflpfGpVmFgCLvAmEnGCjQZEO3OuEE7OxXPlMk7uvKQJlcLXeFkhxxHlDNQN2EG/mmlZOLWhY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166758122444.0862806992825; Thu, 3 Sep 2020 13:59:18 -0700 (PDT) Received: from localhost ([::1]:34764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwK8-00028Y-LI for importer@patchew.org; Thu, 03 Sep 2020 16:59:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwE8-0000Lc-4U for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55141) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwE5-0006XU-Ml for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:52:59 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-534-FEOqU7_sN32EiIYmuV-b-Q-1; Thu, 03 Sep 2020 16:52:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F171801AEC; Thu, 3 Sep 2020 20:52:53 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 288405D9CC; Thu, 3 Sep 2020 20:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzJ0fBUbaOGpIRJlrVvOmS3lXKZBwJYdPPskPKJO3e8=; b=Wp5aV4KR7EMDpjSfefSueRXaISV0Fvyh5UseA84cEHPqES1YHrkblP9IeAeCi/ZveLdOcx Bj8Ia+kqVVsMo0NCMV0X+NQyHw+j+6tZ95+4diFcLtO/yR8k8GVzgQn2znIyCshSkG7W4a XNuhpEWDGuBQIcDL+4DRaZCOph8rhEQ= X-MC-Unique: FEOqU7_sN32EiIYmuV-b-Q-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 04/27] qom: DECLARE_*_CHECKERS macros Date: Thu, 3 Sep 2020 16:52:24 -0400 Message-Id: <20200903205247.1667472-5-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Sometimes the typedefs are buried inside another header, but we want to benefit from the automatic definition of type cast functions. Introduce macros that will let type checkers be defined when typedefs are already available. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 72 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 500e7dfa99..4cd84998c2 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -553,6 +553,62 @@ struct Object Object *parent; }; =20 +/** + * DECLARE_INSTANCE_CHECKER: + * @InstanceType: instance struct name + * @OBJ_NAME: the object name in uppercase with underscore separators + * @TYPENAME: type name + * + * Direct usage of this macro should be avoided, and the complete + * OBJECT_DECLARE_TYPE macro is recommended instead. + * + * This macro will provide the three standard type cast functions for a + * QOM type. + */ +#define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \ + static inline G_GNUC_UNUSED InstanceType * \ + OBJ_NAME(void *obj) \ + { return OBJECT_CHECK(InstanceType, obj, TYPENAME); } + +/** + * DECLARE_CLASS_CHECKERS: + * @ClassType: class struct name + * @OBJ_NAME: the object name in uppercase with underscore separators + * @TYPENAME: type name + * + * Direct usage of this macro should be avoided, and the complete + * OBJECT_DECLARE_TYPE macro is recommended instead. + * + * This macro will provide the three standard type cast functions for a + * QOM type. + */ +#define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \ + static inline G_GNUC_UNUSED ClassType * \ + OBJ_NAME##_GET_CLASS(void *obj) \ + { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ + \ + static inline G_GNUC_UNUSED ClassType * \ + OBJ_NAME##_CLASS(void *klass) \ + { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); } + +/** + * DECLARE_OBJ_CHECKERS: + * @InstanceType: instance struct name + * @ClassType: class struct name + * @OBJ_NAME: the object name in uppercase with underscore separators + * @TYPENAME: type name + * + * Direct usage of this macro should be avoided, and the complete + * OBJECT_DECLARE_TYPE macro is recommended instead. + * + * This macro will provide the three standard type cast functions for a + * QOM type. + */ +#define DECLARE_OBJ_CHECKERS(InstanceType, ClassType, OBJ_NAME, TYPENAME) \ + DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \ + \ + DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) + /** * OBJECT_DECLARE_TYPE: * @InstanceType: instance struct name @@ -574,20 +630,8 @@ struct Object \ G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \ \ - static inline G_GNUC_UNUSED ClassType * \ - MODULE_OBJ_NAME##_GET_CLASS(void *obj) \ - { return OBJECT_GET_CLASS(ClassType, obj, \ - TYPE_##MODULE_OBJ_NAME); } \ - \ - static inline G_GNUC_UNUSED ClassType * \ - MODULE_OBJ_NAME##_CLASS(void *klass) \ - { return OBJECT_CLASS_CHECK(ClassType, klass, \ - TYPE_##MODULE_OBJ_NAME); } \ - \ - static inline G_GNUC_UNUSED InstanceType * \ - MODULE_OBJ_NAME(void *obj) \ - { return OBJECT_CHECK(InstanceType, obj, \ - TYPE_##MODULE_OBJ_NAME); } + DECLARE_OBJ_CHECKERS(InstanceType, ClassType, \ + MODULE_OBJ_NAME, TYPE_##MODULE_OBJ_NAME) =20 /** * OBJECT_DECLARE_SIMPLE_TYPE: --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166461; cv=none; d=zohomail.com; s=zohoarc; b=UAiGGxfuHH7toxefrzlbzm0eEWRdhbZroOdzKIQBGRyl6SQ+Gih5fy0DJDoUk3BZwPWWFPmHUMKYoPHdu8lJRZk4oJvkDR8CfB/zsLBbE/89WcoLLTNxwANZLh7AbuVG5rGasfGKZ2NjGN2cbjNR7jQJHvklej/5FD5nL5JuwK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166461; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IKrAJ1lE8wDUKrGRDLZjEqdt41c0+h5LgFOaBdrpxUU=; b=hpIdigA7LDicC9dpyrvtavYXAY0YSkakd39DIB7qVoaya3E9Cx/C3QoZ6T/ksKuvINS0fdxS76RzhzezCuFUqscQbiKsm5k/QEap1XaqyM9zID8XUQWEax2spsAopYW1zLwlImxoz1E9wGrjwoOWsllk9hsC9LIeSVySc/kzYPk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166461214950.1342514834879; Thu, 3 Sep 2020 13:54:21 -0700 (PDT) Received: from localhost ([::1]:42500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwFQ-00028s-0A for importer@patchew.org; Thu, 03 Sep 2020 16:54:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEF-0000Pl-KF for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:45991 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEE-0006ZM-16 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-neypLMVdMky5zEPHAjUD1Q-1; Thu, 03 Sep 2020 16:53:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C9B5F18BA285; Thu, 3 Sep 2020 20:52:59 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92B155D9EF; Thu, 3 Sep 2020 20:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IKrAJ1lE8wDUKrGRDLZjEqdt41c0+h5LgFOaBdrpxUU=; b=gHSkOVYcBWLFnpzzAwG6yE2xX+fCFs4MMSg0xtqlGDJIJAW8BbCWZgXvpEiM5r/iEUfEzf qPK+GxmBqPYRC6ojYWIsYqLGIwDCH8Tc712hxoQXvtX7kitfmVyKAgzWm34jHhs2MpQKyd BUiPf7bWvWD4kjxk8YlOz4oLkRBwSAw= X-MC-Unique: neypLMVdMky5zEPHAjUD1Q-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 05/27] qom: Make type checker functions accept const pointers Date: Thu, 3 Sep 2020 16:52:25 -0400 Message-Id: <20200903205247.1667472-6-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:58:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) The existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 4cd84998c2..3626ae3c65 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -567,7 +567,7 @@ struct Object */ #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \ static inline G_GNUC_UNUSED InstanceType * \ - OBJ_NAME(void *obj) \ + OBJ_NAME(const void *obj) \ { return OBJECT_CHECK(InstanceType, obj, TYPENAME); } =20 /** @@ -584,11 +584,11 @@ struct Object */ #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \ static inline G_GNUC_UNUSED ClassType * \ - OBJ_NAME##_GET_CLASS(void *obj) \ + OBJ_NAME##_GET_CLASS(const void *obj) \ { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ \ static inline G_GNUC_UNUSED ClassType * \ - OBJ_NAME##_CLASS(void *klass) \ + OBJ_NAME##_CLASS(const void *klass) \ { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); } =20 /** --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166576; cv=none; d=zohomail.com; s=zohoarc; b=iH8/zQQrOa99x5jBRf4qNuO3Hrh8ORZTmJgdCGpJN+7iIMIKrmx7oLvg8/fqf3US5AEDM8sVzikCrBUMs7twGeu8HGRU4YL1wpp3Zl80gaQZxSb6QNzpuKslmIjDh0iMnJANHygVVb+fRlucvlV1n6OCbDlmygLsM5xtqpw9jUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166576; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a5WQ0sTufb3hOWOiRduXcm2dy80qBqfB9xlUEtF7TVs=; b=UWeBp/HmESoBKCgFseSz7WsDemhAhaL3+m5OrYjX6YchxKJ6H8gFK3Fc8LvQHc8mv1k1dEVt2k426QOyhNGAIcEkm7X7UIITyBSls3jOMfNgr7Mt/poq+4Bb7vyGOlRInsOcaHAY4WBnxvX9l2Db8g/6KySOZvvQgNm1KugXSvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166576301369.24208870407995; Thu, 3 Sep 2020 13:56:16 -0700 (PDT) Received: from localhost ([::1]:51182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwHH-0005l8-Ao for importer@patchew.org; Thu, 03 Sep 2020 16:56:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEM-0000ek-ED for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEH-0006a1-Rs for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:14 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-278-nukytq-UMV2CP4Kv-8MigA-1; Thu, 03 Sep 2020 16:53:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0703281CBF1; Thu, 3 Sep 2020 20:53:01 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EBF27E411; Thu, 3 Sep 2020 20:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a5WQ0sTufb3hOWOiRduXcm2dy80qBqfB9xlUEtF7TVs=; b=fOpR/BzpQlRMaY/64YX5E+BRtyz4R3HVnisslKZ0zbng3a1JrDzv0+jV18atfumid3RpOb tmj1LPPplSHw2Kanvsa0UG6lZr5KQaXfLO3+SPtR7OMoE1TkuNqyv6ZnJwDgHKruh28BQH tTvAY0oC0Dj9bUxH0VwjbbaO/D4b+zQ= X-MC-Unique: nukytq-UMV2CP4Kv-8MigA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 06/27] codeconverter: script for automating QOM code cleanups Date: Thu, 3 Sep 2020 16:52:26 -0400 Message-Id: <20200903205247.1667472-7-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This started as a simple script that scanned for regular expressions, but became more and more complex when exceptions to the rules were found. I don't know if this should be maintained in the QEMU source tree long term (maybe it can be reused for other code transformations that Coccinelle can't handle). In either case, this is included as part of the patch series to document how exactly the automated code transformations in the next patches were done. Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-7-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- .../codeconverter/codeconverter/__init__.py | 0 .../codeconverter/codeconverter/patching.py | 397 +++++++++++ .../codeconverter/codeconverter/qom_macros.py | 652 ++++++++++++++++++ .../codeconverter/qom_type_info.py | 434 ++++++++++++ .../codeconverter/codeconverter/regexps.py | 118 ++++ .../codeconverter/test_patching.py | 105 +++ .../codeconverter/test_regexps.py | 282 ++++++++ scripts/codeconverter/codeconverter/utils.py | 72 ++ scripts/codeconverter/converter.py | 123 ++++ MAINTAINERS | 5 + 10 files changed, 2188 insertions(+) create mode 100644 scripts/codeconverter/codeconverter/__init__.py create mode 100644 scripts/codeconverter/codeconverter/patching.py create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py create mode 100644 scripts/codeconverter/codeconverter/regexps.py create mode 100644 scripts/codeconverter/codeconverter/test_patching.py create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py create mode 100644 scripts/codeconverter/codeconverter/utils.py create mode 100755 scripts/codeconverter/converter.py diff --git a/scripts/codeconverter/codeconverter/__init__.py b/scripts/code= converter/codeconverter/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/codeconverter/codeconverter/patching.py b/scripts/code= converter/codeconverter/patching.py new file mode 100644 index 0000000000..627a1a1b04 --- /dev/null +++ b/scripts/codeconverter/codeconverter/patching.py @@ -0,0 +1,397 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +from typing import IO, Match, NamedTuple, Optional, Literal, Iterable, Typ= e, Dict, List, Any, TypeVar, NewType, Tuple +from pathlib import Path +from itertools import chain +from tempfile import NamedTemporaryFile +import os +import re +import subprocess +from io import StringIO + +import logging +logger =3D logging.getLogger(__name__) +DBG =3D logger.debug +INFO =3D logger.info +WARN =3D logger.warning +ERROR =3D logger.error + +from .utils import * + +T =3D TypeVar('T') + +class Patch(NamedTuple): + # start inside file.original_content + start: int + # end position inside file.original_content + end: int + # replacement string for file.original_content[start:end] + replacement: str + +IdentifierType =3D Literal['type', 'symbol', 'include', 'constant'] +class RequiredIdentifier(NamedTuple): + type: IdentifierType + name: str + +class FileMatch: + """Base class for regex matches + + Subclasses just need to set the `regexp` class attribute + """ + regexp: Optional[str] =3D None + + def __init__(self, f: 'FileInfo', m: Match) -> None: + self.file: 'FileInfo' =3D f + self.match: Match =3D m + + @property + def name(self) -> str: + if 'name' not in self.match.groupdict(): + return '[no name]' + return self.group('name') + + @classmethod + def compiled_re(klass): + return re.compile(klass.regexp, re.MULTILINE) + + def start(self) -> int: + return self.match.start() + + def end(self) -> int: + return self.match.end() + + def line_col(self) -> LineAndColumn: + return self.file.line_col(self.start()) + + def group(self, *args): + return self.match.group(*args) + + def log(self, level, fmt, *args) -> None: + pos =3D self.line_col() + logger.log(level, '%s:%d:%d: '+fmt, self.file.filename, pos.line, = pos.col, *args) + + def debug(self, fmt, *args) -> None: + self.log(logging.DEBUG, fmt, *args) + + def info(self, fmt, *args) -> None: + self.log(logging.INFO, fmt, *args) + + def warn(self, fmt, *args) -> None: + self.log(logging.WARNING, fmt, *args) + + def error(self, fmt, *args) -> None: + self.log(logging.ERROR, fmt, *args) + + def sub(self, original: str, replacement: str) -> str: + """Replace content + + XXX: this won't use the match position, but will just + replace all strings that look like the original match. + This should be enough for all the patterns used in this + script. + """ + return original.replace(self.group(0), replacement) + + def sanity_check(self) -> None: + """Sanity check match, and print warnings if necessary""" + pass + + def replacement(self) -> Optional[str]: + """Return replacement text for pattern, to use new code convention= s""" + return None + + def make_patch(self, replacement: str) -> 'Patch': + """Make patch replacing the content of this match""" + return Patch(self.start(), self.end(), replacement) + + def make_subpatch(self, start: int, end: int, replacement: str) -> 'Pa= tch': + return Patch(self.start() + start, self.start() + end, replacement) + + def make_removal_patch(self) -> 'Patch': + """Make patch removing contents of match completely""" + return self.make_patch('') + + def append(self, s: str) -> 'Patch': + """Make patch appending string after this match""" + return Patch(self.end(), self.end(), s) + + def prepend(self, s: str) -> 'Patch': + """Make patch prepending string before this match""" + return Patch(self.start(), self.start(), s) + + def gen_patches(self) -> Iterable['Patch']: + """Patch source code contents to use new code patterns""" + replacement =3D self.replacement() + if replacement is not None: + yield self.make_patch(replacement) + + @classmethod + def has_replacement_rule(klass) -> bool: + return (klass.gen_patches is not FileMatch.gen_patches + or klass.replacement is not FileMatch.replacement) + + def contains(self, other: 'FileMatch') -> bool: + return other.start() >=3D self.start() and other.end() <=3D self.e= nd() + + def __repr__(self) -> str: + start =3D self.file.line_col(self.start()) + end =3D self.file.line_col(self.end() - 1) + return '<%s %s at %d:%d-%d:%d: %r>' % (self.__class__.__name__, + self.name, + start.line, start.col, + end.line, end.col, sel= f.group(0)[:100]) + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + """Can be implemented by subclasses to keep track of identifier re= ferences + + This method will be used by the code that moves declarations aroun= d the file, + to make sure we find the right spot for them. + """ + raise NotImplementedError() + + def provided_identifiers(self) -> Iterable[RequiredIdentifier]: + """Can be implemented by subclasses to keep track of identifier re= ferences + + This method will be used by the code that moves declarations aroun= d the file, + to make sure we find the right spot for them. + """ + raise NotImplementedError() + + @classmethod + def find_matches(klass, content: str) -> Iterable[Match]: + """Generate match objects for class + + Might be reimplemented by subclasses if they + intend to look for matches using a different method. + """ + return klass.compiled_re().finditer(content) + + @property + def allfiles(self) -> 'FileList': + return self.file.allfiles + +def all_subclasses(c: Type[FileMatch]) -> Iterable[Type[FileMatch]]: + for sc in c.__subclasses__(): + yield sc + yield from all_subclasses(sc) + +def match_class_dict() -> Dict[str, Type[FileMatch]]: + d =3D dict((t.__name__, t) for t in all_subclasses(FileMatch)) + return d + +def names(matches: Iterable[FileMatch]) -> Iterable[str]: + return [m.name for m in matches] + +class PatchingError(Exception): + pass + +class OverLappingPatchesError(PatchingError): + pass + +def apply_patches(s: str, patches: Iterable[Patch]) -> str: + """Apply a sequence of patches to string + + >>> apply_patches('abcdefg', [Patch(2,2,'xxx'), Patch(0, 1, 'yy')]) + 'yybxxxcdefg' + """ + r =3D StringIO() + last =3D 0 + for p in sorted(patches): + DBG("Applying patch at position %d (%s) - %d (%s): %r", + p.start, line_col(s, p.start), + p.end, line_col(s, p.end), + p.replacement) + if last > p.start: + raise OverLappingPatchesError("Overlapping patch at position %= d (%s), last patch at %d (%s)" % \ + (p.start, line_col(s, p.start), last, line_col(s, last))) + r.write(s[last:p.start]) + r.write(p.replacement) + last =3D p.end + r.write(s[last:]) + return r.getvalue() + +class RegexpScanner: + def __init__(self) -> None: + self.match_index: Dict[Type[Any], List[FileMatch]] =3D {} + self.match_name_index: Dict[Tuple[Type[Any], str, str], Optional[F= ileMatch]] =3D {} + + def _find_matches(self, klass: Type[Any]) -> Iterable[FileMatch]: + raise NotImplementedError() + + def matches_of_type(self, t: Type[T]) -> List[T]: + if t not in self.match_index: + self.match_index[t] =3D list(self._find_matches(t)) + return self.match_index[t] # type: ignore + + def find_match(self, t: Type[T], name: str, group: str=3D'name') -> Op= tional[T]: + indexkey =3D (t, name, group) + if indexkey in self.match_name_index: + return self.match_name_index[indexkey] # type: ignore + r: Optional[T] =3D None + for m in self.matches_of_type(t): + assert isinstance(m, FileMatch) + if m.group(group) =3D=3D name: + r =3D m # type: ignore + self.match_name_index[indexkey] =3D r # type: ignore + return r + + def reset_index(self) -> None: + self.match_index.clear() + self.match_name_index.clear() + +class FileInfo(RegexpScanner): + filename: Path + original_content: Optional[str] =3D None + + def __init__(self, files: 'FileList', filename: os.PathLike, force:boo= l=3DFalse) -> None: + super().__init__() + self.allfiles =3D files + self.filename =3D Path(filename) + self.patches: List[Patch] =3D [] + self.force =3D force + + def __repr__(self) -> str: + return f'' + + def line_col(self, start: int) -> LineAndColumn: + """Return line and column for a match object inside original_conte= nt""" + return line_col(self.original_content, start) + + def _find_matches(self, klass: Type[Any]) -> List[FileMatch]: + """Build FileMatch objects for each match of regexp""" + if not hasattr(klass, 'regexp') or klass.regexp is None: + return [] + assert hasattr(klass, 'regexp') + DBG("%s: scanning for %s", self.filename, klass.__name__) + DBG("regexp: %s", klass.regexp) + matches =3D [klass(self, m) for m in klass.find_matches(self.origi= nal_content)] + DBG('%s: %d matches found for %s: %s', self.filename, len(matches), + klass.__name__,' '.join(names(matches))) + return matches + + def find_match(self, t: Type[T], name: str, group: str=3D'name') -> Op= tional[T]: + for m in self.matches_of_type(t): + assert isinstance(m, FileMatch) + if m.group(group) =3D=3D name: + return m # type: ignore + return None + + def reset_content(self, s:str): + self.original_content =3D s + self.patches.clear() + self.reset_index() + self.allfiles.reset_index() + + def load(self) -> None: + if self.original_content is not None: + return + with open(self.filename, 'rt') as f: + self.reset_content(f.read()) + + @property + def all_matches(self) -> Iterable[FileMatch]: + lists =3D list(self.match_index.values()) + return (m for l in lists + for m in l) + + def scan_for_matches(self, class_names: Optional[List[str]]=3DNone) ->= None: + DBG("class names: %r", class_names) + class_dict =3D match_class_dict() + if class_names is None: + DBG("default class names") + class_names =3D list(name for name,klass in class_dict.items() + if klass.has_replacement_rule()) + DBG("class_names: %r", class_names) + for cn in class_names: + matches =3D self.matches_of_type(class_dict[cn]) + if len(matches) > 0: + DBG('%s: %d matches found for %s: %s', self.filename, + len(matches), cn, ' '.join(names(matches))) + + def gen_patches(self) -> None: + for m in self.all_matches: + for i,p in enumerate(m.gen_patches()): + DBG("patch %d generated by %r:", i, m) + DBG("replace contents at %s-%s with %r", + self.line_col(p.start), self.line_col(p.end), p.replac= ement) + self.patches.append(p) + + def patch_content(self, max_passes=3D0, class_names: Optional[List[str= ]]=3DNone) -> None: + """Multi-pass content patching loop + + We run multiple passes because there are rules that will + delete init functions once they become empty. + """ + passes =3D 0 + total_patches =3D 0 + DBG("max_passes: %r", max_passes) + while not max_passes or max_passes <=3D 0 or passes < max_passes: + passes +=3D 1 + self.scan_for_matches(class_names) + self.gen_patches() + DBG("patch content: pass %d: %d patches generated", passes, le= n(self.patches)) + total_patches +=3D len(self.patches) + if not self.patches: + break + try: + self.apply_patches() + except PatchingError: + logger.exception("%s: failed to patch file", self.filename) + DBG("%s: %d patches applied total in %d passes", self.filename, to= tal_patches, passes) + + def apply_patches(self) -> None: + """Replace self.original_content after applying patches from self.= patches""" + self.reset_content(self.get_patched_content()) + + def get_patched_content(self) -> str: + assert self.original_content is not None + return apply_patches(self.original_content, self.patches) + + def write_to_file(self, f: IO[str]) -> None: + f.write(self.get_patched_content()) + + def write_to_filename(self, filename: os.PathLike) -> None: + with open(filename, 'wt') as of: + self.write_to_file(of) + + def patch_inplace(self) -> None: + newfile =3D self.filename.with_suffix('.changed') + self.write_to_filename(newfile) + os.rename(newfile, self.filename) + + def show_diff(self) -> None: + with NamedTemporaryFile('wt') as f: + self.write_to_file(f) + f.flush() + subprocess.call(['diff', '-u', self.filename, f.name]) + + def ref(self): + return TypeInfoReference + +class FileList(RegexpScanner): + def __init__(self): + super().__init__() + self.files: List[FileInfo] =3D [] + + def extend(self, *args, **kwargs): + self.files.extend(*args, **kwargs) + + def __iter__(self): + return iter(self.files) + + def _find_matches(self, klass: Type[Any]) -> Iterable[FileMatch]: + return chain(*(f._find_matches(klass) for f in self.files)) + + def find_file(self, name) -> Optional[FileInfo]: + """Get file with path ending with @name""" + nameparts =3D Path(name).parts + for f in self.files: + if f.filename.parts[:len(nameparts)] =3D=3D nameparts: + return f + else: + return None \ No newline at end of file diff --git a/scripts/codeconverter/codeconverter/qom_macros.py b/scripts/co= deconverter/codeconverter/qom_macros.py new file mode 100644 index 0000000000..68a33d5c6f --- /dev/null +++ b/scripts/codeconverter/codeconverter/qom_macros.py @@ -0,0 +1,652 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +import re +from itertools import chain +from typing import * + +from .regexps import * +from .patching import * +from .utils import * + +import logging +logger =3D logging.getLogger(__name__) +DBG =3D logger.debug +INFO =3D logger.info +WARN =3D logger.warning + +# simple expressions: + +RE_CONSTANT =3D OR(RE_STRING, RE_NUMBER) + +class ConstantDefine(FileMatch): + """Simple #define preprocessor directive for a constant""" + # if the macro contents are very simple, it might be included + # in the match group 'value' + regexp =3D S(r'^[ \t]*#[ \t]*define', CPP_SPACE, NAMED('name', RE_IDEN= TIFIER), + CPP_SPACE, NAMED('value', RE_CONSTANT), r'[ \t]*\n') + + def provided_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('constant', self.group('name')) + +class TypeIdentifiers(NamedTuple): + """Type names found in type declarations""" + # TYPE_MYDEVICE + typename: Optional[str] + # MYDEVICE + uppercase: Optional[str] =3D None + # MyDevice + instancetype: Optional[str] =3D None + # MyDeviceClass + classtype: Optional[str] =3D None + # my_device + lowercase: Optional[str] =3D None + + def allfields(self): + return tuple(getattr(self, f) for f in self._fields) + + def merge(self, other: 'TypeIdentifiers') -> Optional['TypeIdentifiers= ']: + """Check if identifiers match, return new identifier with complete= list""" + if any(not opt_compare(a, b) for a,b in zip(self, other)): + return None + return TypeIdentifiers(*(merge(a, b) for a,b in zip(self, other))) + + def __str__(self) -> str: + values =3D ((f, getattr(self, f)) for f in self._fields) + s =3D ', '.join('%s=3D%s' % (f,v) for f,v in values if v is not No= ne) + return f'{s}' + + def check_consistency(self) -> List[str]: + """Check if identifiers are consistent with each other, + return list of problems (or empty list if everything seems consist= ent) + """ + r =3D [] + if self.typename is None: + r.append("typename (TYPE_MYDEVICE) is unavailable") + + if self.uppercase is None: + r.append("uppercase name is unavailable") + + if (self.instancetype is not None + and self.classtype is not None + and self.classtype !=3D f'{self.instancetype}Class'): + r.append("class typedef %s doesn't match instance typedef = %s" % + (self.classtype, self.instancetype)) + + if (self.uppercase is not None + and self.typename is not None + and f'TYPE_{self.uppercase}' !=3D self.typename): + r.append("uppercase name (%s) doesn't match type name (%s)" % + (self.uppercase, self.typename)) + + return r + +class TypedefMatch(FileMatch): + """typedef declaration""" + def provided_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('type', self.group('name')) + +class SimpleTypedefMatch(TypedefMatch): + """Simple typedef declaration + (no replacement rules)""" + regexp =3D S(r'^[ \t]*typedef', SP, + NAMED('typedef_type', RE_TYPE), SP, + NAMED('name', RE_IDENTIFIER), r'\s*;[ \t]*\n') + +RE_MACRO_DEFINE =3D S(r'^[ \t]*#\s*define\s+', NAMED('name', RE_IDENTIFIER= ), + r'\s*\(\s*', RE_IDENTIFIER, r'\s*\)', CPP_SPACE) + +RE_STRUCT_ATTRIBUTE =3D r'QEMU_PACKED' + +# This doesn't parse the struct definitions completely, it just assumes +# the closing brackets are going to be in an unindented line: +RE_FULL_STRUCT =3D S('struct', SP, M(RE_IDENTIFIER, n=3D'?', name=3D'struc= tname'), SP, + NAMED('body', r'{\n', + # acceptable inside the struct body: + # - lines starting with space or tab + # - empty lines + # - preprocessor directives + # - comments + OR(r'[ \t][^\n]*\n', + r'#[^\n]*\n', + r'\n', + S(r'[ \t]*', RE_COMMENT, r'[ \t]*\n'), + repeat=3D'*?'), + r'}', M(RE_STRUCT_ATTRIBUTE, SP, n=3D'*'))) +RE_STRUCT_TYPEDEF =3D S(r'^[ \t]*typedef', SP, RE_FULL_STRUCT, SP, + NAMED('name', RE_IDENTIFIER), r'\s*;[ \t]*\n') + +class FullStructTypedefMatch(TypedefMatch): + """typedef struct [SomeStruct] { ...} SomeType + Will be replaced by separate struct declaration + typedef + """ + regexp =3D RE_STRUCT_TYPEDEF + + def make_structname(self) -> str: + """Make struct name for struct+typedef split""" + name =3D self.group('structname') + if not name: + name =3D self.name + return name + + def strip_typedef(self) -> Patch: + """generate patch that will strip typedef from the struct declarti= on + + The caller is responsible for readding the typedef somewhere else. + """ + name =3D self.make_structname() + body =3D self.group('body') + return self.make_patch(f'struct {name} {body};\n') + + def make_simple_typedef(self) -> str: + structname =3D self.make_structname() + name =3D self.name + return f'typedef struct {structname} {name};\n' + + def move_typedef(self, position) -> Iterator[Patch]: + """Generate patches to move typedef elsewhere""" + yield self.strip_typedef() + yield Patch(position, position, self.make_simple_typedef()) + + def split_typedef(self) -> Iterator[Patch]: + """Split into struct definition + typedef in-place""" + yield self.strip_typedef() + yield self.append(self.make_simple_typedef()) + +class StructTypedefSplit(FullStructTypedefMatch): + """split struct+typedef declaration""" + def gen_patches(self) -> Iterator[Patch]: + if self.group('structname'): + yield from self.split_typedef() + +class DuplicatedTypedefs(SimpleTypedefMatch): + """Delete ALL duplicate typedefs (unsafe)""" + def gen_patches(self) -> Iterable[Patch]: + other_td =3D [td for td in chain(self.file.matches_of_type(SimpleT= ypedefMatch), + self.file.matches_of_type(FullStruc= tTypedefMatch)) + if td.name =3D=3D self.name] + DBG("other_td: %r", other_td) + if any(td.start() < self.start() for td in other_td): + # patch only if handling the first typedef + return + for td in other_td: + if isinstance(td, SimpleTypedefMatch): + DBG("other td: %r", td.match.groupdict()) + if td.group('typedef_type') !=3D self.group('typedef_type'= ): + yield td.make_removal_patch() + elif isinstance(td, FullStructTypedefMatch): + DBG("other td: %r", td.match.groupdict()) + if self.group('typedef_type') =3D=3D 'struct '+td.group('s= tructname'): + yield td.strip_typedef() + +class QOMDuplicatedTypedefs(DuplicatedTypedefs): + """Delete duplicate typedefs if used by QOM type""" + def gen_patches(self) -> Iterable[Patch]: + qom_macros =3D [TypeCheckMacro, DeclareInstanceChecker, DeclareCla= ssCheckers, DeclareObjCheckers] + qom_matches =3D chain(*(self.file.matches_of_type(t) for t in qom_= macros)) + in_use =3D any(RequiredIdentifier('type', self.name) in m.required= _identifiers() + for m in qom_matches) + if in_use: + yield from DuplicatedTypedefs.gen_patches(self) + +class QOMStructTypedefSplit(FullStructTypedefMatch): + """split struct+typedef declaration if used by QOM type""" + def gen_patches(self) -> Iterator[Patch]: + qom_macros =3D [TypeCheckMacro, DeclareInstanceChecker, DeclareCla= ssCheckers, DeclareObjCheckers] + qom_matches =3D chain(*(self.file.matches_of_type(t) for t in qom_= macros)) + in_use =3D any(RequiredIdentifier('type', self.name) in m.required= _identifiers() + for m in qom_matches) + if in_use: + yield from self.split_typedef() + +def typedefs(file: FileInfo) -> Iterable[TypedefMatch]: + return (cast(TypedefMatch, m) + for m in chain(file.matches_of_type(SimpleTypedefMatch), + file.matches_of_type(FullStructTypedefMatch))) + +def find_typedef(f: FileInfo, name: Optional[str]) -> Optional[TypedefMatc= h]: + if not name: + return None + for td in typedefs(f): + if td.name =3D=3D name: + return td + return None + +CHECKER_MACROS =3D ['OBJECT_CHECK', 'OBJECT_CLASS_CHECK', 'OBJECT_GET_CLAS= S'] +CheckerMacroName =3D Literal['OBJECT_CHECK', 'OBJECT_CLASS_CHECK', 'OBJECT= _GET_CLASS'] + +RE_CHECK_MACRO =3D \ + S(RE_MACRO_DEFINE, + OR(*CHECKER_MACROS, name=3D'checker'), + M(r'\s*\(\s*', OR(NAMED('typedefname', RE_IDENTIFIER), RE_TYPE, name= =3D'c_type'), r'\s*,', CPP_SPACE, + OPTIONAL_PARS(RE_IDENTIFIER), r',', CPP_SPACE, + NAMED('qom_typename', RE_IDENTIFIER), r'\s*\)\n', + n=3D'?', name=3D'check_args')) + +EXPECTED_CHECKER_SUFFIXES: List[Tuple[CheckerMacroName, str]] =3D [ + ('OBJECT_GET_CLASS', '_GET_CLASS'), + ('OBJECT_CLASS_CHECK', '_CLASS'), +] + +class TypeCheckMacro(FileMatch): + """OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS macro definitions + Will be replaced by DECLARE_*_CHECKERS macro + """ + #TODO: handle and convert INTERFACE_CHECK macros + regexp =3D RE_CHECK_MACRO + + @property + def checker(self) -> CheckerMacroName: + """Name of checker macro being used""" + return self.group('checker') + + @property + def typedefname(self) -> Optional[str]: + return self.group('typedefname') + + def find_typedef(self) -> Optional[TypedefMatch]: + return find_typedef(self.file, self.typedefname) + + def sanity_check(self) -> None: + DBG("groups: %r", self.match.groups()) + if not self.group('check_args'): + self.warn("type check macro not parsed completely: %s", self.n= ame) + return + DBG("type identifiers: %r", self.type_identifiers) + if self.typedefname and self.find_typedef() is None: + self.warn("typedef used by %s not found", self.name) + + def find_matching_macros(self) -> List['TypeCheckMacro']: + """Find other check macros that generate the same macro names + + The returned list will always be sorted. + """ + my_ids =3D self.type_identifiers + assert my_ids + return [m for m in self.file.matches_of_type(TypeCheckMacro) + if m.type_identifiers is not None + and my_ids.uppercase is not None + and (my_ids.uppercase =3D=3D m.type_identifiers.upperca= se + or my_ids.typename =3D=3D m.type_identifiers.typen= ame)] + + def merge_ids(self, matches: List['TypeCheckMacro']) -> Optional[TypeI= dentifiers]: + """Try to merge info about type identifiers from all matches in a = list""" + if not matches: + return None + r =3D matches[0].type_identifiers + if r is None: + return None + for m in matches[1:]: + assert m.type_identifiers + new =3D r.merge(m.type_identifiers) + if new is None: + self.warn("macro %s identifiers (%s) don't match macro %s = (%s)", + matches[0].name, r, m.name, m.type_identifiers) + return None + r =3D new + return r + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + if self.type_identifiers is None: + return + # to make sure typedefs will be moved above all related macros, + # return dependencies from all of them, not just this match + for m in self.find_matching_macros(): + yield RequiredIdentifier('type', m.group('c_type')) + yield RequiredIdentifier('constant', m.group('qom_typename')) + + @property + def type_identifiers(self) -> Optional[TypeIdentifiers]: + """Extract type identifier information from match""" + typename =3D self.group('qom_typename') + c_type =3D self.group('c_type') + if not typename or not c_type: + return None + typedef =3D self.group('typedefname') + classtype =3D None + instancetype =3D None + uppercase =3D None + expected_suffix =3D dict(EXPECTED_CHECKER_SUFFIXES).get(self.check= er) + + # here the available data depends on the checker macro being calle= d: + # - we need to remove the suffix from the macro name + # - depending on the macro type, we know the class type name, or + # the instance type name + if self.checker in ('OBJECT_GET_CLASS', 'OBJECT_CLASS_CHECK'): + classtype =3D c_type + elif self.checker =3D=3D 'OBJECT_CHECK': + instancetype =3D c_type + uppercase =3D self.name + else: + assert False + if expected_suffix and self.name.endswith(expected_suffix): + uppercase =3D self.name[:-len(expected_suffix)] + return TypeIdentifiers(typename=3Dtypename, classtype=3Dclasstype, + instancetype=3Dinstancetype, uppercase=3Dup= percase) + + def gen_patches(self) -> Iterable[Patch]: + if self.type_identifiers is None: + self.warn("couldn't extract type information from macro %s", s= elf.name) + return + + if self.name =3D=3D 'INTERFACE_CLASS': + # INTERFACE_CLASS is special and won't be patched + return + + for checker,suffix in EXPECTED_CHECKER_SUFFIXES: + if self.name.endswith(suffix): + if self.checker !=3D checker: + self.warn("macro %s is using macro %s instead of %s", = self.name, self.checker, checker) + return + break + + matches =3D self.find_matching_macros() + DBG("found %d matching macros: %s", len(matches), ' '.join(m.name = for m in matches)) + # we will generate patches only when processing the first macro: + if matches[0].start !=3D self.start: + DBG("skipping %s (will patch when handling %s)", self.name, ma= tches[0].name) + return + + + ids =3D self.merge_ids(matches) + if ids is None: + DBG("type identifier mismatch, won't patch %s", self.name) + return + + if not ids.uppercase: + self.warn("macro %s doesn't follow the expected name pattern",= self.name) + return + if not ids.typename: + self.warn("macro %s: couldn't extract type name", self.name) + return + + #issues =3D ids.check_consistency() + #if issues: + # for i in issues: + # self.warn("inconsistent identifiers: %s", i) + + names =3D [n for n in (ids.instancetype, ids.classtype, ids.upperc= ase, ids.typename) + if n is not None] + if len(set(names)) !=3D len(names): + self.warn("duplicate names used by macro: %r", ids) + return + + assert ids.classtype or ids.instancetype + assert ids.typename + assert ids.uppercase + if ids.classtype and ids.instancetype: + new_decl =3D (f'DECLARE_OBJ_CHECKERS({ids.instancetype}, {ids.= classtype},\n' + f' {ids.uppercase}, {ids.typen= ame})\n') + elif ids.classtype: + new_decl =3D (f'DECLARE_CLASS_CHECKERS({ids.classtype}, {ids.u= ppercase},\n' + f' {ids.typename})\n') + elif ids.instancetype: + new_decl =3D (f'DECLARE_INSTANCE_CHECKER({ids.instancetype}, {= ids.uppercase},\n' + f' {ids.typename})\n') + else: + assert False + + # we need to ensure the typedefs are already available + issues =3D [] + for t in [ids.instancetype, ids.classtype]: + if not t: + continue + if re.fullmatch(RE_STRUCT_TYPE, t): + self.info("type %s is not a typedef", t) + continue + td =3D find_typedef(self.file, t) + #if not td and self.allfiles.find_file('include/qemu/typedefs.= h'): + # + if not td: + # it is OK if the typedef is in typedefs.h + f =3D self.allfiles.find_file('include/qemu/typedefs.h') + if f and find_typedef(f, t): + self.info("typedef %s found in typedefs.h", t) + continue + + issues.append("couldn't find typedef %s" % (t)) + elif td.start() > self.start(): + issues.append("typedef %s need to be moved earlier in the = file" % (td.name)) + + for issue in issues: + self.warn(issue) + + if issues and not self.file.force: + return + + # delete all matching macros and add new declaration: + for m in matches: + yield m.make_patch('') + for issue in issues: + yield self.prepend("/* FIXME: %s */\n" % (issue)) + yield self.append(new_decl) + +class DeclareInstanceChecker(FileMatch): + """DECLARE_INSTANCE_CHECKER use + Will be replaced with DECLARE_OBJ_CHECKERS if possible + """ + #TODO: replace lonely DECLARE_INSTANCE_CHECKER with DECLARE_OBJ_CHECKE= RS + # if all types are found. + # This will require looking up the correct class type in the Type= Info + # structs in another file + regexp =3D S(r'^[ \t]*DECLARE_INSTANCE_CHECKER\s*\(\s*', + NAMED('instancetype', RE_TYPE), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + OR(RE_IDENTIFIER, RE_STRING, RE_MACRO_CONCAT, RE_FUN_CALL, = name=3D'typename'), SP, + r'\)[ \t]*;?[ \t]*\n') + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + yield RequiredIdentifier('constant', self.group('typename')) + yield RequiredIdentifier('type', self.group('instancetype')) + +class DeclareClassCheckers(FileMatch): + """DECLARE_INSTANCE_CHECKER use""" + regexp =3D S(r'^[ \t]*DECLARE_CLASS_CHECKERS\s*\(\s*', + NAMED('classtype', RE_TYPE), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + OR(RE_IDENTIFIER, RE_STRING, RE_MACRO_CONCAT, RE_FUN_CALL, = name=3D'typename'), SP, + r'\)[ \t]*;?[ \t]*\n') + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + yield RequiredIdentifier('constant', self.group('typename')) + yield RequiredIdentifier('type', self.group('classtype')) + +class DeclareObjCheckers(FileMatch): + """DECLARE_OBJ_CHECKERS use + Will be replaced with OBJECT_DECLARE_TYPE if possible + """ + #TODO: detect when OBJECT_DECLARE_SIMPLE_TYPE can be used + regexp =3D S(r'^[ \t]*DECLARE_OBJ_CHECKERS\s*\(\s*', + NAMED('instancetype', RE_TYPE), r'\s*,\s*', + NAMED('classtype', RE_TYPE), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + OR(RE_IDENTIFIER, RE_STRING, RE_MACRO_CONCAT, RE_FUN_CALL, = name=3D'typename'), SP, + r'\)[ \t]*;?[ \t]*\n') + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + yield RequiredIdentifier('constant', self.group('typename')) + yield RequiredIdentifier('type', self.group('classtype')) + yield RequiredIdentifier('type', self.group('instancetype')) + + def gen_patches(self): + ids =3D TypeIdentifiers(uppercase=3Dself.group('uppercase'), + typename=3Dself.group('typename'), + classtype=3Dself.group('classtype'), + instancetype=3Dself.group('instancetype')) + issues =3D ids.check_consistency() + if issues: + for i in issues: + self.warn("inconsistent identifiers: %s", i) + return + + if self.group('typename') !=3D 'TYPE_'+self.group('uppercase'): + self.warn("type %s mismatch with uppercase name %s", ids.typen= ame, ids.uppercase) + return + + typedefs =3D [(t,self.file.find_match(SimpleTypedefMatch, t)) + for t in (ids.instancetype, ids.classtype)] + for t,td in typedefs: + if td is None: + self.warn("typedef %s not found", t) + break + if td.start() > self.start(): + self.warn("typedef %s needs to be move earlier in the file= ", t) + break + #HACK: check if typedef is used between its definition and the= macro + #TODO: check if the only match is inside the "struct { ... }" = declaration + if re.search(r'\b'+t+r'\b', self.file.original_content[td.end(= ):self.start()]): + self.warn("typedef %s can't be moved, it is used before th= e macro", t) + break + else: + for t,td in typedefs: + yield td.make_removal_patch() + + lowercase =3D ids.uppercase.lower() + # all is OK, we can replace the macro! + c =3D (f'OBJECT_DECLARE_TYPE({ids.instancetype}, {ids.classtyp= e},\n' + f' {lowercase}, {ids.uppercase})\n') + yield self.make_patch(c) + +class TrivialClassStruct(FileMatch): + """Trivial class struct""" + regexp =3D S(r'^[ \t]*struct\s*', NAMED('name', RE_IDENTIFIER), + r'\s*{\s*', NAMED('parent_struct', RE_IDENTIFIER), r'\s*par= ent(_class)?\s*;\s*};\n') + +class DeclareTypeName(FileMatch): + """DECLARE_TYPE_NAME usage""" + regexp =3D S(r'^[ \t]*DECLARE_TYPE_NAME\s*\(', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + OR(RE_IDENTIFIER, RE_STRING, RE_MACRO_CONCAT, RE_FUN_CALL, = name=3D'typename'), + r'\s*\);?[ \t]*\n') + +class ObjectDeclareType(FileMatch): + """OBJECT_DECLARE_TYPE usage + Will be replaced with OBJECT_DECLARE_SIMPLE_TYPE if possible + """ + regexp =3D S(r'^[ \t]*OBJECT_DECLARE_TYPE\s*\(', + NAMED('instancetype', RE_TYPE), r'\s*,\s*', + NAMED('classtype', RE_TYPE), r'\s*,\s*', + NAMED('lowercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), SP, + r'\)[ \t]*;?[ \t]*\n') + + def gen_patches(self): + DBG("groups: %r", self.match.groupdict()) + trivial_struct =3D self.file.find_match(TrivialClassStruct, self.g= roup('classtype')) + if trivial_struct: + d =3D self.match.groupdict().copy() + d['parent_struct'] =3D trivial_struct.group("parent_struct") + yield trivial_struct.make_removal_patch() + c =3D ("OBJECT_DECLARE_SIMPLE_TYPE(%(instancetype)s, %(lowerca= se)s,\n" + " %(uppercase)s, %(parent_struc= t)s)\n" % d) + yield self.make_patch(c) + +def find_type_declaration(files: FileList, typename: str) -> Optional[File= Match]: + """Find usage of DECLARE*CHECKER macro""" + for c in (DeclareInstanceChecker, DeclareClassCheckers, DeclareObjChec= kers, DeclareTypeName): + d =3D files.find_match(c, name=3Dtypename, group=3D'typename') + if d: + return d + return None + + +class Include(FileMatch): + """#include directive""" + regexp =3D RE_INCLUDE + def provided_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', self.group('includepath')) + +class InitialIncludes(FileMatch): + """Initial #include block""" + regexp =3D S(RE_FILE_BEGIN, + M(SP, RE_COMMENTS, + r'^[ \t]*#[ \t]*ifndef[ \t]+', RE_IDENTIFIER, r'[ \t]*\n', + n=3D'?', name=3D'ifndef_block'), + M(SP, RE_COMMENTS, + OR(RE_INCLUDE, RE_SIMPLEDEFINE), + n=3D'*', name=3D'includes')) + +class SymbolUserList(NamedTuple): + definitions: List[FileMatch] + users: List[FileMatch] + +class MoveSymbols(FileMatch): + """Handle missing symbols + - Move typedefs and defines when necessary + - Add missing #include lines when necessary + """ + regexp =3D RE_FILE_BEGIN + + def gen_patches(self) -> Iterator[Patch]: + index: Dict[RequiredIdentifier, SymbolUserList] =3D {} + definition_classes =3D [SimpleTypedefMatch, FullStructTypedefMatch= , ConstantDefine, Include] + user_classes =3D [TypeCheckMacro, DeclareObjCheckers, DeclareInsta= nceChecker, DeclareClassCheckers] + + # first we scan for all symbol definitions and usage: + for dc in definition_classes: + defs =3D self.file.matches_of_type(dc) + for d in defs: + DBG("scanning %r", d) + for i in d.provided_identifiers(): + index.setdefault(i, SymbolUserList([], [])).definition= s.append(d) + DBG("index: %r", list(index.keys())) + for uc in user_classes: + users =3D self.file.matches_of_type(uc) + for u in users: + for i in u.required_identifiers(): + index.setdefault(i, SymbolUserList([], [])).users.appe= nd(u) + + # validate all symbols: + for i,ul in index.items(): + if not ul.users: + # unused symbol + continue + + # symbol not defined + if len(ul.definitions) =3D=3D 0: + if i.type =3D=3D 'include': + includes, =3D self.file.matches_of_type(InitialIncludes) + #FIXME: don't do this if we're already inside qom/objec= t.h + yield includes.append(f'#include {i.name}\n') + else: + u.warn("definition of %s %s not found in file", i.type= , i.name) + continue + + # symbol defined twice: + if len(ul.definitions) > 1: + ul.definitions[1].warn("%s defined twice", i.name) + ul.definitions[0].warn("previously defined here") + continue + + # symbol defined. check if all users are after its definition: + assert len(ul.definitions) =3D=3D 1 + definition =3D ul.definitions[0] + DBG("handling repositioning of %r", definition) + earliest =3D min(ul.users, key=3Dlambda u: u.start()) + if earliest.start() > definition.start(): + DBG("%r is OK", definition) + continue + + DBG("%r needs to be moved", definition) + if isinstance(definition, SimpleTypedefMatch) \ + or isinstance(definition, ConstantDefine): + # simple typedef or define can be moved directly: + yield definition.make_removal_patch() + yield earliest.prepend(definition.group(0)) + elif isinstance(definition, FullStructTypedefMatch) \ + and definition.group('structname'): + # full struct typedef is more complex: we need to remove + # the typedef + yield from definition.move_typedef(earliest.start()) + else: + definition.warn("definition of %s %s needs to be moved ear= lier in the file", i.type, i.name) + earliest.warn("definition of %s %s is used here", i.type, = i.name) + diff --git a/scripts/codeconverter/codeconverter/qom_type_info.py b/scripts= /codeconverter/codeconverter/qom_type_info.py new file mode 100644 index 0000000000..fc02058739 --- /dev/null +++ b/scripts/codeconverter/codeconverter/qom_type_info.py @@ -0,0 +1,434 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +import re +from .regexps import * +from .patching import * +from .utils import * +from .qom_macros import * + +TI_FIELDS =3D [ 'name', 'parent', 'abstract', 'interfaces', + 'instance_size', 'instance_init', 'instance_post_init', 'instance_fina= lize', + 'class_size', 'class_init', 'class_base_init', 'class_data'] + +RE_TI_FIELD_NAME =3D OR(*TI_FIELDS) + +RE_TI_FIELD_INIT =3D S(r'[ \t]*', NAMED('comments', RE_COMMENTS), + r'\.', NAMED('field', RE_TI_FIELD_NAME), r'\s*=3D\s*', + NAMED('value', RE_EXPRESSION), r'[ \t]*,?[ \t]*\n') +RE_TI_FIELDS =3D M(RE_TI_FIELD_INIT) + +RE_TYPEINFO_START =3D S(r'^[ \t]*', M(r'(static|const)\s+', name=3D'modifi= ers'), r'TypeInfo\s+', + NAMED('name', RE_IDENTIFIER), r'\s*=3D\s*{[ \t]*\n') +RE_TYPEINFO_DEF =3D S(RE_TYPEINFO_START, + M(NAMED('fields', RE_TI_FIELDS), + SP, NAMED('endcomments', RE_COMMENTS), + r'};?\n', + n=3D'?', name=3D'fullspec')) + +ParsedArray =3D List[str] +ParsedInitializerValue =3D Union[str, ParsedArray] +class InitializerValue(NamedTuple): + raw: str + parsed: Optional[ParsedInitializerValue] + match: Optional[Match] +TypeInfoInitializers =3D Dict[str, InitializerValue] + +def parse_array(m: Match) -> ParsedArray: + #DBG('parse_array: %r', m.group(0)) + return [m.group('arrayitem') for m in re.finditer(RE_ARRAY_ITEM, m.gro= up('arrayitems'))] + +def parse_initializer_value(m: Match, s: str) -> InitializerValue: + parsed: Optional[ParsedInitializerValue] =3D None + #DBG("parse_initializer_value: %r", s) + array =3D re.match(RE_ARRAY, s) + if array: + parsed =3D parse_array(array) + return InitializerValue(s, parsed, m) + +class TypeInfoVar(FileMatch): + """TypeInfo variable declaration with initializer + Will be replaced by OBJECT_DEFINE_TYPE_EXTENDED macro + (not implemented yet) + """ + regexp =3D RE_TYPEINFO_DEF + + @property + def initializers(self) -> Optional[TypeInfoInitializers]: + if getattr(self, '_inititalizers', None): + self._initializers: TypeInfoInitializers + return self._initializers + fields =3D self.group('fields') + if fields is None: + return None + d =3D dict((fm.group('field'), parse_initializer_value(fm, fm.grou= p('value'))) + for fm in re.finditer(RE_TI_FIELD_INIT, fields)) + self._initializers =3D d + return d + + def is_static(self) -> bool: + return 'static' in self.group('modifiers') + + def is_full(self) -> bool: + return bool(self.group('fullspec')) + + def get_initializers(self) -> TypeInfoInitializers: + """Helper for code that needs to deal with missing initializer inf= o""" + if self.initializers is None: + return {} + return self.initializers + + def get_initializer_value(self, field: str) -> InitializerValue: + return self.get_initializers().get(field, InitializerValue('', '',= None)) + + #def extract_identifiers(self) -> Optional[TypeIdentifiers]: + # """Try to extract identifiers from names being used""" + # DBG("extracting idenfiers from %s", self.name) + #uppercase =3D None + #if typename and re.fullmatch(RE_IDENTIFIER, typename) and typenam= e.startswith("TYPE_"): + # uppercase =3D typename[len('TYPE_'):] + #lowercase =3D None + #funcs =3D set() + #prefixes =3D set() + #for field,suffix in [('instance_init', '_init'), + # ('instance_finalize', '_finalize'), + # ('class_init', '_class_init')]: + # if field not in values: + # continue + # func =3D values[field].raw + # funcs.add(func) + # if func.endswith(suffix): + # prefixes.add(func[:-len(suffix)]) + # else: + # self.warn("function name %s doesn't have expected %s suff= ix", + # func, suffix) + #if len(prefixes) =3D=3D 1: + # lowercase =3D prefixes.pop() + #elif len(prefixes) > 1: + # self.warn("inconsistent function names: %s", ' '.join(funcs)) + + #.parent =3D TYPE_##PARENT_MODULE_OBJ_NAME, \ + #return TypeIdentifiers(typename=3Dtypename, + # uppercase=3Duppercase, lowercase=3Dlowerca= se, + # instancetype=3Dinstancetype, classtype=3Dc= lasstype) + + def append_field(self, field, value) -> Patch: + """Generate patch appending a field initializer""" + content =3D f' .{field} =3D {value},\n' + return Patch(self.match.end('fields'), self.match.end('fields'), + content) + + def patch_field(self, field: str, replacement: str) -> Patch: + """Generate patch replacing a field initializer""" + values =3D self.initializers + assert values + value =3D values.get(field) + assert value + fm =3D value.match + assert fm + fstart =3D self.match.start('fields') + fm.start() + fend =3D self.match.start('fields') + fm.end() + return Patch(fstart, fend, replacement) + + def gen_patches(self) -> Iterable[Patch]: + values =3D self.initializers + if values is None: + return + if 'name' not in values: + self.warn("name not set in TypeInfo variable %s", self.name) + return + typename =3D values['name'].raw + if 'parent' not in values: + self.warn("parent not set in TypeInfo variable %s", self.name) + return + parent_typename =3D values['parent'].raw + + instancetype =3D None + if 'instance_size' in values: + m =3D re.fullmatch(RE_SIZEOF, values['instance_size'].raw) + if m: + instancetype =3D m.group('sizeoftype') + else: + self.warn("can't extract instance type in TypeInfo variabl= e %s", self.name) + self.warn("instance_size is set to: %r", values['instance_= size'].raw) + return + + classtype =3D None + if 'class_size' in values: + m =3D re.fullmatch(RE_SIZEOF, values['class_size'].raw) + if m: + classtype =3D m.group('sizeoftype') + else: + self.warn("can't extract class type in TypeInfo variable %= s", self.name) + self.warn("class_size is set to: %r", values['class_size']= .raw) + return + + #NOTE: this will NOT work after declarations are converted + # to OBJECT_DECLARE* + + # Now, the challenge is to find out the right MODULE_OBJ_NAME for = the + # type and for the parent type + instance_decl =3D find_type_declaration(self.allfiles, typename) + parent_decl =3D find_type_declaration(self.allfiles, parent_typena= me) + + self.info("TypeInfo variable for %s is here", typename) + if instance_decl: + instance_decl.info("instance type declaration (%s) is here", i= nstance_decl.match.group('uppercase')) + if parent_decl: + parent_decl.info("parent type declaration (%s) is here", paren= t_decl.match.group('uppercase')) + + ok =3D True + if (instance_decl is None and (instancetype or classtype)): + self.warn("Can't find where type checkers for %s are declared.= We need them to validate sizes of %s", typename, self.name) + ok =3D False + + if (instance_decl is not None + and 'instancetype' in instance_decl.match.groupdict() + and instancetype !=3D instance_decl.group('instancetype')): + self.warn("type at instance_size is %r. Should instance_size = be set to sizeof(%s) ?", + instancetype, instance_decl.group('instancetype')) + instance_decl.warn("Type checker declaration for %s is here", = typename) + ok =3D False + if (instance_decl is not None + and 'classtype' in instance_decl.match.groupdict() + and classtype !=3D instance_decl.group('classtype')): + self.warn("type at class_size is %r. Should class_size be set= to sizeof(%s) ?", + classtype, instance_decl.group('classtype')) + instance_decl.warn("Type checker declaration for %s is here", = typename) + ok =3D False + + if not ok: + return + + #if parent_decl is None: + # self.warn("Can't find where parent type %s is declared", pare= nt_typename) + + self.info("%s can be patched!", self.name) + return + yield + +class RedundantTypeSizes(TypeInfoVar): + """Remove redundant instance_size/class_size from TypeInfo vars""" + def gen_patches(self) -> Iterable[Patch]: + values =3D self.initializers + if values is None: + return + if 'name' not in values: + self.warn("name not set in TypeInfo variable %s", self.name) + return + typename =3D values['name'].raw + if 'parent' not in values: + self.warn("parent not set in TypeInfo variable %s", self.name) + return + parent_typename =3D values['parent'].raw + + if 'instance_size' not in values and 'class_size' not in values: + self.debug("no need to validate %s", self.name) + return + + instance_decl =3D find_type_declaration(self.allfiles, typename) + if instance_decl: + self.debug("won't touch TypeInfo var that has type checkers") + return + + parent =3D find_type_info(self.allfiles, parent_typename) + if not parent: + self.warn("Can't find TypeInfo for %s", parent_typename) + return + + if 'instance_size' in values and parent.get_initializer_value('ins= tance_size').raw !=3D values['instance_size'].raw: + self.info("instance_size mismatch") + parent.info("parent type declared here") + return + + if 'class_size' in values and parent.get_initializer_value('class_= size').raw !=3D values['class_size'].raw: + self.info("class_size mismatch") + parent.info("parent type declared here") + return + + self.debug("will patch variable %s", self.name) + + if 'instance_size' in values: + self.debug("deleting instance_size") + yield self.patch_field('instance_size', '') + + if 'class_size' in values: + self.debug("deleting class_size") + yield self.patch_field('class_size', '') + + +#class TypeInfoVarInitFuncs(TypeInfoVar): +# """TypeInfo variable +# Will create missing init functions +# """ +# def gen_patches(self) -> Iterable[Patch]: +# values =3D self.initializers +# if values is None: +# self.warn("type not parsed completely: %s", self.name) +# return +# +# macro =3D self.file.find_match(TypeInfoVar, self.name) +# if macro is None: +# self.warn("No TYPE_INFO macro for %s", self.name) +# return +# +# ids =3D self.extract_identifiers() +# if ids is None: +# return +# +# DBG("identifiers extracted: %r", ids) +# fields =3D set(values.keys()) +# if ids.lowercase: +# if 'instance_init' not in fields: +# yield self.prepend(('static void %s_init(Object *obj)\n' +# '{\n' +# '}\n\n') % (ids.lowercase)) +# yield self.append_field('instance_init', ids.lowercase+'_= init') +# +# if 'instance_finalize' not in fields: +# yield self.prepend(('static void %s_finalize(Object *obj)= \n' +# '{\n' +# '}\n\n') % (ids.lowercase)) +# yield self.append_field('instance_finalize', ids.lowercas= e+'_finalize') +# +# +# if 'class_init' not in fields: +# yield self.prepend(('static void %s_class_init(ObjectClas= s *oc, void *data)\n' +# '{\n' +# '}\n\n') % (ids.lowercase)) +# yield self.append_field('class_init', ids.lowercase+'_cla= ss_init') + +class TypeInitMacro(FileMatch): + """type_init(...) macro use + Will be deleted if function is empty + """ + regexp =3D S(r'^[ \t]*type_init\s*\(\s*', NAMED('name', RE_IDENTIFIER)= , r'\s*\);?[ \t]*\n') + def gen_patches(self) -> Iterable[Patch]: + fn =3D self.file.find_match(StaticVoidFunction, self.name) + DBG("function for %s: %s", self.name, fn) + if fn and fn.body =3D=3D '': + yield fn.make_patch('') + yield self.make_patch('') + +class StaticVoidFunction(FileMatch): + """simple static void function + (no replacement rules) + """ + #NOTE: just like RE_FULL_STRUCT, this doesn't parse any of the body co= ntents + # of the function. Tt will just look for "}" in the beginning of= a line + regexp =3D S(r'static\s+void\s+', NAMED('name', RE_IDENTIFIER), r'\s*\= (\s*void\s*\)\n', + r'{\n', + NAMED('body', + # acceptable inside the function body: + # - lines starting with space or tab + # - empty lines + # - preprocessor directives + OR(r'[ \t][^\n]*\n', + r'#[^\n]*\n', + r'\n', + repeat=3D'*')), + r'}\n') + + @property + def body(self) -> str: + return self.group('body') + + def has_preprocessor_directive(self) -> bool: + return bool(re.search(r'^[ \t]*#', self.body, re.MULTILINE)) + +class TypeRegisterCall(FileMatch): + """type_register_static() call + Will be replaced by TYPE_INFO() macro + """ + regexp =3D S(r'^[ \t]*type_register_static\s*\(&\s*', NAMED('name', RE= _IDENTIFIER), r'\s*\);[ \t]*\n') + + def function(self) -> Optional['StaticVoidFunction']: + """Return function containing this call""" + for m in self.file.matches_of_type(StaticVoidFunction): + if m.contains(self): + return m + return None + + def gen_patches(self) -> Iterable[Patch]: + fn =3D self.function() + if fn is None: + self.warn("can't find function where type_register_static(&%s)= is called", self.name) + return + + #if fn.has_preprocessor_directive() and not self.file.force: + # self.warn("function %s has preprocessor directives, this requ= ires --force", fn.name) + # return + + type_init =3D self.file.find_match(TypeInitMacro, fn.name) + if type_init is None: + self.warn("can't find type_init(%s) line", fn.name) + return + + var =3D self.file.find_match(TypeInfoVar, self.name) + if var is None: + self.warn("can't find TypeInfo var declaration for %s", self.n= ame) + return + + if not var.is_full(): + self.warn("variable declaration %s wasn't parsed fully", var.n= ame) + return + + if fn.contains(var): + self.warn("TypeInfo %s variable is inside a function", self.na= me) + return + + # delete type_register_static() call: + yield self.make_patch('') + # append TYPE_REGISTER(...) after variable declaration: + yield var.append(f'TYPE_INFO({self.name})\n') + +class TypeInfoMacro(FileMatch): + """TYPE_INFO macro usage""" + regexp =3D S(r'^[ \t]*TYPE_INFO\s*\(\s*', NAMED('name', RE_IDENTIFIER)= , r'\s*\)[ \t]*;?[ \t]*\n') + +def find_type_info(files: RegexpScanner, name: str) -> Optional[TypeInfoVa= r]: + ti =3D [ti for ti in files.matches_of_type(TypeInfoVar) + if ti.get_initializer_value('name').raw =3D=3D name] + DBG("type info vars: %r", ti) + if len(ti) > 1: + DBG("multiple TypeInfo vars found for %s", name) + return None + if len(ti) =3D=3D 0: + DBG("no TypeInfo var found for %s", name) + return None + return ti[0] + +class CreateClassStruct(DeclareInstanceChecker): + """Replace DECLARE_INSTANCE_CHECKER with OBJECT_DECLARE_SIMPLE_TYPE""" + def gen_patches(self) -> Iterable[Patch]: + typename =3D self.group('typename') + DBG("looking for TypeInfo variable for %s", typename) + var =3D find_type_info(self.allfiles, typename) + if var is None: + self.warn("no TypeInfo var found for %s", typename) + return + assert var.initializers + if 'class_size' in var.initializers: + self.warn("class size already set for TypeInfo %s", var.name) + return + classtype =3D self.group('instancetype')+'Class' + return + yield + #TODO: need to find out what's the parent class type... + #yield var.append_field('class_size', f'sizeof({classtype})') + #c =3D (f'OBJECT_DECLARE_SIMPLE_TYPE({instancetype}, {lowercase},\= n' + # f' MODULE_OBJ_NAME, ParentClassTyp= e)\n') + #yield self.make_patch(c) + +def type_infos(file: FileInfo) -> Iterable[TypeInfoVar]: + return file.matches_of_type(TypeInfoVar) + +def full_types(file: FileInfo) -> Iterable[TypeInfoVar]: + return [t for t in type_infos(file) if t.is_full()] + +def partial_types(file: FileInfo) -> Iterable[TypeInfoVar]: + return [t for t in type_infos(file) if not t.is_full()] diff --git a/scripts/codeconverter/codeconverter/regexps.py b/scripts/codec= onverter/codeconverter/regexps.py new file mode 100644 index 0000000000..77993cc3b9 --- /dev/null +++ b/scripts/codeconverter/codeconverter/regexps.py @@ -0,0 +1,118 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +"""Helpers for creation of regular expressions""" +import re + +import logging +logger =3D logging.getLogger(__name__) +DBG =3D logger.debug +INFO =3D logger.info +WARN =3D logger.warning + +def S(*regexps) -> str: + """Just a shortcut to concatenate multiple regexps more easily""" + return ''.join(regexps) + +def P(*regexps, name=3DNone, capture=3DFalse, repeat=3D'') -> str: + """Just add parenthesis around regexp(s), with optional name or repeat= suffix""" + s =3D S(*regexps) + if name: + return f'(?P<{name}>{s}){repeat}' + elif capture: + return f'({s}){repeat}' + else: + return f'(?:{s}){repeat}' + +def NAMED(name, *regexps) -> str: + """Make named group using ...) syntax + + >>> NAMED('mygroup', 'xyz', 'abc') + '(?Pxyzabc)' + """ + return P(*regexps, name=3Dname) + +def OR(*regexps, **kwargs) -> str: + """Build (a|b|c) regexp""" + return P('|'.join(regexps), **kwargs) + +def M(*regexps, n=3D'*', name=3DNone) -> str: + """Add repetition qualifier to regexp(s) + + >>> M('a', 'b') + '(?:ab)*' + >>> M('a' , 'b', n=3D'+') + '(?:ab)+' + >>> M('a' , 'b', n=3D'{2,3}', name=3D'name') + '(?P(?:ab){2,3})' + """ + r =3D P(*regexps, repeat=3Dn) + if name: + r =3D NAMED(name, r) + return r + +# helper to make parenthesis optional around regexp +OPTIONAL_PARS =3D lambda R: OR(S(r'\(\s*', R, r'\s*\)'), R) +def test_optional_pars(): + r =3D OPTIONAL_PARS('abc')+'$' + assert re.match(r, 'abc') + assert re.match(r, '(abc)') + assert not re.match(r, '(abcd)') + assert not re.match(r, '(abc') + assert not re.match(r, 'abc)') + + +# this disables the MULTILINE flag, so it will match at the +# beginning of the file: +RE_FILE_BEGIN =3D r'(?-m:^)' + +# C primitives: + +SP =3D r'\s*' + +RE_COMMENT =3D r'//[^\n]*$|/\*([^*]|\*[^/])*\*/' +RE_COMMENTS =3D M(RE_COMMENT + SP) + +RE_IDENTIFIER =3D r'[a-zA-Z_][a-zA-Z0-9_]*(?![a-zA-Z0-9])' +RE_STRING =3D r'\"([^\"\\]|\\[a-z\"])*\"' +RE_NUMBER =3D r'[0-9]+|0x[0-9a-fA-F]+' + +# space or escaped newlines: +CPP_SPACE =3D OR(r'\s', r'\\\n', repeat=3D'+') + +RE_PATH =3D '[a-zA-Z0-9/_.-]+' + +RE_INCLUDEPATH =3D OR(S(r'\"', RE_PATH, r'\"'), + S(r'<', RE_PATH, r'>')) + +RE_INCLUDE =3D S(r'^[ \t]*#[ \t]*include[ \t]+', NAMED('includepath', RE_I= NCLUDEPATH), r'[ \t]*\n') +RE_SIMPLEDEFINE =3D S(r'^[ \t]*#[ \t]*define[ \t]+', RE_IDENTIFIER, r'[ \t= ]*\n') + +RE_STRUCT_TYPE =3D S(r'struct\s+', RE_IDENTIFIER) +RE_TYPE =3D OR(RE_IDENTIFIER, RE_STRUCT_TYPE) + +RE_MACRO_CONCAT =3D M(S(OR(RE_IDENTIFIER, RE_STRING), SP), n=3D'{2,}') + +RE_SIMPLE_VALUE =3D OR(RE_IDENTIFIER, RE_STRING, RE_NUMBER) + +RE_FUN_CALL =3D S(RE_IDENTIFIER, r'\s*\(\s*', RE_SIMPLE_VALUE, r'\s*\)') +RE_SIZEOF =3D S(r'sizeof\s*\(\s*', NAMED('sizeoftype', RE_TYPE), r'\s*\)') + +RE_ADDRESS =3D S(r'&\s*', RE_IDENTIFIER) + +RE_ARRAY_ITEM =3D S(r'{\s*', NAMED('arrayitem', M(RE_SIMPLE_VALUE, n=3D'?'= )), r'\s*}\s*,?') +RE_ARRAY_CAST =3D S(r'\(\s*', RE_IDENTIFIER, r'\s*\[\s*\]\)') +RE_ARRAY_ITEMS =3D M(S(RE_ARRAY_ITEM, SP)) +RE_ARRAY =3D S(M(RE_ARRAY_CAST, n=3D'?'), r'\s*{\s*', + NAMED('arrayitems', RE_ARRAY_ITEMS), + r'}') + +# NOTE: this covers a very small subset of valid expressions + +RE_EXPRESSION =3D OR(RE_SIZEOF, RE_FUN_CALL, RE_MACRO_CONCAT, RE_SIMPLE_VA= LUE, + RE_ARRAY, RE_ADDRESS) + diff --git a/scripts/codeconverter/codeconverter/test_patching.py b/scripts= /codeconverter/codeconverter/test_patching.py new file mode 100644 index 0000000000..5998af81c9 --- /dev/null +++ b/scripts/codeconverter/codeconverter/test_patching.py @@ -0,0 +1,105 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +from tempfile import NamedTemporaryFile +from .patching import FileInfo, FileMatch, Patch, FileList +from .regexps import * + +class BasicPattern(FileMatch): + regexp =3D '[abc]{3}' + + @property + def name(self): + return self.group(0) + + def replacement(self) -> str: + # replace match with the middle character repeated 5 times + return self.group(0)[1].upper()*5 + +def test_pattern_patching(): + of =3D NamedTemporaryFile('wt') + of.writelines(['one line\n', + 'this pattern will be patched: defbbahij\n', + 'third line\n', + 'another pattern: jihaabfed']) + of.flush() + + files =3D FileList() + f =3D FileInfo(files, of.name) + f.load() + f.scan_for_matches() + matches =3D f.matches_of_type(BasicPattern) + assert len(matches) =3D=3D 2 + p2 =3D matches[1] + + # manually add patch, to see if .append() works: + f.patches.append(p2.append('XXX')) + + # apply all patches: + f.gen_patches() + patched =3D f.get_patched_content() + assert patched =3D=3D ('one line\n'+ + 'this pattern will be patched: defBBBBBhij\n'+ + 'third line\n'+ + 'another pattern: jihAAAAAXXXfed') + +class Function(FileMatch): + regexp =3D S(r'BEGIN\s+', NAMED('name', RE_IDENTIFIER), r'\n', + r'(.*\n)*?END\n') + +class Statement(FileMatch): + regexp =3D S(r'^\s*', NAMED('name', RE_IDENTIFIER), r'\(\)\n') + +def test_container_match(): + of =3D NamedTemporaryFile('wt') + of.writelines(['statement1()\n', + 'statement2()\n', + 'BEGIN function1\n', + ' statement3()\n', + ' statement4()\n', + 'END\n', + 'BEGIN function2\n', + ' statement5()\n', + ' statement6()\n', + 'END\n', + 'statement7()\n']) + of.flush() + + files =3D FileList() + f =3D FileInfo(files, of.name) + f.load() + assert len(f.matches_of_type(Function)) =3D=3D 2 + print(' '.join(m.name for m in f.matches_of_type(Statement))) + assert len(f.matches_of_type(Statement)) =3D=3D 7 + + f1 =3D f.find_match(Function, 'function1') + f2 =3D f.find_match(Function, 'function2') + st1 =3D f.find_match(Statement, 'statement1') + st2 =3D f.find_match(Statement, 'statement2') + st3 =3D f.find_match(Statement, 'statement3') + st4 =3D f.find_match(Statement, 'statement4') + st5 =3D f.find_match(Statement, 'statement5') + st6 =3D f.find_match(Statement, 'statement6') + st7 =3D f.find_match(Statement, 'statement7') + + assert not f1.contains(st1) + assert not f1.contains(st2) + assert not f1.contains(st2) + assert f1.contains(st3) + assert f1.contains(st4) + assert not f1.contains(st5) + assert not f1.contains(st6) + assert not f1.contains(st7) + + assert not f2.contains(st1) + assert not f2.contains(st2) + assert not f2.contains(st2) + assert not f2.contains(st3) + assert not f2.contains(st4) + assert f2.contains(st5) + assert f2.contains(st6) + assert not f2.contains(st7) diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/= codeconverter/codeconverter/test_regexps.py new file mode 100644 index 0000000000..9b84d689a6 --- /dev/null +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -0,0 +1,282 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +from .regexps import * +from .qom_macros import * +from .qom_type_info import * + +def test_res(): + def fullmatch(regexp, s): + return re.fullmatch(regexp, s, re.MULTILINE) + + assert fullmatch(RE_IDENTIFIER, 'sizeof') + assert fullmatch(RE_IDENTIFIER, 'X86CPU') + assert fullmatch(RE_FUN_CALL, 'sizeof(X86CPU)') + assert fullmatch(RE_IDENTIFIER, 'X86_CPU_TYPE_NAME') + assert fullmatch(RE_SIMPLE_VALUE, '"base"') + print(RE_FUN_CALL) + assert fullmatch(RE_FUN_CALL, 'X86_CPU_TYPE_NAME("base")') + print(RE_TI_FIELD_INIT) + assert fullmatch(RE_TI_FIELD_INIT, '.name =3D X86_CPU_TYPE_NAME("base"= ),\n') + + + assert fullmatch(RE_MACRO_CONCAT, 'TYPE_ASPEED_GPIO "-ast2600"') + assert fullmatch(RE_EXPRESSION, 'TYPE_ASPEED_GPIO "-ast2600"') + + print(RE_MACRO_DEFINE) + assert re.search(RE_MACRO_DEFINE, r''' + #define OFFSET_CHECK(c) \ + do { \ + if (!(c)) { \ + goto bad_offset; \ + } \ + } while (0) + ''', re.MULTILINE) + + print(RE_CHECK_MACRO) + print(CPP_SPACE) + assert not re.match(RE_CHECK_MACRO, r''' + #define OFFSET_CHECK(c) \ + do { \ + if (!(c)) { \ + goto bad_offset; \ + } \ + } while (0)''', re.MULTILINE) + + print(RE_CHECK_MACRO) + assert fullmatch(RE_CHECK_MACRO, r'''#define PCI_DEVICE(obj) \ + OBJECT_CHECK(PCIDevice, (obj), TYPE_PCI_DEVICE) +''') + assert fullmatch(RE_CHECK_MACRO, r'''#define COLLIE_MACHINE(obj) \ + OBJECT_CHECK(CollieMachineState, obj, TYPE_COLLIE_MAC= HINE) +''') + + print(RE_TYPEINFO_START) + assert re.search(RE_TYPEINFO_START, r''' + cc->open =3D qmp_chardev_open_file; +} + +static const TypeInfo char_file_type_info =3D { + .name =3D TYPE_CHARDEV_FILE, +#ifdef _WIN32 + .parent =3D TYPE_CHARDEV_WIN, +''', re.MULTILINE) + assert re.search(RE_TYPEINFO_START, r''' + TypeInfo ti =3D { + .name =3D armsse_variants[i].name, + .parent =3D TYPE_ARMSSE, + .class_init =3D armsse_class_init, + .class_data =3D (void *)&armsse_variants[i], + };''', re.MULTILINE) + + print(RE_ARRAY_ITEM) + assert fullmatch(RE_ARRAY_ITEM, '{ TYPE_HOTPLUG_HANDLER },') + assert fullmatch(RE_ARRAY_ITEM, '{ TYPE_ACPI_DEVICE_IF },') + assert fullmatch(RE_ARRAY_ITEM, '{ }') + assert fullmatch(RE_ARRAY_CAST, '(InterfaceInfo[])') + assert fullmatch(RE_ARRAY, '''(InterfaceInfo[]) { + { TYPE_HOTPLUG_HANDLER }, + { TYPE_ACPI_DEVICE_IF }, + { } + }''') + print(RE_COMMENT) + assert fullmatch(RE_COMMENT, r'''/* multi-line + * comment + */''') + + print(RE_TI_FIELDS) + assert fullmatch(RE_TI_FIELDS, + r'''/* could be TYPE_SYS_BUS_DEVICE (or LPC etc) */ + .parent =3D TYPE_DEVICE, +''') + assert fullmatch(RE_TI_FIELDS, r'''.name =3D TYPE_TPM_CRB, + /* could be TYPE_SYS_BUS_DEVICE (or LPC etc) */ + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(CRBState), + .class_init =3D tpm_crb_class_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_TPM_IF }, + { } + } +''') + assert fullmatch(RE_TI_FIELDS + SP + RE_COMMENTS, + r'''.name =3D TYPE_PALM_MISC_GPIO, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(PalmMiscGPIOState), + .instance_init =3D palm_misc_gpio_init, + /* + * No class init required: device has no internal state so doe= s not + * need to set up reset or vmstate, and has no realize method. + */''') + + print(RE_TYPEINFO_DEF) + test_empty =3D 'static const TypeInfo x86_base_cpu_type_info =3D {\n'+\ + '};\n'; + assert fullmatch(RE_TYPEINFO_DEF, test_empty) + + test_simple =3D r''' + static const TypeInfo x86_base_cpu_type_info =3D { + .name =3D X86_CPU_TYPE_NAME("base"), + .parent =3D TYPE_X86_CPU, + .class_init =3D x86_cpu_base_class_init, + }; + ''' + assert re.search(RE_TYPEINFO_DEF, test_simple, re.MULTILINE) + + test_interfaces =3D r''' + static const TypeInfo acpi_ged_info =3D { + .name =3D TYPE_ACPI_GED, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AcpiGedState), + .instance_init =3D acpi_ged_initfn, + .class_init =3D acpi_ged_class_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_HOTPLUG_HANDLER }, + { TYPE_ACPI_DEVICE_IF }, + { } + } + }; + ''' + assert re.search(RE_TYPEINFO_DEF, test_interfaces, re.MULTILINE) + + test_comments =3D r''' + static const TypeInfo palm_misc_gpio_info =3D { + .name =3D TYPE_PALM_MISC_GPIO, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(PalmMiscGPIOState), + .instance_init =3D palm_misc_gpio_init, + /* + * No class init required: device has no internal state so does not + * need to set up reset or vmstate, and has no realize method. + */ + }; + ''' + assert re.search(RE_TYPEINFO_DEF, test_comments, re.MULTILINE) + + test_comments =3D r''' + static const TypeInfo tpm_crb_info =3D { + .name =3D TYPE_TPM_CRB, + /* could be TYPE_SYS_BUS_DEVICE (or LPC etc) */ + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(CRBState), + .class_init =3D tpm_crb_class_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_TPM_IF }, + { } + } + }; + ''' + assert re.search(RE_TYPEINFO_DEF, test_comments, re.MULTILINE) + +def test_struct_re(): + print('---') + print(RE_STRUCT_TYPEDEF) + assert re.search(RE_STRUCT_TYPEDEF, r''' +typedef struct TCGState { + AccelState parent_obj; + + bool mttcg_enabled; + unsigned long tb_size; +} TCGState; +''', re.MULTILINE) + + assert re.search(RE_STRUCT_TYPEDEF, r''' +typedef struct { + ISADevice parent_obj; + + QEMUSoundCard card; + uint32_t freq; + uint32_t port; + int ticking[2]; + int enabled; + int active; + int bufpos; +#ifdef DEBUG + int64_t exp[2]; +#endif + int16_t *mixbuf; + uint64_t dexp[2]; + SWVoiceOut *voice; + int left, pos, samples; + QEMUAudioTimeStamp ats; + FM_OPL *opl; + PortioList port_list; +} AdlibState; +''', re.MULTILINE) + + false_positive =3D r''' +typedef struct dma_pagetable_entry { + int32_t frame; + int32_t owner; +} A B C D E; +struct foo { + int x; +} some_variable; +''' + assert not re.search(RE_STRUCT_TYPEDEF, false_positive, re.MULTILINE) + +def test_initial_includes(): + print(InitialIncludes.regexp) + c =3D ''' +#ifndef HW_FLASH_H +#define HW_FLASH_H + +/* NOR flash devices */ + +#include "qom/object.h" +#include "exec/hwaddr.h" + +/* pflash_cfi01.c */ +''' + print(repr(list(m.groupdict() for m in re.finditer(InitialIncludes.reg= exp, c, re.MULTILINE)))) + m =3D re.match(InitialIncludes.regexp, c, re.MULTILINE) + assert m + print(repr(m.group(0))) + assert m.group(0).endswith('#include "exec/hwaddr.h"\n') + + c =3D '''#ifndef QEMU_VIRTIO_9P_H +#define QEMU_VIRTIO_9P_H + +#include "standard-headers/linux/virtio_9p.h" +#include "hw/virtio/virtio.h" +#include "9p.h" + + +''' + print(repr(list(m.groupdict() for m in re.finditer(InitialIncludes.reg= exp, c, re.MULTILINE)))) + m =3D re.match(InitialIncludes.regexp, c, re.MULTILINE) + assert m + print(repr(m.group(0))) + assert m.group(0).endswith('#include "9p.h"\n') + + c =3D '''#include "qom/object.h" +/* + * QEMU ES1370 emulation +... + */ + +/* #define DEBUG_ES1370 */ +/* #define VERBOSE_ES1370 */ +#define SILENT_ES1370 + +#include "qemu/osdep.h" +#include "hw/audio/soundhw.h" +#include "audio/audio.h" +#include "hw/pci/pci.h" +#include "migration/vmstate.h" +#include "qemu/module.h" +#include "sysemu/dma.h" + +/* Missing stuff: + SCTRL_P[12](END|ST)INC +''' + print(repr(list(m.groupdict() for m in re.finditer(InitialIncludes.reg= exp, c, re.MULTILINE)))) + m =3D re.match(InitialIncludes.regexp, c, re.MULTILINE) + assert m + print(repr(m.group(0))) + assert m.group(0).endswith('#include "sysemu/dma.h"\n') + diff --git a/scripts/codeconverter/codeconverter/utils.py b/scripts/codecon= verter/codeconverter/utils.py new file mode 100644 index 0000000000..760ab7eecd --- /dev/null +++ b/scripts/codeconverter/codeconverter/utils.py @@ -0,0 +1,72 @@ +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +from typing import * + +import logging +logger =3D logging.getLogger(__name__) +DBG =3D logger.debug +INFO =3D logger.info +WARN =3D logger.warning + +T =3D TypeVar('T') +def opt_compare(a: T, b: T) -> bool: + """Compare two values, ignoring mismatches if one of them is None""" + return (a is None) or (b is None) or (a =3D=3D b) + +def merge(a: T, b: T) -> T: + """Merge two values if they matched using opt_compare()""" + assert opt_compare(a, b) + if a is None: + return b + else: + return a + +def test_comp_merge(): + assert opt_compare(None, 1) =3D=3D True + assert opt_compare(2, None) =3D=3D True + assert opt_compare(1, 1) =3D=3D True + assert opt_compare(1, 2) =3D=3D False + + assert merge(None, None) is None + assert merge(None, 10) =3D=3D 10 + assert merge(10, None) =3D=3D 10 + assert merge(10, 10) =3D=3D 10 + + +LineNumber =3D NewType('LineNumber', int) +ColumnNumber =3D NewType('ColumnNumber', int) +class LineAndColumn(NamedTuple): + line: int + col: int + + def __str__(self): + return '%d:%d' % (self.line, self.col) + +def line_col(s, position: int) -> LineAndColumn: + """Return line and column for a char position in string + + Character position starts in 0, but lines and columns start in 1. + """ + before =3D s[:position] + lines =3D before.split('\n') + line =3D len(lines) + col =3D len(lines[-1]) + 1 + return LineAndColumn(line, col) + +def test_line_col(): + assert line_col('abc\ndefg\nhijkl', 0) =3D=3D (1, 1) + assert line_col('abc\ndefg\nhijkl', 2) =3D=3D (1, 3) + assert line_col('abc\ndefg\nhijkl', 3) =3D=3D (1, 4) + assert line_col('abc\ndefg\nhijkl', 4) =3D=3D (2, 1) + assert line_col('abc\ndefg\nhijkl', 10) =3D=3D (3, 2) + +def not_optional(arg: Optional[T]) -> T: + assert arg is not None + return arg + +__all__ =3D ['not_optional', 'opt_compare', 'merge', 'line_col', 'LineAndC= olumn'] \ No newline at end of file diff --git a/scripts/codeconverter/converter.py b/scripts/codeconverter/con= verter.py new file mode 100755 index 0000000000..ebaf9b57ce --- /dev/null +++ b/scripts/codeconverter/converter.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +# QEMU library +# +# Copyright (C) 2020 Red Hat Inc. +# +# Authors: +# Eduardo Habkost +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +# +import sys +import argparse +import os +import os.path +import re +from typing import * + +from codeconverter.patching import FileInfo, match_class_dict, FileList +import codeconverter.qom_macros +from codeconverter.qom_type_info import TI_FIELDS, type_infos, TypeInfoVar + +import logging +logger =3D logging.getLogger(__name__) +DBG =3D logger.debug +INFO =3D logger.info +WARN =3D logger.warning + +def process_all_files(parser: argparse.ArgumentParser, args: argparse.Name= space) -> None: + DBG("filenames: %r", args.filenames) + + files =3D FileList() + files.extend(FileInfo(files, fn, args.force) for fn in args.filenames) + for f in files: + DBG('opening %s', f.filename) + f.load() + + if args.table: + fields =3D ['filename', 'variable_name'] + TI_FIELDS + print('\t'.join(fields)) + for f in files: + for t in f.matches_of_type(TypeInfoVar): + assert isinstance(t, TypeInfoVar) + values =3D [f.filename, t.name] + \ + [t.get_initializer_value(f).raw + for f in TI_FIELDS] + DBG('values: %r', values) + assert all('\t' not in v for v in values) + values =3D [v.replace('\n', ' ').replace('"', '') for v in= values] + print('\t'.join(values)) + return + + match_classes =3D match_class_dict() + if not args.patterns: + parser.error("--pattern is required") + + classes =3D [p for arg in args.patterns + for p in re.split(r'[\s,]', arg)] + for c in classes: + if c not in match_classes: + print("Invalid pattern name: %s" % (c), file=3Dsys.stderr) + print("Valid patterns:", file=3Dsys.stderr) + print(PATTERN_HELP, file=3Dsys.stderr) + sys.exit(1) + + DBG("classes: %r", classes) + for f in files: + DBG("patching contents of %s", f.filename) + f.patch_content(max_passes=3Dargs.passes, class_names=3Dclasses) + + for f in files: + #alltypes.extend(f.type_infos) + #full_types.extend(f.full_types()) + + if not args.dry_run: + if args.inplace: + f.patch_inplace() + if args.diff: + f.show_diff() + if not args.diff and not args.inplace: + f.write_to_file(sys.stdout) + sys.stdout.flush() + + +PATTERN_HELP =3D ('\n'.join(" %s: %s" % (n, str(c.__doc__).strip()) + for (n,c) in sorted(match_class_dict().items()) + if c.has_replacement_rule())) + +def main() -> None: + p =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawDescriptio= nHelpFormatter) + p.add_argument('filenames', nargs=3D'+') + p.add_argument('--passes', type=3Dint, default=3D1, + help=3D"Number of passes (0 means unlimited)") + p.add_argument('--pattern', required=3DTrue, action=3D'append', + default=3D[], dest=3D'patterns', + help=3D"Pattern to scan for") + p.add_argument('--inplace', '-i', action=3D'store_true', + help=3D"Patch file in place") + p.add_argument('--dry-run', action=3D'store_true', + help=3D"Don't patch files or print patching results") + p.add_argument('--force', '-f', action=3D'store_true', + help=3D"Perform changes even if not completely safe") + p.add_argument('--diff', action=3D'store_true', + help=3D"Print diff output on stdout") + p.add_argument('--debug', '-d', action=3D'store_true', + help=3D"Enable debugging") + p.add_argument('--verbose', '-v', action=3D'store_true', + help=3D"Verbose logging on stderr") + p.add_argument('--table', action=3D'store_true', + help=3D"Print CSV table of type information") + p.add_argument_group("Valid pattern names", + PATTERN_HELP) + args =3D p.parse_args() + + loglevel =3D (logging.DEBUG if args.debug + else logging.INFO if args.verbose + else logging.WARN) + logging.basicConfig(format=3D'%(levelname)s: %(message)s', level=3Dlog= level) + DBG("args: %r", args) + process_all_files(p, args) + +if __name__ =3D=3D '__main__': + main() \ No newline at end of file diff --git a/MAINTAINERS b/MAINTAINERS index b233da2a73..752d0304ec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2423,6 +2423,11 @@ F: tests/check-qom-interface.c F: tests/check-qom-proplist.c F: tests/test-qdev-global-props.c =20 +QOM boilerplate conversion script +M: Eduardo Habkost +S: Maintained +F: scripts/codeconverter/ + QMP M: Markus Armbruster S: Supported --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166982; cv=none; d=zohomail.com; s=zohoarc; b=MOTPbKOJELZP9sBp0jPnVLWREG6uIY5jbq2GWhhfnRwGgMfxfUB8ZFWQcn8XwWkaKmFX/tf6RLxB5vVxz5k0afBhdqNRzGsNAKlp/FezuF1YiBP6+jG6QQw1XGcUNn60VXRxClSgKlF/3g68UUaWZMws2xFSRKhHRO5eQ17DENU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166982; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JkqiBB6icU60yHAv0YmC/ClUkdOtm/IL+BUw87QCUtU=; b=KrmlPDSQDvpAjNoaES5qIod9sHVOMn244z2jKcecxCyx4Fmz7DZ/zttEDG3WmrQG1IicYB6jjMZkl3O+elv0F1q9DoQOm75FJ4uhzbZLc4bE1UCIdV2Xmu7mGxUVaYSS/ETIwENWRQkMphRVQAXAu7603C6R+liglNMAAz3jFYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166982450188.33023857121248; Thu, 3 Sep 2020 14:03:02 -0700 (PDT) Received: from localhost ([::1]:44460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwNp-0006sp-K0 for importer@patchew.org; Thu, 03 Sep 2020 17:03:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEF-0000QD-R7 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:07 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:51074 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEE-0006ZO-7L for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-7QlBS_uPPmaggGXrFf8UfQ-1; Thu, 03 Sep 2020 16:53:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 10DE481F014; Thu, 3 Sep 2020 20:53:02 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB1262D07D; Thu, 3 Sep 2020 20:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JkqiBB6icU60yHAv0YmC/ClUkdOtm/IL+BUw87QCUtU=; b=Z94kgdTiCNR59oRuAbRymqx1NVLF4jEAFkiiyXbHMMtJYesMYJTxJHlyHvDTzrNUJfd22x kMhXvV9BA/rpa0ImnsI5PlBPStBky/3CnL4GJ3T76ohLvNVZGbEl/AIwV3tXZd4M3/z3EB /IchXMoJQoTaqf8tOvPM6EIHTaBJb0w= X-MC-Unique: 7QlBS_uPPmaggGXrFf8UfQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 07/27] Delete duplicate QOM typedefs Date: Thu, 3 Sep 2020 16:52:27 -0400 Message-Id: <20200903205247.1667472-8-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:28:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=3DQOMDuplicatedTypedefs $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-8-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/crypto/secret_keyring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyrin= g.h index 9f371ad251..4345eb048e 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -39,14 +39,14 @@ typedef struct QCryptoSecretKeyring QCryptoSecretKeyring; typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass; =20 -typedef struct QCryptoSecretKeyring { +struct QCryptoSecretKeyring { QCryptoSecretCommon parent; int32_t serial; -} QCryptoSecretKeyring; +}; =20 =20 -typedef struct QCryptoSecretKeyringClass { +struct QCryptoSecretKeyringClass { QCryptoSecretCommonClass parent; -} QCryptoSecretKeyringClass; +}; =20 #endif /* QCRYPTO_SECRET_KEYRING_H */ --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167488; cv=none; d=zohomail.com; s=zohoarc; b=UQsM+cuVLszoVCnZ+XDAzLtPjazp+Xq9saL8LpQDW3K9mGuEEd/gPCU9iJor4FXb9uUVEdtx/9wolzYTbT1BOqVU+uc6AWpzU3Zttc9REFQs2haUIbhBJIBxvEff66sa6+RVvlOB+Y9TFMrze65RptlWAZmZxAf65y33R8Ou5g0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167488; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i1FIPDPszA7/DcgrwvZa7AGukzumgGbtmpGC9LBghig=; b=Tsmlz6z1wwkdmUjuuFYDOzSdH9wcsQqwc+8KIlk0wuuXKCqobBMovFr+f19gl2hqEjLEdYXasxf2d9rPAXbs+WOhqtRl9ocJ3zGroVgevHe72T2EfjTZ6V8nnpyFl+Za41pm7t1jtue7Eh8VeiWCsr6nu4R1F8SIcYVImQDck8w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167488885568.8951553290481; Thu, 3 Sep 2020 14:11:28 -0700 (PDT) Received: from localhost ([::1]:44752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwVz-0002Z1-K7 for importer@patchew.org; Thu, 03 Sep 2020 17:11:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEs-0001HS-VU for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:47 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:42556 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEk-0006eC-M6 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:46 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-539-zi0juI3qPkKPmZoYAIvG5w-1; Thu, 03 Sep 2020 16:53:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CDFA801AEE; Thu, 3 Sep 2020 20:53:04 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD4641002D57; Thu, 3 Sep 2020 20:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i1FIPDPszA7/DcgrwvZa7AGukzumgGbtmpGC9LBghig=; b=DW9z9SF2y9L8pVX085DYgn+HtxuxZOiEz7tAoUp2slzgPyaKxZjKl/eFjnv+jS0FHxIuIY DL1pA/uVHvp6dG6ABka+MPFZW5+0m9NTr1NMNaKTjdoAE+80AMUjf0FFL/3wPKCK1DVNKK St+v0biO8gDzwYy6QFde+YnamhAUXa8= X-MC-Unique: zi0juI3qPkKPmZoYAIvG5w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 08/27] Move QOM typedefs and add missing includes Date: Thu, 3 Sep 2020 16:52:28 -0400 Message-Id: <20200903205247.1667472-9-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.005 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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=3DQOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=3DMoveSymbols \ $(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=C3=A9 Reviewed-by: Juan Quintela Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by: Juan Quintela Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- chardev/chardev-internal.h | 5 +- hw/9pfs/virtio-9p.h | 7 ++- hw/audio/intel-hda.h | 11 ++-- hw/avr/atmega.h | 6 +- hw/display/ati_int.h | 6 +- hw/display/qxl.h | 6 +- hw/display/virtio-vga.h | 11 ++-- hw/i386/amd_iommu.h | 6 +- hw/misc/tmp105.h | 6 +- hw/net/fsl_etsec/etsec.h | 6 +- hw/net/rocker/rocker.h | 1 + hw/net/tulip.h | 1 + hw/net/vmxnet3_defs.h | 6 +- hw/ppc/e500-ccsr.h | 6 +- hw/ppc/e500.h | 11 ++-- hw/ppc/mac.h | 11 ++-- hw/rdma/vmw/pvrdma.h | 6 +- hw/s390x/ccw-device.h | 10 ++-- hw/s390x/ipl.h | 3 +- hw/s390x/s390-pci-bus.h | 18 +++--- hw/s390x/virtio-ccw.h | 73 ++++++++++++++---------- hw/scsi/mptsas.h | 1 + hw/usb/ccid.h | 6 +- hw/usb/hcd-dwc2.h | 1 + hw/usb/hcd-ehci.h | 21 ++++--- hw/usb/hcd-ohci.h | 6 +- hw/usb/hcd-xhci.h | 3 +- hw/vfio/pci.h | 6 +- hw/virtio/virtio-mem-pci.h | 1 + hw/virtio/virtio-pci.h | 6 +- hw/virtio/virtio-pmem-pci.h | 1 + hw/xen/xen_pt.h | 1 + include/authz/base.h | 4 +- include/authz/list.h | 5 +- include/authz/listfile.h | 5 +- include/authz/pamacct.h | 5 +- include/authz/simple.h | 5 +- include/block/throttle-groups.h | 1 + include/chardev/char-fd.h | 6 +- include/chardev/char-win.h | 6 +- include/chardev/char.h | 5 +- include/chardev/spice.h | 6 +- include/crypto/secret.h | 2 +- include/crypto/secret_common.h | 4 +- include/crypto/secret_keyring.h | 4 +- include/crypto/tls-cipher-suites.h | 5 +- include/crypto/tlscreds.h | 2 +- include/crypto/tlscredsanon.h | 3 +- include/crypto/tlscredspsk.h | 3 +- include/crypto/tlscredsx509.h | 3 +- include/exec/memory.h | 5 +- include/hw/acpi/acpi_dev_interface.h | 5 +- include/hw/acpi/generic_event_device.h | 6 +- include/hw/acpi/vmgenid.h | 6 +- include/hw/adc/stm32f2xx_adc.h | 6 +- include/hw/arm/allwinner-a10.h | 6 +- include/hw/arm/allwinner-h3.h | 5 +- include/hw/arm/armsse.h | 11 ++-- include/hw/arm/armv7m.h | 11 ++-- include/hw/arm/aspeed.h | 6 +- include/hw/arm/aspeed_soc.h | 11 ++-- include/hw/arm/bcm2835_peripherals.h | 6 +- include/hw/arm/bcm2836.h | 11 ++-- include/hw/arm/digic.h | 6 +- include/hw/arm/exynos4210.h | 6 +- include/hw/arm/fsl-imx25.h | 6 +- include/hw/arm/fsl-imx31.h | 6 +- include/hw/arm/fsl-imx6.h | 6 +- include/hw/arm/fsl-imx6ul.h | 6 +- include/hw/arm/fsl-imx7.h | 6 +- include/hw/arm/linux-boot-if.h | 5 +- include/hw/arm/msf2-soc.h | 6 +- include/hw/arm/nrf51_soc.h | 6 +- include/hw/arm/omap.h | 5 +- include/hw/arm/pxa.h | 1 + include/hw/arm/smmu-common.h | 11 ++-- include/hw/arm/smmuv3.h | 11 ++-- include/hw/arm/stm32f205_soc.h | 6 +- include/hw/arm/stm32f405_soc.h | 6 +- include/hw/arm/virt.h | 11 ++-- include/hw/arm/xlnx-versal.h | 6 +- include/hw/arm/xlnx-zynqmp.h | 6 +- include/hw/block/flash.h | 5 +- include/hw/block/swim.h | 6 +- include/hw/char/avr_usart.h | 6 +- include/hw/char/bcm2835_aux.h | 6 +- include/hw/char/cadence_uart.h | 6 +- include/hw/char/cmsdk-apb-uart.h | 6 +- include/hw/char/digic-uart.h | 6 +- include/hw/char/escc.h | 6 +- include/hw/char/ibex_uart.h | 6 +- include/hw/char/imx_serial.h | 6 +- include/hw/char/nrf51_uart.h | 6 +- include/hw/char/pl011.h | 6 +- include/hw/char/renesas_sci.h | 6 +- include/hw/char/serial.h | 16 ++++-- include/hw/char/stm32f2xx_usart.h | 6 +- include/hw/clock.h | 2 +- include/hw/core/cpu.h | 6 +- include/hw/core/generic-loader.h | 6 +- include/hw/cpu/a15mpcore.h | 6 +- include/hw/cpu/a9mpcore.h | 6 +- include/hw/cpu/arm11mpcore.h | 6 +- include/hw/cpu/cluster.h | 6 +- include/hw/cpu/core.h | 6 +- include/hw/display/bcm2835_fb.h | 6 +- include/hw/display/dpcd.h | 1 + include/hw/display/i2c-ddc.h | 1 + include/hw/display/macfb.h | 18 +++--- include/hw/display/xlnx_dp.h | 6 +- include/hw/dma/bcm2835_dma.h | 6 +- include/hw/dma/i8257.h | 6 +- include/hw/dma/pl080.h | 6 +- include/hw/dma/xlnx-zdma.h | 6 +- include/hw/dma/xlnx-zynq-devcfg.h | 6 +- include/hw/dma/xlnx_dpdma.h | 1 + include/hw/fw-path-provider.h | 5 +- include/hw/gpio/aspeed_gpio.h | 11 ++-- include/hw/gpio/bcm2835_gpio.h | 6 +- include/hw/gpio/imx_gpio.h | 6 +- include/hw/gpio/nrf51_gpio.h | 6 +- include/hw/hotplug.h | 5 +- include/hw/hyperv/vmbus-bridge.h | 6 +- include/hw/hyperv/vmbus.h | 8 ++- include/hw/i2c/arm_sbcon_i2c.h | 6 +- include/hw/i2c/aspeed_i2c.h | 11 ++-- include/hw/i2c/i2c.h | 6 +- include/hw/i2c/imx_i2c.h | 6 +- include/hw/i2c/microbit_i2c.h | 6 +- include/hw/i2c/ppc4xx_i2c.h | 6 +- include/hw/i2c/smbus_slave.h | 9 +-- include/hw/i386/apic_internal.h | 7 ++- include/hw/i386/ich9.h | 6 +- include/hw/i386/intel_iommu.h | 3 +- include/hw/i386/ioapic_internal.h | 6 +- include/hw/i386/microvm.h | 11 ++-- include/hw/i386/pc.h | 6 +- include/hw/i386/x86-iommu.h | 5 +- include/hw/i386/x86.h | 11 ++-- include/hw/ide/ahci.h | 11 ++-- include/hw/ide/internal.h | 6 +- include/hw/ide/pci.h | 6 +- include/hw/input/adb.h | 6 +- include/hw/input/i8042.h | 3 +- include/hw/intc/allwinner-a10-pic.h | 6 +- include/hw/intc/arm_gic.h | 6 +- include/hw/intc/arm_gic_common.h | 11 ++-- include/hw/intc/arm_gicv3.h | 6 +- include/hw/intc/arm_gicv3_common.h | 6 +- include/hw/intc/arm_gicv3_its_common.h | 3 +- include/hw/intc/armv7m_nvic.h | 6 +- include/hw/intc/aspeed_vic.h | 6 +- include/hw/intc/bcm2835_ic.h | 6 +- include/hw/intc/bcm2836_control.h | 6 +- include/hw/intc/heathrow_pic.h | 6 +- include/hw/intc/ibex_plic.h | 6 +- include/hw/intc/imx_avic.h | 6 +- include/hw/intc/imx_gpcv2.h | 6 +- include/hw/intc/intc.h | 5 +- include/hw/intc/mips_gic.h | 3 +- include/hw/intc/realview_gic.h | 6 +- include/hw/intc/rx_icu.h | 1 + include/hw/intc/xlnx-pmu-iomod-intc.h | 6 +- include/hw/intc/xlnx-zynqmp-ipi.h | 6 +- include/hw/ipack/ipack.h | 1 + include/hw/ipmi/ipmi.h | 18 +++--- include/hw/isa/i8259_internal.h | 7 ++- include/hw/isa/isa.h | 11 ++-- include/hw/isa/pc87312.h | 6 +- include/hw/isa/superio.h | 11 ++-- include/hw/m68k/mcf_fec.h | 1 + include/hw/mem/memory-device.h | 5 +- include/hw/mem/nvdimm.h | 5 +- include/hw/mem/pc-dimm.h | 11 ++-- include/hw/mips/cps.h | 6 +- include/hw/misc/a9scu.h | 6 +- include/hw/misc/allwinner-cpucfg.h | 5 +- include/hw/misc/allwinner-h3-ccu.h | 5 +- include/hw/misc/allwinner-h3-dramc.h | 5 +- include/hw/misc/allwinner-h3-sysctrl.h | 5 +- include/hw/misc/allwinner-sid.h | 5 +- include/hw/misc/arm11scu.h | 6 +- include/hw/misc/armsse-cpuid.h | 6 +- include/hw/misc/armsse-mhu.h | 6 +- include/hw/misc/aspeed_scu.h | 11 ++-- include/hw/misc/aspeed_sdmc.h | 11 ++-- include/hw/misc/aspeed_xdma.h | 6 +- include/hw/misc/auxbus.h | 1 + include/hw/misc/avr_power.h | 6 +- include/hw/misc/bcm2835_mbox.h | 6 +- include/hw/misc/bcm2835_mphi.h | 1 + include/hw/misc/bcm2835_property.h | 6 +- include/hw/misc/bcm2835_rng.h | 6 +- include/hw/misc/bcm2835_thermal.h | 6 +- include/hw/misc/grlib_ahb_apb_pnp.h | 5 +- include/hw/misc/imx25_ccm.h | 6 +- include/hw/misc/imx31_ccm.h | 6 +- include/hw/misc/imx6_ccm.h | 6 +- include/hw/misc/imx6_src.h | 6 +- include/hw/misc/imx6ul_ccm.h | 6 +- include/hw/misc/imx7_ccm.h | 11 ++-- include/hw/misc/imx7_gpr.h | 6 +- include/hw/misc/imx7_snvs.h | 6 +- include/hw/misc/imx_ccm.h | 11 ++-- include/hw/misc/imx_rngc.h | 6 +- include/hw/misc/iotkit-secctl.h | 3 +- include/hw/misc/iotkit-sysctl.h | 6 +- include/hw/misc/iotkit-sysinfo.h | 6 +- include/hw/misc/mac_via.h | 16 ++++-- include/hw/misc/macio/cuda.h | 11 ++-- include/hw/misc/macio/gpio.h | 6 +- include/hw/misc/macio/macio.h | 26 +++++---- include/hw/misc/macio/pmu.h | 11 ++-- include/hw/misc/max111x.h | 6 +- include/hw/misc/mips_cmgcr.h | 3 +- include/hw/misc/mips_cpc.h | 6 +- include/hw/misc/mips_itu.h | 6 +- include/hw/misc/mos6522.h | 11 ++-- include/hw/misc/mps2-fpgaio.h | 6 +- include/hw/misc/mps2-scc.h | 6 +- include/hw/misc/msf2-sysreg.h | 6 +- include/hw/misc/nrf51_rng.h | 6 +- include/hw/misc/pca9552.h | 6 +- include/hw/misc/stm32f2xx_syscfg.h | 6 +- include/hw/misc/stm32f4xx_exti.h | 6 +- include/hw/misc/stm32f4xx_syscfg.h | 6 +- include/hw/misc/tz-mpc.h | 3 +- include/hw/misc/tz-msc.h | 6 +- include/hw/misc/tz-ppc.h | 3 +- include/hw/misc/unimp.h | 6 +- include/hw/misc/vmcoreinfo.h | 6 +- include/hw/misc/zynq-xadc.h | 6 +- include/hw/net/allwinner-sun8i-emac.h | 5 +- include/hw/net/allwinner_emac.h | 6 +- include/hw/net/cadence_gem.h | 6 +- include/hw/net/ftgmac100.h | 11 ++-- include/hw/net/imx_fec.h | 6 +- include/hw/net/lance.h | 6 +- include/hw/net/lasi_82596.h | 6 +- include/hw/net/msf2-emac.h | 6 +- include/hw/nmi.h | 5 +- include/hw/nubus/mac-nubus-bridge.h | 6 +- include/hw/nubus/nubus.h | 11 ++-- include/hw/nvram/fw_cfg.h | 6 +- include/hw/nvram/nrf51_nvm.h | 6 +- include/hw/pci-bridge/simba.h | 6 +- include/hw/pci-host/designware.h | 8 ++- include/hw/pci-host/gpex.h | 11 ++-- include/hw/pci-host/i440fx.h | 6 +- include/hw/pci-host/pnv_phb3.h | 11 ++-- include/hw/pci-host/pnv_phb4.h | 6 +- include/hw/pci-host/q35.h | 11 ++-- include/hw/pci-host/sabre.h | 11 ++-- include/hw/pci-host/spapr.h | 3 +- include/hw/pci-host/uninorth.h | 11 ++-- include/hw/pci-host/xilinx-pcie.h | 11 ++-- include/hw/pci/pci.h | 6 +- include/hw/pci/pci_bridge.h | 1 + include/hw/pci/pci_host.h | 6 +- include/hw/pci/pcie_host.h | 1 + include/hw/pci/pcie_port.h | 6 +- include/hw/pcmcia.h | 11 ++-- include/hw/platform-bus.h | 1 + include/hw/ppc/mac_dbdma.h | 6 +- include/hw/ppc/openpic.h | 6 +- include/hw/ppc/pnv.h | 33 ++++++----- include/hw/ppc/pnv_core.h | 16 ++++-- include/hw/ppc/pnv_homer.h | 11 ++-- include/hw/ppc/pnv_lpc.h | 11 ++-- include/hw/ppc/pnv_occ.h | 11 ++-- include/hw/ppc/pnv_pnor.h | 6 +- include/hw/ppc/pnv_psi.h | 21 ++++--- include/hw/ppc/pnv_xive.h | 11 ++-- include/hw/ppc/pnv_xscom.h | 5 +- include/hw/ppc/spapr.h | 3 +- include/hw/ppc/spapr_cpu_core.h | 11 ++-- include/hw/ppc/spapr_drc.h | 15 +++-- include/hw/ppc/spapr_irq.h | 6 +- include/hw/ppc/spapr_tpm_proxy.h | 5 +- include/hw/ppc/spapr_vio.h | 10 ++-- include/hw/ppc/spapr_xive.h | 11 ++-- include/hw/ppc/xics.h | 6 +- include/hw/ppc/xics_spapr.h | 1 + include/hw/ppc/xive.h | 41 +++++++------ include/hw/qdev-core.h | 5 +- include/hw/rdma/rdma.h | 5 +- include/hw/register.h | 1 + include/hw/resettable.h | 5 +- include/hw/riscv/opentitan.h | 6 +- include/hw/riscv/riscv_hart.h | 6 +- include/hw/riscv/sifive_clint.h | 6 +- include/hw/riscv/sifive_e.h | 11 ++-- include/hw/riscv/sifive_e_prci.h | 6 +- include/hw/riscv/sifive_gpio.h | 6 +- include/hw/riscv/sifive_plic.h | 6 +- include/hw/riscv/sifive_test.h | 6 +- include/hw/riscv/sifive_u.h | 11 ++-- include/hw/riscv/sifive_u_otp.h | 6 +- include/hw/riscv/sifive_u_prci.h | 6 +- include/hw/riscv/sifive_uart.h | 6 +- include/hw/riscv/spike.h | 6 +- include/hw/riscv/virt.h | 6 +- include/hw/rtc/allwinner-rtc.h | 10 ++-- include/hw/rtc/aspeed_rtc.h | 6 +- include/hw/rtc/goldfish_rtc.h | 6 +- include/hw/rtc/m48t59.h | 5 +- include/hw/rtc/mc146818rtc.h | 6 +- include/hw/rtc/pl031.h | 6 +- include/hw/rtc/xlnx-zynqmp-rtc.h | 6 +- include/hw/rx/rx62n.h | 6 +- include/hw/s390x/3270-ccw.h | 11 ++-- include/hw/s390x/ap-device.h | 6 +- include/hw/s390x/css-bridge.h | 10 ++-- include/hw/s390x/event-facility.h | 16 ++++-- include/hw/s390x/s390-ccw.h | 11 ++-- include/hw/s390x/s390-virtio-ccw.h | 11 ++-- include/hw/s390x/s390_flic.h | 16 ++++-- include/hw/s390x/sclp.h | 11 ++-- include/hw/s390x/storage-attributes.h | 21 ++++--- include/hw/s390x/storage-keys.h | 16 ++++-- include/hw/s390x/tod.h | 11 ++-- include/hw/s390x/vfio-ccw.h | 3 +- include/hw/scsi/esp.h | 6 +- include/hw/scsi/scsi.h | 6 +- include/hw/sd/allwinner-sdhost.h | 10 ++-- include/hw/sd/aspeed_sdhci.h | 6 +- include/hw/sd/bcm2835_sdhost.h | 6 +- include/hw/sd/sd.h | 11 ++-- include/hw/sd/sdhci.h | 6 +- include/hw/southbridge/piix.h | 6 +- include/hw/sparc/sparc32_dma.h | 18 +++--- include/hw/sparc/sun4m_iommu.h | 6 +- include/hw/sparc/sun4u_iommu.h | 6 +- include/hw/ssi/aspeed_smc.h | 11 ++-- include/hw/ssi/imx_spi.h | 6 +- include/hw/ssi/mss-spi.h | 6 +- include/hw/ssi/pl022.h | 6 +- include/hw/ssi/ssi.h | 1 + include/hw/ssi/stm32f2xx_spi.h | 6 +- include/hw/ssi/xilinx_spips.h | 16 ++++-- include/hw/stream.h | 5 +- include/hw/sysbus.h | 6 +- include/hw/timer/a9gtimer.h | 3 +- include/hw/timer/allwinner-a10-pit.h | 3 +- include/hw/timer/arm_mptimer.h | 6 +- include/hw/timer/armv7m_systick.h | 6 +- include/hw/timer/aspeed_timer.h | 13 +++-- include/hw/timer/avr_timer16.h | 6 +- include/hw/timer/bcm2835_systmr.h | 6 +- include/hw/timer/cmsdk-apb-dualtimer.h | 3 +- include/hw/timer/cmsdk-apb-timer.h | 6 +- include/hw/timer/digic-timer.h | 6 +- include/hw/timer/i8254.h | 1 + include/hw/timer/imx_epit.h | 6 +- include/hw/timer/imx_gpt.h | 6 +- include/hw/timer/mss-timer.h | 6 +- include/hw/timer/nrf51_timer.h | 6 +- include/hw/timer/renesas_cmt.h | 6 +- include/hw/timer/renesas_tmr.h | 6 +- include/hw/timer/stm32f2xx_timer.h | 6 +- include/hw/usb.h | 6 +- include/hw/usb/chipidea.h | 6 +- include/hw/usb/imx-usb-phy.h | 6 +- include/hw/vfio/vfio-amd-xgbe.h | 1 + include/hw/vfio/vfio-calxeda-xgmac.h | 11 ++-- include/hw/vfio/vfio-platform.h | 11 ++-- include/hw/virtio/vhost-scsi-common.h | 6 +- include/hw/virtio/vhost-scsi.h | 6 +- include/hw/virtio/vhost-user-blk.h | 6 +- include/hw/virtio/vhost-user-fs.h | 6 +- include/hw/virtio/vhost-user-scsi.h | 6 +- include/hw/virtio/vhost-user-vsock.h | 6 +- include/hw/virtio/vhost-vsock-common.h | 6 +- include/hw/virtio/vhost-vsock.h | 6 +- include/hw/virtio/virtio-balloon.h | 6 +- include/hw/virtio/virtio-blk.h | 6 +- include/hw/virtio/virtio-bus.h | 8 ++- include/hw/virtio/virtio-crypto.h | 6 +- include/hw/virtio/virtio-gpu-pci.h | 1 + include/hw/virtio/virtio-gpu.h | 21 ++++--- include/hw/virtio/virtio-input.h | 11 ++-- include/hw/virtio/virtio-iommu.h | 6 +- include/hw/virtio/virtio-mem.h | 11 ++-- include/hw/virtio/virtio-mmio.h | 6 +- include/hw/virtio/virtio-net.h | 3 +- include/hw/virtio/virtio-pmem.h | 11 ++-- include/hw/virtio/virtio-rng.h | 6 +- include/hw/virtio/virtio-scsi.h | 11 ++-- include/hw/virtio/virtio-serial.h | 8 ++- include/hw/virtio/virtio.h | 6 +- include/hw/vmstate-if.h | 5 +- include/hw/watchdog/cmsdk-apb-watchdog.h | 6 +- include/hw/watchdog/wdt_aspeed.h | 11 ++-- include/hw/watchdog/wdt_diag288.h | 11 ++-- include/hw/watchdog/wdt_imx2.h | 6 +- include/hw/xen/xen-block.h | 21 ++++--- include/hw/xen/xen-bus.h | 21 ++++--- include/hw/xen/xen-legacy-backend.h | 1 + include/io/channel-buffer.h | 3 +- include/io/channel-command.h | 3 +- include/io/channel-file.h | 3 +- include/io/channel-socket.h | 3 +- include/io/channel-tls.h | 3 +- include/io/channel-websock.h | 3 +- include/io/channel.h | 4 +- include/io/dns-resolver.h | 4 +- include/io/net-listener.h | 5 +- include/net/can_host.h | 11 ++-- include/net/filter.h | 5 +- include/qom/object.h | 1 + include/qom/object_interfaces.h | 5 +- include/scsi/pr-manager.h | 10 ++-- include/sysemu/accel.h | 10 ++-- include/sysemu/cryptodev.h | 7 ++- include/sysemu/hostmem.h | 4 +- include/sysemu/hvf.h | 1 + include/sysemu/iothread.h | 5 +- include/sysemu/kvm.h | 1 + include/sysemu/rng-random.h | 2 +- include/sysemu/rng.h | 4 +- include/sysemu/tpm.h | 5 +- include/sysemu/tpm_backend.h | 4 +- include/sysemu/vhost-user-backend.h | 4 +- include/ui/console.h | 2 +- migration/migration.h | 6 +- target/alpha/cpu-qom.h | 8 ++- target/arm/cpu-qom.h | 13 +++-- target/arm/idau.h | 5 +- target/avr/cpu-qom.h | 8 ++- target/cris/cpu-qom.h | 8 ++- target/hppa/cpu-qom.h | 8 ++- target/i386/cpu-qom.h | 8 ++- target/lm32/cpu-qom.h | 8 ++- target/m68k/cpu-qom.h | 8 ++- target/microblaze/cpu-qom.h | 8 ++- target/mips/cpu-qom.h | 8 ++- target/moxie/cpu.h | 11 ++-- target/nios2/cpu.h | 11 ++-- target/openrisc/cpu.h | 11 ++-- target/ppc/cpu-qom.h | 8 ++- target/ppc/cpu.h | 1 + target/riscv/cpu.h | 11 ++-- target/rx/cpu-qom.h | 6 +- target/s390x/cpu-qom.h | 8 ++- target/sh4/cpu-qom.h | 8 ++- target/sparc/cpu-qom.h | 8 ++- target/tilegx/cpu.h | 11 ++-- target/tricore/cpu-qom.h | 8 ++- target/unicore32/cpu-qom.h | 8 ++- target/xtensa/cpu-qom.h | 8 ++- accel/tcg/tcg-all.c | 5 +- backends/cryptodev-builtin.c | 5 +- backends/cryptodev-vhost-user.c | 6 +- backends/dbus-vmstate.c | 1 + backends/hostmem-file.c | 3 +- backends/hostmem-memfd.c | 3 +- backends/rng-builtin.c | 6 +- backends/rng-egd.c | 7 ++- backends/tpm/tpm_emulator.c | 6 +- backends/tpm/tpm_passthrough.c | 3 +- chardev/baum.c | 6 +- chardev/char-parallel.c | 11 ++-- chardev/char-pty.c | 6 +- chardev/char-ringbuf.c | 6 +- chardev/char-socket.c | 6 +- chardev/char-udp.c | 6 +- chardev/char-win-stdio.c | 6 +- chardev/msmouse.c | 6 +- chardev/testdev.c | 6 +- chardev/wctablet.c | 6 +- hw/acpi/piix4.c | 6 +- hw/alpha/typhoon.c | 6 +- hw/arm/collie.c | 6 +- hw/arm/highbank.c | 6 +- hw/arm/integratorcp.c | 16 ++++-- hw/arm/microbit.c | 6 +- hw/arm/mps2-tz.c | 11 ++-- hw/arm/mps2.c | 11 ++-- hw/arm/musca.c | 11 ++-- hw/arm/musicpal.c | 41 +++++++------ hw/arm/palm.c | 6 +- hw/arm/pxa2xx.c | 16 ++++-- hw/arm/pxa2xx_gpio.c | 3 +- hw/arm/pxa2xx_pic.c | 6 +- hw/arm/raspi.c | 11 ++-- hw/arm/sbsa-ref.c | 6 +- hw/arm/spitz.c | 36 +++++++----- hw/arm/stellaris.c | 16 ++++-- hw/arm/strongarm.c | 25 ++++---- hw/arm/tosa.c | 11 ++-- hw/arm/versatilepb.c | 6 +- hw/arm/vexpress.c | 11 ++-- hw/arm/xilinx_zynq.c | 6 +- hw/arm/xlnx-versal-virt.c | 6 +- hw/arm/xlnx-zcu102.c | 6 +- hw/arm/z2.c | 11 ++-- hw/audio/ac97.c | 6 +- hw/audio/adlib.c | 6 +- hw/audio/cs4231.c | 6 +- hw/audio/cs4231a.c | 6 +- hw/audio/es1370.c | 6 +- hw/audio/gus.c | 6 +- hw/audio/hda-codec.c | 1 + hw/audio/intel-hda.c | 1 + hw/audio/marvell_88w8618.c | 6 +- hw/audio/milkymist-ac97.c | 3 +- hw/audio/pcspk.c | 6 +- hw/audio/pl041.c | 6 +- hw/audio/sb16.c | 6 +- hw/audio/wm8750.c | 6 +- hw/avr/arduino.c | 11 ++-- hw/avr/atmega.c | 6 +- hw/block/fdc.c | 21 ++++--- hw/block/m25p80.c | 11 ++-- hw/block/nand.c | 1 + hw/block/onenand.c | 6 +- hw/char/debugcon.c | 6 +- hw/char/etraxfs_ser.c | 6 +- hw/char/exynos4210_uart.c | 6 +- hw/char/grlib_apbuart.c | 6 +- hw/char/ipoctal232.c | 1 + hw/char/lm32_juart.c | 3 +- hw/char/lm32_uart.c | 3 +- hw/char/mcf_uart.c | 6 +- hw/char/milkymist-uart.c | 3 +- hw/char/parallel.c | 6 +- hw/char/sclpconsole-lm.c | 6 +- hw/char/sclpconsole.c | 6 +- hw/char/serial-isa.c | 6 +- hw/char/serial-pci.c | 6 +- hw/char/spapr_vty.c | 6 +- hw/char/terminal3270.c | 6 +- hw/char/virtio-console.c | 6 +- hw/char/xilinx_uartlite.c | 6 +- hw/cpu/realview_mpcore.c | 6 +- hw/display/ads7846.c | 6 +- hw/display/artist.c | 6 +- hw/display/bochs-display.c | 6 +- hw/display/cg3.c | 6 +- hw/display/cirrus_vga.c | 6 +- hw/display/cirrus_vga_isa.c | 6 +- hw/display/exynos4210_fimd.c | 6 +- hw/display/g364fb.c | 6 +- hw/display/jazz_led.c | 6 +- hw/display/milkymist-tmu2.c | 3 +- hw/display/milkymist-vgafb.c | 3 +- hw/display/next-fb.c | 3 +- hw/display/pl110.c | 6 +- hw/display/ramfb-standalone.c | 6 +- hw/display/sii9022.c | 6 +- hw/display/sm501.c | 11 ++-- hw/display/ssd0303.c | 6 +- hw/display/ssd0323.c | 6 +- hw/display/tcx.c | 6 +- hw/display/vga-isa.c | 6 +- hw/display/vga-pci.c | 6 +- hw/display/vhost-user-gpu-pci.c | 6 +- hw/display/vhost-user-vga.c | 6 +- hw/display/virtio-gpu-pci.c | 6 +- hw/display/virtio-vga.c | 6 +- hw/display/vmware_vga.c | 1 + hw/dma/i82374.c | 6 +- hw/dma/pl330.c | 1 + hw/dma/puv3_dma.c | 6 +- hw/dma/pxa2xx_dma.c | 6 +- hw/dma/rc4030.c | 6 +- hw/dma/xilinx_axidma.c | 5 +- hw/gpio/gpio_key.c | 6 +- hw/gpio/max7310.c | 6 +- hw/gpio/mpc8xxx.c | 6 +- hw/gpio/pl061.c | 6 +- hw/gpio/puv3_gpio.c | 6 +- hw/gpio/zaurus.c | 3 +- hw/hppa/dino.c | 6 +- hw/hppa/lasi.c | 6 +- hw/hyperv/hyperv.c | 6 +- hw/hyperv/hyperv_testdev.c | 1 + hw/i2c/bitbang_i2c.c | 6 +- hw/i2c/exynos4210_i2c.c | 6 +- hw/i2c/mpc_i2c.c | 6 +- hw/i2c/smbus_eeprom.c | 6 +- hw/i2c/smbus_ich9.c | 6 +- hw/i2c/versatile_i2c.c | 3 +- hw/i386/kvm/clock.c | 6 +- hw/i386/kvm/i8254.c | 11 ++-- hw/i386/kvm/i8259.c | 6 +- hw/i386/kvmvapic.c | 6 +- hw/i386/port92.c | 6 +- hw/i386/vmmouse.c | 7 ++- hw/i386/vmport.c | 6 +- hw/i386/xen/xen_platform.c | 6 +- hw/i386/xen/xen_pvdevice.c | 6 +- hw/ide/isa.c | 6 +- hw/ide/microdrive.c | 6 +- hw/ide/mmio.c | 6 +- hw/ide/sii3112.c | 6 +- hw/input/adb-kbd.c | 11 ++-- hw/input/adb-mouse.c | 11 ++-- hw/input/lm832x.c | 6 +- hw/input/milkymist-softusb.c | 3 +- hw/input/pl050.c | 6 +- hw/intc/apic.c | 1 + hw/intc/arm_gic_kvm.c | 6 +- hw/intc/arm_gicv2m.c | 6 +- hw/intc/arm_gicv3_its_kvm.c | 6 +- hw/intc/arm_gicv3_kvm.c | 6 +- hw/intc/etraxfs_pic.c | 1 + hw/intc/exynos4210_combiner.c | 6 +- hw/intc/exynos4210_gic.c | 11 ++-- hw/intc/grlib_irqmp.c | 6 +- hw/intc/i8259.c | 6 +- hw/intc/lm32_pic.c | 3 +- hw/intc/loongson_liointc.c | 1 + hw/intc/nios2_iic.c | 6 +- hw/intc/ompic.c | 3 +- hw/intc/openpic_kvm.c | 6 +- hw/intc/pl190.c | 6 +- hw/intc/puv3_intc.c | 6 +- hw/intc/s390_flic_kvm.c | 6 +- hw/intc/slavio_intctl.c | 6 +- hw/intc/xilinx_intc.c | 1 + hw/ipack/tpci200.c | 6 +- hw/ipmi/ipmi_bmc_extern.c | 6 +- hw/ipmi/isa_ipmi_bt.c | 6 +- hw/ipmi/isa_ipmi_kcs.c | 6 +- hw/ipmi/pci_ipmi_bt.c | 6 +- hw/ipmi/pci_ipmi_kcs.c | 6 +- hw/ipmi/smbus_ipmi.c | 6 +- hw/isa/i82378.c | 6 +- hw/isa/piix4.c | 6 +- hw/isa/vt82c686.c | 21 ++++--- hw/m68k/mcf_intc.c | 6 +- hw/m68k/next-cube.c | 6 +- hw/m68k/next-kbd.c | 6 +- hw/microblaze/xlnx-zynqmp-pmu.c | 6 +- hw/mips/boston.c | 6 +- hw/mips/gt64xxx_pci.c | 6 +- hw/mips/malta.c | 6 +- hw/misc/applesmc.c | 3 +- hw/misc/arm_integrator_debug.c | 6 +- hw/misc/arm_l2x0.c | 6 +- hw/misc/arm_sysctl.c | 6 +- hw/misc/debugexit.c | 6 +- hw/misc/eccmemctl.c | 6 +- hw/misc/edu.c | 6 +- hw/misc/empty_slot.c | 6 +- hw/misc/exynos4210_clk.c | 6 +- hw/misc/exynos4210_pmu.c | 6 +- hw/misc/exynos4210_rng.c | 6 +- hw/misc/ivshmem.c | 6 +- hw/misc/milkymist-hpdmc.c | 3 +- hw/misc/milkymist-pfpu.c | 3 +- hw/misc/mst_fpga.c | 6 +- hw/misc/pc-testdev.c | 6 +- hw/misc/pca9552.c | 6 +- hw/misc/pci-testdev.c | 6 +- hw/misc/puv3_pm.c | 6 +- hw/misc/pvpanic.c | 6 +- hw/misc/sga.c | 6 +- hw/misc/slavio_misc.c | 11 ++-- hw/misc/tmp421.c | 11 ++-- hw/misc/zynq_slcr.c | 6 +- hw/net/can/can_kvaser_pci.c | 6 +- hw/net/can/can_mioe3680_pci.c | 6 +- hw/net/can/can_pcm3680_pci.c | 6 +- hw/net/dp8393x.c | 6 +- hw/net/e1000.c | 11 ++-- hw/net/e1000e.c | 6 +- hw/net/etraxfs_eth.c | 7 ++- hw/net/lan9118.c | 6 +- hw/net/milkymist-minimac2.c | 3 +- hw/net/mipsnet.c | 6 +- hw/net/ne2000-isa.c | 6 +- hw/net/opencores_eth.c | 6 +- hw/net/pcnet-pci.c | 6 +- hw/net/rtl8139.c | 6 +- hw/net/smc91c111.c | 6 +- hw/net/spapr_llan.c | 6 +- hw/net/stellaris_enet.c | 6 +- hw/net/sungem.c | 6 +- hw/net/sunhme.c | 6 +- hw/net/vmxnet3.c | 6 +- hw/net/xgmac.c | 6 +- hw/net/xilinx_axienet.c | 5 +- hw/net/xilinx_ethlite.c | 1 + hw/nvram/ds1225y.c | 6 +- hw/nvram/eeprom_at24c.c | 6 +- hw/nvram/spapr_nvram.c | 6 +- hw/pci-bridge/dec.c | 6 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +- hw/pci-bridge/pci_bridge_dev.c | 3 +- hw/pci-bridge/pci_expander_bridge.c | 11 ++-- hw/pci-bridge/pcie_pci_bridge.c | 6 +- hw/pci-host/bonito.c | 6 +- hw/pci-host/grackle.c | 6 +- hw/pci-host/i440fx.c | 6 +- hw/pci-host/pnv_phb3.c | 1 + hw/pci-host/pnv_phb4.c | 1 + hw/pci-host/ppce500.c | 5 +- hw/pci-host/prep.c | 11 ++-- hw/pci-host/versatile.c | 6 +- hw/ppc/mpc8544_guts.c | 3 +- hw/ppc/ppc440_pcix.c | 6 +- hw/ppc/ppc440_uc.c | 6 +- hw/ppc/ppc4xx_pci.c | 3 +- hw/ppc/ppce500_spin.c | 6 +- hw/ppc/prep_systemio.c | 6 +- hw/ppc/rs6000_mc.c | 6 +- hw/ppc/spapr_rng.c | 3 +- hw/rtc/ds1338.c | 6 +- hw/rtc/exynos4210_rtc.c | 6 +- hw/rtc/m41t80.c | 6 +- hw/rtc/m48t59-isa.c | 11 ++-- hw/rtc/m48t59.c | 11 ++-- hw/rtc/sun4v-rtc.c | 6 +- hw/rtc/twl92230.c | 6 +- hw/rx/rx-gdbsim.c | 11 ++-- hw/rx/rx62n.c | 6 +- hw/scsi/esp-pci.c | 11 ++-- hw/scsi/lsi53c895a.c | 6 +- hw/scsi/megasas.c | 11 ++-- hw/scsi/scsi-disk.c | 12 ++-- hw/scsi/spapr_vscsi.c | 6 +- hw/scsi/vmw_pvscsi.c | 11 ++-- hw/sd/allwinner-sdhost.c | 1 + hw/sd/bcm2835_sdhost.c | 1 + hw/sd/milkymist-memcard.c | 3 +- hw/sd/pl181.c | 6 +- hw/sd/pxa2xx_mmci.c | 1 + hw/sd/sdhci.c | 1 + hw/sd/ssi-sd.c | 6 +- hw/sh4/sh_pci.c | 6 +- hw/sparc/sun4m.c | 21 ++++--- hw/sparc64/sun4u.c | 21 ++++--- hw/ssi/ssi.c | 1 + hw/ssi/xilinx_spi.c | 6 +- hw/timer/altera_timer.c | 6 +- hw/timer/arm_timer.c | 11 ++-- hw/timer/cadence_ttc.c | 6 +- hw/timer/etraxfs_timer.c | 6 +- hw/timer/exynos4210_mct.c | 6 +- hw/timer/exynos4210_pwm.c | 6 +- hw/timer/grlib_gptimer.c | 3 +- hw/timer/hpet.c | 6 +- hw/timer/i8254.c | 6 +- hw/timer/lm32_timer.c | 3 +- hw/timer/milkymist-sysctl.c | 3 +- hw/timer/puv3_ost.c | 6 +- hw/timer/pxa2xx_timer.c | 3 +- hw/timer/slavio_timer.c | 6 +- hw/timer/xilinx_timer.c | 1 + hw/tpm/tpm_crb.c | 6 +- hw/tpm/tpm_spapr.c | 6 +- hw/tpm/tpm_tis_isa.c | 6 +- hw/tpm/tpm_tis_sysbus.c | 6 +- hw/usb/ccid-card-emulated.c | 3 +- hw/usb/ccid-card-passthru.c | 1 + hw/usb/dev-audio.c | 6 +- hw/usb/dev-hid.c | 6 +- hw/usb/dev-hub.c | 6 +- hw/usb/dev-mtp.c | 1 + hw/usb/dev-network.c | 6 +- hw/usb/dev-serial.c | 6 +- hw/usb/dev-smartcard-reader.c | 11 ++-- hw/usb/dev-storage.c | 6 +- hw/usb/dev-uas.c | 1 + hw/usb/dev-wacom.c | 6 +- hw/usb/hcd-ohci-pci.c | 6 +- hw/usb/hcd-uhci.c | 1 + hw/usb/host-libusb.c | 3 +- hw/usb/redirect.c | 1 + hw/usb/tusb6010.c | 6 +- hw/vfio/ap.c | 6 +- hw/virtio/vhost-scsi-pci.c | 1 + hw/virtio/vhost-user-blk-pci.c | 1 + hw/virtio/vhost-user-fs-pci.c | 1 + hw/virtio/vhost-user-input-pci.c | 1 + hw/virtio/vhost-user-scsi-pci.c | 1 + hw/virtio/vhost-user-vsock-pci.c | 1 + hw/virtio/vhost-vsock-pci.c | 1 + hw/virtio/virtio-9p-pci.c | 6 +- hw/virtio/virtio-balloon-pci.c | 1 + hw/virtio/virtio-blk-pci.c | 1 + hw/virtio/virtio-crypto-pci.c | 1 + hw/virtio/virtio-input-host-pci.c | 1 + hw/virtio/virtio-input-pci.c | 1 + hw/virtio/virtio-iommu-pci.c | 1 + hw/virtio/virtio-net-pci.c | 1 + hw/virtio/virtio-rng-pci.c | 1 + hw/virtio/virtio-scsi-pci.c | 1 + hw/virtio/virtio-serial-pci.c | 1 + hw/watchdog/wdt_i6300esb.c | 1 + hw/watchdog/wdt_ib700.c | 6 +- migration/rdma.c | 3 +- net/can/can_socketcan.c | 6 +- net/colo-compare.c | 5 +- net/dump.c | 3 +- net/filter-buffer.c | 5 +- net/filter-mirror.c | 9 +-- net/filter-replay.c | 3 +- net/filter-rewriter.c | 7 ++- scsi/pr-manager-helper.c | 6 +- target/i386/sev.c | 3 +- tests/check-qom-interface.c | 5 +- tests/test-qdev-global-props.c | 5 +- ui/console.c | 6 +- ui/gtk.c | 5 +- ui/input-barrier.c | 5 +- ui/input-linux.c | 5 +- ui/spice-app.c | 6 +- 810 files changed, 3453 insertions(+), 1865 deletions(-) diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h index f4d0429763..2926a326e0 100644 --- a/chardev/chardev-internal.h +++ b/chardev/chardev-internal.h @@ -32,7 +32,7 @@ #define MUX_BUFFER_SIZE 32 /* Must be a power of 2. */ #define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1) =20 -typedef struct MuxChardev { +struct MuxChardev { Chardev parent; CharBackend *backends[MAX_MUX]; CharBackend chr; @@ -51,7 +51,8 @@ typedef struct MuxChardev { /* Protected by the Chardev chr_write_lock. */ int linestart; int64_t timestamps_start; -} MuxChardev; +}; +typedef struct MuxChardev MuxChardev; =20 #define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX) #define CHARDEV_IS_MUX(chr) \ diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index e763da2c02..6dd945ecda 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -4,15 +4,16 @@ #include "standard-headers/linux/virtio_9p.h" #include "hw/virtio/virtio.h" #include "9p.h" +#include "qom/object.h" =20 -typedef struct V9fsVirtioState -{ +struct V9fsVirtioState { VirtIODevice parent_obj; VirtQueue *vq; size_t config_size; VirtQueueElement *elems[MAX_REQ]; V9fsState state; -} V9fsVirtioState; +}; +typedef struct V9fsVirtioState V9fsVirtioState; =20 #define TYPE_VIRTIO_9P "virtio-9p-device" #define VIRTIO_9P(obj) \ diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index eee6fee5af..44a2897fff 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -2,11 +2,14 @@ #define HW_INTEL_HDA_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 /* --------------------------------------------------------------------- */ /* hda bus */ =20 #define TYPE_HDA_CODEC_DEVICE "hda-codec" +typedef struct HDACodecDevice HDACodecDevice; +typedef struct HDACodecDeviceClass HDACodecDeviceClass; #define HDA_CODEC_DEVICE(obj) \ OBJECT_CHECK(HDACodecDevice, (obj), TYPE_HDA_CODEC_DEVICE) #define HDA_CODEC_DEVICE_CLASS(klass) \ @@ -15,10 +18,9 @@ OBJECT_GET_CLASS(HDACodecDeviceClass, (obj), TYPE_HDA_CODEC_DEVICE) =20 #define TYPE_HDA_BUS "HDA" +typedef struct HDACodecBus HDACodecBus; #define HDA_BUS(obj) OBJECT_CHECK(HDACodecBus, (obj), TYPE_HDA_BUS) =20 -typedef struct HDACodecBus HDACodecBus; -typedef struct HDACodecDevice HDACodecDevice; =20 typedef void (*hda_codec_response_func)(HDACodecDevice *dev, bool solicited, uint32_t response); @@ -33,15 +35,14 @@ struct HDACodecBus { hda_codec_xfer_func xfer; }; =20 -typedef struct HDACodecDeviceClass -{ +struct HDACodecDeviceClass { DeviceClass parent_class; =20 int (*init)(HDACodecDevice *dev); void (*exit)(HDACodecDevice *dev); void (*command)(HDACodecDevice *dev, uint32_t nid, uint32_t data); void (*stream)(HDACodecDevice *dev, uint32_t stnr, bool running, bool = output); -} HDACodecDeviceClass; +}; =20 struct HDACodecDevice { DeviceState qdev; diff --git a/hw/avr/atmega.h b/hw/avr/atmega.h index 0928cb0ce6..2c46ecb904 100644 --- a/hw/avr/atmega.h +++ b/hw/avr/atmega.h @@ -15,6 +15,7 @@ #include "hw/timer/avr_timer16.h" #include "hw/misc/avr_power.h" #include "target/avr/cpu.h" +#include "qom/object.h" =20 #define TYPE_ATMEGA_MCU "ATmega" #define TYPE_ATMEGA168_MCU "ATmega168" @@ -22,6 +23,7 @@ #define TYPE_ATMEGA1280_MCU "ATmega1280" #define TYPE_ATMEGA2560_MCU "ATmega2560" =20 +typedef struct AtmegaMcuState AtmegaMcuState; #define ATMEGA_MCU(obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MC= U) =20 #define POWER_MAX 2 @@ -29,7 +31,7 @@ #define TIMER_MAX 6 #define GPIO_MAX 12 =20 -typedef struct AtmegaMcuState { +struct AtmegaMcuState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -43,6 +45,6 @@ typedef struct AtmegaMcuState { AVRUsartState usart[USART_MAX]; AVRTimer16State timer[TIMER_MAX]; uint64_t xtal_freq_hz; -} AtmegaMcuState; +}; =20 #endif /* HW_AVR_ATMEGA_H */ diff --git a/hw/display/ati_int.h b/hw/display/ati_int.h index 2a16708e4f..2a8a3306da 100644 --- a/hw/display/ati_int.h +++ b/hw/display/ati_int.h @@ -13,6 +13,7 @@ #include "hw/pci/pci.h" #include "hw/i2c/bitbang_i2c.h" #include "vga_int.h" +#include "qom/object.h" =20 /*#define DEBUG_ATI*/ =20 @@ -29,6 +30,7 @@ #define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 =20 #define TYPE_ATI_VGA "ati-vga" +typedef struct ATIVGAState ATIVGAState; #define ATI_VGA(obj) OBJECT_CHECK(ATIVGAState, (obj), TYPE_ATI_VGA) =20 typedef struct ATIVGARegs { @@ -82,7 +84,7 @@ typedef struct ATIVGARegs { uint32_t default_sc_bottom_right; } ATIVGARegs; =20 -typedef struct ATIVGAState { +struct ATIVGAState { PCIDevice dev; VGACommonState vga; char *model; @@ -97,7 +99,7 @@ typedef struct ATIVGAState { MemoryRegion io; MemoryRegion mm; ATIVGARegs regs; -} ATIVGAState; +}; =20 const char *ati_reg_name(int num); =20 diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 707631a1f5..4ecb6b2934 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -8,6 +8,7 @@ =20 #include "ui/qemu-spice.h" #include "ui/spice-display.h" +#include "qom/object.h" =20 enum qxl_mode { QXL_MODE_UNDEFINED, @@ -27,7 +28,7 @@ enum qxl_mode { #define QXL_PAGE_BITS 12 #define QXL_PAGE_SIZE (1 << QXL_PAGE_BITS); =20 -typedef struct PCIQXLDevice { +struct PCIQXLDevice { PCIDevice pci; PortioList vga_port_list; SimpleSpiceDisplay ssd; @@ -126,7 +127,8 @@ typedef struct PCIQXLDevice { int num_dirty_rects; QXLRect dirty[QXL_NUM_DIRTY_RECTS]; QEMUBH *update_area_bh; -} PCIQXLDevice; +}; +typedef struct PCIQXLDevice PCIQXLDevice; =20 #define TYPE_PCI_QXL "pci-qxl" #define PCI_QXL(obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL) diff --git a/hw/display/virtio-vga.h b/hw/display/virtio-vga.h index c41281a010..2d3b765bf9 100644 --- a/hw/display/virtio-vga.h +++ b/hw/display/virtio-vga.h @@ -3,11 +3,14 @@ =20 #include "hw/virtio/virtio-gpu-pci.h" #include "vga_int.h" +#include "qom/object.h" =20 /* * virtio-vga-base: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base" +typedef struct VirtIOVGABase VirtIOVGABase; +typedef struct VirtIOVGABaseClass VirtIOVGABaseClass; #define VIRTIO_VGA_BASE(obj) \ OBJECT_CHECK(VirtIOVGABase, (obj), TYPE_VIRTIO_VGA_BASE) #define VIRTIO_VGA_BASE_GET_CLASS(obj) \ @@ -15,18 +18,18 @@ #define VIRTIO_VGA_BASE_CLASS(klass) \ OBJECT_CLASS_CHECK(VirtIOVGABaseClass, klass, TYPE_VIRTIO_VGA_BASE) =20 -typedef struct VirtIOVGABase { +struct VirtIOVGABase { VirtIOPCIProxy parent_obj; =20 VirtIOGPUBase *vgpu; VGACommonState vga; MemoryRegion vga_mrs[3]; -} VirtIOVGABase; +}; =20 -typedef struct VirtIOVGABaseClass { +struct VirtIOVGABaseClass { VirtioPCIClass parent_class; =20 DeviceReset parent_reset; -} VirtIOVGABaseClass; +}; =20 #endif /* VIRTIO_VGA_H */ diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index e05a4eff5d..85860c36dd 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -23,6 +23,7 @@ =20 #include "hw/pci/pci.h" #include "hw/i386/x86-iommu.h" +#include "qom/object.h" =20 /* Capability registers */ #define AMDVI_CAPAB_BAR_LOW 0x04 @@ -296,6 +297,7 @@ struct irte_ga { }; =20 #define TYPE_AMD_IOMMU_DEVICE "amd-iommu" +typedef struct AMDVIState AMDVIState; #define AMD_IOMMU_DEVICE(obj)\ OBJECT_CHECK(AMDVIState, (obj), TYPE_AMD_IOMMU_DEVICE) =20 @@ -310,7 +312,7 @@ typedef struct AMDVIPCIState { PCIDevice dev; /* The PCI device itself */ } AMDVIPCIState; =20 -typedef struct AMDVIState { +struct AMDVIState { X86IOMMUState iommu; /* IOMMU bus device */ AMDVIPCIState pci; /* IOMMU PCI device */ =20 @@ -367,6 +369,6 @@ typedef struct AMDVIState { =20 /* Interrupt remapping */ bool ga_enabled; -} AMDVIState; +}; =20 #endif diff --git a/hw/misc/tmp105.h b/hw/misc/tmp105.h index 9ba05ecc9c..634bb4a0d6 100644 --- a/hw/misc/tmp105.h +++ b/hw/misc/tmp105.h @@ -16,8 +16,10 @@ =20 #include "hw/i2c/i2c.h" #include "hw/misc/tmp105_regs.h" +#include "qom/object.h" =20 #define TYPE_TMP105 "tmp105" +typedef struct TMP105State TMP105State; #define TMP105(obj) OBJECT_CHECK(TMP105State, (obj), TYPE_TMP105) =20 /** @@ -27,7 +29,7 @@ * * @see_also: http://www.ti.com/lit/gpn/tmp105 */ -typedef struct TMP105State { +struct TMP105State { /*< private >*/ I2CSlave i2c; /*< public >*/ @@ -42,6 +44,6 @@ typedef struct TMP105State { int16_t limit[2]; int faults; uint8_t alarm; -} TMP105State; +}; =20 #endif diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h index 7951c3ad65..132a87b1ba 100644 --- a/hw/net/fsl_etsec/etsec.h +++ b/hw/net/fsl_etsec/etsec.h @@ -28,6 +28,7 @@ #include "hw/sysbus.h" #include "net/net.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 /* Buffer Descriptors */ =20 @@ -104,7 +105,7 @@ typedef struct eTSEC_Register { uint32_t value; } eTSEC_Register; =20 -typedef struct eTSEC { +struct eTSEC { SysBusDevice busdev; =20 MemoryRegion io_area; @@ -145,7 +146,8 @@ typedef struct eTSEC { =20 /* Whether we should flush the rx queue when buffer becomes available.= */ bool need_flush; -} eTSEC; +}; +typedef struct eTSEC eTSEC; =20 #define TYPE_ETSEC_COMMON "eTSEC" #define ETSEC_COMMON(obj) \ diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h index e4c22db4ff..0dd49d5f41 100644 --- a/hw/net/rocker/rocker.h +++ b/hw/net/rocker/rocker.h @@ -20,6 +20,7 @@ #define ROCKER_H =20 #include "qemu/sockets.h" +#include "qom/object.h" =20 #if defined(DEBUG_ROCKER) # define DPRINTF(fmt, ...) \ diff --git a/hw/net/tulip.h b/hw/net/tulip.h index c3fcd4d4e1..5fe4aee87d 100644 --- a/hw/net/tulip.h +++ b/hw/net/tulip.h @@ -3,6 +3,7 @@ =20 #include "qemu/units.h" #include "net/net.h" +#include "qom/object.h" =20 #define TYPE_TULIP "tulip" typedef struct TULIPState TULIPState; diff --git a/hw/net/vmxnet3_defs.h b/hw/net/vmxnet3_defs.h index 65780c576d..1df1e4c3a6 100644 --- a/hw/net/vmxnet3_defs.h +++ b/hw/net/vmxnet3_defs.h @@ -19,8 +19,10 @@ =20 #include "net/net.h" #include "hw/net/vmxnet3.h" +#include "qom/object.h" =20 #define TYPE_VMXNET3 "vmxnet3" +typedef struct VMXNET3State VMXNET3State; #define VMXNET3(obj) OBJECT_CHECK(VMXNET3State, (obj), TYPE_VMXNET3) =20 /* Device state and helper functions */ @@ -58,7 +60,7 @@ typedef struct { bool is_asserted; } Vmxnet3IntState; =20 -typedef struct { +struct VMXNET3State { PCIDevice parent_obj; NICState *nic; NICConf conf; @@ -132,6 +134,6 @@ typedef struct { =20 /* Compatibility flags for migration */ uint32_t compat_flags; -} VMXNET3State; +}; =20 #endif diff --git a/hw/ppc/e500-ccsr.h b/hw/ppc/e500-ccsr.h index 12a2ba4b97..f7fd73fc0d 100644 --- a/hw/ppc/e500-ccsr.h +++ b/hw/ppc/e500-ccsr.h @@ -2,14 +2,16 @@ #define E500_CCSR_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 -typedef struct PPCE500CCSRState { +struct PPCE500CCSRState { /*< private >*/ SysBusDevice parent; /*< public >*/ =20 MemoryRegion ccsr_space; -} PPCE500CCSRState; +}; +typedef struct PPCE500CCSRState PPCE500CCSRState; =20 #define TYPE_CCSR "e500-ccsr" #define CCSR(obj) OBJECT_CHECK(PPCE500CCSRState, (obj), TYPE_CCSR) diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 3fd9f825ca..5773460d5e 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -3,8 +3,9 @@ =20 #include "hw/boards.h" #include "hw/platform-bus.h" +#include "qom/object.h" =20 -typedef struct PPCE500MachineState { +struct PPCE500MachineState { /*< private >*/ MachineState parent_obj; =20 @@ -12,9 +13,10 @@ typedef struct PPCE500MachineState { * board supports dynamic sysbus devices */ PlatformBusDevice *pbus_dev; -} PPCE500MachineState; +}; +typedef struct PPCE500MachineState PPCE500MachineState; =20 -typedef struct PPCE500MachineClass { +struct PPCE500MachineClass { /*< private >*/ MachineClass parent_class; =20 @@ -36,7 +38,8 @@ typedef struct PPCE500MachineClass { hwaddr pci_mmio_base; hwaddr pci_mmio_bus_base; hwaddr spin_base; -} PPCE500MachineClass; +}; +typedef struct PPCE500MachineClass PPCE500MachineClass; =20 void ppce500_init(MachineState *machine); =20 diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 6af87d1fa0..f4ef3f32b0 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -34,6 +34,7 @@ #include "hw/misc/mos6522.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/uninorth.h" +#include "qom/object.h" =20 /* SMP is not enabled, for now */ #define MAX_CPUS 1 @@ -71,6 +72,7 @@ =20 /* Core99 machine */ #define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99") +typedef struct Core99MachineState Core99MachineState; #define CORE99_MACHINE(obj) OBJECT_CHECK(Core99MachineState, (obj), \ TYPE_CORE99_MACHINE) =20 @@ -78,22 +80,23 @@ #define CORE99_VIA_CONFIG_PMU 0x1 #define CORE99_VIA_CONFIG_PMU_ADB 0x2 =20 -typedef struct Core99MachineState { +struct Core99MachineState { /*< private >*/ MachineState parent; =20 uint8_t via_config; -} Core99MachineState; +}; =20 /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" =20 /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" +typedef struct MacIONVRAMState MacIONVRAMState; #define MACIO_NVRAM(obj) \ OBJECT_CHECK(MacIONVRAMState, (obj), TYPE_MACIO_NVRAM) =20 -typedef struct MacIONVRAMState { +struct MacIONVRAMState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -103,7 +106,7 @@ typedef struct MacIONVRAMState { =20 MemoryRegion mem; uint8_t *data; -} MacIONVRAMState; +}; =20 void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len); #endif /* PPC_MAC_H */ diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h index a8a04a253c..db9d9e2c73 100644 --- a/hw/rdma/vmw/pvrdma.h +++ b/hw/rdma/vmw/pvrdma.h @@ -29,6 +29,7 @@ #include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h" #include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api= .h" #include "pvrdma_dev_ring.h" +#include "qom/object.h" =20 /* BARs */ #define RDMA_MSIX_BAR_IDX 0 @@ -78,7 +79,7 @@ typedef struct PVRDMADevStats { uint64_t interrupts; } PVRDMADevStats; =20 -typedef struct PVRDMADev { +struct PVRDMADev { PCIDevice parent_obj; MemoryRegion msix; MemoryRegion regs; @@ -98,7 +99,8 @@ typedef struct PVRDMADev { VMXNET3State *func0; Notifier shutdown_notifier; PVRDMADevStats stats; -} PVRDMADev; +}; +typedef struct PVRDMADev PVRDMADev; #define PVRDMA_DEV(dev) OBJECT_CHECK(PVRDMADev, (dev), PVRDMA_HW_NAME) =20 static inline int get_reg_val(PVRDMADev *dev, hwaddr addr, uint32_t *val) diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 4e6af287e7..867547b4eb 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -15,7 +15,7 @@ #include "hw/qdev-core.h" #include "hw/s390x/css.h" =20 -typedef struct CcwDevice { +struct CcwDevice { DeviceState parent_obj; SubchDev *sch; /* .. */ @@ -25,18 +25,20 @@ typedef struct CcwDevice { CssDevId dev_id; /* The actual busid of the virtual subchannel. */ CssDevId subch_id; -} CcwDevice; +}; +typedef struct CcwDevice CcwDevice; =20 extern const VMStateDescription vmstate_ccw_dev; #define VMSTATE_CCW_DEVICE(_field, _state) \ VMSTATE_STRUCT(_field, _state, 1, vmstate_ccw_dev, CcwDevice) =20 -typedef struct CCWDeviceClass { +struct CCWDeviceClass { DeviceClass parent_class; void (*unplug)(HotplugHandler *, DeviceState *, Error **); void (*realize)(CcwDevice *, Error **); void (*refill_ids)(CcwDevice *); -} CCWDeviceClass; +}; +typedef struct CCWDeviceClass CCWDeviceClass; =20 static inline CcwDevice *to_ccw_dev_fast(DeviceState *d) { diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 53cc9eb5ac..282b22cc4f 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -16,6 +16,7 @@ #include "cpu.h" #include "exec/address-spaces.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 struct IPLBlockPVComp { uint64_t tweak_pref; @@ -152,6 +153,7 @@ struct QemuIplParameters { typedef struct QemuIplParameters QemuIplParameters; =20 #define TYPE_S390_IPL "s390-ipl" +typedef struct S390IPLState S390IPLState; #define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL) =20 struct S390IPLState { @@ -183,7 +185,6 @@ struct S390IPLState { uint16_t devno; bool iplbext_migration; }; -typedef struct S390IPLState S390IPLState; QEMU_BUILD_BUG_MSG(offsetof(S390IPLState, iplb) & 3, "alignment of iplb wr= ong"); =20 #define DIAG_308_RC_OK 0x0001 diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index 550f3cc5e9..06f046e73a 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -19,6 +19,7 @@ #include "hw/s390x/sclp.h" #include "hw/s390x/s390_flic.h" #include "hw/s390x/css.h" +#include "qom/object.h" =20 #define TYPE_S390_PCI_HOST_BRIDGE "s390-pcihost" #define TYPE_S390_PCI_BUS "s390-pcibus" @@ -36,12 +37,16 @@ #define UID_UNDEFINED 0 #define UID_CHECKING_ENABLED 0x01 =20 +typedef struct S390pciState S390pciState; #define S390_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(S390pciState, (obj), TYPE_S390_PCI_HOST_BRIDGE) +typedef struct S390PCIBus S390PCIBus; #define S390_PCI_BUS(obj) \ OBJECT_CHECK(S390PCIBus, (obj), TYPE_S390_PCI_BUS) +typedef struct S390PCIBusDevice S390PCIBusDevice; #define S390_PCI_DEVICE(obj) \ OBJECT_CHECK(S390PCIBusDevice, (obj), TYPE_S390_PCI_DEVICE) +typedef struct S390PCIIOMMU S390PCIIOMMU; #define S390_PCI_IOMMU(obj) \ OBJECT_CHECK(S390PCIIOMMU, (obj), TYPE_S390_PCI_IOMMU) =20 @@ -265,8 +270,7 @@ typedef struct S390IOTLBEntry { uint64_t perm; } S390IOTLBEntry; =20 -typedef struct S390PCIBusDevice S390PCIBusDevice; -typedef struct S390PCIIOMMU { +struct S390PCIIOMMU { Object parent_obj; S390PCIBusDevice *pbdev; AddressSpace as; @@ -277,7 +281,7 @@ typedef struct S390PCIIOMMU { uint64_t pba; uint64_t pal; GHashTable *iotlb; -} S390PCIIOMMU; +}; =20 typedef struct S390PCIIOMMUTable { uint64_t key; @@ -339,11 +343,11 @@ struct S390PCIBusDevice { QTAILQ_ENTRY(S390PCIBusDevice) link; }; =20 -typedef struct S390PCIBus { +struct S390PCIBus { BusState qbus; -} S390PCIBus; +}; =20 -typedef struct S390pciState { +struct S390pciState { PCIHostState parent_obj; uint32_t next_idx; int bus_no; @@ -352,7 +356,7 @@ typedef struct S390pciState { GHashTable *zpci_table; QTAILQ_HEAD(, SeiContainer) pending_sei; QTAILQ_HEAD(, S390PCIBusDevice) zpci_devs; -} S390pciState; +}; =20 S390pciState *s390_get_phb(void); int pci_chsc_sei_nt2_get_event(void *res); diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index b281896f7d..c046c816c9 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -17,6 +17,7 @@ #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-serial.h" #include "hw/virtio/virtio-scsi.h" +#include "qom/object.h" #ifdef CONFIG_VHOST_SCSI #include "hw/virtio/vhost-scsi.h" #endif @@ -53,6 +54,8 @@ #define CCW_CMD_SET_VIRTIO_REV 0x83 =20 #define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device" +typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass; +typedef struct VirtioCcwDevice VirtioCcwDevice; #define VIRTIO_CCW_DEVICE(obj) \ OBJECT_CHECK(VirtioCcwDevice, (obj), TYPE_VIRTIO_CCW_DEVICE) #define VIRTIO_CCW_DEVICE_CLASS(klass) \ @@ -71,14 +74,13 @@ typedef struct VirtioBusClass VirtioCcwBusClass; #define VIRTIO_CCW_BUS_CLASS(klass) \ OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS) =20 -typedef struct VirtioCcwDevice VirtioCcwDevice; =20 -typedef struct VirtIOCCWDeviceClass { +struct VirtIOCCWDeviceClass { CCWDeviceClass parent_class; void (*realize)(VirtioCcwDevice *dev, Error **errp); void (*unrealize)(VirtioCcwDevice *dev); void (*parent_reset)(DeviceState *dev); -} VirtIOCCWDeviceClass; +}; =20 /* Performance improves when virtqueue kick processing is decoupled from t= he * vcpu thread using ioeventfd for some devices. */ @@ -111,92 +113,100 @@ static inline int virtio_ccw_rev_max(VirtioCcwDevice= *dev) /* virtio-scsi-ccw */ =20 #define TYPE_VIRTIO_SCSI_CCW "virtio-scsi-ccw" +typedef struct VirtIOSCSICcw VirtIOSCSICcw; #define VIRTIO_SCSI_CCW(obj) \ OBJECT_CHECK(VirtIOSCSICcw, (obj), TYPE_VIRTIO_SCSI_CCW) =20 -typedef struct VirtIOSCSICcw { +struct VirtIOSCSICcw { VirtioCcwDevice parent_obj; VirtIOSCSI vdev; -} VirtIOSCSICcw; +}; =20 #ifdef CONFIG_VHOST_SCSI /* vhost-scsi-ccw */ =20 #define TYPE_VHOST_SCSI_CCW "vhost-scsi-ccw" +typedef struct VHostSCSICcw VHostSCSICcw; #define VHOST_SCSI_CCW(obj) \ OBJECT_CHECK(VHostSCSICcw, (obj), TYPE_VHOST_SCSI_CCW) =20 -typedef struct VHostSCSICcw { +struct VHostSCSICcw { VirtioCcwDevice parent_obj; VHostSCSI vdev; -} VHostSCSICcw; +}; #endif =20 /* virtio-blk-ccw */ =20 #define TYPE_VIRTIO_BLK_CCW "virtio-blk-ccw" +typedef struct VirtIOBlkCcw VirtIOBlkCcw; #define VIRTIO_BLK_CCW(obj) \ OBJECT_CHECK(VirtIOBlkCcw, (obj), TYPE_VIRTIO_BLK_CCW) =20 -typedef struct VirtIOBlkCcw { +struct VirtIOBlkCcw { VirtioCcwDevice parent_obj; VirtIOBlock vdev; -} VirtIOBlkCcw; +}; =20 /* virtio-balloon-ccw */ =20 #define TYPE_VIRTIO_BALLOON_CCW "virtio-balloon-ccw" +typedef struct VirtIOBalloonCcw VirtIOBalloonCcw; #define VIRTIO_BALLOON_CCW(obj) \ OBJECT_CHECK(VirtIOBalloonCcw, (obj), TYPE_VIRTIO_BALLOON_CCW) =20 -typedef struct VirtIOBalloonCcw { +struct VirtIOBalloonCcw { VirtioCcwDevice parent_obj; VirtIOBalloon vdev; -} VirtIOBalloonCcw; +}; =20 /* virtio-serial-ccw */ =20 #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw" +typedef struct VirtioSerialCcw VirtioSerialCcw; #define VIRTIO_SERIAL_CCW(obj) \ OBJECT_CHECK(VirtioSerialCcw, (obj), TYPE_VIRTIO_SERIAL_CCW) =20 -typedef struct VirtioSerialCcw { +struct VirtioSerialCcw { VirtioCcwDevice parent_obj; VirtIOSerial vdev; -} VirtioSerialCcw; +}; =20 /* virtio-net-ccw */ =20 #define TYPE_VIRTIO_NET_CCW "virtio-net-ccw" +typedef struct VirtIONetCcw VirtIONetCcw; #define VIRTIO_NET_CCW(obj) \ OBJECT_CHECK(VirtIONetCcw, (obj), TYPE_VIRTIO_NET_CCW) =20 -typedef struct VirtIONetCcw { +struct VirtIONetCcw { VirtioCcwDevice parent_obj; VirtIONet vdev; -} VirtIONetCcw; +}; =20 /* virtio-rng-ccw */ =20 #define TYPE_VIRTIO_RNG_CCW "virtio-rng-ccw" +typedef struct VirtIORNGCcw VirtIORNGCcw; #define VIRTIO_RNG_CCW(obj) \ OBJECT_CHECK(VirtIORNGCcw, (obj), TYPE_VIRTIO_RNG_CCW) =20 -typedef struct VirtIORNGCcw { +struct VirtIORNGCcw { VirtioCcwDevice parent_obj; VirtIORNG vdev; -} VirtIORNGCcw; +}; =20 /* virtio-crypto-ccw */ =20 #define TYPE_VIRTIO_CRYPTO_CCW "virtio-crypto-ccw" +typedef struct VirtIOCryptoCcw VirtIOCryptoCcw; #define VIRTIO_CRYPTO_CCW(obj) \ OBJECT_CHECK(VirtIOCryptoCcw, (obj), TYPE_VIRTIO_CRYPTO_CCW) =20 -typedef struct VirtIOCryptoCcw { +struct VirtIOCryptoCcw { VirtioCcwDevice parent_obj; VirtIOCrypto vdev; -} VirtIOCryptoCcw; +}; =20 VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch); =20 @@ -204,56 +214,61 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch); #include "hw/9pfs/virtio-9p.h" =20 #define TYPE_VIRTIO_9P_CCW "virtio-9p-ccw" +typedef struct V9fsCCWState V9fsCCWState; #define VIRTIO_9P_CCW(obj) \ OBJECT_CHECK(V9fsCCWState, (obj), TYPE_VIRTIO_9P_CCW) =20 -typedef struct V9fsCCWState { +struct V9fsCCWState { VirtioCcwDevice parent_obj; V9fsVirtioState vdev; -} V9fsCCWState; +}; =20 #endif /* CONFIG_VIRTFS */ =20 #ifdef CONFIG_VHOST_VSOCK #define TYPE_VHOST_VSOCK_CCW "vhost-vsock-ccw" +typedef struct VHostVSockCCWState VHostVSockCCWState; #define VHOST_VSOCK_CCW(obj) \ OBJECT_CHECK(VHostVSockCCWState, (obj), TYPE_VHOST_VSOCK_CCW) =20 -typedef struct VHostVSockCCWState { +struct VHostVSockCCWState { VirtioCcwDevice parent_obj; VHostVSock vdev; -} VHostVSockCCWState; +}; =20 #endif /* CONFIG_VHOST_VSOCK */ =20 #define TYPE_VIRTIO_GPU_CCW "virtio-gpu-ccw" +typedef struct VirtIOGPUCcw VirtIOGPUCcw; #define VIRTIO_GPU_CCW(obj) \ OBJECT_CHECK(VirtIOGPUCcw, (obj), TYPE_VIRTIO_GPU_CCW) =20 -typedef struct VirtIOGPUCcw { +struct VirtIOGPUCcw { VirtioCcwDevice parent_obj; VirtIOGPU vdev; -} VirtIOGPUCcw; +}; =20 #define TYPE_VIRTIO_INPUT_CCW "virtio-input-ccw" +typedef struct VirtIOInputCcw VirtIOInputCcw; #define VIRTIO_INPUT_CCW(obj) \ OBJECT_CHECK(VirtIOInputCcw, (obj), TYPE_VIRTIO_INPUT_CCW) =20 -typedef struct VirtIOInputCcw { +struct VirtIOInputCcw { VirtioCcwDevice parent_obj; VirtIOInput vdev; -} VirtIOInputCcw; +}; =20 #define TYPE_VIRTIO_INPUT_HID_CCW "virtio-input-hid-ccw" #define TYPE_VIRTIO_KEYBOARD_CCW "virtio-keyboard-ccw" #define TYPE_VIRTIO_MOUSE_CCW "virtio-mouse-ccw" #define TYPE_VIRTIO_TABLET_CCW "virtio-tablet-ccw" +typedef struct VirtIOInputHIDCcw VirtIOInputHIDCcw; #define VIRTIO_INPUT_HID_CCW(obj) \ OBJECT_CHECK(VirtIOInputHIDCcw, (obj), TYPE_VIRTIO_INPUT_HID_CCW) =20 -typedef struct VirtIOInputHIDCcw { +struct VirtIOInputHIDCcw { VirtioCcwDevice parent_obj; VirtIOInputHID vdev; -} VirtIOInputHIDCcw; +}; =20 #endif diff --git a/hw/scsi/mptsas.h b/hw/scsi/mptsas.h index 9ac98fc20e..2e76bda79e 100644 --- a/hw/scsi/mptsas.h +++ b/hw/scsi/mptsas.h @@ -2,6 +2,7 @@ #define MPTSAS_H =20 #include "mpi.h" +#include "qom/object.h" =20 #define MPTSAS_NUM_PORTS 8 #define MPTSAS_MAX_FRAMES 2048 /* Firmware limit at 65535 */ diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h index 531bf28fb0..b992d2ccf8 100644 --- a/hw/usb/ccid.h +++ b/hw/usb/ccid.h @@ -11,11 +11,13 @@ #define CCID_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 typedef struct CCIDCardState CCIDCardState; typedef struct CCIDCardInfo CCIDCardInfo; =20 #define TYPE_CCID_CARD "ccid-card" +typedef struct CCIDCardClass CCIDCardClass; #define CCID_CARD(obj) \ OBJECT_CHECK(CCIDCardState, (obj), TYPE_CCID_CARD) #define CCID_CARD_CLASS(klass) \ @@ -27,7 +29,7 @@ typedef struct CCIDCardInfo CCIDCardInfo; * callbacks to be used by the CCID device (hw/usb-ccid.c) to call * into the smartcard device (hw/ccid-card-*.c) */ -typedef struct CCIDCardClass { +struct CCIDCardClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -37,7 +39,7 @@ typedef struct CCIDCardClass { uint32_t len); void (*realize)(CCIDCardState *card, Error **errp); void (*unrealize)(CCIDCardState *card); -} CCIDCardClass; +}; =20 /* * state of the CCID Card device (i.e. hw/ccid-card-*.c) diff --git a/hw/usb/hcd-dwc2.h b/hw/usb/hcd-dwc2.h index 54111d835e..71b40f0d8a 100644 --- a/hw/usb/hcd-dwc2.h +++ b/hw/usb/hcd-dwc2.h @@ -24,6 +24,7 @@ #include "hw/sysbus.h" #include "hw/usb.h" #include "sysemu/dma.h" +#include "qom/object.h" =20 #define DWC2_MMIO_SIZE 0x11000 =20 diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 57b38cfc05..c12c9bae46 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -23,6 +23,7 @@ #include "sysemu/dma.h" #include "hw/pci/pci.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #ifndef EHCI_DEBUG #define EHCI_DEBUG 0 @@ -328,15 +329,16 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *de= v); void ehci_reset(void *opaque); =20 #define TYPE_PCI_EHCI "pci-ehci-usb" +typedef struct EHCIPCIState EHCIPCIState; #define PCI_EHCI(obj) OBJECT_CHECK(EHCIPCIState, (obj), TYPE_PCI_EHCI) =20 -typedef struct EHCIPCIState { +struct EHCIPCIState { /*< private >*/ PCIDevice pcidev; /*< public >*/ =20 EHCIState ehci; -} EHCIPCIState; +}; =20 =20 #define TYPE_SYS_BUS_EHCI "sysbus-ehci-usb" @@ -347,6 +349,8 @@ typedef struct EHCIPCIState { #define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb" #define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb" =20 +typedef struct EHCISysBusState EHCISysBusState; +typedef struct SysBusEHCIClass SysBusEHCIClass; #define SYS_BUS_EHCI(obj) \ OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI) #define SYS_BUS_EHCI_CLASS(class) \ @@ -354,15 +358,15 @@ typedef struct EHCIPCIState { #define SYS_BUS_EHCI_GET_CLASS(obj) \ OBJECT_GET_CLASS(SysBusEHCIClass, (obj), TYPE_SYS_BUS_EHCI) =20 -typedef struct EHCISysBusState { +struct EHCISysBusState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ =20 EHCIState ehci; -} EHCISysBusState; +}; =20 -typedef struct SysBusEHCIClass { +struct SysBusEHCIClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ @@ -371,17 +375,18 @@ typedef struct SysBusEHCIClass { uint16_t opregbase; uint16_t portscbase; uint16_t portnr; -} SysBusEHCIClass; +}; =20 +typedef struct FUSBH200EHCIState FUSBH200EHCIState; #define FUSBH200_EHCI(obj) \ OBJECT_CHECK(FUSBH200EHCIState, (obj), TYPE_FUSBH200_EHCI) =20 -typedef struct FUSBH200EHCIState { +struct FUSBH200EHCIState { /*< private >*/ EHCISysBusState parent_obj; /*< public >*/ =20 MemoryRegion mem_vendor; -} FUSBH200EHCIState; +}; =20 #endif diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 5c8819aedf..3e9053fb26 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -23,6 +23,7 @@ =20 #include "sysemu/dma.h" #include "hw/usb.h" +#include "qom/object.h" =20 /* Number of Downstream Ports on the root hub: */ #define OHCI_MAX_PORTS 15 @@ -92,9 +93,10 @@ typedef struct OHCIState { } OHCIState; =20 #define TYPE_SYSBUS_OHCI "sysbus-ohci" +typedef struct OHCISysBusState OHCISysBusState; #define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_= OHCI) =20 -typedef struct { +struct OHCISysBusState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -104,7 +106,7 @@ typedef struct { uint32_t num_ports; uint32_t firstport; dma_addr_t dma_offset; -} OHCISysBusState; +}; =20 extern const VMStateDescription vmstate_ohci_state; =20 diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 946af51fc2..867388a061 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -21,11 +21,13 @@ =20 #ifndef HW_USB_HCD_XHCI_H #define HW_USB_HCD_XHCI_H +#include "qom/object.h" =20 #define TYPE_XHCI "base-xhci" #define TYPE_NEC_XHCI "nec-usb-xhci" #define TYPE_QEMU_XHCI "qemu-xhci" =20 +typedef struct XHCIState XHCIState; #define XHCI(obj) \ OBJECT_CHECK(XHCIState, (obj), TYPE_XHCI) =20 @@ -39,7 +41,6 @@ /* Very pessimistic, let's hope it's enough for all cases */ #define EV_QUEUE (((3 * 24) + 16) * MAXSLOTS) =20 -typedef struct XHCIState XHCIState; typedef struct XHCIStreamContext XHCIStreamContext; typedef struct XHCIEPContext XHCIEPContext; =20 diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 3c0dca024b..8c1f94118a 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -18,6 +18,7 @@ #include "qemu/event_notifier.h" #include "qemu/queue.h" #include "qemu/timer.h" +#include "qom/object.h" =20 #define PCI_ANY_ID (~0) =20 @@ -114,9 +115,10 @@ typedef struct VFIOMSIXInfo { } VFIOMSIXInfo; =20 #define TYPE_VFIO_PCI "vfio-pci" +typedef struct VFIOPCIDevice VFIOPCIDevice; #define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI) =20 -typedef struct VFIOPCIDevice { +struct VFIOPCIDevice { PCIDevice pdev; VFIODevice vbasedev; VFIOINTx intx; @@ -173,7 +175,7 @@ typedef struct VFIOPCIDevice { VFIODisplay *dpy; Error *migration_blocker; Notifier irqchip_change_notifier; -} VFIOPCIDevice; +}; =20 /* Use uin32_t for vendor & device so PCI_ANY_ID expands and cannot match = hw */ static inline bool vfio_pci_is(VFIOPCIDevice *vdev, uint32_t vendor, uint3= 2_t device) diff --git a/hw/virtio/virtio-mem-pci.h b/hw/virtio/virtio-mem-pci.h index b51a28b275..65b86beac7 100644 --- a/hw/virtio/virtio-mem-pci.h +++ b/hw/virtio/virtio-mem-pci.h @@ -15,6 +15,7 @@ =20 #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-mem.h" +#include "qom/object.h" =20 typedef struct VirtIOMEMPCI VirtIOMEMPCI; =20 diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index 91096f0291..d59ac97430 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -17,6 +17,7 @@ =20 #include "hw/pci/msi.h" #include "hw/virtio/virtio-bus.h" +#include "qom/object.h" =20 typedef struct VirtIOPCIProxy VirtIOPCIProxy; =20 @@ -94,6 +95,7 @@ typedef struct { * virtio-pci: This is the PCIDevice which has a virtio-pci-bus. */ #define TYPE_VIRTIO_PCI "virtio-pci" +typedef struct VirtioPCIClass VirtioPCIClass; #define VIRTIO_PCI_GET_CLASS(obj) \ OBJECT_GET_CLASS(VirtioPCIClass, obj, TYPE_VIRTIO_PCI) #define VIRTIO_PCI_CLASS(klass) \ @@ -101,11 +103,11 @@ typedef struct { #define VIRTIO_PCI(obj) \ OBJECT_CHECK(VirtIOPCIProxy, (obj), TYPE_VIRTIO_PCI) =20 -typedef struct VirtioPCIClass { +struct VirtioPCIClass { PCIDeviceClass parent_class; DeviceRealize parent_dc_realize; void (*realize)(VirtIOPCIProxy *vpci_dev, Error **errp); -} VirtioPCIClass; +}; =20 typedef struct VirtIOPCIRegion { MemoryRegion mr; diff --git a/hw/virtio/virtio-pmem-pci.h b/hw/virtio/virtio-pmem-pci.h index 616abef093..5ac8099637 100644 --- a/hw/virtio/virtio-pmem-pci.h +++ b/hw/virtio/virtio-pmem-pci.h @@ -16,6 +16,7 @@ =20 #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-pmem.h" +#include "qom/object.h" =20 typedef struct VirtIOPMEMPCI VirtIOPMEMPCI; =20 diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index 6e9cec95f3..c367c7da27 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -4,6 +4,7 @@ #include "hw/xen/xen_common.h" #include "hw/pci/pci.h" #include "xen-host-pci-device.h" +#include "qom/object.h" =20 bool xen_igd_gfx_pt_enabled(void); void xen_igd_gfx_pt_set(bool value, Error **errp); diff --git a/include/authz/base.h b/include/authz/base.h index 0782981ad8..c01946b4ce 100644 --- a/include/authz/base.h +++ b/include/authz/base.h @@ -27,6 +27,8 @@ =20 #define TYPE_QAUTHZ "authz" =20 +typedef struct QAuthZ QAuthZ; +typedef struct QAuthZClass QAuthZClass; #define QAUTHZ_CLASS(klass) \ OBJECT_CLASS_CHECK(QAuthZClass, (klass), \ TYPE_QAUTHZ) @@ -37,8 +39,6 @@ OBJECT_CHECK(QAuthZ, (obj), \ TYPE_QAUTHZ) =20 -typedef struct QAuthZ QAuthZ; -typedef struct QAuthZClass QAuthZClass; =20 /** * QAuthZ: diff --git a/include/authz/list.h b/include/authz/list.h index a88cdbbcf8..5d5e8e803f 100644 --- a/include/authz/list.h +++ b/include/authz/list.h @@ -23,9 +23,12 @@ =20 #include "authz/base.h" #include "qapi/qapi-types-authz.h" +#include "qom/object.h" =20 #define TYPE_QAUTHZ_LIST "authz-list" =20 +typedef struct QAuthZList QAuthZList; +typedef struct QAuthZListClass QAuthZListClass; #define QAUTHZ_LIST_CLASS(klass) \ OBJECT_CLASS_CHECK(QAuthZListClass, (klass), \ TYPE_QAUTHZ_LIST) @@ -36,8 +39,6 @@ OBJECT_CHECK(QAuthZList, (obj), \ TYPE_QAUTHZ_LIST) =20 -typedef struct QAuthZList QAuthZList; -typedef struct QAuthZListClass QAuthZListClass; =20 =20 /** diff --git a/include/authz/listfile.h b/include/authz/listfile.h index 24ae2e606c..11169ac882 100644 --- a/include/authz/listfile.h +++ b/include/authz/listfile.h @@ -23,9 +23,12 @@ =20 #include "authz/list.h" #include "qemu/filemonitor.h" +#include "qom/object.h" =20 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file" =20 +typedef struct QAuthZListFile QAuthZListFile; +typedef struct QAuthZListFileClass QAuthZListFileClass; #define QAUTHZ_LIST_FILE_CLASS(klass) \ OBJECT_CLASS_CHECK(QAuthZListFileClass, (klass), \ TYPE_QAUTHZ_LIST_FILE) @@ -36,8 +39,6 @@ OBJECT_CHECK(QAuthZListFile, (obj), \ TYPE_QAUTHZ_LIST_FILE) =20 -typedef struct QAuthZListFile QAuthZListFile; -typedef struct QAuthZListFileClass QAuthZListFileClass; =20 =20 /** diff --git a/include/authz/pamacct.h b/include/authz/pamacct.h index f3a7ef1011..a14cf33fb4 100644 --- a/include/authz/pamacct.h +++ b/include/authz/pamacct.h @@ -22,10 +22,13 @@ #define QAUTHZ_PAMACCT_H =20 #include "authz/base.h" +#include "qom/object.h" =20 =20 #define TYPE_QAUTHZ_PAM "authz-pam" =20 +typedef struct QAuthZPAM QAuthZPAM; +typedef struct QAuthZPAMClass QAuthZPAMClass; #define QAUTHZ_PAM_CLASS(klass) \ OBJECT_CLASS_CHECK(QAuthZPAMClass, (klass), \ TYPE_QAUTHZ_PAM) @@ -36,8 +39,6 @@ OBJECT_CHECK(QAuthZPAM, (obj), \ TYPE_QAUTHZ_PAM) =20 -typedef struct QAuthZPAM QAuthZPAM; -typedef struct QAuthZPAMClass QAuthZPAMClass; =20 =20 /** diff --git a/include/authz/simple.h b/include/authz/simple.h index 2b7ab0cdd9..df8c1bf39c 100644 --- a/include/authz/simple.h +++ b/include/authz/simple.h @@ -22,9 +22,12 @@ #define QAUTHZ_SIMPLE_H =20 #include "authz/base.h" +#include "qom/object.h" =20 #define TYPE_QAUTHZ_SIMPLE "authz-simple" =20 +typedef struct QAuthZSimple QAuthZSimple; +typedef struct QAuthZSimpleClass QAuthZSimpleClass; #define QAUTHZ_SIMPLE_CLASS(klass) \ OBJECT_CLASS_CHECK(QAuthZSimpleClass, (klass), \ TYPE_QAUTHZ_SIMPLE) @@ -35,8 +38,6 @@ OBJECT_CHECK(QAuthZSimple, (obj), \ TYPE_QAUTHZ_SIMPLE) =20 -typedef struct QAuthZSimple QAuthZSimple; -typedef struct QAuthZSimpleClass QAuthZSimpleClass; =20 =20 /** diff --git a/include/block/throttle-groups.h b/include/block/throttle-group= s.h index 5e77db700f..7c6f572cf9 100644 --- a/include/block/throttle-groups.h +++ b/include/block/throttle-groups.h @@ -27,6 +27,7 @@ =20 #include "qemu/throttle.h" #include "block/block_int.h" +#include "qom/object.h" =20 /* The ThrottleGroupMember structure indicates membership in a ThrottleGro= up * and holds related data. diff --git a/include/chardev/char-fd.h b/include/chardev/char-fd.h index e7c2b176f9..1442dcaa62 100644 --- a/include/chardev/char-fd.h +++ b/include/chardev/char-fd.h @@ -26,13 +26,15 @@ =20 #include "io/channel.h" #include "chardev/char.h" +#include "qom/object.h" =20 -typedef struct FDChardev { +struct FDChardev { Chardev parent; =20 QIOChannel *ioc_in, *ioc_out; int max_size; -} FDChardev; +}; +typedef struct FDChardev FDChardev; =20 #define TYPE_CHARDEV_FD "chardev-fd" =20 diff --git a/include/chardev/char-win.h b/include/chardev/char-win.h index fa59e9e423..f1632330f1 100644 --- a/include/chardev/char-win.h +++ b/include/chardev/char-win.h @@ -25,8 +25,9 @@ #define CHAR_WIN_H =20 #include "chardev/char.h" +#include "qom/object.h" =20 -typedef struct { +struct WinChardev { Chardev parent; =20 bool keep_open; /* console do not close file */ @@ -36,7 +37,8 @@ typedef struct { =20 /* Protected by the Chardev chr_write_lock. */ OVERLAPPED osend; -} WinChardev; +}; +typedef struct WinChardev WinChardev; =20 #define NSENDBUF 2048 #define NRECVBUF 2048 diff --git a/include/chardev/char.h b/include/chardev/char.h index 00589a6025..d91d851b33 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -226,6 +226,7 @@ int qemu_chr_write(Chardev *s, const uint8_t *buf, int = len, bool write_all); int qemu_chr_wait_connected(Chardev *chr, Error **errp); =20 #define TYPE_CHARDEV "chardev" +typedef struct ChardevClass ChardevClass; #define CHARDEV(obj) OBJECT_CHECK(Chardev, (obj), TYPE_CHARDEV) #define CHARDEV_CLASS(klass) \ OBJECT_CLASS_CHECK(ChardevClass, (klass), TYPE_CHARDEV) @@ -251,7 +252,7 @@ int qemu_chr_wait_connected(Chardev *chr, Error **errp); #define CHARDEV_IS_PTY(chr) \ object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_PTY) =20 -typedef struct ChardevClass { +struct ChardevClass { ObjectClass parent_class; =20 bool internal; /* TODO: eventually use TYPE_USER_CREATABLE */ @@ -276,7 +277,7 @@ typedef struct ChardevClass { void (*chr_be_event)(Chardev *s, QEMUChrEvent event); /* Return 0 if succeeded, 1 if failed */ int (*chr_machine_done)(Chardev *chr); -} ChardevClass; +}; =20 Chardev *qemu_chardev_new(const char *id, const char *typename, ChardevBackend *backend, GMainContext *context, diff --git a/include/chardev/spice.h b/include/chardev/spice.h index 1f7339b649..5bccc47392 100644 --- a/include/chardev/spice.h +++ b/include/chardev/spice.h @@ -3,8 +3,9 @@ =20 #include #include "chardev/char-fe.h" +#include "qom/object.h" =20 -typedef struct SpiceChardev { +struct SpiceChardev { Chardev parent; =20 SpiceCharDeviceInstance sin; @@ -13,7 +14,8 @@ typedef struct SpiceChardev { const uint8_t *datapos; int datalen; QLIST_ENTRY(SpiceChardev) next; -} SpiceChardev; +}; +typedef struct SpiceChardev SpiceChardev; =20 #define TYPE_CHARDEV_SPICE "chardev-spice" #define TYPE_CHARDEV_SPICEVMC "chardev-spicevmc" diff --git a/include/crypto/secret.h b/include/crypto/secret.h index 2deb461d2f..8c03971e75 100644 --- a/include/crypto/secret.h +++ b/include/crypto/secret.h @@ -26,10 +26,10 @@ #include "crypto/secret_common.h" =20 #define TYPE_QCRYPTO_SECRET "secret" +typedef struct QCryptoSecret QCryptoSecret; #define QCRYPTO_SECRET(obj) \ OBJECT_CHECK(QCryptoSecret, (obj), TYPE_QCRYPTO_SECRET) =20 -typedef struct QCryptoSecret QCryptoSecret; typedef struct QCryptoSecretClass QCryptoSecretClass; =20 /** diff --git a/include/crypto/secret_common.h b/include/crypto/secret_common.h index 980c02ab71..db282a3872 100644 --- a/include/crypto/secret_common.h +++ b/include/crypto/secret_common.h @@ -25,6 +25,8 @@ #include "qom/object.h" =20 #define TYPE_QCRYPTO_SECRET_COMMON "secret_common" +typedef struct QCryptoSecretCommon QCryptoSecretCommon; +typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass; #define QCRYPTO_SECRET_COMMON(obj) \ OBJECT_CHECK(QCryptoSecretCommon, (obj), TYPE_QCRYPTO_SECRET_COMMON) #define QCRYPTO_SECRET_COMMON_CLASS(class) \ @@ -34,8 +36,6 @@ OBJECT_GET_CLASS(QCryptoSecretCommonClass, \ (obj), TYPE_QCRYPTO_SECRET_COMMON) =20 -typedef struct QCryptoSecretCommon QCryptoSecretCommon; -typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass; =20 struct QCryptoSecretCommon { Object parent_obj; diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyrin= g.h index 4345eb048e..8b3b8ee67d 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -26,6 +26,8 @@ #include "crypto/secret_common.h" =20 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" +typedef struct QCryptoSecretKeyring QCryptoSecretKeyring; +typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass; #define QCRYPTO_SECRET_KEYRING(obj) \ OBJECT_CHECK(QCryptoSecretKeyring, (obj), \ TYPE_QCRYPTO_SECRET_KEYRING) @@ -36,8 +38,6 @@ OBJECT_GET_CLASS(QCryptoSecretKeyringClass, \ (class), TYPE_QCRYPTO_SECRET_KEYRING) =20 -typedef struct QCryptoSecretKeyring QCryptoSecretKeyring; -typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass; =20 struct QCryptoSecretKeyring { QCryptoSecretCommon parent; diff --git a/include/crypto/tls-cipher-suites.h b/include/crypto/tls-cipher= -suites.h index 28b3a73ce1..23f031953f 100644 --- a/include/crypto/tls-cipher-suites.h +++ b/include/crypto/tls-cipher-suites.h @@ -15,14 +15,15 @@ #include "crypto/tlscreds.h" =20 #define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites" +typedef struct QCryptoTLSCipherSuites QCryptoTLSCipherSuites; #define QCRYPTO_TLS_CIPHER_SUITES(obj) \ OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SU= ITES) =20 -typedef struct QCryptoTLSCipherSuites { +struct QCryptoTLSCipherSuites { /* */ QCryptoTLSCreds parent_obj; /* */ -} QCryptoTLSCipherSuites; +}; =20 /** * qcrypto_tls_cipher_suites_get_data: diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h index fd7a284aa2..9f065a4def 100644 --- a/include/crypto/tlscreds.h +++ b/include/crypto/tlscreds.h @@ -29,10 +29,10 @@ #endif =20 #define TYPE_QCRYPTO_TLS_CREDS "tls-creds" +typedef struct QCryptoTLSCreds QCryptoTLSCreds; #define QCRYPTO_TLS_CREDS(obj) \ OBJECT_CHECK(QCryptoTLSCreds, (obj), TYPE_QCRYPTO_TLS_CREDS) =20 -typedef struct QCryptoTLSCreds QCryptoTLSCreds; typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass; =20 #define QCRYPTO_TLS_CREDS_DH_PARAMS "dh-params.pem" diff --git a/include/crypto/tlscredsanon.h b/include/crypto/tlscredsanon.h index 9e9a5ce1a8..034ebd3fd9 100644 --- a/include/crypto/tlscredsanon.h +++ b/include/crypto/tlscredsanon.h @@ -22,13 +22,14 @@ #define QCRYPTO_TLSCREDSANON_H =20 #include "crypto/tlscreds.h" +#include "qom/object.h" =20 #define TYPE_QCRYPTO_TLS_CREDS_ANON "tls-creds-anon" +typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon; #define QCRYPTO_TLS_CREDS_ANON(obj) \ OBJECT_CHECK(QCryptoTLSCredsAnon, (obj), TYPE_QCRYPTO_TLS_CREDS_ANON) =20 =20 -typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon; typedef struct QCryptoTLSCredsAnonClass QCryptoTLSCredsAnonClass; =20 /** diff --git a/include/crypto/tlscredspsk.h b/include/crypto/tlscredspsk.h index 907035a29b..6e361366eb 100644 --- a/include/crypto/tlscredspsk.h +++ b/include/crypto/tlscredspsk.h @@ -22,12 +22,13 @@ #define QCRYPTO_TLSCREDSPSK_H =20 #include "crypto/tlscreds.h" +#include "qom/object.h" =20 #define TYPE_QCRYPTO_TLS_CREDS_PSK "tls-creds-psk" +typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK; #define QCRYPTO_TLS_CREDS_PSK(obj) \ OBJECT_CHECK(QCryptoTLSCredsPSK, (obj), TYPE_QCRYPTO_TLS_CREDS_PSK) =20 -typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK; typedef struct QCryptoTLSCredsPSKClass QCryptoTLSCredsPSKClass; =20 #define QCRYPTO_TLS_CREDS_PSKFILE "keys.psk" diff --git a/include/crypto/tlscredsx509.h b/include/crypto/tlscredsx509.h index e1542e5c8c..e4d44ea22d 100644 --- a/include/crypto/tlscredsx509.h +++ b/include/crypto/tlscredsx509.h @@ -22,12 +22,13 @@ #define QCRYPTO_TLSCREDSX509_H =20 #include "crypto/tlscreds.h" +#include "qom/object.h" =20 #define TYPE_QCRYPTO_TLS_CREDS_X509 "tls-creds-x509" +typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509; #define QCRYPTO_TLS_CREDS_X509(obj) \ OBJECT_CHECK(QCryptoTLSCredsX509, (obj), TYPE_QCRYPTO_TLS_CREDS_X509) =20 -typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509; typedef struct QCryptoTLSCredsX509Class QCryptoTLSCredsX509Class; =20 #define QCRYPTO_TLS_CREDS_X509_CA_CERT "ca-cert.pem" diff --git a/include/exec/memory.h b/include/exec/memory.h index 0cfe987ab4..752b905e14 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -38,6 +38,7 @@ OBJECT_CHECK(MemoryRegion, (obj), TYPE_MEMORY_REGION) =20 #define TYPE_IOMMU_MEMORY_REGION "qemu:iommu-memory-region" +typedef struct IOMMUMemoryRegionClass IOMMUMemoryRegionClass; #define IOMMU_MEMORY_REGION(obj) \ OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_IOMMU_MEMORY_REGION) #define IOMMU_MEMORY_REGION_CLASS(klass) \ @@ -242,7 +243,7 @@ enum IOMMUMemoryRegionAttr { * only a single IOMMU index. A more complex IOMMU might have one index * for secure transactions and one for non-secure transactions. */ -typedef struct IOMMUMemoryRegionClass { +struct IOMMUMemoryRegionClass { /* private */ MemoryRegionClass parent_class; =20 @@ -355,7 +356,7 @@ typedef struct IOMMUMemoryRegionClass { * @iommu: the IOMMUMemoryRegion */ int (*num_indexes)(IOMMUMemoryRegion *iommu); -} IOMMUMemoryRegionClass; +}; =20 typedef struct CoalescedMemoryRange CoalescedMemoryRange; typedef struct MemoryRegionIoeventfd MemoryRegionIoeventfd; diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index a2a12af9b9..4ef44d6fe8 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -18,6 +18,7 @@ typedef enum { =20 #define TYPE_ACPI_DEVICE_IF "acpi-device-interface" =20 +typedef struct AcpiDeviceIfClass AcpiDeviceIfClass; #define ACPI_DEVICE_IF_CLASS(klass) \ OBJECT_CLASS_CHECK(AcpiDeviceIfClass, (klass), \ TYPE_ACPI_DEVICE_IF) @@ -48,7 +49,7 @@ void acpi_send_event(DeviceState *dev, AcpiEventStatusBit= s event); * knowledge about internals of actual device that implements * ACPI interface. */ -typedef struct AcpiDeviceIfClass { +struct AcpiDeviceIfClass { /* */ InterfaceClass parent_class; =20 @@ -57,5 +58,5 @@ typedef struct AcpiDeviceIfClass { void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev); void (*madt_cpu)(AcpiDeviceIf *adev, int uid, const CPUArchIdList *apic_ids, GArray *entry); -} AcpiDeviceIfClass; +}; #endif diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/gener= ic_event_device.h index 90a9180db5..2208f0b939 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -62,10 +62,12 @@ #include "hw/sysbus.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/ghes.h" +#include "qom/object.h" =20 #define ACPI_POWER_BUTTON_DEVICE "PWRB" =20 #define TYPE_ACPI_GED "acpi-ged" +typedef struct AcpiGedState AcpiGedState; #define ACPI_GED(obj) \ OBJECT_CHECK(AcpiGedState, (obj), TYPE_ACPI_GED) =20 @@ -90,7 +92,7 @@ typedef struct GEDState { uint32_t sel; } GEDState; =20 -typedef struct AcpiGedState { +struct AcpiGedState { SysBusDevice parent_obj; MemHotplugState memhp_state; MemoryRegion container_memhp; @@ -98,7 +100,7 @@ typedef struct AcpiGedState { uint32_t ged_event_bitmap; qemu_irq irq; AcpiGhesState ghes_state; -} AcpiGedState; +}; =20 void build_ged_aml(Aml *table, const char* name, HotplugHandler *hotplug_d= ev, uint32_t ged_irq, AmlRegionSpace rs, hwaddr ged_base); diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index c49d913f3e..0286fc0f09 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -4,6 +4,7 @@ #include "hw/acpi/bios-linker-loader.h" #include "hw/qdev-core.h" #include "qemu/uuid.h" +#include "qom/object.h" =20 #define VMGENID_DEVICE "vmgenid" #define VMGENID_GUID "guid" @@ -15,13 +16,14 @@ * OVMF SDT Header Probe Supressor */ =20 +typedef struct VmGenIdState VmGenIdState; #define VMGENID(obj) OBJECT_CHECK(VmGenIdState, (obj), VMGENID_DEVICE) =20 -typedef struct VmGenIdState { +struct VmGenIdState { DeviceClass parent_obj; QemuUUID guid; /* The 128-bit GUID seen by the guest */ uint8_t vmgenid_addr_le[8]; /* Address of the GUID (little-endian) */ -} VmGenIdState; +}; =20 /* returns NULL unless there is exactly one device */ static inline Object *find_vmgenid_dev(void) diff --git a/include/hw/adc/stm32f2xx_adc.h b/include/hw/adc/stm32f2xx_adc.h index 663b79f4f3..60d4b65570 100644 --- a/include/hw/adc/stm32f2xx_adc.h +++ b/include/hw/adc/stm32f2xx_adc.h @@ -26,6 +26,7 @@ #define HW_STM32F2XX_ADC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define ADC_SR 0x00 #define ADC_CR1 0x04 @@ -58,10 +59,11 @@ #define ADC_COMMON_ADDRESS 0x100 =20 #define TYPE_STM32F2XX_ADC "stm32f2xx-adc" +typedef struct STM32F2XXADCState STM32F2XXADCState; #define STM32F2XX_ADC(obj) \ OBJECT_CHECK(STM32F2XXADCState, (obj), TYPE_STM32F2XX_ADC) =20 -typedef struct { +struct STM32F2XXADCState { /* */ SysBusDevice parent_obj; =20 @@ -84,6 +86,6 @@ typedef struct { uint32_t adc_dr; =20 qemu_irq irq; -} STM32F2XXADCState; +}; =20 #endif /* HW_STM32F2XX_ADC_H */ diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index 77c82a9982..631454f1c7 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -14,6 +14,7 @@ #include "hw/rtc/allwinner-rtc.h" =20 #include "target/arm/cpu.h" +#include "qom/object.h" =20 =20 #define AW_A10_SDRAM_BASE 0x40000000 @@ -21,9 +22,10 @@ #define AW_A10_NUM_USB 2 =20 #define TYPE_AW_A10 "allwinner-a10" +typedef struct AwA10State AwA10State; #define AW_A10(obj) OBJECT_CHECK(AwA10State, (obj), TYPE_AW_A10) =20 -typedef struct AwA10State { +struct AwA10State { /*< private >*/ DeviceState parent_obj; /*< public >*/ @@ -38,6 +40,6 @@ typedef struct AwA10State { MemoryRegion sram_a; EHCISysBusState ehci[AW_A10_NUM_USB]; OHCISysBusState ohci[AW_A10_NUM_USB]; -} AwA10State; +}; =20 #endif diff --git a/include/hw/arm/allwinner-h3.h b/include/hw/arm/allwinner-h3.h index 626139dcb3..5fda95066f 100644 --- a/include/hw/arm/allwinner-h3.h +++ b/include/hw/arm/allwinner-h3.h @@ -106,6 +106,7 @@ enum { #define TYPE_AW_H3 "allwinner-h3" =20 /** Convert input object to Allwinner H3 state object */ +typedef struct AwH3State AwH3State; #define AW_H3(obj) OBJECT_CHECK(AwH3State, (obj), TYPE_AW_H3) =20 /** @} */ @@ -116,7 +117,7 @@ enum { * This struct contains the state of all the devices * which are currently emulated by the H3 SoC code. */ -typedef struct AwH3State { +struct AwH3State { /*< private >*/ DeviceState parent_obj; /*< public >*/ @@ -136,7 +137,7 @@ typedef struct AwH3State { MemoryRegion sram_a1; MemoryRegion sram_a2; MemoryRegion sram_c; -} AwH3State; +}; =20 /** * Emulate Boot ROM firmware setup functionality. diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index 347b977ae5..e5788e9d3c 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -105,8 +105,11 @@ #include "hw/or-irq.h" #include "hw/core/split-irq.h" #include "hw/cpu/cluster.h" +#include "qom/object.h" =20 #define TYPE_ARM_SSE "arm-sse" +typedef struct ARMSSE ARMSSE; +typedef struct ARMSSEClass ARMSSEClass; #define ARM_SSE(obj) OBJECT_CHECK(ARMSSE, (obj), TYPE_ARM_SSE) =20 /* @@ -140,7 +143,7 @@ #define RAM3_PPU 6 #define NUM_PPUS 7 =20 -typedef struct ARMSSE { +struct ARMSSE { /*< private >*/ SysBusDevice parent_obj; =20 @@ -215,14 +218,14 @@ typedef struct ARMSSE { uint32_t init_svtor; bool cpu_fpu[SSE_MAX_CPUS]; bool cpu_dsp[SSE_MAX_CPUS]; -} ARMSSE; +}; =20 typedef struct ARMSSEInfo ARMSSEInfo; =20 -typedef struct ARMSSEClass { +struct ARMSSEClass { SysBusDeviceClass parent_class; const ARMSSEInfo *info; -} ARMSSEClass; +}; =20 #define ARM_SSE_CLASS(klass) \ OBJECT_CLASS_CHECK(ARMSSEClass, (klass), TYPE_ARM_SSE) diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h index a30e3c6471..c820d32ad5 100644 --- a/include/hw/arm/armv7m.h +++ b/include/hw/arm/armv7m.h @@ -13,11 +13,13 @@ #include "hw/sysbus.h" #include "hw/intc/armv7m_nvic.h" #include "target/arm/idau.h" +#include "qom/object.h" =20 #define TYPE_BITBAND "ARM,bitband-memory" +typedef struct BitBandState BitBandState; #define BITBAND(obj) OBJECT_CHECK(BitBandState, (obj), TYPE_BITBAND) =20 -typedef struct { +struct BitBandState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -26,9 +28,10 @@ typedef struct { MemoryRegion iomem; uint32_t base; MemoryRegion *source_memory; -} BitBandState; +}; =20 #define TYPE_ARMV7M "armv7m" +typedef struct ARMv7MState ARMv7MState; #define ARMV7M(obj) OBJECT_CHECK(ARMv7MState, (obj), TYPE_ARMV7M) =20 #define ARMV7M_NUM_BITBANDS 2 @@ -49,7 +52,7 @@ typedef struct { * + Property "dsp": enable DSP (forwarded to CPU object) * + Property "enable-bitband": expose bitbanded IO */ -typedef struct ARMv7MState { +struct ARMv7MState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -72,6 +75,6 @@ typedef struct ARMv7MState { bool start_powered_off; bool vfp; bool dsp; -} ARMv7MState; +}; =20 #endif diff --git a/include/hw/arm/aspeed.h b/include/hw/arm/aspeed.h index 09da9d9acc..4e5ec37acb 100644 --- a/include/hw/arm/aspeed.h +++ b/include/hw/arm/aspeed.h @@ -10,10 +10,12 @@ #define ARM_ASPEED_H =20 #include "hw/boards.h" +#include "qom/object.h" =20 typedef struct AspeedMachineState AspeedMachineState; =20 #define TYPE_ASPEED_MACHINE MACHINE_TYPE_NAME("aspeed") +typedef struct AspeedMachineClass AspeedMachineClass; #define ASPEED_MACHINE(obj) \ OBJECT_CHECK(AspeedMachineState, (obj), TYPE_ASPEED_MACHINE) =20 @@ -27,7 +29,7 @@ typedef struct AspeedMachineState AspeedMachineState; #define ASPEED_MACHINE_GET_CLASS(obj) \ OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE) =20 -typedef struct AspeedMachineClass { +struct AspeedMachineClass { MachineClass parent_obj; =20 const char *name; @@ -40,7 +42,7 @@ typedef struct AspeedMachineClass { uint32_t num_cs; uint32_t macs_mask; void (*i2c_init)(AspeedMachineState *bmc); -} AspeedMachineClass; +}; =20 =20 #endif diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index d46f197cbe..31679ee42e 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -27,6 +27,7 @@ #include "hw/gpio/aspeed_gpio.h" #include "hw/sd/aspeed_sdhci.h" #include "hw/usb/hcd-ehci.h" +#include "qom/object.h" =20 #define ASPEED_SPIS_NUM 2 #define ASPEED_EHCIS_NUM 2 @@ -34,7 +35,7 @@ #define ASPEED_CPUS_NUM 2 #define ASPEED_MACS_NUM 4 =20 -typedef struct AspeedSoCState { +struct AspeedSoCState { /*< private >*/ DeviceState parent; =20 @@ -60,12 +61,14 @@ typedef struct AspeedSoCState { AspeedGPIOState gpio_1_8v; AspeedSDHCIState sdhci; AspeedSDHCIState emmc; -} AspeedSoCState; +}; +typedef struct AspeedSoCState AspeedSoCState; =20 #define TYPE_ASPEED_SOC "aspeed-soc" +typedef struct AspeedSoCClass AspeedSoCClass; #define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SO= C) =20 -typedef struct AspeedSoCClass { +struct AspeedSoCClass { DeviceClass parent_class; =20 const char *name; @@ -79,7 +82,7 @@ typedef struct AspeedSoCClass { const int *irqmap; const hwaddr *memmap; uint32_t num_cpus; -} AspeedSoCClass; +}; =20 #define ASPEED_SOC_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC) diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_= peripherals.h index 48a0ad1633..67f5a5f8f5 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -29,12 +29,14 @@ #include "hw/timer/bcm2835_systmr.h" #include "hw/usb/hcd-dwc2.h" #include "hw/misc/unimp.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals" +typedef struct BCM2835PeripheralState BCM2835PeripheralState; #define BCM2835_PERIPHERALS(obj) \ OBJECT_CHECK(BCM2835PeripheralState, (obj), TYPE_BCM2835_PERIPHERALS) =20 -typedef struct BCM2835PeripheralState { +struct BCM2835PeripheralState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -70,6 +72,6 @@ typedef struct BCM2835PeripheralState { UnimplementedDeviceState smi; DWC2State dwc2; UnimplementedDeviceState sdramc; -} BCM2835PeripheralState; +}; =20 #endif /* BCM2835_PERIPHERALS_H */ diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 79dfff9d73..cf22dc96a0 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -15,8 +15,11 @@ #include "hw/arm/bcm2835_peripherals.h" #include "hw/intc/bcm2836_control.h" #include "target/arm/cpu.h" +#include "qom/object.h" =20 #define TYPE_BCM283X "bcm283x" +typedef struct BCM283XClass BCM283XClass; +typedef struct BCM283XState BCM283XState; #define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X) =20 #define BCM283X_NCPUS 4 @@ -28,7 +31,7 @@ #define TYPE_BCM2836 "bcm2836" #define TYPE_BCM2837 "bcm2837" =20 -typedef struct BCM283XState { +struct BCM283XState { /*< private >*/ DeviceState parent_obj; /*< public >*/ @@ -40,14 +43,14 @@ typedef struct BCM283XState { } cpu[BCM283X_NCPUS]; BCM2836ControlState control; BCM2835PeripheralState peripherals; -} BCM283XState; +}; =20 typedef struct BCM283XInfo BCM283XInfo; =20 -typedef struct BCM283XClass { +struct BCM283XClass { DeviceClass parent_class; const BCM283XInfo *info; -} BCM283XClass; +}; =20 #define BCM283X_CLASS(klass) \ OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) diff --git a/include/hw/arm/digic.h b/include/hw/arm/digic.h index 63785baaa8..f77833f6e3 100644 --- a/include/hw/arm/digic.h +++ b/include/hw/arm/digic.h @@ -21,14 +21,16 @@ #include "cpu.h" #include "hw/timer/digic-timer.h" #include "hw/char/digic-uart.h" +#include "qom/object.h" =20 #define TYPE_DIGIC "digic" =20 +typedef struct DigicState DigicState; #define DIGIC(obj) OBJECT_CHECK(DigicState, (obj), TYPE_DIGIC) =20 #define DIGIC4_NB_TIMERS 3 =20 -typedef struct DigicState { +struct DigicState { /*< private >*/ DeviceState parent_obj; /*< public >*/ @@ -37,6 +39,6 @@ typedef struct DigicState { =20 DigicTimerState timer[DIGIC4_NB_TIMERS]; DigicUartState uart; -} DigicState; +}; =20 #endif /* HW_ARM_DIGIC_H */ diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index 55260394af..114c594cd2 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -27,6 +27,7 @@ #include "hw/or-irq.h" #include "hw/sysbus.h" #include "target/arm/cpu-qom.h" +#include "qom/object.h" =20 #define EXYNOS4210_NCPUS 2 =20 @@ -85,7 +86,7 @@ typedef struct Exynos4210Irq { qemu_irq board_irqs[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; } Exynos4210Irq; =20 -typedef struct Exynos4210State { +struct Exynos4210State { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -101,7 +102,8 @@ typedef struct Exynos4210State { MemoryRegion bootreg_mem; I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; qemu_or_irq pl330_irq_orgate[EXYNOS4210_NUM_DMA]; -} Exynos4210State; +}; +typedef struct Exynos4210State Exynos4210State; =20 #define TYPE_EXYNOS4210_SOC "exynos4210" #define EXYNOS4210_SOC(obj) \ diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 54ee1bfd78..8b4c974f09 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -32,8 +32,10 @@ #include "hw/watchdog/wdt_imx2.h" #include "exec/memory.h" #include "target/arm/cpu.h" +#include "qom/object.h" =20 #define TYPE_FSL_IMX25 "fsl,imx25" +typedef struct FslIMX25State FslIMX25State; #define FSL_IMX25(obj) OBJECT_CHECK(FslIMX25State, (obj), TYPE_FSL_IMX25) =20 #define FSL_IMX25_NUM_UARTS 5 @@ -44,7 +46,7 @@ #define FSL_IMX25_NUM_ESDHCS 2 #define FSL_IMX25_NUM_USBS 2 =20 -typedef struct FslIMX25State { +struct FslIMX25State { /*< private >*/ DeviceState parent_obj; =20 @@ -66,7 +68,7 @@ typedef struct FslIMX25State { MemoryRegion iram; MemoryRegion iram_alias; uint32_t phy_num; -} FslIMX25State; +}; =20 /** * i.MX25 memory map diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h index dd8561b309..12368f2c8f 100644 --- a/include/hw/arm/fsl-imx31.h +++ b/include/hw/arm/fsl-imx31.h @@ -28,8 +28,10 @@ #include "hw/watchdog/wdt_imx2.h" #include "exec/memory.h" #include "target/arm/cpu.h" +#include "qom/object.h" =20 #define TYPE_FSL_IMX31 "fsl,imx31" +typedef struct FslIMX31State FslIMX31State; #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31) =20 #define FSL_IMX31_NUM_UARTS 2 @@ -37,7 +39,7 @@ #define FSL_IMX31_NUM_I2CS 3 #define FSL_IMX31_NUM_GPIOS 3 =20 -typedef struct FslIMX31State { +struct FslIMX31State { /*< private >*/ DeviceState parent_obj; =20 @@ -55,7 +57,7 @@ typedef struct FslIMX31State { MemoryRegion rom; MemoryRegion iram; MemoryRegion iram_alias; -} FslIMX31State; +}; =20 #define FSL_IMX31_SECURE_ROM_ADDR 0x00000000 #define FSL_IMX31_SECURE_ROM_SIZE 0x4000 diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h index 162fe99375..e66ea1e917 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -34,8 +34,10 @@ #include "hw/usb/imx-usb-phy.h" #include "exec/memory.h" #include "cpu.h" +#include "qom/object.h" =20 #define TYPE_FSL_IMX6 "fsl,imx6" +typedef struct FslIMX6State FslIMX6State; #define FSL_IMX6(obj) OBJECT_CHECK(FslIMX6State, (obj), TYPE_FSL_IMX6) =20 #define FSL_IMX6_NUM_CPUS 4 @@ -49,7 +51,7 @@ #define FSL_IMX6_NUM_USB_PHYS 2 #define FSL_IMX6_NUM_USBS 4 =20 -typedef struct FslIMX6State { +struct FslIMX6State { /*< private >*/ DeviceState parent_obj; =20 @@ -74,7 +76,7 @@ typedef struct FslIMX6State { MemoryRegion ocram; MemoryRegion ocram_alias; uint32_t phy_num; -} FslIMX6State; +}; =20 =20 #define FSL_IMX6_MMDC_ADDR 0x10000000 diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index fcbaf3dc86..e95c4820c6 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -38,8 +38,10 @@ #include "hw/usb/imx-usb-phy.h" #include "exec/memory.h" #include "cpu.h" +#include "qom/object.h" =20 #define TYPE_FSL_IMX6UL "fsl,imx6ul" +typedef struct FslIMX6ULState FslIMX6ULState; #define FSL_IMX6UL(obj) OBJECT_CHECK(FslIMX6ULState, (obj), TYPE_FSL_IMX6U= L) =20 enum FslIMX6ULConfiguration { @@ -60,7 +62,7 @@ enum FslIMX6ULConfiguration { FSL_IMX6UL_NUM_USBS =3D 2, }; =20 -typedef struct FslIMX6ULState { +struct FslIMX6ULState { /*< private >*/ DeviceState parent_obj; =20 @@ -89,7 +91,7 @@ typedef struct FslIMX6ULState { MemoryRegion ocram_alias; =20 uint32_t phy_num[FSL_IMX6UL_NUM_ETHS]; -} FslIMX6ULState; +}; =20 enum FslIMX6ULMemoryMap { FSL_IMX6UL_MMDC_ADDR =3D 0x80000000, diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index ad88923707..8095e5544b 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -39,8 +39,10 @@ #include "hw/pci-host/designware.h" #include "hw/usb/chipidea.h" #include "cpu.h" +#include "qom/object.h" =20 #define TYPE_FSL_IMX7 "fsl,imx7" +typedef struct FslIMX7State FslIMX7State; #define FSL_IMX7(obj) OBJECT_CHECK(FslIMX7State, (obj), TYPE_FSL_IMX7) =20 enum FslIMX7Configuration { @@ -59,7 +61,7 @@ enum FslIMX7Configuration { FSL_IMX7_NUM_ADCS =3D 2, }; =20 -typedef struct FslIMX7State { +struct FslIMX7State { /*< private >*/ DeviceState parent_obj; =20 @@ -82,7 +84,7 @@ typedef struct FslIMX7State { ChipideaState usb[FSL_IMX7_NUM_USBS]; DesignwarePCIEHost pcie; uint32_t phy_num[FSL_IMX7_NUM_ETHS]; -} FslIMX7State; +}; =20 enum FslIMX7MemoryMap { FSL_IMX7_MMDC_ADDR =3D 0x80000000, diff --git a/include/hw/arm/linux-boot-if.h b/include/hw/arm/linux-boot-if.h index 7bbdfd1cc6..6d9e13fd36 100644 --- a/include/hw/arm/linux-boot-if.h +++ b/include/hw/arm/linux-boot-if.h @@ -9,6 +9,7 @@ #include "qom/object.h" =20 #define TYPE_ARM_LINUX_BOOT_IF "arm-linux-boot-if" +typedef struct ARMLinuxBootIfClass ARMLinuxBootIfClass; #define ARM_LINUX_BOOT_IF_CLASS(klass) \ OBJECT_CLASS_CHECK(ARMLinuxBootIfClass, (klass), TYPE_ARM_LINUX_BOOT_I= F) #define ARM_LINUX_BOOT_IF_GET_CLASS(obj) \ @@ -18,7 +19,7 @@ =20 typedef struct ARMLinuxBootIf ARMLinuxBootIf; =20 -typedef struct ARMLinuxBootIfClass { +struct ARMLinuxBootIfClass { /*< private >*/ InterfaceClass parent_class; =20 @@ -35,6 +36,6 @@ typedef struct ARMLinuxBootIfClass { * (or for a CPU which doesn't support TrustZone) */ void (*arm_linux_init)(ARMLinuxBootIf *obj, bool secure_boot); -} ARMLinuxBootIfClass; +}; =20 #endif diff --git a/include/hw/arm/msf2-soc.h b/include/hw/arm/msf2-soc.h index c9cb214aa6..b4bc5ef96a 100644 --- a/include/hw/arm/msf2-soc.h +++ b/include/hw/arm/msf2-soc.h @@ -30,8 +30,10 @@ #include "hw/misc/msf2-sysreg.h" #include "hw/ssi/mss-spi.h" #include "hw/net/msf2-emac.h" +#include "qom/object.h" =20 #define TYPE_MSF2_SOC "msf2-soc" +typedef struct MSF2State MSF2State; #define MSF2_SOC(obj) OBJECT_CHECK(MSF2State, (obj), TYPE_MSF2_SOC) =20 #define MSF2_NUM_SPIS 2 @@ -44,7 +46,7 @@ */ #define MSF2_NUM_TIMERS 2 =20 -typedef struct MSF2State { +struct MSF2State { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -64,6 +66,6 @@ typedef struct MSF2State { MSSTimerState timer; MSSSpiState spi[MSF2_NUM_SPIS]; MSF2EmacState emac; -} MSF2State; +}; =20 #endif diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h index 0cb78aafea..727ac1ae04 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -17,14 +17,16 @@ #include "hw/gpio/nrf51_gpio.h" #include "hw/nvram/nrf51_nvm.h" #include "hw/timer/nrf51_timer.h" +#include "qom/object.h" =20 #define TYPE_NRF51_SOC "nrf51-soc" +typedef struct NRF51State NRF51State; #define NRF51_SOC(obj) \ OBJECT_CHECK(NRF51State, (obj), TYPE_NRF51_SOC) =20 #define NRF51_NUM_TIMERS 3 =20 -typedef struct NRF51State { +struct NRF51State { /*< private >*/ SysBusDevice parent_obj; =20 @@ -50,6 +52,6 @@ typedef struct NRF51State { =20 MemoryRegion container; =20 -} NRF51State; +}; =20 #endif diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 6be386d0e2..0d365edeec 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -24,6 +24,7 @@ #include "hw/input/tsc2xxx.h" #include "target/arm/cpu-qom.h" #include "qemu/log.h" +#include "qom/object.h" =20 # define OMAP_EMIFS_BASE 0x00000000 # define OMAP2_Q0_BASE 0x00000000 @@ -69,10 +70,10 @@ void omap_clk_reparent(omap_clk clk, omap_clk parent); =20 /* omap_intc.c */ #define TYPE_OMAP_INTC "common-omap-intc" +typedef struct omap_intr_handler_s omap_intr_handler; #define OMAP_INTC(obj) \ OBJECT_CHECK(omap_intr_handler, (obj), TYPE_OMAP_INTC) =20 -typedef struct omap_intr_handler_s omap_intr_handler; =20 /* * TODO: Ideally we should have a clock framework that @@ -93,9 +94,9 @@ void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk= clk); =20 /* omap_i2c.c */ #define TYPE_OMAP_I2C "omap_i2c" +typedef struct OMAPI2CState OMAPI2CState; #define OMAP_I2C(obj) OBJECT_CHECK(OMAPI2CState, (obj), TYPE_OMAP_I2C) =20 -typedef struct OMAPI2CState OMAPI2CState; =20 /* TODO: clock framework (see above) */ void omap_i2c_set_iclk(OMAPI2CState *i2c, omap_clk clk); diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 09c1336071..b2f9a41468 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -13,6 +13,7 @@ #include "exec/memory.h" #include "target/arm/cpu-qom.h" #include "hw/pcmcia.h" +#include "qom/object.h" =20 /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0 diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index 880dccd7c0..b6b51a1cb1 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -21,6 +21,7 @@ =20 #include "hw/sysbus.h" #include "hw/pci/pci.h" +#include "qom/object.h" =20 #define SMMU_PCI_BUS_MAX 256 #define SMMU_PCI_DEVFN_MAX 256 @@ -102,7 +103,7 @@ typedef struct SMMUIOTLBKey { uint8_t level; } SMMUIOTLBKey; =20 -typedef struct SMMUState { +struct SMMUState { /* */ SysBusDevice dev; const char *mrtypename; @@ -116,9 +117,10 @@ typedef struct SMMUState { QLIST_HEAD(, SMMUDevice) devices_with_notifiers; uint8_t bus_num; PCIBus *primary_bus; -} SMMUState; +}; +typedef struct SMMUState SMMUState; =20 -typedef struct { +struct SMMUBaseClass { /* */ SysBusDeviceClass parent_class; =20 @@ -126,7 +128,8 @@ typedef struct { =20 DeviceRealize parent_realize; =20 -} SMMUBaseClass; +}; +typedef struct SMMUBaseClass SMMUBaseClass; =20 #define TYPE_ARM_SMMU "arm-smmu" #define ARM_SMMU(obj) OBJECT_CHECK(SMMUState, (obj), TYPE_ARM_SMMU) diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h index 68d7a963e0..698b89d234 100644 --- a/include/hw/arm/smmuv3.h +++ b/include/hw/arm/smmuv3.h @@ -21,6 +21,7 @@ =20 #include "hw/arm/smmu-common.h" #include "hw/registerfields.h" +#include "qom/object.h" =20 #define TYPE_SMMUV3_IOMMU_MEMORY_REGION "smmuv3-iommu-memory-region" =20 @@ -32,7 +33,7 @@ typedef struct SMMUQueue { uint8_t log2size; } SMMUQueue; =20 -typedef struct SMMUv3State { +struct SMMUv3State { SMMUState smmu_state; =20 uint32_t features; @@ -61,7 +62,8 @@ typedef struct SMMUv3State { =20 qemu_irq irq[4]; QemuMutex mutex; -} SMMUv3State; +}; +typedef struct SMMUv3State SMMUv3State; =20 typedef enum { SMMU_IRQ_EVTQ, @@ -70,14 +72,15 @@ typedef enum { SMMU_IRQ_GERROR, } SMMUIrq; =20 -typedef struct { +struct SMMUv3Class { /*< private >*/ SMMUBaseClass smmu_base_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} SMMUv3Class; +}; +typedef struct SMMUv3Class SMMUv3Class; =20 #define TYPE_ARM_SMMUV3 "arm-smmuv3" #define ARM_SMMUV3(obj) OBJECT_CHECK(SMMUv3State, (obj), TYPE_ARM_SMMUV3) diff --git a/include/hw/arm/stm32f205_soc.h b/include/hw/arm/stm32f205_soc.h index 922a733f88..6d86937e07 100644 --- a/include/hw/arm/stm32f205_soc.h +++ b/include/hw/arm/stm32f205_soc.h @@ -32,8 +32,10 @@ #include "hw/or-irq.h" #include "hw/ssi/stm32f2xx_spi.h" #include "hw/arm/armv7m.h" +#include "qom/object.h" =20 #define TYPE_STM32F205_SOC "stm32f205-soc" +typedef struct STM32F205State STM32F205State; #define STM32F205_SOC(obj) \ OBJECT_CHECK(STM32F205State, (obj), TYPE_STM32F205_SOC) =20 @@ -47,7 +49,7 @@ #define SRAM_BASE_ADDRESS 0x20000000 #define SRAM_SIZE (128 * 1024) =20 -typedef struct STM32F205State { +struct STM32F205State { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -63,6 +65,6 @@ typedef struct STM32F205State { STM32F2XXSPIState spi[STM_NUM_SPIS]; =20 qemu_or_irq *adc_irqs; -} STM32F205State; +}; =20 #endif diff --git a/include/hw/arm/stm32f405_soc.h b/include/hw/arm/stm32f405_soc.h index 1fe97f8c3a..8f44fb2046 100644 --- a/include/hw/arm/stm32f405_soc.h +++ b/include/hw/arm/stm32f405_soc.h @@ -33,8 +33,10 @@ #include "hw/or-irq.h" #include "hw/ssi/stm32f2xx_spi.h" #include "hw/arm/armv7m.h" +#include "qom/object.h" =20 #define TYPE_STM32F405_SOC "stm32f405-soc" +typedef struct STM32F405State STM32F405State; #define STM32F405_SOC(obj) \ OBJECT_CHECK(STM32F405State, (obj), TYPE_STM32F405_SOC) =20 @@ -48,7 +50,7 @@ #define SRAM_BASE_ADDRESS 0x20000000 #define SRAM_SIZE (192 * 1024) =20 -typedef struct STM32F405State { +struct STM32F405State { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -68,6 +70,6 @@ typedef struct STM32F405State { MemoryRegion sram; MemoryRegion flash; MemoryRegion flash_alias; -} STM32F405State; +}; =20 #endif diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index dff67e1bef..49ad860943 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -37,6 +37,7 @@ #include "hw/block/flash.h" #include "sysemu/kvm.h" #include "hw/intc/arm_gicv3_common.h" +#include "qom/object.h" =20 #define NUM_GICV2M_SPIS 64 #define NUM_VIRTIO_TRANSPORTS 32 @@ -115,7 +116,7 @@ typedef struct MemMapEntry { hwaddr size; } MemMapEntry; =20 -typedef struct { +struct VirtMachineClass { MachineClass parent; bool disallow_affinity_adjustment; bool no_its; @@ -126,9 +127,10 @@ typedef struct { bool no_ged; /* Machines < 4.2 has no support for ACPI GED device */ bool kvm_no_adjvtime; bool acpi_expose_flash; -} VirtMachineClass; +}; +typedef struct VirtMachineClass VirtMachineClass; =20 -typedef struct { +struct VirtMachineState { MachineState parent; Notifier machine_done; DeviceState *platform_bus_dev; @@ -162,7 +164,8 @@ typedef struct { DeviceState *gic; DeviceState *acpi_dev; Notifier powerdown_notifier; -} VirtMachineState; +}; +typedef struct VirtMachineState VirtMachineState; =20 #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) =20 diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 9c9f47ba9d..a960619ec9 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -20,8 +20,10 @@ #include "hw/dma/xlnx-zdma.h" #include "hw/net/cadence_gem.h" #include "hw/rtc/xlnx-zynqmp-rtc.h" +#include "qom/object.h" =20 #define TYPE_XLNX_VERSAL "xlnx-versal" +typedef struct Versal Versal; #define XLNX_VERSAL(obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL) =20 #define XLNX_VERSAL_NR_ACPUS 2 @@ -31,7 +33,7 @@ #define XLNX_VERSAL_NR_SDS 2 #define XLNX_VERSAL_NR_IRQS 192 =20 -typedef struct Versal { +struct Versal { /*< private >*/ SysBusDevice parent_obj; =20 @@ -74,7 +76,7 @@ typedef struct Versal { MemoryRegion *mr_ddr; uint32_t psci_conduit; } cfg; -} Versal; +}; =20 /* Memory-map and IRQ definitions. Copied a subset from * auto-generated files. */ diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 53076fa29a..6a24216abf 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -32,8 +32,10 @@ #include "hw/rtc/xlnx-zynqmp-rtc.h" #include "hw/cpu/cluster.h" #include "target/arm/cpu.h" +#include "qom/object.h" =20 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" +typedef struct XlnxZynqMPState XlnxZynqMPState; #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ TYPE_XLNX_ZYNQMP) =20 @@ -73,7 +75,7 @@ #define XLNX_ZYNQMP_MAX_RAM_SIZE (XLNX_ZYNQMP_MAX_LOW_RAM_SIZE + \ XLNX_ZYNQMP_MAX_HIGH_RAM_SIZE) =20 -typedef struct XlnxZynqMPState { +struct XlnxZynqMPState { /*< private >*/ DeviceState parent_obj; =20 @@ -112,6 +114,6 @@ typedef struct XlnxZynqMPState { bool virt; /* Has the RPU subsystem? */ bool has_rpu; -} XlnxZynqMPState; +}; =20 #endif diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index 2136a2d5e4..9b2fa7e92c 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -4,14 +4,15 @@ /* NOR flash devices */ =20 #include "exec/hwaddr.h" +#include "qom/object.h" =20 /* pflash_cfi01.c */ =20 #define TYPE_PFLASH_CFI01 "cfi.pflash01" +typedef struct PFlashCFI01 PFlashCFI01; #define PFLASH_CFI01(obj) \ OBJECT_CHECK(PFlashCFI01, (obj), TYPE_PFLASH_CFI01) =20 -typedef struct PFlashCFI01 PFlashCFI01; =20 PFlashCFI01 *pflash_cfi01_register(hwaddr base, const char *name, @@ -29,10 +30,10 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveI= nfo *dinfo); /* pflash_cfi02.c */ =20 #define TYPE_PFLASH_CFI02 "cfi.pflash02" +typedef struct PFlashCFI02 PFlashCFI02; #define PFLASH_CFI02(obj) \ OBJECT_CHECK(PFlashCFI02, (obj), TYPE_PFLASH_CFI02) =20 -typedef struct PFlashCFI02 PFlashCFI02; =20 PFlashCFI02 *pflash_cfi02_register(hwaddr base, const char *name, diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h index 9d8b65c561..f013d634f7 100644 --- a/include/hw/block/swim.h +++ b/include/hw/block/swim.h @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define SWIM_MAX_FD 2 =20 @@ -67,10 +68,11 @@ struct SWIMCtrl { }; =20 #define TYPE_SWIM "swim" +typedef struct Swim Swim; #define SWIM(obj) OBJECT_CHECK(Swim, (obj), TYPE_SWIM) =20 -typedef struct Swim { +struct Swim { SysBusDevice parent_obj; SWIMCtrl ctrl; -} Swim; +}; #endif diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h index 5739aaf26f..67ad345edd 100644 --- a/include/hw/char/avr_usart.h +++ b/include/hw/char/avr_usart.h @@ -25,6 +25,7 @@ #include "hw/sysbus.h" #include "chardev/char-fe.h" #include "hw/hw.h" +#include "qom/object.h" =20 /* Offsets of registers. */ #define USART_DR 0x06 @@ -57,10 +58,11 @@ #define USART_CSRC_CSZ0 (1 << 1) =20 #define TYPE_AVR_USART "avr-usart" +typedef struct AVRUsartState AVRUsartState; #define AVR_USART(obj) \ OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART) =20 -typedef struct { +struct AVRUsartState { /* */ SysBusDevice parent_obj; =20 @@ -88,6 +90,6 @@ typedef struct { qemu_irq txc_irq; /* Data Register Empty */ qemu_irq dre_irq; -} AVRUsartState; +}; =20 #endif /* HW_CHAR_AVR_USART_H */ diff --git a/include/hw/char/bcm2835_aux.h b/include/hw/char/bcm2835_aux.h index 934acf9c81..2647becc52 100644 --- a/include/hw/char/bcm2835_aux.h +++ b/include/hw/char/bcm2835_aux.h @@ -11,13 +11,15 @@ =20 #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_AUX "bcm2835-aux" +typedef struct BCM2835AuxState BCM2835AuxState; #define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835= _AUX) =20 #define BCM2835_AUX_RX_FIFO_LEN 8 =20 -typedef struct { +struct BCM2835AuxState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -29,6 +31,6 @@ typedef struct { uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN]; uint8_t read_pos, read_count; uint8_t ier, iir; -} BCM2835AuxState; +}; =20 #endif diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h index dabc49ea4f..3d02d6ef1a 100644 --- a/include/hw/char/cadence_uart.h +++ b/include/hw/char/cadence_uart.h @@ -24,6 +24,7 @@ #include "chardev/char-fe.h" #include "qapi/error.h" #include "qemu/timer.h" +#include "qom/object.h" =20 #define CADENCE_UART_RX_FIFO_SIZE 16 #define CADENCE_UART_TX_FIFO_SIZE 16 @@ -31,10 +32,11 @@ #define CADENCE_UART_R_MAX (0x48/4) =20 #define TYPE_CADENCE_UART "cadence_uart" +typedef struct CadenceUARTState CadenceUARTState; #define CADENCE_UART(obj) OBJECT_CHECK(CadenceUARTState, (obj), \ TYPE_CADENCE_UART) =20 -typedef struct { +struct CadenceUARTState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -51,6 +53,6 @@ typedef struct { qemu_irq irq; QEMUTimer *fifo_trigger_handle; Clock *refclk; -} CadenceUARTState; +}; =20 #endif diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-u= art.h index bc9069f9fd..32c0df9df3 100644 --- a/include/hw/char/cmsdk-apb-uart.h +++ b/include/hw/char/cmsdk-apb-uart.h @@ -15,12 +15,14 @@ #include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" +typedef struct CMSDKAPBUART CMSDKAPBUART; #define CMSDK_APB_UART(obj) OBJECT_CHECK(CMSDKAPBUART, (obj), \ TYPE_CMSDK_APB_UART) =20 -typedef struct { +struct CMSDKAPBUART { /*< private >*/ SysBusDevice parent_obj; =20 @@ -42,7 +44,7 @@ typedef struct { /* This UART has no FIFO, only a 1-character buffer for each of Tx and= Rx */ uint8_t txbuf; uint8_t rxbuf; -} CMSDKAPBUART; +}; =20 /** * cmsdk_apb_uart_create - convenience function to create TYPE_CMSDK_APB_U= ART diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h index de9a3e3551..7c6ec2a5c5 100644 --- a/include/hw/char/digic-uart.h +++ b/include/hw/char/digic-uart.h @@ -20,8 +20,10 @@ =20 #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define TYPE_DIGIC_UART "digic-uart" +typedef struct DigicUartState DigicUartState; #define DIGIC_UART(obj) \ OBJECT_CHECK(DigicUartState, (obj), TYPE_DIGIC_UART) =20 @@ -32,7 +34,7 @@ enum { R_MAX }; =20 -typedef struct DigicUartState { +struct DigicUartState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -42,6 +44,6 @@ typedef struct DigicUartState { =20 uint32_t reg_rx; uint32_t reg_st; -} DigicUartState; +}; =20 #endif /* HW_CHAR_DIGIC_UART_H */ diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h index 794b653484..5de2a39e77 100644 --- a/include/hw/char/escc.h +++ b/include/hw/char/escc.h @@ -5,11 +5,13 @@ #include "chardev/char-serial.h" #include "hw/sysbus.h" #include "ui/input.h" +#include "qom/object.h" =20 /* escc.c */ #define TYPE_ESCC "escc" #define ESCC_SIZE 4 =20 +typedef struct ESCCState ESCCState; #define ESCC(obj) OBJECT_CHECK(ESCCState, (obj), TYPE_ESCC) =20 typedef enum { @@ -46,7 +48,7 @@ typedef struct ESCCChannelState { QemuInputHandlerState *hs; } ESCCChannelState; =20 -typedef struct ESCCState { +struct ESCCState { SysBusDevice parent_obj; =20 struct ESCCChannelState chn[2]; @@ -55,6 +57,6 @@ typedef struct ESCCState { MemoryRegion mmio; uint32_t disabled; uint32_t frequency; -} ESCCState; +}; =20 #endif diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h index b6bd5a6700..ec9fcde8f0 100644 --- a/include/hw/char/ibex_uart.h +++ b/include/hw/char/ibex_uart.h @@ -29,6 +29,7 @@ #include "hw/registerfields.h" #include "chardev/char-fe.h" #include "qemu/timer.h" +#include "qom/object.h" =20 REG32(INTR_STATE, 0x00) FIELD(INTR_STATE, TX_WATERMARK, 0, 1) @@ -69,10 +70,11 @@ REG32(TIMEOUT_CTRL, 0x2c) #define IBEX_UART_CLOCK 50000000 /* 50MHz clock */ =20 #define TYPE_IBEX_UART "ibex-uart" +typedef struct IbexUartState IbexUartState; #define IBEX_UART(obj) \ OBJECT_CHECK(IbexUartState, (obj), TYPE_IBEX_UART) =20 -typedef struct { +struct IbexUartState { /* */ SysBusDevice parent_obj; =20 @@ -103,5 +105,5 @@ typedef struct { qemu_irq rx_watermark; qemu_irq tx_empty; qemu_irq rx_overflow; -} IbexUartState; +}; #endif /* HW_IBEX_UART_H */ diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h index c8b74284f8..bfaf8ec695 100644 --- a/include/hw/char/imx_serial.h +++ b/include/hw/char/imx_serial.h @@ -20,8 +20,10 @@ =20 #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define TYPE_IMX_SERIAL "imx.serial" +typedef struct IMXSerialState IMXSerialState; #define IMX_SERIAL(obj) OBJECT_CHECK(IMXSerialState, (obj), TYPE_IMX_SERIA= L) =20 #define URXD_CHARRDY (1<<15) /* character read is valid */ @@ -76,7 +78,7 @@ #define UTS1_TXFULL (1<<4) #define UTS1_RXFULL (1<<3) =20 -typedef struct IMXSerialState { +struct IMXSerialState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -103,6 +105,6 @@ typedef struct IMXSerialState { =20 qemu_irq irq; CharBackend chr; -} IMXSerialState; +}; =20 #endif diff --git a/include/hw/char/nrf51_uart.h b/include/hw/char/nrf51_uart.h index eb1c15b490..20560ba6dc 100644 --- a/include/hw/char/nrf51_uart.h +++ b/include/hw/char/nrf51_uart.h @@ -14,11 +14,13 @@ #include "hw/sysbus.h" #include "chardev/char-fe.h" #include "hw/registerfields.h" +#include "qom/object.h" =20 #define UART_FIFO_LENGTH 6 #define UART_SIZE 0x1000 =20 #define TYPE_NRF51_UART "nrf51_soc.uart" +typedef struct NRF51UARTState NRF51UARTState; #define NRF51_UART(obj) OBJECT_CHECK(NRF51UARTState, (obj), TYPE_NRF51_UAR= T) =20 REG32(UART_STARTRX, 0x000) @@ -54,7 +56,7 @@ REG32(UART_TXD, 0x51C) REG32(UART_BAUDRATE, 0x524) REG32(UART_CONFIG, 0x56C) =20 -typedef struct NRF51UARTState { +struct NRF51UARTState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -72,6 +74,6 @@ typedef struct NRF51UARTState { bool tx_started; bool pending_tx_byte; bool enabled; -} NRF51UARTState; +}; =20 #endif diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h index bed758350f..ddbd8ad45b 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -19,14 +19,16 @@ #include "hw/sysbus.h" #include "chardev/char-fe.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define TYPE_PL011 "pl011" +typedef struct PL011State PL011State; #define PL011(obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011) =20 /* This shares the same struct (and cast macro) as the base pl011 device */ #define TYPE_PL011_LUMINARY "pl011_luminary" =20 -typedef struct PL011State { +struct PL011State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -49,7 +51,7 @@ typedef struct PL011State { CharBackend chr; qemu_irq irq[6]; const unsigned char *id; -} PL011State; +}; =20 static inline DeviceState *pl011_create(hwaddr addr, qemu_irq irq, diff --git a/include/hw/char/renesas_sci.h b/include/hw/char/renesas_sci.h index efdebc620a..5a5ebfd28c 100644 --- a/include/hw/char/renesas_sci.h +++ b/include/hw/char/renesas_sci.h @@ -11,8 +11,10 @@ =20 #include "chardev/char-fe.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_RENESAS_SCI "renesas-sci" +typedef struct RSCIState RSCIState; #define RSCI(obj) OBJECT_CHECK(RSCIState, (obj), TYPE_RENESAS_SCI) =20 enum { @@ -23,7 +25,7 @@ enum { SCI_NR_IRQ =3D 4 }; =20 -typedef struct { +struct RSCIState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -46,6 +48,6 @@ typedef struct { int64_t trtime; int64_t rx_next; uint64_t input_freq; -} RSCIState; +}; =20 #endif diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 535fa23a2b..dbeef43676 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -31,10 +31,11 @@ #include "qemu/fifo8.h" #include "chardev/char.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define UART_FIFO_LENGTH 16 /* 16550A Fifo Length */ =20 -typedef struct SerialState { +struct SerialState { DeviceState parent; =20 uint16_t divider; @@ -77,22 +78,25 @@ typedef struct SerialState { =20 QEMUTimer *modem_status_poll; MemoryRegion io; -} SerialState; +}; +typedef struct SerialState SerialState; =20 -typedef struct SerialMM { +struct SerialMM { SysBusDevice parent; =20 SerialState serial; =20 uint8_t regshift; uint8_t endianness; -} SerialMM; +}; +typedef struct SerialMM SerialMM; =20 -typedef struct SerialIO { +struct SerialIO { SysBusDevice parent; =20 SerialState serial; -} SerialIO; +}; +typedef struct SerialIO SerialIO; =20 extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; diff --git a/include/hw/char/stm32f2xx_usart.h b/include/hw/char/stm32f2xx_= usart.h index 8e112671e3..c44faca751 100644 --- a/include/hw/char/stm32f2xx_usart.h +++ b/include/hw/char/stm32f2xx_usart.h @@ -27,6 +27,7 @@ =20 #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define USART_SR 0x00 #define USART_DR 0x04 @@ -53,10 +54,11 @@ #define USART_CR1_RE (1 << 2) =20 #define TYPE_STM32F2XX_USART "stm32f2xx-usart" +typedef struct STM32F2XXUsartState STM32F2XXUsartState; #define STM32F2XX_USART(obj) \ OBJECT_CHECK(STM32F2XXUsartState, (obj), TYPE_STM32F2XX_USART) =20 -typedef struct { +struct STM32F2XXUsartState { /* */ SysBusDevice parent_obj; =20 @@ -73,5 +75,5 @@ typedef struct { =20 CharBackend chr; qemu_irq irq; -} STM32F2XXUsartState; +}; #endif /* HW_STM32F2XX_USART_H */ diff --git a/include/hw/clock.h b/include/hw/clock.h index 9ecd78b2c3..65cf363dd5 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -18,6 +18,7 @@ #include "qemu/queue.h" =20 #define TYPE_CLOCK "clock" +typedef struct Clock Clock; #define CLOCK(obj) OBJECT_CHECK(Clock, (obj), TYPE_CLOCK) =20 typedef void ClockCallback(void *opaque); @@ -54,7 +55,6 @@ typedef void ClockCallback(void *opaque); * @sibling: structure used to form a clock list */ =20 -typedef struct Clock Clock; =20 struct Clock { /*< private >*/ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 8f145733ce..5f319b9d22 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -30,6 +30,7 @@ #include "qemu/queue.h" #include "qemu/thread.h" #include "qemu/plugin.h" +#include "qom/object.h" =20 typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size, void *opaque); @@ -61,6 +62,7 @@ typedef uint64_t vaddr; */ #define CPU(obj) ((CPUState *)(obj)) =20 +typedef struct CPUClass CPUClass; #define CPU_CLASS(class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU) #define CPU_GET_CLASS(obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU) =20 @@ -156,7 +158,7 @@ struct TranslationBlock; * * Represents a CPU family or model. */ -typedef struct CPUClass { +struct CPUClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -222,7 +224,7 @@ typedef struct CPUClass { /* Keep non-pointer data at the end to minimize holes. */ int gdb_num_core_regs; bool gdb_stop_before_watchpoint; -} CPUClass; +}; =20 /* * Low 16 bits: number of cycles left, used only in icount mode. diff --git a/include/hw/core/generic-loader.h b/include/hw/core/generic-loa= der.h index 9ffce1c5a3..f435af1884 100644 --- a/include/hw/core/generic-loader.h +++ b/include/hw/core/generic-loader.h @@ -20,8 +20,9 @@ =20 #include "elf.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 -typedef struct GenericLoaderState { +struct GenericLoaderState { /* */ DeviceState parent_obj; =20 @@ -38,7 +39,8 @@ typedef struct GenericLoaderState { bool force_raw; bool data_be; bool set_pc; -} GenericLoaderState; +}; +typedef struct GenericLoaderState GenericLoaderState; =20 #define TYPE_GENERIC_LOADER "loader" #define GENERIC_LOADER(obj) OBJECT_CHECK(GenericLoaderState, (obj), \ diff --git a/include/hw/cpu/a15mpcore.h b/include/hw/cpu/a15mpcore.h index b423533d20..01415728d0 100644 --- a/include/hw/cpu/a15mpcore.h +++ b/include/hw/cpu/a15mpcore.h @@ -22,14 +22,16 @@ =20 #include "hw/sysbus.h" #include "hw/intc/arm_gic.h" +#include "qom/object.h" =20 /* A15MP private memory region. */ =20 #define TYPE_A15MPCORE_PRIV "a15mpcore_priv" +typedef struct A15MPPrivState A15MPPrivState; #define A15MPCORE_PRIV(obj) \ OBJECT_CHECK(A15MPPrivState, (obj), TYPE_A15MPCORE_PRIV) =20 -typedef struct A15MPPrivState { +struct A15MPPrivState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -39,6 +41,6 @@ typedef struct A15MPPrivState { MemoryRegion container; =20 GICState gic; -} A15MPPrivState; +}; =20 #endif diff --git a/include/hw/cpu/a9mpcore.h b/include/hw/cpu/a9mpcore.h index 5d67ca22c4..1a3b32cc4c 100644 --- a/include/hw/cpu/a9mpcore.h +++ b/include/hw/cpu/a9mpcore.h @@ -15,12 +15,14 @@ #include "hw/misc/a9scu.h" #include "hw/timer/arm_mptimer.h" #include "hw/timer/a9gtimer.h" +#include "qom/object.h" =20 #define TYPE_A9MPCORE_PRIV "a9mpcore_priv" +typedef struct A9MPPrivState A9MPPrivState; #define A9MPCORE_PRIV(obj) \ OBJECT_CHECK(A9MPPrivState, (obj), TYPE_A9MPCORE_PRIV) =20 -typedef struct A9MPPrivState { +struct A9MPPrivState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -34,6 +36,6 @@ typedef struct A9MPPrivState { A9GTimerState gtimer; ARMMPTimerState mptimer; ARMMPTimerState wdt; -} A9MPPrivState; +}; =20 #endif diff --git a/include/hw/cpu/arm11mpcore.h b/include/hw/cpu/arm11mpcore.h index 6196109ca2..5a5575b86d 100644 --- a/include/hw/cpu/arm11mpcore.h +++ b/include/hw/cpu/arm11mpcore.h @@ -14,12 +14,14 @@ #include "hw/misc/arm11scu.h" #include "hw/intc/arm_gic.h" #include "hw/timer/arm_mptimer.h" +#include "qom/object.h" =20 #define TYPE_ARM11MPCORE_PRIV "arm11mpcore_priv" +typedef struct ARM11MPCorePriveState ARM11MPCorePriveState; #define ARM11MPCORE_PRIV(obj) \ OBJECT_CHECK(ARM11MPCorePriveState, (obj), TYPE_ARM11MPCORE_PRIV) =20 -typedef struct ARM11MPCorePriveState { +struct ARM11MPCorePriveState { SysBusDevice parent_obj; =20 uint32_t num_cpu; @@ -30,6 +32,6 @@ typedef struct ARM11MPCorePriveState { GICState gic; ARMMPTimerState mptimer; ARMMPTimerState wdtimer; -} ARM11MPCorePriveState; +}; =20 #endif diff --git a/include/hw/cpu/cluster.h b/include/hw/cpu/cluster.h index a616501a55..faacf9757e 100644 --- a/include/hw/cpu/cluster.h +++ b/include/hw/cpu/cluster.h @@ -21,6 +21,7 @@ #define HW_CPU_CLUSTER_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 /* * CPU Cluster type @@ -54,6 +55,7 @@ */ =20 #define TYPE_CPU_CLUSTER "cpu-cluster" +typedef struct CPUClusterState CPUClusterState; #define CPU_CLUSTER(obj) \ OBJECT_CHECK(CPUClusterState, (obj), TYPE_CPU_CLUSTER) =20 @@ -70,12 +72,12 @@ * * State of a CPU cluster. */ -typedef struct CPUClusterState { +struct CPUClusterState { /*< private >*/ DeviceState parent_obj; =20 /*< public >*/ uint32_t cluster_id; -} CPUClusterState; +}; =20 #endif diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h index 555ad831bb..850191527e 100644 --- a/include/hw/cpu/core.h +++ b/include/hw/cpu/core.h @@ -10,20 +10,22 @@ #define HW_CPU_CORE_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define TYPE_CPU_CORE "cpu-core" =20 +typedef struct CPUCore CPUCore; #define CPU_CORE(obj) \ OBJECT_CHECK(CPUCore, (obj), TYPE_CPU_CORE) =20 -typedef struct CPUCore { +struct CPUCore { /*< private >*/ DeviceState parent_obj; =20 /*< public >*/ int core_id; int nr_threads; -} CPUCore; +}; =20 /* Note: topology field names need to be kept in sync with * 'CpuInstanceProperties' */ diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_f= b.h index 2246be74d8..5fc4d74a06 100644 --- a/include/hw/display/bcm2835_fb.h +++ b/include/hw/display/bcm2835_fb.h @@ -14,8 +14,10 @@ =20 #include "hw/sysbus.h" #include "ui/console.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_FB "bcm2835-fb" +typedef struct BCM2835FBState BCM2835FBState; #define BCM2835_FB(obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_F= B) =20 /* @@ -32,7 +34,7 @@ typedef struct { uint32_t alpha; } BCM2835FBConfig; =20 -typedef struct { +struct BCM2835FBState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -49,7 +51,7 @@ typedef struct { =20 BCM2835FBConfig config; BCM2835FBConfig initial_config; -} BCM2835FBState; +}; =20 void bcm2835_fb_reconfigure(BCM2835FBState *s, BCM2835FBConfig *newconfig); =20 diff --git a/include/hw/display/dpcd.h b/include/hw/display/dpcd.h index 6880ee36a3..6b96a463a7 100644 --- a/include/hw/display/dpcd.h +++ b/include/hw/display/dpcd.h @@ -24,6 +24,7 @@ =20 #ifndef DPCD_H #define DPCD_H +#include "qom/object.h" =20 typedef struct DPCDState DPCDState; =20 diff --git a/include/hw/display/i2c-ddc.h b/include/hw/display/i2c-ddc.h index 1cf53a0c8d..8ab50641aa 100644 --- a/include/hw/display/i2c-ddc.h +++ b/include/hw/display/i2c-ddc.h @@ -21,6 +21,7 @@ =20 #include "hw/display/edid.h" #include "hw/i2c/i2c.h" +#include "qom/object.h" =20 /* A simple I2C slave which just returns the contents of its EDID blob. */ struct I2CDDCState { diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 347871b623..d330ee9823 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "exec/memory.h" #include "ui/console.h" +#include "qom/object.h" =20 typedef struct MacfbState { MemoryRegion mem_vram; @@ -31,34 +32,37 @@ typedef struct MacfbState { } MacfbState; =20 #define TYPE_MACFB "sysbus-macfb" +typedef struct MacfbSysBusState MacfbSysBusState; #define MACFB(obj) \ OBJECT_CHECK(MacfbSysBusState, (obj), TYPE_MACFB) =20 -typedef struct { +struct MacfbSysBusState { SysBusDevice busdev; =20 MacfbState macfb; -} MacfbSysBusState; +}; =20 +#define TYPE_NUBUS_MACFB "nubus-macfb" +typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass; +typedef struct MacfbNubusState MacfbNubusState; #define NUBUS_MACFB_CLASS(class) \ OBJECT_CLASS_CHECK(MacfbNubusDeviceClass, (class), TYPE_NUBUS_MACFB) #define NUBUS_MACFB_GET_CLASS(obj) \ OBJECT_GET_CLASS(MacfbNubusDeviceClass, (obj), TYPE_NUBUS_MACFB) =20 -typedef struct MacfbNubusDeviceClass { +struct MacfbNubusDeviceClass { DeviceClass parent_class; =20 DeviceRealize parent_realize; -} MacfbNubusDeviceClass; +}; =20 -#define TYPE_NUBUS_MACFB "nubus-macfb" #define NUBUS_MACFB(obj) \ OBJECT_CHECK(MacfbNubusState, (obj), TYPE_NUBUS_MACFB) =20 -typedef struct { +struct MacfbNubusState { NubusDevice busdev; =20 MacfbState macfb; -} MacfbNubusState; +}; =20 #endif diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index ab0dd250cc..f76bde2e77 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -34,6 +34,7 @@ #include "qemu/units.h" #include "hw/dma/xlnx_dpdma.h" #include "audio/audio.h" +#include "qom/object.h" =20 #define AUD_CHBUF_MAX_DEPTH (32 * KiB) #define MAX_QEMU_BUFFER_SIZE (4 * KiB) @@ -48,7 +49,7 @@ struct PixmanPlane { DisplaySurface *surface; }; =20 -typedef struct XlnxDPState { +struct XlnxDPState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -101,7 +102,8 @@ typedef struct XlnxDPState { */ DPCDState *dpcd; I2CDDCState *edid; -} XlnxDPState; +}; +typedef struct XlnxDPState XlnxDPState; =20 #define TYPE_XLNX_DP "xlnx.v-dp" #define XLNX_DP(obj) OBJECT_CHECK(XlnxDPState, (obj), TYPE_XLNX_DP) diff --git a/include/hw/dma/bcm2835_dma.h b/include/hw/dma/bcm2835_dma.h index a6747842b7..31f335ec5b 100644 --- a/include/hw/dma/bcm2835_dma.h +++ b/include/hw/dma/bcm2835_dma.h @@ -9,6 +9,7 @@ #define BCM2835_DMA_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 typedef struct { uint32_t cs; @@ -25,12 +26,13 @@ typedef struct { } BCM2835DMAChan; =20 #define TYPE_BCM2835_DMA "bcm2835-dma" +typedef struct BCM2835DMAState BCM2835DMAState; #define BCM2835_DMA(obj) \ OBJECT_CHECK(BCM2835DMAState, (obj), TYPE_BCM2835_DMA) =20 #define BCM2835_DMA_NCHANS 16 =20 -typedef struct { +struct BCM2835DMAState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -42,6 +44,6 @@ typedef struct { BCM2835DMAChan chan[BCM2835_DMA_NCHANS]; uint32_t int_status; uint32_t enable; -} BCM2835DMAState; +}; =20 #endif diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index ee06371699..46eef1f581 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -3,8 +3,10 @@ =20 #include "hw/isa/isa.h" #include "exec/ioport.h" +#include "qom/object.h" =20 #define TYPE_I8257 "i8257" +typedef struct I8257State I8257State; #define I8257(obj) \ OBJECT_CHECK(I8257State, (obj), TYPE_I8257) =20 @@ -20,7 +22,7 @@ typedef struct I8257Regs { void *opaque; } I8257Regs; =20 -typedef struct I8257State { +struct I8257State { /* */ ISADevice parent_obj; =20 @@ -43,7 +45,7 @@ typedef struct I8257State { int running; PortioList portio_page; PortioList portio_pageh; -} I8257State; +}; =20 void i8257_dma_init(ISABus *bus, bool high_page_enable); =20 diff --git a/include/hw/dma/pl080.h b/include/hw/dma/pl080.h index 9d4b3df143..55a645b055 100644 --- a/include/hw/dma/pl080.h +++ b/include/hw/dma/pl080.h @@ -29,6 +29,7 @@ #define HW_DMA_PL080_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define PL080_MAX_CHANNELS 8 =20 @@ -42,9 +43,10 @@ typedef struct { =20 #define TYPE_PL080 "pl080" #define TYPE_PL081 "pl081" +typedef struct PL080State PL080State; #define PL080(obj) OBJECT_CHECK(PL080State, (obj), TYPE_PL080) =20 -typedef struct PL080State { +struct PL080State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -66,6 +68,6 @@ typedef struct PL080State { =20 MemoryRegion *downstream; AddressSpace downstream_as; -} PL080State; +}; =20 #endif diff --git a/include/hw/dma/xlnx-zdma.h b/include/hw/dma/xlnx-zdma.h index 0b240b4c3c..8be9ee5cc2 100644 --- a/include/hw/dma/xlnx-zdma.h +++ b/include/hw/dma/xlnx-zdma.h @@ -32,6 +32,7 @@ #include "hw/sysbus.h" #include "hw/register.h" #include "sysemu/dma.h" +#include "qom/object.h" =20 #define ZDMA_R_MAX (0x204 / 4) =20 @@ -50,7 +51,7 @@ typedef union { uint32_t words[4]; } XlnxZDMADescr; =20 -typedef struct XlnxZDMA { +struct XlnxZDMA { SysBusDevice parent_obj; MemoryRegion iomem; MemTxAttrs attr; @@ -74,7 +75,8 @@ typedef struct XlnxZDMA { /* We don't model the common bufs. Must be at least 16 bytes to model write only mode. */ uint8_t buf[2048]; -} XlnxZDMA; +}; +typedef struct XlnxZDMA XlnxZDMA; =20 #define TYPE_XLNX_ZDMA "xlnx.zdma" =20 diff --git a/include/hw/dma/xlnx-zynq-devcfg.h b/include/hw/dma/xlnx-zynq-d= evcfg.h index 1d3969d91f..52ba61b653 100644 --- a/include/hw/dma/xlnx-zynq-devcfg.h +++ b/include/hw/dma/xlnx-zynq-devcfg.h @@ -29,9 +29,11 @@ =20 #include "hw/register.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_XLNX_ZYNQ_DEVCFG "xlnx.ps7-dev-cfg" =20 +typedef struct XlnxZynqDevcfg XlnxZynqDevcfg; #define XLNX_ZYNQ_DEVCFG(obj) \ OBJECT_CHECK(XlnxZynqDevcfg, (obj), TYPE_XLNX_ZYNQ_DEVCFG) =20 @@ -46,7 +48,7 @@ typedef struct XlnxZynqDevcfgDMACmd { uint32_t dest_len; } XlnxZynqDevcfgDMACmd; =20 -typedef struct XlnxZynqDevcfg { +struct XlnxZynqDevcfg { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -57,6 +59,6 @@ typedef struct XlnxZynqDevcfg { =20 uint32_t regs[XLNX_ZYNQ_DEVCFG_R_MAX]; RegisterInfo regs_info[XLNX_ZYNQ_DEVCFG_R_MAX]; -} XlnxZynqDevcfg; +}; =20 #endif diff --git a/include/hw/dma/xlnx_dpdma.h b/include/hw/dma/xlnx_dpdma.h index 7a304a5bb4..50952dd7ce 100644 --- a/include/hw/dma/xlnx_dpdma.h +++ b/include/hw/dma/xlnx_dpdma.h @@ -28,6 +28,7 @@ #include "hw/sysbus.h" #include "ui/console.h" #include "sysemu/dma.h" +#include "qom/object.h" =20 #define XLNX_DPDMA_REG_ARRAY_SIZE (0x1000 >> 2) =20 diff --git a/include/hw/fw-path-provider.h b/include/hw/fw-path-provider.h index 10d1bd4959..1231cca63b 100644 --- a/include/hw/fw-path-provider.h +++ b/include/hw/fw-path-provider.h @@ -22,6 +22,7 @@ =20 #define TYPE_FW_PATH_PROVIDER "fw-path-provider" =20 +typedef struct FWPathProviderClass FWPathProviderClass; #define FW_PATH_PROVIDER_CLASS(klass) \ OBJECT_CLASS_CHECK(FWPathProviderClass, (klass), TYPE_FW_PATH_PROVIDE= R) #define FW_PATH_PROVIDER_GET_CLASS(obj) \ @@ -31,11 +32,11 @@ =20 typedef struct FWPathProvider FWPathProvider; =20 -typedef struct FWPathProviderClass { +struct FWPathProviderClass { InterfaceClass parent_class; =20 char *(*get_dev_path)(FWPathProvider *p, BusState *bus, DeviceState *d= ev); -} FWPathProviderClass; +}; =20 char *fw_path_provider_get_dev_path(FWPathProvider *p, BusState *bus, DeviceState *dev); diff --git a/include/hw/gpio/aspeed_gpio.h b/include/hw/gpio/aspeed_gpio.h index a2deac046a..4dc0bc3f3d 100644 --- a/include/hw/gpio/aspeed_gpio.h +++ b/include/hw/gpio/aspeed_gpio.h @@ -11,8 +11,11 @@ #define ASPEED_GPIO_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_GPIO "aspeed.gpio" +typedef struct AspeedGPIOClass AspeedGPIOClass; +typedef struct AspeedGPIOState AspeedGPIOState; #define ASPEED_GPIO(obj) OBJECT_CHECK(AspeedGPIOState, (obj), TYPE_ASPEED_= GPIO) #define ASPEED_GPIO_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedGPIOClass, (klass), TYPE_ASPEED_GPIO) @@ -58,16 +61,16 @@ typedef struct AspeedGPIOReg { enum GPIORegType type; } AspeedGPIOReg; =20 -typedef struct AspeedGPIOClass { +struct AspeedGPIOClass { SysBusDevice parent_obj; const GPIOSetProperties *props; uint32_t nr_gpio_pins; uint32_t nr_gpio_sets; uint32_t gap; const AspeedGPIOReg *reg_table; -} AspeedGPIOClass; +}; =20 -typedef struct AspeedGPIOState { +struct AspeedGPIOState { /* */ SysBusDevice parent; =20 @@ -95,6 +98,6 @@ typedef struct AspeedGPIOState { uint32_t debounce_2; uint32_t input_mask; } sets[ASPEED_GPIO_MAX_NR_SETS]; -} AspeedGPIOState; +}; =20 #endif /* _ASPEED_GPIO_H_ */ diff --git a/include/hw/gpio/bcm2835_gpio.h b/include/hw/gpio/bcm2835_gpio.h index b0de0a3c74..d8268f1461 100644 --- a/include/hw/gpio/bcm2835_gpio.h +++ b/include/hw/gpio/bcm2835_gpio.h @@ -16,8 +16,9 @@ =20 #include "hw/sd/sd.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 -typedef struct BCM2835GpioState { +struct BCM2835GpioState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -31,7 +32,8 @@ typedef struct BCM2835GpioState { uint32_t lev0, lev1; uint8_t sd_fsel; qemu_irq out[54]; -} BCM2835GpioState; +}; +typedef struct BCM2835GpioState BCM2835GpioState; =20 #define TYPE_BCM2835_GPIO "bcm2835_gpio" #define BCM2835_GPIO(obj) \ diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h index ffab437f23..b7dc689f73 100644 --- a/include/hw/gpio/imx_gpio.h +++ b/include/hw/gpio/imx_gpio.h @@ -21,8 +21,10 @@ #define IMX_GPIO_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IMX_GPIO "imx.gpio" +typedef struct IMXGPIOState IMXGPIOState; #define IMX_GPIO(obj) OBJECT_CHECK(IMXGPIOState, (obj), TYPE_IMX_GPIO) =20 #define IMX_GPIO_MEM_SIZE 0x20 @@ -39,7 +41,7 @@ =20 #define IMX_GPIO_PIN_COUNT 32 =20 -typedef struct IMXGPIOState { +struct IMXGPIOState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -58,6 +60,6 @@ typedef struct IMXGPIOState { =20 qemu_irq irq[2]; qemu_irq output[IMX_GPIO_PIN_COUNT]; -} IMXGPIOState; +}; =20 #endif /* IMX_GPIO_H */ diff --git a/include/hw/gpio/nrf51_gpio.h b/include/hw/gpio/nrf51_gpio.h index 1d62bbc928..0c37dd74c0 100644 --- a/include/hw/gpio/nrf51_gpio.h +++ b/include/hw/gpio/nrf51_gpio.h @@ -27,7 +27,9 @@ #define NRF51_GPIO_H =20 #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_NRF51_GPIO "nrf51_soc.gpio" +typedef struct NRF51GPIOState NRF51GPIOState; #define NRF51_GPIO(obj) OBJECT_CHECK(NRF51GPIOState, (obj), TYPE_NRF51_GPI= O) =20 #define NRF51_GPIO_PINS 32 @@ -47,7 +49,7 @@ #define NRF51_GPIO_PULLDOWN 1 #define NRF51_GPIO_PULLUP 3 =20 -typedef struct NRF51GPIOState { +struct NRF51GPIOState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -63,7 +65,7 @@ typedef struct NRF51GPIOState { uint32_t old_out_connected; =20 qemu_irq output[NRF51_GPIO_PINS]; -} NRF51GPIOState; +}; =20 =20 #endif diff --git a/include/hw/hotplug.h b/include/hw/hotplug.h index 6321e292fd..6536bb01a3 100644 --- a/include/hw/hotplug.h +++ b/include/hw/hotplug.h @@ -16,6 +16,7 @@ =20 #define TYPE_HOTPLUG_HANDLER "hotplug-handler" =20 +typedef struct HotplugHandlerClass HotplugHandlerClass; #define HOTPLUG_HANDLER_CLASS(klass) \ OBJECT_CLASS_CHECK(HotplugHandlerClass, (klass), TYPE_HOTPLUG_HANDLER) #define HOTPLUG_HANDLER_GET_CLASS(obj) \ @@ -50,7 +51,7 @@ typedef void (*hotplug_fn)(HotplugHandler *plug_handler, * Used for device removal with devices that implement * asynchronous and synchronous (surprise) removal. */ -typedef struct HotplugHandlerClass { +struct HotplugHandlerClass { /* */ InterfaceClass parent; =20 @@ -59,7 +60,7 @@ typedef struct HotplugHandlerClass { hotplug_fn plug; hotplug_fn unplug_request; hotplug_fn unplug; -} HotplugHandlerClass; +}; =20 /** * hotplug_handler_plug: diff --git a/include/hw/hyperv/vmbus-bridge.h b/include/hw/hyperv/vmbus-bri= dge.h index fe90bda01b..d090d46651 100644 --- a/include/hw/hyperv/vmbus-bridge.h +++ b/include/hw/hyperv/vmbus-bridge.h @@ -12,16 +12,18 @@ =20 #include "hw/sysbus.h" #include "hw/hyperv/vmbus.h" +#include "qom/object.h" =20 #define TYPE_VMBUS_BRIDGE "vmbus-bridge" =20 -typedef struct VMBusBridge { +struct VMBusBridge { SysBusDevice parent_obj; =20 uint8_t irq; =20 VMBus *bus; -} VMBusBridge; +}; +typedef struct VMBusBridge VMBusBridge; =20 #define VMBUS_BRIDGE(obj) OBJECT_CHECK(VMBusBridge, (obj), TYPE_VMBUS_BRID= GE) =20 diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h index cd98ec24e7..282399b8ce 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -16,9 +16,12 @@ #include "migration/vmstate.h" #include "hw/hyperv/vmbus-proto.h" #include "qemu/uuid.h" +#include "qom/object.h" =20 #define TYPE_VMBUS_DEVICE "vmbus-dev" =20 +typedef struct VMBusDevice VMBusDevice; +typedef struct VMBusDeviceClass VMBusDeviceClass; #define VMBUS_DEVICE(obj) \ OBJECT_CHECK(VMBusDevice, (obj), TYPE_VMBUS_DEVICE) #define VMBUS_DEVICE_CLASS(klass) \ @@ -44,11 +47,10 @@ typedef struct VMBusChannel VMBusChannel; * Base class for VMBus devices. Includes one or more channels. Identifi= ed by * class GUID and instance GUID. */ -typedef struct VMBusDevice VMBusDevice; =20 typedef void(*VMBusChannelNotifyCb)(struct VMBusChannel *chan); =20 -typedef struct VMBusDeviceClass { +struct VMBusDeviceClass { DeviceClass parent; =20 QemuUUID classid; @@ -80,7 +82,7 @@ typedef struct VMBusDeviceClass { * side, when there's work to do with the data in the channel ring buf= fers. */ VMBusChannelNotifyCb chan_notify_cb; -} VMBusDeviceClass; +}; =20 struct VMBusDevice { DeviceState parent; diff --git a/include/hw/i2c/arm_sbcon_i2c.h b/include/hw/i2c/arm_sbcon_i2c.h index 5d96507ab6..ca54867964 100644 --- a/include/hw/i2c/arm_sbcon_i2c.h +++ b/include/hw/i2c/arm_sbcon_i2c.h @@ -14,14 +14,16 @@ =20 #include "hw/sysbus.h" #include "hw/i2c/bitbang_i2c.h" +#include "qom/object.h" =20 #define TYPE_VERSATILE_I2C "versatile_i2c" #define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C =20 +typedef struct ArmSbconI2CState ArmSbconI2CState; #define ARM_SBCON_I2C(obj) \ OBJECT_CHECK(ArmSbconI2CState, (obj), TYPE_ARM_SBCON_I2C) =20 -typedef struct ArmSbconI2CState { +struct ArmSbconI2CState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -30,6 +32,6 @@ typedef struct ArmSbconI2CState { bitbang_i2c_interface bitbang; int out; int in; -} ArmSbconI2CState; +}; =20 #endif /* HW_I2C_ARM_SBCON_H */ diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index 243789ae5d..2c0198e314 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -23,11 +23,14 @@ =20 #include "hw/i2c/i2c.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_I2C "aspeed.i2c" #define TYPE_ASPEED_2400_I2C TYPE_ASPEED_I2C "-ast2400" #define TYPE_ASPEED_2500_I2C TYPE_ASPEED_I2C "-ast2500" #define TYPE_ASPEED_2600_I2C TYPE_ASPEED_I2C "-ast2600" +typedef struct AspeedI2CClass AspeedI2CClass; +typedef struct AspeedI2CState AspeedI2CState; #define ASPEED_I2C(obj) \ OBJECT_CHECK(AspeedI2CState, (obj), TYPE_ASPEED_I2C) =20 @@ -56,7 +59,7 @@ typedef struct AspeedI2CBus { uint32_t dma_len; } AspeedI2CBus; =20 -typedef struct AspeedI2CState { +struct AspeedI2CState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -70,14 +73,14 @@ typedef struct AspeedI2CState { AspeedI2CBus busses[ASPEED_I2C_NR_BUSSES]; MemoryRegion *dram_mr; AddressSpace dram_as; -} AspeedI2CState; +}; =20 #define ASPEED_I2C_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedI2CClass, (klass), TYPE_ASPEED_I2C) #define ASPEED_I2C_GET_CLASS(obj) \ OBJECT_GET_CLASS(AspeedI2CClass, (obj), TYPE_ASPEED_I2C) =20 -typedef struct AspeedI2CClass { +struct AspeedI2CClass { SysBusDeviceClass parent_class; =20 uint8_t num_busses; @@ -91,7 +94,7 @@ typedef struct AspeedI2CClass { bool check_sram; bool has_dma; =20 -} AspeedI2CClass; +}; =20 I2CBus *aspeed_i2c_get_bus(AspeedI2CState *s, int busnr); =20 diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index f57808851e..a22f861451 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -2,6 +2,7 @@ #define QEMU_I2C_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 /* The QEMU I2C implementation only supports simple transfers that complete immediately. It does not support slave devices that need to be able to @@ -18,6 +19,7 @@ enum i2c_event { typedef struct I2CSlave I2CSlave; =20 #define TYPE_I2C_SLAVE "i2c-slave" +typedef struct I2CSlaveClass I2CSlaveClass; #define I2C_SLAVE(obj) \ OBJECT_CHECK(I2CSlave, (obj), TYPE_I2C_SLAVE) #define I2C_SLAVE_CLASS(klass) \ @@ -25,7 +27,7 @@ typedef struct I2CSlave I2CSlave; #define I2C_SLAVE_GET_CLASS(obj) \ OBJECT_GET_CLASS(I2CSlaveClass, (obj), TYPE_I2C_SLAVE) =20 -typedef struct I2CSlaveClass { +struct I2CSlaveClass { DeviceClass parent_class; =20 /* Master to slave. Returns non-zero for a NAK, 0 for success. */ @@ -43,7 +45,7 @@ typedef struct I2CSlaveClass { * return code is not used and should be zero. */ int (*event)(I2CSlave *s, enum i2c_event event); -} I2CSlaveClass; +}; =20 struct I2CSlave { DeviceState qdev; diff --git a/include/hw/i2c/imx_i2c.h b/include/hw/i2c/imx_i2c.h index 7c73a1fa28..285a8f40a4 100644 --- a/include/hw/i2c/imx_i2c.h +++ b/include/hw/i2c/imx_i2c.h @@ -22,8 +22,10 @@ #define IMX_I2C_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IMX_I2C "imx.i2c" +typedef struct IMXI2CState IMXI2CState; #define IMX_I2C(obj) OBJECT_CHECK(IMXI2CState, (obj), TYPE_IMX_I2C) =20 #define IMX_I2C_MEM_SIZE 0x14 @@ -65,7 +67,7 @@ =20 #define ADDR_RESET 0xFF00 =20 -typedef struct IMXI2CState { +struct IMXI2CState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -82,6 +84,6 @@ typedef struct IMXI2CState { uint16_t i2sr; uint16_t i2dr_read; uint16_t i2dr_write; -} IMXI2CState; +}; =20 #endif /* IMX_I2C_H */ diff --git a/include/hw/i2c/microbit_i2c.h b/include/hw/i2c/microbit_i2c.h index 2bff36680c..76ffaff47a 100644 --- a/include/hw/i2c/microbit_i2c.h +++ b/include/hw/i2c/microbit_i2c.h @@ -13,6 +13,7 @@ =20 #include "hw/sysbus.h" #include "hw/arm/nrf51.h" +#include "qom/object.h" =20 #define NRF51_TWI_TASK_STARTRX 0x000 #define NRF51_TWI_TASK_STARTTX 0x008 @@ -26,17 +27,18 @@ #define NRF51_TWI_REG_ADDRESS 0x588 =20 #define TYPE_MICROBIT_I2C "microbit.i2c" +typedef struct MicrobitI2CState MicrobitI2CState; #define MICROBIT_I2C(obj) \ OBJECT_CHECK(MicrobitI2CState, (obj), TYPE_MICROBIT_I2C) =20 #define MICROBIT_I2C_NREGS (NRF51_PERIPHERAL_SIZE / sizeof(uint32_t)) =20 -typedef struct { +struct MicrobitI2CState { SysBusDevice parent_obj; =20 MemoryRegion iomem; uint32_t regs[MICROBIT_I2C_NREGS]; uint32_t read_idx; -} MicrobitI2CState; +}; =20 #endif /* MICROBIT_I2C_H */ diff --git a/include/hw/i2c/ppc4xx_i2c.h b/include/hw/i2c/ppc4xx_i2c.h index f6f837fbec..3698e054b1 100644 --- a/include/hw/i2c/ppc4xx_i2c.h +++ b/include/hw/i2c/ppc4xx_i2c.h @@ -29,11 +29,13 @@ =20 #include "hw/sysbus.h" #include "hw/i2c/bitbang_i2c.h" +#include "qom/object.h" =20 #define TYPE_PPC4xx_I2C "ppc4xx-i2c" +typedef struct PPC4xxI2CState PPC4xxI2CState; #define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2= C) =20 -typedef struct PPC4xxI2CState { +struct PPC4xxI2CState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -57,6 +59,6 @@ typedef struct PPC4xxI2CState { uint8_t xfrcnt; uint8_t xtcntlss; uint8_t directcntl; -} PPC4xxI2CState; +}; =20 #endif /* PPC4XX_I2C_H */ diff --git a/include/hw/i2c/smbus_slave.h b/include/hw/i2c/smbus_slave.h index ebe068304e..17f2cd2d8d 100644 --- a/include/hw/i2c/smbus_slave.h +++ b/include/hw/i2c/smbus_slave.h @@ -26,8 +26,11 @@ #define HW_SMBUS_SLAVE_H =20 #include "hw/i2c/i2c.h" +#include "qom/object.h" =20 #define TYPE_SMBUS_DEVICE "smbus-device" +typedef struct SMBusDevice SMBusDevice; +typedef struct SMBusDeviceClass SMBusDeviceClass; #define SMBUS_DEVICE(obj) \ OBJECT_CHECK(SMBusDevice, (obj), TYPE_SMBUS_DEVICE) #define SMBUS_DEVICE_CLASS(klass) \ @@ -35,10 +38,8 @@ #define SMBUS_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SMBusDeviceClass, (obj), TYPE_SMBUS_DEVICE) =20 -typedef struct SMBusDevice SMBusDevice; =20 -typedef struct SMBusDeviceClass -{ +struct SMBusDeviceClass { I2CSlaveClass parent_class; =20 /* @@ -67,7 +68,7 @@ typedef struct SMBusDeviceClass * return 0xff in that case. */ uint8_t (*receive_byte)(SMBusDevice *dev); -} SMBusDeviceClass; +}; =20 #define SMBUS_DATA_MAX_LEN 34 /* command + len + 32 bytes of data. */ =20 diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_interna= l.h index 2597000e03..124f1fad6f 100644 --- a/include/hw/i386/apic_internal.h +++ b/include/hw/i386/apic_internal.h @@ -25,6 +25,7 @@ #include "exec/memory.h" #include "qemu/timer.h" #include "target/i386/cpu-qom.h" +#include "qom/object.h" =20 /* APIC Local Vector Table */ #define APIC_LVT_TIMER 0 @@ -125,6 +126,7 @@ typedef struct APICCommonState APICCommonState; =20 #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) \ @@ -132,8 +134,7 @@ typedef struct APICCommonState APICCommonState; #define APIC_COMMON_GET_CLASS(obj) \ OBJECT_GET_CLASS(APICCommonClass, (obj), TYPE_APIC_COMMON) =20 -typedef struct APICCommonClass -{ +struct APICCommonClass { DeviceClass parent_class; =20 DeviceRealize realize; @@ -151,7 +152,7 @@ typedef struct APICCommonClass * device, but it's convenient to have it here for now. */ void (*send_msi)(MSIMessage *msi); -} APICCommonClass; +}; =20 struct APICCommonState { /*< private >*/ diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index a98d10b252..8fdac227f2 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -11,6 +11,7 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" #include "hw/pci/pci_bus.h" +#include "qom/object.h" =20 void ich9_lpc_set_irq(void *opaque, int irq_num, int level); int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx); @@ -23,10 +24,11 @@ void ich9_generate_smi(void); #define ICH9_CC_SIZE (16 * 1024) /* 16KB. Chipset configuration registers = */ =20 #define TYPE_ICH9_LPC_DEVICE "ICH9-LPC" +typedef struct ICH9LPCState ICH9LPCState; #define ICH9_LPC_DEVICE(obj) \ OBJECT_CHECK(ICH9LPCState, (obj), TYPE_ICH9_LPC_DEVICE) =20 -typedef struct ICH9LPCState { +struct ICH9LPCState { /* ICH9 LPC PCI to ISA bridge */ PCIDevice d; =20 @@ -77,7 +79,7 @@ typedef struct ICH9LPCState { Notifier machine_ready; =20 qemu_irq gsi[GSI_NUM_PINS]; -} ICH9LPCState; +}; =20 #define Q35_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index 3870052f5f..53e5d32d54 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -24,8 +24,10 @@ =20 #include "hw/i386/x86-iommu.h" #include "qemu/iova-tree.h" +#include "qom/object.h" =20 #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu" +typedef struct IntelIOMMUState IntelIOMMUState; #define INTEL_IOMMU_DEVICE(obj) \ OBJECT_CHECK(IntelIOMMUState, (obj), TYPE_INTEL_IOMMU_DEVICE) =20 @@ -56,7 +58,6 @@ =20 typedef struct VTDContextEntry VTDContextEntry; typedef struct VTDContextCacheEntry VTDContextCacheEntry; -typedef struct IntelIOMMUState IntelIOMMUState; typedef struct VTDAddressSpace VTDAddressSpace; typedef struct VTDIOTLBEntry VTDIOTLBEntry; typedef struct VTDBus VTDBus; diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_int= ernal.h index fe06938bda..29ae150727 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -25,6 +25,7 @@ #include "exec/memory.h" #include "hw/sysbus.h" #include "qemu/notify.h" +#include "qom/object.h" =20 #define MAX_IOAPICS 1 =20 @@ -84,6 +85,7 @@ typedef struct IOAPICCommonState IOAPICCommonState; =20 #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) \ @@ -91,14 +93,14 @@ typedef struct IOAPICCommonState IOAPICCommonState; #define IOAPIC_COMMON_GET_CLASS(obj) \ OBJECT_GET_CLASS(IOAPICCommonClass, (obj), TYPE_IOAPIC_COMMON) =20 -typedef struct IOAPICCommonClass { +struct IOAPICCommonClass { SysBusDeviceClass parent_class; =20 DeviceRealize realize; DeviceUnrealize unrealize; void (*pre_save)(IOAPICCommonState *s); void (*post_load)(IOAPICCommonState *s); -} IOAPICCommonClass; +}; =20 struct IOAPICCommonState { SysBusDevice busdev; diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h index fd34b78e0d..0556f64206 100644 --- a/include/hw/i386/microvm.h +++ b/include/hw/i386/microvm.h @@ -24,6 +24,7 @@ =20 #include "hw/boards.h" #include "hw/i386/x86.h" +#include "qom/object.h" =20 /* Platform virtio definitions */ #define VIRTIO_MMIO_BASE 0xfeb00000 @@ -39,13 +40,14 @@ #define MICROVM_MACHINE_OPTION_ROMS "x-option-roms" #define MICROVM_MACHINE_AUTO_KERNEL_CMDLINE "auto-kernel-cmdline" =20 -typedef struct { +struct MicrovmMachineClass { X86MachineClass parent; HotplugHandler *(*orig_hotplug_handler)(MachineState *machine, DeviceState *dev); -} MicrovmMachineClass; +}; +typedef struct MicrovmMachineClass MicrovmMachineClass; =20 -typedef struct { +struct MicrovmMachineState { X86MachineState parent; =20 /* Machine type options */ @@ -58,7 +60,8 @@ typedef struct { =20 /* Machine state */ bool kernel_cmdline_fixed; -} MicrovmMachineState; +}; +typedef struct MicrovmMachineState MicrovmMachineState; =20 #define TYPE_MICROVM_MACHINE MACHINE_TYPE_NAME("microvm") #define MICROVM_MACHINE(obj) \ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index fe52e165b2..602b57dc5d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -10,6 +10,7 @@ =20 #include "hw/acpi/acpi_dev_interface.h" #include "hw/hotplug.h" +#include "qom/object.h" =20 #define HPET_INTCAP "hpet-intcap" =20 @@ -76,7 +77,7 @@ struct PCMachineState { * way we can use 1GByte pages in the host. * */ -typedef struct PCMachineClass { +struct PCMachineClass { /*< private >*/ X86MachineClass parent_class; =20 @@ -118,7 +119,8 @@ typedef struct PCMachineClass { =20 /* use PVH to load kernels that support this feature */ bool pvh_enabled; -} PCMachineClass; +}; +typedef struct PCMachineClass PCMachineClass; =20 #define TYPE_PC_MACHINE "generic-pc-machine" #define PC_MACHINE(obj) \ diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h index 18420ada15..dae2eab800 100644 --- a/include/hw/i386/x86-iommu.h +++ b/include/hw/i386/x86-iommu.h @@ -23,8 +23,11 @@ #include "hw/sysbus.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" +#include "qom/object.h" =20 #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) \ @@ -34,8 +37,6 @@ =20 #define X86_IOMMU_SID_INVALID (0xffff) =20 -typedef struct X86IOMMUState X86IOMMUState; -typedef struct X86IOMMUClass X86IOMMUClass; typedef struct X86IOMMUIrq X86IOMMUIrq; typedef struct X86IOMMU_MSIMessage X86IOMMU_MSIMessage; =20 diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 4d9a26326d..42d46cc404 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -26,8 +26,9 @@ #include "hw/nmi.h" #include "hw/isa/isa.h" #include "hw/i386/ioapic.h" +#include "qom/object.h" =20 -typedef struct { +struct X86MachineClass { /*< private >*/ MachineClass parent; =20 @@ -37,9 +38,10 @@ typedef struct { bool save_tsc_khz; /* Enables contiguous-apic-ID mode */ bool compat_apic_id_mode; -} X86MachineClass; +}; +typedef struct X86MachineClass X86MachineClass; =20 -typedef struct { +struct X86MachineState { /*< private >*/ MachineState parent; =20 @@ -68,7 +70,8 @@ typedef struct { * will be translated to MSI messages in the address space. */ AddressSpace *ioapic_as; -} X86MachineState; +}; +typedef struct X86MachineState X86MachineState; =20 #define X86_MACHINE_SMM "smm" #define X86_MACHINE_ACPI "acpi" diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index 41bb517047..110269f152 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -25,6 +25,7 @@ #define HW_IDE_AHCI_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 typedef struct AHCIDevice AHCIDevice; =20 @@ -60,31 +61,33 @@ int32_t ahci_get_num_ports(PCIDevice *dev); void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); =20 #define TYPE_SYSBUS_AHCI "sysbus-ahci" +typedef struct SysbusAHCIState SysbusAHCIState; #define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_= AHCI) =20 -typedef struct SysbusAHCIState { +struct SysbusAHCIState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ =20 AHCIState ahci; uint32_t num_ports; -} SysbusAHCIState; +}; =20 #define TYPE_ALLWINNER_AHCI "allwinner-ahci" +typedef struct AllwinnerAHCIState AllwinnerAHCIState; #define ALLWINNER_AHCI(obj) \ OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI) =20 #define ALLWINNER_AHCI_MMIO_OFF 0x80 #define ALLWINNER_AHCI_MMIO_SIZE 0x80 =20 -typedef struct AllwinnerAHCIState { +struct AllwinnerAHCIState { /*< private >*/ SysbusAHCIState parent_obj; /*< public >*/ =20 MemoryRegion mmio; uint32_t regs[ALLWINNER_AHCI_MMIO_SIZE/4]; -} AllwinnerAHCIState; +}; =20 #endif /* HW_IDE_AHCI_H */ diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 1a7869e85d..74ea1e324c 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -17,6 +17,7 @@ =20 /* debug IDE devices */ #define USE_DMA_CDROM +#include "qom/object.h" =20 typedef struct IDEBus IDEBus; typedef struct IDEDevice IDEDevice; @@ -486,6 +487,7 @@ struct IDEBus { }; =20 #define TYPE_IDE_DEVICE "ide-device" +typedef struct IDEDeviceClass IDEDeviceClass; #define IDE_DEVICE(obj) \ OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE) #define IDE_DEVICE_CLASS(klass) \ @@ -493,10 +495,10 @@ struct IDEBus { #define IDE_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE) =20 -typedef struct IDEDeviceClass { +struct IDEDeviceClass { DeviceClass parent_class; void (*realize)(IDEDevice *dev, Error **errp); -} IDEDeviceClass; +}; =20 struct IDEDevice { DeviceState qdev; diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index dd504e5a0b..7ed1fa101d 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -3,6 +3,7 @@ =20 #include "hw/ide/internal.h" #include "hw/pci/pci.h" +#include "qom/object.h" =20 #define BM_STATUS_DMAING 0x01 #define BM_STATUS_ERROR 0x02 @@ -39,9 +40,10 @@ typedef struct BMDMAState { } BMDMAState; =20 #define TYPE_PCI_IDE "pci-ide" +typedef struct PCIIDEState PCIIDEState; #define PCI_IDE(obj) OBJECT_CHECK(PCIIDEState, (obj), TYPE_PCI_IDE) =20 -typedef struct PCIIDEState { +struct PCIIDEState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -52,7 +54,7 @@ typedef struct PCIIDEState { MemoryRegion bmdma_bar; MemoryRegion cmd_bar[2]; MemoryRegion data_bar[2]; -} PCIIDEState; +}; =20 static inline IDEState *bmdma_active_if(BMDMAState *bmdma) { diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h index bb75a7b1e3..ad89a21176 100644 --- a/include/hw/input/adb.h +++ b/include/hw/input/adb.h @@ -27,6 +27,7 @@ #define ADB_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define MAX_ADB_DEVICES 16 =20 @@ -42,6 +43,7 @@ typedef int ADBDeviceRequest(ADBDevice *d, uint8_t *buf_o= ut, typedef bool ADBDeviceHasData(ADBDevice *d); =20 #define TYPE_ADB_DEVICE "adb-device" +typedef struct ADBDeviceClass ADBDeviceClass; #define ADB_DEVICE(obj) OBJECT_CHECK(ADBDevice, (obj), TYPE_ADB_DEVICE) =20 struct ADBDevice { @@ -58,14 +60,14 @@ struct ADBDevice { #define ADB_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(ADBDeviceClass, (obj), TYPE_ADB_DEVICE) =20 -typedef struct ADBDeviceClass { +struct ADBDeviceClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ =20 ADBDeviceRequest *devreq; ADBDeviceHasData *devhasdata; -} ADBDeviceClass; +}; =20 #define TYPE_ADB_BUS "apple-desktop-bus" #define ADB_BUS(obj) OBJECT_CHECK(ADBBusState, (obj), TYPE_ADB_BUS) diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index 4569dfddd9..d4bf584699 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -9,13 +9,14 @@ #define HW_INPUT_I8042_H =20 #include "hw/isa/isa.h" +#include "qom/object.h" =20 #define TYPE_I8042 "i8042" +typedef struct ISAKBDState ISAKBDState; #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042) =20 #define I8042_A20_LINE "a20" =20 -typedef struct ISAKBDState ISAKBDState; =20 void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, MemoryRegion *region, ram_addr_t size, diff --git a/include/hw/intc/allwinner-a10-pic.h b/include/hw/intc/allwinne= r-a10-pic.h index a5895401d1..692d2a88d0 100644 --- a/include/hw/intc/allwinner-a10-pic.h +++ b/include/hw/intc/allwinner-a10-pic.h @@ -2,8 +2,10 @@ #define ALLWINNER_A10_PIC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_AW_A10_PIC "allwinner-a10-pic" +typedef struct AwA10PICState AwA10PICState; #define AW_A10_PIC(obj) OBJECT_CHECK(AwA10PICState, (obj), TYPE_AW_A10_PIC) =20 #define AW_A10_PIC_VECTOR 0 @@ -19,7 +21,7 @@ #define AW_A10_PIC_INT_NR 95 #define AW_A10_PIC_REG_NUM DIV_ROUND_UP(AW_A10_PIC_INT_NR, 32) =20 -typedef struct AwA10PICState { +struct AwA10PICState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -37,6 +39,6 @@ typedef struct AwA10PICState { uint32_t enable[AW_A10_PIC_REG_NUM]; uint32_t mask[AW_A10_PIC_REG_NUM]; /*priority setting here*/ -} AwA10PICState; +}; =20 #endif diff --git a/include/hw/intc/arm_gic.h b/include/hw/intc/arm_gic.h index 303b9748cb..704ef2b751 100644 --- a/include/hw/intc/arm_gic.h +++ b/include/hw/intc/arm_gic.h @@ -65,6 +65,7 @@ #define HW_ARM_GIC_H =20 #include "arm_gic_common.h" +#include "qom/object.h" =20 /* Number of SGI target-list bits */ #define GIC_TARGETLIST_BITS 8 @@ -72,6 +73,7 @@ #define GIC_MIN_PRIORITY_BITS 4 =20 #define TYPE_ARM_GIC "arm_gic" +typedef struct ARMGICClass ARMGICClass; #define ARM_GIC(obj) \ OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC) #define ARM_GIC_CLASS(klass) \ @@ -79,12 +81,12 @@ #define ARM_GIC_GET_CLASS(obj) \ OBJECT_GET_CLASS(ARMGICClass, (obj), TYPE_ARM_GIC) =20 -typedef struct ARMGICClass { +struct ARMGICClass { /*< private >*/ ARMGICCommonClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; -} ARMGICClass; +}; =20 #endif diff --git a/include/hw/intc/arm_gic_common.h b/include/hw/intc/arm_gic_com= mon.h index 6e0d6b8a88..2cbde9b7a9 100644 --- a/include/hw/intc/arm_gic_common.h +++ b/include/hw/intc/arm_gic_common.h @@ -22,6 +22,7 @@ #define HW_ARM_GIC_COMMON_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 /* Maximum number of possible interrupts, determined by the GIC architectu= re */ #define GIC_MAXIRQ 1020 @@ -61,7 +62,7 @@ typedef struct gic_irq_state { uint8_t group; } gic_irq_state; =20 -typedef struct GICState { +struct GICState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -143,9 +144,11 @@ typedef struct GICState { bool irq_reset_nonsecure; /* configure IRQs as group 1 (NS) on reset? = */ int dev_fd; /* kvm device fd if backed by kvm vgic support */ Error *migration_blocker; -} GICState; +}; +typedef struct GICState GICState; =20 #define TYPE_ARM_GIC_COMMON "arm_gic_common" +typedef struct ARMGICCommonClass ARMGICCommonClass; #define ARM_GIC_COMMON(obj) \ OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC_COMMON) #define ARM_GIC_COMMON_CLASS(klass) \ @@ -153,14 +156,14 @@ typedef struct GICState { #define ARM_GIC_COMMON_GET_CLASS(obj) \ OBJECT_GET_CLASS(ARMGICCommonClass, (obj), TYPE_ARM_GIC_COMMON) =20 -typedef struct ARMGICCommonClass { +struct ARMGICCommonClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ =20 void (*pre_save)(GICState *s); void (*post_load)(GICState *s); -} ARMGICCommonClass; +}; =20 void gic_init_irqs_and_mmio(GICState *s, qemu_irq_handler handler, const MemoryRegionOps *ops, diff --git a/include/hw/intc/arm_gicv3.h b/include/hw/intc/arm_gicv3.h index 4a6fd85e22..58e9131a33 100644 --- a/include/hw/intc/arm_gicv3.h +++ b/include/hw/intc/arm_gicv3.h @@ -13,20 +13,22 @@ #define HW_ARM_GICV3_H =20 #include "arm_gicv3_common.h" +#include "qom/object.h" =20 #define TYPE_ARM_GICV3 "arm-gicv3" +typedef struct ARMGICv3Class ARMGICv3Class; #define ARM_GICV3(obj) OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3) #define ARM_GICV3_CLASS(klass) \ OBJECT_CLASS_CHECK(ARMGICv3Class, (klass), TYPE_ARM_GICV3) #define ARM_GICV3_GET_CLASS(obj) \ OBJECT_GET_CLASS(ARMGICv3Class, (obj), TYPE_ARM_GICV3) =20 -typedef struct ARMGICv3Class { +struct ARMGICv3Class { /*< private >*/ ARMGICv3CommonClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; -} ARMGICv3Class; +}; =20 #endif diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3= _common.h index 31ec9a1ae4..86fb060320 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -26,6 +26,7 @@ =20 #include "hw/sysbus.h" #include "hw/intc/arm_gic_common.h" +#include "qom/object.h" =20 /* * Maximum number of possible interrupts, determined by the GIC architectu= re. @@ -279,6 +280,7 @@ GICV3_BITMAP_ACCESSORS(level) GICV3_BITMAP_ACCESSORS(edge_trigger) =20 #define TYPE_ARM_GICV3_COMMON "arm-gicv3-common" +typedef struct ARMGICv3CommonClass ARMGICv3CommonClass; #define ARM_GICV3_COMMON(obj) \ OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3_COMMON) #define ARM_GICV3_COMMON_CLASS(klass) \ @@ -286,14 +288,14 @@ GICV3_BITMAP_ACCESSORS(edge_trigger) #define ARM_GICV3_COMMON_GET_CLASS(obj) \ OBJECT_GET_CLASS(ARMGICv3CommonClass, (obj), TYPE_ARM_GICV3_COMMON) =20 -typedef struct ARMGICv3CommonClass { +struct ARMGICv3CommonClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ =20 void (*pre_save)(GICv3State *s); void (*post_load)(GICv3State *s); -} ARMGICv3CommonClass; +}; =20 void gicv3_init_irqs_and_mmio(GICv3State *s, qemu_irq_handler handler, const MemoryRegionOps *ops, Error **errp); diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_g= icv3_its_common.h index fd1fe64c03..03a0fa335b 100644 --- a/include/hw/intc/arm_gicv3_its_common.h +++ b/include/hw/intc/arm_gicv3_its_common.h @@ -23,6 +23,7 @@ =20 #include "hw/sysbus.h" #include "hw/intc/arm_gicv3_common.h" +#include "qom/object.h" =20 #define ITS_CONTROL_SIZE 0x10000 #define ITS_TRANS_SIZE 0x10000 @@ -64,6 +65,7 @@ typedef struct GICv3ITSState GICv3ITSState; void gicv3_its_init_mmio(GICv3ITSState *s, const MemoryRegionOps *ops); =20 #define TYPE_ARM_GICV3_ITS_COMMON "arm-gicv3-its-common" +typedef struct GICv3ITSCommonClass GICv3ITSCommonClass; #define ARM_GICV3_ITS_COMMON(obj) \ OBJECT_CHECK(GICv3ITSState, (obj), TYPE_ARM_GICV3_ITS_COMMON) #define ARM_GICV3_ITS_COMMON_CLASS(klass) \ @@ -81,6 +83,5 @@ struct GICv3ITSCommonClass { void (*post_load)(GICv3ITSState *s); }; =20 -typedef struct GICv3ITSCommonClass GICv3ITSCommonClass; =20 #endif diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h index a472c9b8f0..63098822fa 100644 --- a/include/hw/intc/armv7m_nvic.h +++ b/include/hw/intc/armv7m_nvic.h @@ -13,9 +13,11 @@ #include "target/arm/cpu.h" #include "hw/sysbus.h" #include "hw/timer/armv7m_systick.h" +#include "qom/object.h" =20 #define TYPE_NVIC "armv7m_nvic" =20 +typedef struct NVICState NVICState; #define NVIC(obj) \ OBJECT_CHECK(NVICState, (obj), TYPE_NVIC) =20 @@ -35,7 +37,7 @@ typedef struct VecInfo { uint8_t level; /* exceptions <=3D15 never set level */ } VecInfo; =20 -typedef struct NVICState { +struct NVICState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -88,6 +90,6 @@ typedef struct NVICState { qemu_irq sysresetreq; =20 SysTickState systick[M_REG_NUM_BANKS]; -} NVICState; +}; =20 #endif diff --git a/include/hw/intc/aspeed_vic.h b/include/hw/intc/aspeed_vic.h index 107ff17c3b..f8844b3327 100644 --- a/include/hw/intc/aspeed_vic.h +++ b/include/hw/intc/aspeed_vic.h @@ -14,13 +14,15 @@ #define ASPEED_VIC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_VIC "aspeed.vic" +typedef struct AspeedVICState AspeedVICState; #define ASPEED_VIC(obj) OBJECT_CHECK(AspeedVICState, (obj), TYPE_ASPEED_VI= C) =20 #define ASPEED_VIC_NR_IRQS 51 =20 -typedef struct AspeedVICState { +struct AspeedVICState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -43,6 +45,6 @@ typedef struct AspeedVICState { =20 /* 0=3Dlow-sensitive/falling-edge, 1=3Dhigh-sensitive/rising-edge */ uint64_t event; -} AspeedVICState; +}; =20 #endif /* ASPEED_VIC_H */ diff --git a/include/hw/intc/bcm2835_ic.h b/include/hw/intc/bcm2835_ic.h index 392ded1cb3..4a9f093025 100644 --- a/include/hw/intc/bcm2835_ic.h +++ b/include/hw/intc/bcm2835_ic.h @@ -9,14 +9,16 @@ #define BCM2835_IC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_IC "bcm2835-ic" +typedef struct BCM2835ICState BCM2835ICState; #define BCM2835_IC(obj) OBJECT_CHECK(BCM2835ICState, (obj), TYPE_BCM2835_I= C) =20 #define BCM2835_IC_GPU_IRQ "gpu-irq" #define BCM2835_IC_ARM_IRQ "arm-irq" =20 -typedef struct BCM2835ICState { +struct BCM2835ICState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -30,6 +32,6 @@ typedef struct BCM2835ICState { uint8_t arm_irq_level, arm_irq_enable; bool fiq_enable; uint8_t fiq_select; -} BCM2835ICState; +}; =20 #endif diff --git a/include/hw/intc/bcm2836_control.h b/include/hw/intc/bcm2836_co= ntrol.h index 2c22405686..7d8a51fc72 100644 --- a/include/hw/intc/bcm2836_control.h +++ b/include/hw/intc/bcm2836_control.h @@ -17,16 +17,18 @@ =20 #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" =20 /* 4 mailboxes per core, for 16 total */ #define BCM2836_NCORES 4 #define BCM2836_MBPERCORE 4 =20 #define TYPE_BCM2836_CONTROL "bcm2836-control" +typedef struct BCM2836ControlState BCM2836ControlState; #define BCM2836_CONTROL(obj) \ OBJECT_CHECK(BCM2836ControlState, (obj), TYPE_BCM2836_CONTROL) =20 -typedef struct BCM2836ControlState { +struct BCM2836ControlState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -56,6 +58,6 @@ typedef struct BCM2836ControlState { /* outputs to CPU cores */ qemu_irq irq[BCM2836_NCORES]; qemu_irq fiq[BCM2836_NCORES]; -} BCM2836ControlState; +}; =20 #endif diff --git a/include/hw/intc/heathrow_pic.h b/include/hw/intc/heathrow_pic.h index b163e27ab9..bd9fc115a8 100644 --- a/include/hw/intc/heathrow_pic.h +++ b/include/hw/intc/heathrow_pic.h @@ -27,8 +27,10 @@ #define HW_INTC_HEATHROW_PIC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_HEATHROW "heathrow" +typedef struct HeathrowState HeathrowState; #define HEATHROW(obj) OBJECT_CHECK(HeathrowState, (obj), TYPE_HEATHROW) =20 typedef struct HeathrowPICState { @@ -38,13 +40,13 @@ typedef struct HeathrowPICState { uint32_t level_triggered; } HeathrowPICState; =20 -typedef struct HeathrowState { +struct HeathrowState { SysBusDevice parent_obj; =20 MemoryRegion mem; HeathrowPICState pics[2]; qemu_irq irqs[1]; -} HeathrowState; +}; =20 #define HEATHROW_NUM_IRQS 64 =20 diff --git a/include/hw/intc/ibex_plic.h b/include/hw/intc/ibex_plic.h index d8eb09b258..0125b36267 100644 --- a/include/hw/intc/ibex_plic.h +++ b/include/hw/intc/ibex_plic.h @@ -20,12 +20,14 @@ #define HW_IBEX_PLIC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IBEX_PLIC "ibex-plic" +typedef struct IbexPlicState IbexPlicState; #define IBEX_PLIC(obj) \ OBJECT_CHECK(IbexPlicState, (obj), TYPE_IBEX_PLIC) =20 -typedef struct IbexPlicState { +struct IbexPlicState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -59,6 +61,6 @@ typedef struct IbexPlicState { uint32_t threshold_base; =20 uint32_t claim_base; -} IbexPlicState; +}; =20 #endif /* HW_IBEX_PLIC_H */ diff --git a/include/hw/intc/imx_avic.h b/include/hw/intc/imx_avic.h index 1b80769018..124f29f763 100644 --- a/include/hw/intc/imx_avic.h +++ b/include/hw/intc/imx_avic.h @@ -18,8 +18,10 @@ #define IMX_AVIC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IMX_AVIC "imx.avic" +typedef struct IMXAVICState IMXAVICState; #define IMX_AVIC(obj) OBJECT_CHECK(IMXAVICState, (obj), TYPE_IMX_AVIC) =20 #define IMX_AVIC_NUM_IRQS 64 @@ -36,7 +38,7 @@ #define PRIO_PER_WORD (sizeof(uint32_t) * 8 / 4) #define PRIO_WORDS (IMX_AVIC_NUM_IRQS/PRIO_PER_WORD) =20 -typedef struct IMXAVICState{ +struct IMXAVICState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -50,6 +52,6 @@ typedef struct IMXAVICState{ qemu_irq irq; qemu_irq fiq; uint32_t prio[PRIO_WORDS]; /* Priorities are 4-bits each */ -} IMXAVICState; +}; =20 #endif /* IMX_AVIC_H */ diff --git a/include/hw/intc/imx_gpcv2.h b/include/hw/intc/imx_gpcv2.h index ed978b24bb..66befda3fd 100644 --- a/include/hw/intc/imx_gpcv2.h +++ b/include/hw/intc/imx_gpcv2.h @@ -2,19 +2,21 @@ #define IMX_GPCV2_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 enum IMXGPCv2Registers { GPC_NUM =3D 0xE00 / sizeof(uint32_t), }; =20 -typedef struct IMXGPCv2State { +struct IMXGPCv2State { /*< private >*/ SysBusDevice parent_obj; =20 /*< public >*/ MemoryRegion iomem; uint32_t regs[GPC_NUM]; -} IMXGPCv2State; +}; +typedef struct IMXGPCv2State IMXGPCv2State; =20 #define TYPE_IMX_GPCV2 "imx-gpcv2" #define IMX_GPCV2(obj) OBJECT_CHECK(IMXGPCv2State, (obj), TYPE_IMX_GPCV2) diff --git a/include/hw/intc/intc.h b/include/hw/intc/intc.h index fb3e8e621f..b51c0ac0f4 100644 --- a/include/hw/intc/intc.h +++ b/include/hw/intc/intc.h @@ -5,6 +5,7 @@ =20 #define TYPE_INTERRUPT_STATS_PROVIDER "intctrl" =20 +typedef struct InterruptStatsProviderClass InterruptStatsProviderClass; #define INTERRUPT_STATS_PROVIDER_CLASS(klass) \ OBJECT_CLASS_CHECK(InterruptStatsProviderClass, (klass), \ TYPE_INTERRUPT_STATS_PROVIDER) @@ -17,7 +18,7 @@ =20 typedef struct InterruptStatsProvider InterruptStatsProvider; =20 -typedef struct InterruptStatsProviderClass { +struct InterruptStatsProviderClass { InterfaceClass parent; =20 /* The returned pointer and statistics must remain valid until @@ -26,6 +27,6 @@ typedef struct InterruptStatsProviderClass { bool (*get_statistics)(InterruptStatsProvider *obj, uint64_t **irq_cou= nts, unsigned int *nb_irqs); void (*print_info)(InterruptStatsProvider *obj, Monitor *mon); -} InterruptStatsProviderClass; +}; =20 #endif diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index 8428287bf9..5670421e62 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -15,6 +15,7 @@ #include "hw/timer/mips_gictimer.h" #include "hw/sysbus.h" #include "cpu.h" +#include "qom/object.h" /* * GIC Specific definitions */ @@ -170,13 +171,13 @@ #define GIC_LOCAL_INT_WD 0 /* GIC watchdog */ =20 #define TYPE_MIPS_GIC "mips-gic" +typedef struct MIPSGICState MIPSGICState; #define MIPS_GIC(obj) OBJECT_CHECK(MIPSGICState, (obj), TYPE_MIPS_GIC) =20 /* Support up to 32 VPs and 256 IRQs */ #define GIC_MAX_VPS 32 #define GIC_MAX_INTRS 256 =20 -typedef struct MIPSGICState MIPSGICState; typedef struct MIPSGICIRQState MIPSGICIRQState; typedef struct MIPSGICVPState MIPSGICVPState; =20 diff --git a/include/hw/intc/realview_gic.h b/include/hw/intc/realview_gic.h index 1783ea11b9..e633992b9c 100644 --- a/include/hw/intc/realview_gic.h +++ b/include/hw/intc/realview_gic.h @@ -12,17 +12,19 @@ =20 #include "hw/sysbus.h" #include "hw/intc/arm_gic.h" +#include "qom/object.h" =20 #define TYPE_REALVIEW_GIC "realview_gic" +typedef struct RealViewGICState RealViewGICState; #define REALVIEW_GIC(obj) \ OBJECT_CHECK(RealViewGICState, (obj), TYPE_REALVIEW_GIC) =20 -typedef struct RealViewGICState { +struct RealViewGICState { SysBusDevice parent_obj; =20 MemoryRegion container; =20 GICState gic; -} RealViewGICState; +}; =20 #endif diff --git a/include/hw/intc/rx_icu.h b/include/hw/intc/rx_icu.h index 7176015cd9..5660cb4e7f 100644 --- a/include/hw/intc/rx_icu.h +++ b/include/hw/intc/rx_icu.h @@ -22,6 +22,7 @@ #define HW_INTC_RX_ICU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 enum TRG_MODE { TRG_LEVEL =3D 0, diff --git a/include/hw/intc/xlnx-pmu-iomod-intc.h b/include/hw/intc/xlnx-p= mu-iomod-intc.h index 0bd118884a..fce35ac941 100644 --- a/include/hw/intc/xlnx-pmu-iomod-intc.h +++ b/include/hw/intc/xlnx-pmu-iomod-intc.h @@ -27,16 +27,18 @@ =20 #include "hw/sysbus.h" #include "hw/register.h" +#include "qom/object.h" =20 #define TYPE_XLNX_PMU_IO_INTC "xlnx.pmu_io_intc" =20 +typedef struct XlnxPMUIOIntc XlnxPMUIOIntc; #define XLNX_PMU_IO_INTC(obj) \ OBJECT_CHECK(XlnxPMUIOIntc, (obj), TYPE_XLNX_PMU_IO_INTC) =20 /* This is R_PIT3_CONTROL + 1 */ #define XLNXPMUIOINTC_R_MAX (0x78 + 1) =20 -typedef struct XlnxPMUIOIntc { +struct XlnxPMUIOIntc { SysBusDevice parent_obj; MemoryRegion iomem; =20 @@ -52,6 +54,6 @@ typedef struct XlnxPMUIOIntc { =20 uint32_t regs[XLNXPMUIOINTC_R_MAX]; RegisterInfo regs_info[XLNXPMUIOINTC_R_MAX]; -} XlnxPMUIOIntc; +}; =20 #endif /* HW_INTC_XLNX_PMU_IOMOD_INTC_H */ diff --git a/include/hw/intc/xlnx-zynqmp-ipi.h b/include/hw/intc/xlnx-zynqm= p-ipi.h index 866c719c6f..9044ca5afe 100644 --- a/include/hw/intc/xlnx-zynqmp-ipi.h +++ b/include/hw/intc/xlnx-zynqmp-ipi.h @@ -27,9 +27,11 @@ =20 #include "hw/sysbus.h" #include "hw/register.h" +#include "qom/object.h" =20 #define TYPE_XLNX_ZYNQMP_IPI "xlnx.zynqmp_ipi" =20 +typedef struct XlnxZynqMPIPI XlnxZynqMPIPI; #define XLNX_ZYNQMP_IPI(obj) \ OBJECT_CHECK(XlnxZynqMPIPI, (obj), TYPE_XLNX_ZYNQMP_IPI) =20 @@ -38,7 +40,7 @@ =20 #define NUM_IPIS 11 =20 -typedef struct XlnxZynqMPIPI { +struct XlnxZynqMPIPI { /* Private */ SysBusDevice parent_obj; =20 @@ -51,6 +53,6 @@ typedef struct XlnxZynqMPIPI { =20 uint32_t regs[R_XLNX_ZYNQMP_IPI_MAX]; RegisterInfo regs_info[R_XLNX_ZYNQMP_IPI_MAX]; -} XlnxZynqMPIPI; +}; =20 #endif /* XLNX_ZYNQMP_IPI_H */ diff --git a/include/hw/ipack/ipack.h b/include/hw/ipack/ipack.h index 1c07969bc9..ac6105ff8b 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -12,6 +12,7 @@ #define QEMU_IPACK_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 typedef struct IPackBus IPackBus; =20 diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index 8a99d958bb..742c400533 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -27,6 +27,7 @@ =20 #include "exec/memory.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define MAX_IPMI_MSG_SIZE 300 =20 @@ -109,6 +110,7 @@ uint32_t ipmi_next_uuid(void); #define TYPE_IPMI_INTERFACE "ipmi-interface" #define IPMI_INTERFACE(obj) \ INTERFACE_CHECK(IPMIInterface, (obj), TYPE_IPMI_INTERFACE) +typedef struct IPMIInterfaceClass IPMIInterfaceClass; #define IPMI_INTERFACE_CLASS(class) \ OBJECT_CLASS_CHECK(IPMIInterfaceClass, (class), TYPE_IPMI_INTERFACE) #define IPMI_INTERFACE_GET_CLASS(class) \ @@ -116,7 +118,7 @@ uint32_t ipmi_next_uuid(void); =20 typedef struct IPMIInterface IPMIInterface; =20 -typedef struct IPMIInterfaceClass { +struct IPMIInterfaceClass { InterfaceClass parent; =20 /* @@ -169,12 +171,14 @@ typedef struct IPMIInterfaceClass { * Return the firmware info for a device. */ void (*get_fwinfo)(struct IPMIInterface *s, IPMIFwInfo *info); -} IPMIInterfaceClass; +}; =20 /* * Define a BMC simulator (or perhaps a connection to a real BMC) */ #define TYPE_IPMI_BMC "ipmi-bmc" +typedef struct IPMIBmc IPMIBmc; +typedef struct IPMIBmcClass IPMIBmcClass; #define IPMI_BMC(obj) \ OBJECT_CHECK(IPMIBmc, (obj), TYPE_IPMI_BMC) #define IPMI_BMC_CLASS(obj_class) \ @@ -182,15 +186,15 @@ typedef struct IPMIInterfaceClass { #define IPMI_BMC_GET_CLASS(obj) \ OBJECT_GET_CLASS(IPMIBmcClass, (obj), TYPE_IPMI_BMC) =20 -typedef struct IPMIBmc { +struct IPMIBmc { DeviceState parent; =20 uint8_t slave_addr; =20 IPMIInterface *intf; -} IPMIBmc; +}; =20 -typedef struct IPMIBmcClass { +struct IPMIBmcClass { DeviceClass parent; =20 /* Called when the system resets to report to the bmc. */ @@ -203,7 +207,7 @@ typedef struct IPMIBmcClass { uint8_t *cmd, unsigned int cmd_len, unsigned int max_cmd_len, uint8_t msg_id); -} IPMIBmcClass; +}; =20 /* * Add a link property to obj that points to a BMC. @@ -267,10 +271,10 @@ int ipmi_bmc_sdr_find(IPMIBmc *b, uint16_t recid, void ipmi_bmc_gen_event(IPMIBmc *b, uint8_t *evt, bool log); =20 #define TYPE_IPMI_BMC_SIMULATOR "ipmi-bmc-sim" +typedef struct IPMIBmcSim IPMIBmcSim; #define IPMI_BMC_SIMULATOR(obj) OBJECT_CHECK(IPMIBmcSim, (obj), \ TYPE_IPMI_BMC_SIMULATOR) =20 -typedef struct IPMIBmcSim IPMIBmcSim; =20 typedef struct RspBuffer { uint8_t buffer[MAX_IPMI_MSG_SIZE]; diff --git a/include/hw/isa/i8259_internal.h b/include/hw/isa/i8259_interna= l.h index 861d70d8f8..69170df6f8 100644 --- a/include/hw/isa/i8259_internal.h +++ b/include/hw/isa/i8259_internal.h @@ -28,10 +28,12 @@ #include "hw/isa/isa.h" #include "hw/intc/intc.h" #include "hw/intc/i8259.h" +#include "qom/object.h" =20 typedef struct PICCommonState PICCommonState; =20 #define TYPE_PIC_COMMON "pic-common" +typedef struct PICCommonClass PICCommonClass; #define PIC_COMMON(obj) \ OBJECT_CHECK(PICCommonState, (obj), TYPE_PIC_COMMON) #define PIC_COMMON_CLASS(klass) \ @@ -39,13 +41,12 @@ typedef struct PICCommonState PICCommonState; #define PIC_COMMON_GET_CLASS(obj) \ OBJECT_GET_CLASS(PICCommonClass, (obj), TYPE_PIC_COMMON) =20 -typedef struct PICCommonClass -{ +struct PICCommonClass { ISADeviceClass parent_class; =20 void (*pre_save)(PICCommonState *s); void (*post_load)(PICCommonState *s); -} PICCommonClass; +}; =20 struct PICCommonState { ISADevice parent_obj; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 52b61eed88..c7f27d5aa9 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -6,10 +6,12 @@ #include "exec/memory.h" #include "exec/ioport.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define ISA_NUM_IRQS 16 =20 #define TYPE_ISA_DEVICE "isa-device" +typedef struct ISADeviceClass ISADeviceClass; #define ISA_DEVICE(obj) \ OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE) #define ISA_DEVICE_CLASS(klass) \ @@ -36,6 +38,7 @@ static inline uint16_t applesmc_port(void) =20 #define TYPE_ISADMA "isa-dma" =20 +typedef struct IsaDmaClass IsaDmaClass; #define ISADMA_CLASS(klass) \ OBJECT_CLASS_CHECK(IsaDmaClass, (klass), TYPE_ISADMA) #define ISADMA_GET_CLASS(obj) \ @@ -53,7 +56,7 @@ typedef enum { typedef int (*IsaDmaTransferHandler)(void *opaque, int nchan, int pos, int size); =20 -typedef struct IsaDmaClass { +struct IsaDmaClass { InterfaceClass parent; =20 bool (*has_autoinitialization)(IsaDma *obj, int nchan); @@ -65,12 +68,12 @@ typedef struct IsaDmaClass { void (*register_channel)(IsaDma *obj, int nchan, IsaDmaTransferHandler transfer_handler, void *opaque); -} IsaDmaClass; +}; =20 -typedef struct ISADeviceClass { +struct ISADeviceClass { DeviceClass parent_class; void (*build_aml)(ISADevice *dev, Aml *scope); -} ISADeviceClass; +}; =20 struct ISABus { /*< private >*/ diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index e16263d4b1..c8e98ea029 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -26,12 +26,14 @@ #define QEMU_PC87312_H =20 #include "hw/isa/superio.h" +#include "qom/object.h" =20 =20 #define TYPE_PC87312_SUPERIO "pc87312" +typedef struct PC87312State PC87312State; #define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERI= O) =20 -typedef struct PC87312State { +struct PC87312State { /*< private >*/ ISASuperIODevice parent_dev; /*< public >*/ @@ -49,7 +51,7 @@ typedef struct PC87312State { uint8_t selected_index; =20 uint8_t regs[3]; -} PC87312State; +}; =20 =20 #endif diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index 147cc0a7b7..c782c8b64e 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -12,8 +12,11 @@ =20 #include "sysemu/sysemu.h" #include "hw/isa/isa.h" +#include "qom/object.h" =20 #define TYPE_ISA_SUPERIO "isa-superio" +typedef struct ISASuperIOClass ISASuperIOClass; +typedef struct ISASuperIODevice ISASuperIODevice; #define ISA_SUPERIO(obj) \ OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO) #define ISA_SUPERIO_GET_CLASS(obj) \ @@ -23,7 +26,7 @@ =20 #define SUPERIO_MAX_SERIAL_PORTS 4 =20 -typedef struct ISASuperIODevice { +struct ISASuperIODevice { /*< private >*/ ISADevice parent_obj; /*< public >*/ @@ -33,7 +36,7 @@ typedef struct ISASuperIODevice { ISADevice *floppy; ISADevice *kbc; ISADevice *ide; -} ISASuperIODevice; +}; =20 typedef struct ISASuperIOFuncs { size_t count; @@ -43,7 +46,7 @@ typedef struct ISASuperIOFuncs { unsigned int (*get_dma)(ISASuperIODevice *sio, uint8_t index); } ISASuperIOFuncs; =20 -typedef struct ISASuperIOClass { +struct ISASuperIOClass { /*< private >*/ ISADeviceClass parent_class; /*< public >*/ @@ -53,7 +56,7 @@ typedef struct ISASuperIOClass { ISASuperIOFuncs serial; ISASuperIOFuncs floppy; ISASuperIOFuncs ide; -} ISASuperIOClass; +}; =20 #define TYPE_FDC37M81X_SUPERIO "fdc37m81x-superio" #define TYPE_SMC37C669_SUPERIO "smc37c669-superio" diff --git a/include/hw/m68k/mcf_fec.h b/include/hw/m68k/mcf_fec.h index c09e33a57c..c8ece3cb4b 100644 --- a/include/hw/m68k/mcf_fec.h +++ b/include/hw/m68k/mcf_fec.h @@ -9,6 +9,7 @@ =20 #ifndef HW_M68K_MCF_FEC_H #define HW_M68K_MCF_FEC_H +#include "qom/object.h" =20 #define TYPE_MCF_FEC_NET "mcf-fec" typedef struct mcf_fec_state mcf_fec_state; diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h index 04476acb8f..d19bca5942 100644 --- a/include/hw/mem/memory-device.h +++ b/include/hw/mem/memory-device.h @@ -19,6 +19,7 @@ =20 #define TYPE_MEMORY_DEVICE "memory-device" =20 +typedef struct MemoryDeviceClass MemoryDeviceClass; #define MEMORY_DEVICE_CLASS(klass) \ OBJECT_CLASS_CHECK(MemoryDeviceClass, (klass), TYPE_MEMORY_DEVICE) #define MEMORY_DEVICE_GET_CLASS(obj) \ @@ -43,7 +44,7 @@ typedef struct MemoryDeviceState MemoryDeviceState; * be provided. Scattered memory regions are not supported for single * devices. */ -typedef struct MemoryDeviceClass { +struct MemoryDeviceClass { /* private */ InterfaceClass parent_class; =20 @@ -94,7 +95,7 @@ typedef struct MemoryDeviceClass { */ void (*fill_device_info)(const MemoryDeviceState *md, MemoryDeviceInfo *info); -} MemoryDeviceClass; +}; =20 MemoryDeviceInfoList *qmp_memory_device_list(void); uint64_t get_plugged_memory_size(void); diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index b67a1aedf6..4b4a4b5b17 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -27,6 +27,7 @@ #include "hw/acpi/bios-linker-loader.h" #include "qemu/uuid.h" #include "hw/acpi/aml-build.h" +#include "qom/object.h" =20 #define NVDIMM_DEBUG 0 #define nvdimm_debug(fmt, ...) \ @@ -45,6 +46,8 @@ #define MIN_NAMESPACE_LABEL_SIZE (128UL << 10) =20 #define TYPE_NVDIMM "nvdimm" +typedef struct NVDIMMClass NVDIMMClass; +typedef struct NVDIMMDevice NVDIMMDevice; #define NVDIMM(obj) OBJECT_CHECK(NVDIMMDevice, (obj), TYPE_NVDIMM) #define NVDIMM_CLASS(oc) OBJECT_CLASS_CHECK(NVDIMMClass, (oc), TYPE_NVDIMM) #define NVDIMM_GET_CLASS(obj) OBJECT_GET_CLASS(NVDIMMClass, (obj), \ @@ -92,7 +95,6 @@ struct NVDIMMDevice { */ QemuUUID uuid; }; -typedef struct NVDIMMDevice NVDIMMDevice; =20 struct NVDIMMClass { /* private */ @@ -107,7 +109,6 @@ struct NVDIMMClass { void (*write_label_data)(NVDIMMDevice *nvdimm, const void *buf, uint64_t size, uint64_t offset); }; -typedef struct NVDIMMClass NVDIMMClass; =20 #define NVDIMM_DSM_MEM_FILE "etc/acpi/nvdimm-mem" =20 diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 289edc0f3d..41d4ff39ba 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -18,8 +18,11 @@ =20 #include "exec/memory.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define TYPE_PC_DIMM "pc-dimm" +typedef struct PCDIMMDevice PCDIMMDevice; +typedef struct PCDIMMDeviceClass PCDIMMDeviceClass; #define PC_DIMM(obj) \ OBJECT_CHECK(PCDIMMDevice, (obj), TYPE_PC_DIMM) #define PC_DIMM_CLASS(oc) \ @@ -44,7 +47,7 @@ * Default value: -1, means that slot is auto-allocated. * @hostmem: host memory backend providing memory for @PCDIMMDevice */ -typedef struct PCDIMMDevice { +struct PCDIMMDevice { /* private */ DeviceState parent_obj; =20 @@ -53,7 +56,7 @@ typedef struct PCDIMMDevice { uint32_t node; int32_t slot; HostMemoryBackend *hostmem; -} PCDIMMDevice; +}; =20 /** * PCDIMMDeviceClass: @@ -63,7 +66,7 @@ typedef struct PCDIMMDevice { * memory of @dimm should be kept during live migration. Will not fail * after the device was realized. */ -typedef struct PCDIMMDeviceClass { +struct PCDIMMDeviceClass { /* private */ DeviceClass parent_class; =20 @@ -71,7 +74,7 @@ typedef struct PCDIMMDeviceClass { void (*realize)(PCDIMMDevice *dimm, Error **errp); MemoryRegion *(*get_vmstate_memory_region)(PCDIMMDevice *dimm, Error **errp); -} PCDIMMDeviceClass; +}; =20 void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine, const uint64_t *legacy_align, Error **errp); diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h index a941c55f27..ab79a66b1d 100644 --- a/include/hw/mips/cps.h +++ b/include/hw/mips/cps.h @@ -26,11 +26,13 @@ #include "hw/misc/mips_cpc.h" #include "hw/misc/mips_itu.h" #include "target/mips/cpu.h" +#include "qom/object.h" =20 #define TYPE_MIPS_CPS "mips-cps" +typedef struct MIPSCPSState MIPSCPSState; #define MIPS_CPS(obj) OBJECT_CHECK(MIPSCPSState, (obj), TYPE_MIPS_CPS) =20 -typedef struct MIPSCPSState { +struct MIPSCPSState { SysBusDevice parent_obj; =20 uint32_t num_vp; @@ -42,7 +44,7 @@ typedef struct MIPSCPSState { MIPSGICState gic; MIPSCPCState cpc; MIPSITUState itu; -} MIPSCPSState; +}; =20 qemu_irq get_cps_irq(MIPSCPSState *cps, int pin_number); =20 diff --git a/include/hw/misc/a9scu.h b/include/hw/misc/a9scu.h index efb0c305c2..c5481f4dbb 100644 --- a/include/hw/misc/a9scu.h +++ b/include/hw/misc/a9scu.h @@ -11,10 +11,11 @@ #define HW_MISC_A9SCU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 /* A9MP private memory region. */ =20 -typedef struct A9SCUState { +struct A9SCUState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -23,7 +24,8 @@ typedef struct A9SCUState { uint32_t control; uint32_t status; uint32_t num_cpu; -} A9SCUState; +}; +typedef struct A9SCUState A9SCUState; =20 #define TYPE_A9_SCU "a9-scu" #define A9_SCU(obj) OBJECT_CHECK(A9SCUState, (obj), TYPE_A9_SCU) diff --git a/include/hw/misc/allwinner-cpucfg.h b/include/hw/misc/allwinner= -cpucfg.h index 2c3693a8be..f5420b11d5 100644 --- a/include/hw/misc/allwinner-cpucfg.h +++ b/include/hw/misc/allwinner-cpucfg.h @@ -29,6 +29,7 @@ */ =20 #define TYPE_AW_CPUCFG "allwinner-cpucfg" +typedef struct AwCpuCfgState AwCpuCfgState; #define AW_CPUCFG(obj) \ OBJECT_CHECK(AwCpuCfgState, (obj), TYPE_AW_CPUCFG) =20 @@ -37,7 +38,7 @@ /** * Allwinner CPU Configuration Module instance state */ -typedef struct AwCpuCfgState { +struct AwCpuCfgState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -47,6 +48,6 @@ typedef struct AwCpuCfgState { uint32_t super_standby; uint32_t entry_addr; =20 -} AwCpuCfgState; +}; =20 #endif /* HW_MISC_ALLWINNER_CPUCFG_H */ diff --git a/include/hw/misc/allwinner-h3-ccu.h b/include/hw/misc/allwinner= -h3-ccu.h index eec59649f3..60f0c56cd9 100644 --- a/include/hw/misc/allwinner-h3-ccu.h +++ b/include/hw/misc/allwinner-h3-ccu.h @@ -42,6 +42,7 @@ */ =20 #define TYPE_AW_H3_CCU "allwinner-h3-ccu" +typedef struct AwH3ClockCtlState AwH3ClockCtlState; #define AW_H3_CCU(obj) \ OBJECT_CHECK(AwH3ClockCtlState, (obj), TYPE_AW_H3_CCU) =20 @@ -50,7 +51,7 @@ /** * Allwinner H3 CCU object instance state. */ -typedef struct AwH3ClockCtlState { +struct AwH3ClockCtlState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -61,6 +62,6 @@ typedef struct AwH3ClockCtlState { /** Array of hardware registers */ uint32_t regs[AW_H3_CCU_REGS_NUM]; =20 -} AwH3ClockCtlState; +}; =20 #endif /* HW_MISC_ALLWINNER_H3_CCU_H */ diff --git a/include/hw/misc/allwinner-h3-dramc.h b/include/hw/misc/allwinn= er-h3-dramc.h index bacdf236b7..0538e598b0 100644 --- a/include/hw/misc/allwinner-h3-dramc.h +++ b/include/hw/misc/allwinner-h3-dramc.h @@ -58,6 +58,7 @@ */ =20 #define TYPE_AW_H3_DRAMC "allwinner-h3-dramc" +typedef struct AwH3DramCtlState AwH3DramCtlState; #define AW_H3_DRAMC(obj) \ OBJECT_CHECK(AwH3DramCtlState, (obj), TYPE_AW_H3_DRAMC) =20 @@ -66,7 +67,7 @@ /** * Allwinner H3 SDRAM Controller object instance state. */ -typedef struct AwH3DramCtlState { +struct AwH3DramCtlState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -101,6 +102,6 @@ typedef struct AwH3DramCtlState { =20 /** @} */ =20 -} AwH3DramCtlState; +}; =20 #endif /* HW_MISC_ALLWINNER_H3_DRAMC_H */ diff --git a/include/hw/misc/allwinner-h3-sysctrl.h b/include/hw/misc/allwi= nner-h3-sysctrl.h index af4119e026..7360698f8f 100644 --- a/include/hw/misc/allwinner-h3-sysctrl.h +++ b/include/hw/misc/allwinner-h3-sysctrl.h @@ -43,6 +43,7 @@ */ =20 #define TYPE_AW_H3_SYSCTRL "allwinner-h3-sysctrl" +typedef struct AwH3SysCtrlState AwH3SysCtrlState; #define AW_H3_SYSCTRL(obj) \ OBJECT_CHECK(AwH3SysCtrlState, (obj), TYPE_AW_H3_SYSCTRL) =20 @@ -51,7 +52,7 @@ /** * Allwinner H3 System Control object instance state */ -typedef struct AwH3SysCtrlState { +struct AwH3SysCtrlState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -62,6 +63,6 @@ typedef struct AwH3SysCtrlState { /** Array of hardware registers */ uint32_t regs[AW_H3_SYSCTRL_REGS_NUM]; =20 -} AwH3SysCtrlState; +}; =20 #endif /* HW_MISC_ALLWINNER_H3_SYSCTRL_H */ diff --git a/include/hw/misc/allwinner-sid.h b/include/hw/misc/allwinner-si= d.h index 4c1fa4762b..70cd7cc7c0 100644 --- a/include/hw/misc/allwinner-sid.h +++ b/include/hw/misc/allwinner-sid.h @@ -30,6 +30,7 @@ */ =20 #define TYPE_AW_SID "allwinner-sid" +typedef struct AwSidState AwSidState; #define AW_SID(obj) \ OBJECT_CHECK(AwSidState, (obj), TYPE_AW_SID) =20 @@ -38,7 +39,7 @@ /** * Allwinner Security ID object instance state */ -typedef struct AwSidState { +struct AwSidState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -55,6 +56,6 @@ typedef struct AwSidState { /** Stores the emulated device identifier */ QemuUUID identifier; =20 -} AwSidState; +}; =20 #endif /* HW_MISC_ALLWINNER_SID_H */ diff --git a/include/hw/misc/arm11scu.h b/include/hw/misc/arm11scu.h index 5ad0f3d339..7e2e6d2b44 100644 --- a/include/hw/misc/arm11scu.h +++ b/include/hw/misc/arm11scu.h @@ -12,11 +12,13 @@ #define HW_MISC_ARM11SCU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ARM11_SCU "arm11-scu" +typedef struct ARM11SCUState ARM11SCUState; #define ARM11_SCU(obj) OBJECT_CHECK(ARM11SCUState, (obj), TYPE_ARM11_SCU) =20 -typedef struct ARM11SCUState { +struct ARM11SCUState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -24,6 +26,6 @@ typedef struct ARM11SCUState { uint32_t control; uint32_t num_cpu; MemoryRegion iomem; -} ARM11SCUState; +}; =20 #endif diff --git a/include/hw/misc/armsse-cpuid.h b/include/hw/misc/armsse-cpuid.h index 0ef33fcaba..290a52cf10 100644 --- a/include/hw/misc/armsse-cpuid.h +++ b/include/hw/misc/armsse-cpuid.h @@ -23,11 +23,13 @@ #define HW_MISC_ARMSSE_CPUID_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ARMSSE_CPUID "armsse-cpuid" +typedef struct ARMSSECPUID ARMSSECPUID; #define ARMSSE_CPUID(obj) OBJECT_CHECK(ARMSSECPUID, (obj), TYPE_ARMSSE_CPU= ID) =20 -typedef struct ARMSSECPUID { +struct ARMSSECPUID { /*< private >*/ SysBusDevice parent_obj; =20 @@ -36,6 +38,6 @@ typedef struct ARMSSECPUID { =20 /* Properties */ uint32_t cpuid; -} ARMSSECPUID; +}; =20 #endif diff --git a/include/hw/misc/armsse-mhu.h b/include/hw/misc/armsse-mhu.h index cf5d8a73e6..d1ae4a463a 100644 --- a/include/hw/misc/armsse-mhu.h +++ b/include/hw/misc/armsse-mhu.h @@ -24,11 +24,13 @@ #define HW_MISC_ARMSSE_MHU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ARMSSE_MHU "armsse-mhu" +typedef struct ARMSSEMHU ARMSSEMHU; #define ARMSSE_MHU(obj) OBJECT_CHECK(ARMSSEMHU, (obj), TYPE_ARMSSE_MHU) =20 -typedef struct ARMSSEMHU { +struct ARMSSEMHU { /*< private >*/ SysBusDevice parent_obj; =20 @@ -39,6 +41,6 @@ typedef struct ARMSSEMHU { =20 uint32_t cpu0intr; uint32_t cpu1intr; -} ARMSSEMHU; +}; =20 #endif 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 =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_SCU "aspeed.scu" +typedef struct AspeedSCUClass AspeedSCUClass; +typedef struct AspeedSCUState AspeedSCUState; #define ASPEED_SCU(obj) OBJECT_CHECK(AspeedSCUState, (obj), TYPE_ASPEED_SC= U) #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) =20 -typedef struct AspeedSCUState { +struct AspeedSCUState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -34,7 +37,7 @@ typedef struct AspeedSCUState { uint32_t hw_strap1; uint32_t hw_strap2; uint32_t hw_prot_key; -} AspeedSCUState; +}; =20 #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) =20 -typedef struct AspeedSCUClass { +struct AspeedSCUClass { SysBusDeviceClass parent_class; =20 const uint32_t *resets; @@ -60,7 +63,7 @@ typedef struct AspeedSCUClass { uint32_t apb_divider; uint32_t nr_regs; const MemoryRegionOps *ops; -} AspeedSCUClass; +}; =20 #define ASPEED_SCU_PROT_KEY 0x1688A8A8 =20 diff --git a/include/hw/misc/aspeed_sdmc.h b/include/hw/misc/aspeed_sdmc.h index c6226957dd..3d98817715 100644 --- a/include/hw/misc/aspeed_sdmc.h +++ b/include/hw/misc/aspeed_sdmc.h @@ -10,8 +10,11 @@ #define ASPEED_SDMC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_SDMC "aspeed.sdmc" +typedef struct AspeedSDMCClass AspeedSDMCClass; +typedef struct AspeedSDMCState AspeedSDMCState; #define ASPEED_SDMC(obj) OBJECT_CHECK(AspeedSDMCState, (obj), TYPE_ASPEED_= SDMC) #define TYPE_ASPEED_2400_SDMC TYPE_ASPEED_SDMC "-ast2400" #define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500" @@ -30,7 +33,7 @@ */ #define ASPEED_SDMC_NR_REGS (0x500 >> 2) =20 -typedef struct AspeedSDMCState { +struct AspeedSDMCState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -40,20 +43,20 @@ typedef struct AspeedSDMCState { uint32_t regs[ASPEED_SDMC_NR_REGS]; uint64_t ram_size; uint64_t max_ram_size; -} AspeedSDMCState; +}; =20 #define ASPEED_SDMC_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedSDMCClass, (klass), TYPE_ASPEED_SDMC) #define ASPEED_SDMC_GET_CLASS(obj) \ OBJECT_GET_CLASS(AspeedSDMCClass, (obj), TYPE_ASPEED_SDMC) =20 -typedef struct AspeedSDMCClass { +struct AspeedSDMCClass { SysBusDeviceClass parent_class; =20 uint64_t max_ram_size; const uint64_t *valid_ram_sizes; uint32_t (*compute_conf)(AspeedSDMCState *s, uint32_t data); void (*write)(AspeedSDMCState *s, uint32_t reg, uint32_t data); -} AspeedSDMCClass; +}; =20 #endif /* ASPEED_SDMC_H */ diff --git a/include/hw/misc/aspeed_xdma.h b/include/hw/misc/aspeed_xdma.h index 00b45d931f..e5177e2c02 100644 --- a/include/hw/misc/aspeed_xdma.h +++ b/include/hw/misc/aspeed_xdma.h @@ -10,14 +10,16 @@ #define ASPEED_XDMA_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_XDMA "aspeed.xdma" +typedef struct AspeedXDMAState AspeedXDMAState; #define ASPEED_XDMA(obj) OBJECT_CHECK(AspeedXDMAState, (obj), TYPE_ASPEED_= XDMA) =20 #define ASPEED_XDMA_NUM_REGS (ASPEED_XDMA_REG_SIZE / sizeof(uint32_t)) #define ASPEED_XDMA_REG_SIZE 0x7C =20 -typedef struct AspeedXDMAState { +struct AspeedXDMAState { SysBusDevice parent; =20 MemoryRegion iomem; @@ -25,6 +27,6 @@ typedef struct AspeedXDMAState { =20 char bmc_cmdq_readp_set; uint32_t regs[ASPEED_XDMA_NUM_REGS]; -} AspeedXDMAState; +}; =20 #endif /* ASPEED_XDMA_H */ diff --git a/include/hw/misc/auxbus.h b/include/hw/misc/auxbus.h index 041edfc9e9..f24f2fd789 100644 --- a/include/hw/misc/auxbus.h +++ b/include/hw/misc/auxbus.h @@ -27,6 +27,7 @@ =20 #include "exec/memory.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 typedef struct AUXBus AUXBus; typedef struct AUXSlave AUXSlave; diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h index e08e44f629..c230a2655c 100644 --- a/include/hw/misc/avr_power.h +++ b/include/hw/misc/avr_power.h @@ -27,12 +27,14 @@ =20 #include "hw/sysbus.h" #include "hw/hw.h" +#include "qom/object.h" =20 =20 #define TYPE_AVR_MASK "avr-power" +typedef struct AVRMaskState AVRMaskState; #define AVR_MASK(obj) OBJECT_CHECK(AVRMaskState, (obj), TYPE_AVR_MASK) =20 -typedef struct { +struct AVRMaskState { /* */ SysBusDevice parent_obj; =20 @@ -41,6 +43,6 @@ typedef struct { =20 uint8_t val; qemu_irq irq[8]; -} AVRMaskState; +}; =20 #endif /* HW_MISC_AVR_POWER_H */ diff --git a/include/hw/misc/bcm2835_mbox.h b/include/hw/misc/bcm2835_mbox.h index 57f95cc35e..3ec6a2f0e8 100644 --- a/include/hw/misc/bcm2835_mbox.h +++ b/include/hw/misc/bcm2835_mbox.h @@ -10,8 +10,10 @@ =20 #include "bcm2835_mbox_defs.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_MBOX "bcm2835-mbox" +typedef struct BCM2835MboxState BCM2835MboxState; #define BCM2835_MBOX(obj) \ OBJECT_CHECK(BCM2835MboxState, (obj), TYPE_BCM2835_MBOX) =20 @@ -22,7 +24,7 @@ typedef struct { uint32_t config; } BCM2835Mbox; =20 -typedef struct { +struct BCM2835MboxState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -34,6 +36,6 @@ typedef struct { bool mbox_irq_disabled; bool available[MBOX_CHAN_COUNT]; BCM2835Mbox mbox[2]; -} BCM2835MboxState; +}; =20 #endif diff --git a/include/hw/misc/bcm2835_mphi.h b/include/hw/misc/bcm2835_mphi.h index e084314d0f..ce1c273cfb 100644 --- a/include/hw/misc/bcm2835_mphi.h +++ b/include/hw/misc/bcm2835_mphi.h @@ -19,6 +19,7 @@ =20 #include "hw/irq.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define MPHI_MMIO_SIZE 0x1000 =20 diff --git a/include/hw/misc/bcm2835_property.h b/include/hw/misc/bcm2835_p= roperty.h index b321f22499..28bf2b49b6 100644 --- a/include/hw/misc/bcm2835_property.h +++ b/include/hw/misc/bcm2835_property.h @@ -11,12 +11,14 @@ #include "hw/sysbus.h" #include "net/net.h" #include "hw/display/bcm2835_fb.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_PROPERTY "bcm2835-property" +typedef struct BCM2835PropertyState BCM2835PropertyState; #define BCM2835_PROPERTY(obj) \ OBJECT_CHECK(BCM2835PropertyState, (obj), TYPE_BCM2835_PROPERTY) =20 -typedef struct { +struct BCM2835PropertyState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -31,6 +33,6 @@ typedef struct { uint32_t board_rev; uint32_t addr; bool pending; -} BCM2835PropertyState; +}; =20 #endif diff --git a/include/hw/misc/bcm2835_rng.h b/include/hw/misc/bcm2835_rng.h index 41a531bce7..0921d9b3f1 100644 --- a/include/hw/misc/bcm2835_rng.h +++ b/include/hw/misc/bcm2835_rng.h @@ -11,17 +11,19 @@ #define BCM2835_RNG_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_RNG "bcm2835-rng" +typedef struct BCM2835RngState BCM2835RngState; #define BCM2835_RNG(obj) \ OBJECT_CHECK(BCM2835RngState, (obj), TYPE_BCM2835_RNG) =20 -typedef struct { +struct BCM2835RngState { SysBusDevice busdev; MemoryRegion iomem; =20 uint32_t rng_ctrl; uint32_t rng_status; -} BCM2835RngState; +}; =20 #endif diff --git a/include/hw/misc/bcm2835_thermal.h b/include/hw/misc/bcm2835_th= ermal.h index c3651b27ec..2b937527eb 100644 --- a/include/hw/misc/bcm2835_thermal.h +++ b/include/hw/misc/bcm2835_thermal.h @@ -10,18 +10,20 @@ #define HW_MISC_BCM2835_THERMAL_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_THERMAL "bcm2835-thermal" =20 +typedef struct Bcm2835ThermalState Bcm2835ThermalState; #define BCM2835_THERMAL(obj) \ OBJECT_CHECK(Bcm2835ThermalState, (obj), TYPE_BCM2835_THERMAL) =20 -typedef struct { +struct Bcm2835ThermalState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ MemoryRegion iomem; uint32_t ctl; -} Bcm2835ThermalState; +}; =20 #endif diff --git a/include/hw/misc/grlib_ahb_apb_pnp.h b/include/hw/misc/grlib_ah= b_apb_pnp.h index a0f6dcfda7..427606fd6b 100644 --- a/include/hw/misc/grlib_ahb_apb_pnp.h +++ b/include/hw/misc/grlib_ahb_apb_pnp.h @@ -23,16 +23,17 @@ =20 #ifndef GRLIB_AHB_APB_PNP_H #define GRLIB_AHB_APB_PNP_H +#include "qom/object.h" =20 #define TYPE_GRLIB_AHB_PNP "grlib,ahbpnp" +typedef struct AHBPnp AHBPnp; #define GRLIB_AHB_PNP(obj) \ OBJECT_CHECK(AHBPnp, (obj), TYPE_GRLIB_AHB_PNP) -typedef struct AHBPnp AHBPnp; =20 #define TYPE_GRLIB_APB_PNP "grlib,apbpnp" +typedef struct APBPnp APBPnp; #define GRLIB_APB_PNP(obj) \ OBJECT_CHECK(APBPnp, (obj), TYPE_GRLIB_APB_PNP) -typedef struct APBPnp APBPnp; =20 void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask, uint8_t vendor, uint16_t device, int slave, diff --git a/include/hw/misc/imx25_ccm.h b/include/hw/misc/imx25_ccm.h index 296321c612..8a7a9b675f 100644 --- a/include/hw/misc/imx25_ccm.h +++ b/include/hw/misc/imx25_ccm.h @@ -12,6 +12,7 @@ #define IMX25_CCM_H =20 #include "hw/misc/imx_ccm.h" +#include "qom/object.h" =20 #define IMX25_CCM_MPCTL_REG 0 #define IMX25_CCM_UPCTL_REG 1 @@ -63,9 +64,10 @@ CCTL_##name##_SHIFT) =20 #define TYPE_IMX25_CCM "imx25.ccm" +typedef struct IMX25CCMState IMX25CCMState; #define IMX25_CCM(obj) OBJECT_CHECK(IMX25CCMState, (obj), TYPE_IMX25_CCM) =20 -typedef struct IMX25CCMState { +struct IMX25CCMState { /* */ IMXCCMState parent_obj; =20 @@ -74,6 +76,6 @@ typedef struct IMX25CCMState { =20 uint32_t reg[IMX25_CCM_MAX_REG]; =20 -} IMX25CCMState; +}; =20 #endif /* IMX25_CCM_H */ diff --git a/include/hw/misc/imx31_ccm.h b/include/hw/misc/imx31_ccm.h index c376fad14c..a56ee992af 100644 --- a/include/hw/misc/imx31_ccm.h +++ b/include/hw/misc/imx31_ccm.h @@ -12,6 +12,7 @@ #define IMX31_CCM_H =20 #include "hw/misc/imx_ccm.h" +#include "qom/object.h" =20 #define IMX31_CCM_CCMR_REG 0 #define IMX31_CCM_PDR0_REG 1 @@ -72,9 +73,10 @@ PDR0_##name##_PODF_SHIFT) =20 #define TYPE_IMX31_CCM "imx31.ccm" +typedef struct IMX31CCMState IMX31CCMState; #define IMX31_CCM(obj) OBJECT_CHECK(IMX31CCMState, (obj), TYPE_IMX31_CCM) =20 -typedef struct IMX31CCMState { +struct IMX31CCMState { /* */ IMXCCMState parent_obj; =20 @@ -83,6 +85,6 @@ typedef struct IMX31CCMState { =20 uint32_t reg[IMX31_CCM_MAX_REG]; =20 -} IMX31CCMState; +}; =20 #endif /* IMX31_CCM_H */ diff --git a/include/hw/misc/imx6_ccm.h b/include/hw/misc/imx6_ccm.h index 80505809b4..affa13087e 100644 --- a/include/hw/misc/imx6_ccm.h +++ b/include/hw/misc/imx6_ccm.h @@ -13,6 +13,7 @@ =20 #include "hw/misc/imx_ccm.h" #include "qemu/bitops.h" +#include "qom/object.h" =20 #define CCM_CCR 0 #define CCM_CCDR 1 @@ -178,9 +179,10 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 #define TYPE_IMX6_CCM "imx6.ccm" +typedef struct IMX6CCMState IMX6CCMState; #define IMX6_CCM(obj) OBJECT_CHECK(IMX6CCMState, (obj), TYPE_IMX6_CCM) =20 -typedef struct IMX6CCMState { +struct IMX6CCMState { /* */ IMXCCMState parent_obj; =20 @@ -192,6 +194,6 @@ typedef struct IMX6CCMState { uint32_t ccm[CCM_MAX]; uint32_t analog[CCM_ANALOG_MAX]; =20 -} IMX6CCMState; +}; =20 #endif /* IMX6_CCM_H */ diff --git a/include/hw/misc/imx6_src.h b/include/hw/misc/imx6_src.h index eb3640732e..f1d70ec177 100644 --- a/include/hw/misc/imx6_src.h +++ b/include/hw/misc/imx6_src.h @@ -13,6 +13,7 @@ =20 #include "hw/sysbus.h" #include "qemu/bitops.h" +#include "qom/object.h" =20 #define SRC_SCR 0 #define SRC_SBMR1 1 @@ -57,9 +58,10 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 #define TYPE_IMX6_SRC "imx6.src" +typedef struct IMX6SRCState IMX6SRCState; #define IMX6_SRC(obj) OBJECT_CHECK(IMX6SRCState, (obj), TYPE_IMX6_SRC) =20 -typedef struct IMX6SRCState { +struct IMX6SRCState { /* */ SysBusDevice parent_obj; =20 @@ -68,6 +70,6 @@ typedef struct IMX6SRCState { =20 uint32_t regs[SRC_MAX]; =20 -} IMX6SRCState; +}; =20 #endif /* IMX6_SRC_H */ diff --git a/include/hw/misc/imx6ul_ccm.h b/include/hw/misc/imx6ul_ccm.h index 377ddca244..2304c6e738 100644 --- a/include/hw/misc/imx6ul_ccm.h +++ b/include/hw/misc/imx6ul_ccm.h @@ -12,6 +12,7 @@ =20 #include "hw/misc/imx_ccm.h" #include "qemu/bitops.h" +#include "qom/object.h" =20 #define CCM_CCR 0 #define CCM_CCDR 1 @@ -207,9 +208,10 @@ #define CCM_ANALOG_PLL_LOCK (1 << 31); =20 #define TYPE_IMX6UL_CCM "imx6ul.ccm" +typedef struct IMX6ULCCMState IMX6ULCCMState; #define IMX6UL_CCM(obj) OBJECT_CHECK(IMX6ULCCMState, (obj), TYPE_IMX6UL_CC= M) =20 -typedef struct IMX6ULCCMState { +struct IMX6ULCCMState { /* */ IMXCCMState parent_obj; =20 @@ -221,6 +223,6 @@ typedef struct IMX6ULCCMState { uint32_t ccm[CCM_MAX]; uint32_t analog[CCM_ANALOG_MAX]; =20 -} IMX6ULCCMState; +}; =20 #endif /* IMX6UL_CCM_H */ diff --git a/include/hw/misc/imx7_ccm.h b/include/hw/misc/imx7_ccm.h index 9538f37d98..9e9e58a5c2 100644 --- a/include/hw/misc/imx7_ccm.h +++ b/include/hw/misc/imx7_ccm.h @@ -14,6 +14,7 @@ =20 #include "hw/misc/imx_ccm.h" #include "qemu/bitops.h" +#include "qom/object.h" =20 enum IMX7AnalogRegisters { ANALOG_PLL_ARM, @@ -104,9 +105,10 @@ enum IMX7PMURegisters { }; =20 #define TYPE_IMX7_CCM "imx7.ccm" +typedef struct IMX7CCMState IMX7CCMState; #define IMX7_CCM(obj) OBJECT_CHECK(IMX7CCMState, (obj), TYPE_IMX7_CCM) =20 -typedef struct IMX7CCMState { +struct IMX7CCMState { /* */ IMXCCMState parent_obj; =20 @@ -114,13 +116,14 @@ typedef struct IMX7CCMState { MemoryRegion iomem; =20 uint32_t ccm[CCM_MAX]; -} IMX7CCMState; +}; =20 =20 #define TYPE_IMX7_ANALOG "imx7.analog" +typedef struct IMX7AnalogState IMX7AnalogState; #define IMX7_ANALOG(obj) OBJECT_CHECK(IMX7AnalogState, (obj), TYPE_IMX7_AN= ALOG) =20 -typedef struct IMX7AnalogState { +struct IMX7AnalogState { /* */ IMXCCMState parent_obj; =20 @@ -134,6 +137,6 @@ typedef struct IMX7AnalogState { =20 uint32_t analog[ANALOG_MAX]; uint32_t pmu[PMU_MAX]; -} IMX7AnalogState; +}; =20 #endif /* IMX7_CCM_H */ diff --git a/include/hw/misc/imx7_gpr.h b/include/hw/misc/imx7_gpr.h index e19373d274..83384ec0cc 100644 --- a/include/hw/misc/imx7_gpr.h +++ b/include/hw/misc/imx7_gpr.h @@ -14,15 +14,17 @@ =20 #include "qemu/bitops.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IMX7_GPR "imx7.gpr" +typedef struct IMX7GPRState IMX7GPRState; #define IMX7_GPR(obj) OBJECT_CHECK(IMX7GPRState, (obj), TYPE_IMX7_GPR) =20 -typedef struct IMX7GPRState { +struct IMX7GPRState { /* */ SysBusDevice parent_obj; =20 MemoryRegion mmio; -} IMX7GPRState; +}; =20 #endif /* IMX7_GPR_H */ diff --git a/include/hw/misc/imx7_snvs.h b/include/hw/misc/imx7_snvs.h index 255f8f26f9..f8659acb7d 100644 --- a/include/hw/misc/imx7_snvs.h +++ b/include/hw/misc/imx7_snvs.h @@ -14,6 +14,7 @@ =20 #include "qemu/bitops.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 =20 enum IMX7SNVSRegisters { @@ -23,13 +24,14 @@ enum IMX7SNVSRegisters { }; =20 #define TYPE_IMX7_SNVS "imx7.snvs" +typedef struct IMX7SNVSState IMX7SNVSState; #define IMX7_SNVS(obj) OBJECT_CHECK(IMX7SNVSState, (obj), TYPE_IMX7_SNVS) =20 -typedef struct IMX7SNVSState { +struct IMX7SNVSState { /* */ SysBusDevice parent_obj; =20 MemoryRegion mmio; -} IMX7SNVSState; +}; =20 #endif /* IMX7_SNVS_H */ diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h index efdc451eb0..174248e5df 100644 --- a/include/hw/misc/imx_ccm.h +++ b/include/hw/misc/imx_ccm.h @@ -12,6 +12,7 @@ #define IMX_CCM_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define CKIL_FREQ 32768 /* nominal 32khz clock */ =20 @@ -27,6 +28,8 @@ #define PLL_MFN(x) (((x) & 0x3ff) << 0) =20 #define TYPE_IMX_CCM "imx.ccm" +typedef struct IMXCCMClass IMXCCMClass; +typedef struct IMXCCMState IMXCCMState; #define IMX_CCM(obj) \ OBJECT_CHECK(IMXCCMState, (obj), TYPE_IMX_CCM) #define IMX_CCM_CLASS(klass) \ @@ -34,13 +37,13 @@ #define IMX_CCM_GET_CLASS(obj) \ OBJECT_GET_CLASS(IMXCCMClass, (obj), TYPE_IMX_CCM) =20 -typedef struct IMXCCMState { +struct IMXCCMState { /* */ SysBusDevice parent_obj; =20 /* */ =20 -} IMXCCMState; +}; =20 typedef enum { CLK_NONE, @@ -52,13 +55,13 @@ typedef enum { CLK_HIGH, } IMXClk; =20 -typedef struct IMXCCMClass { +struct IMXCCMClass { /* */ SysBusDeviceClass parent_class; =20 /* */ uint32_t (*get_clock_frequency)(IMXCCMState *s, IMXClk clk); -} IMXCCMClass; +}; =20 uint32_t imx_ccm_calc_pll(uint32_t pllreg, uint32_t base_freq); =20 diff --git a/include/hw/misc/imx_rngc.h b/include/hw/misc/imx_rngc.h index f0d2b44d4f..cd7ba8f91e 100644 --- a/include/hw/misc/imx_rngc.h +++ b/include/hw/misc/imx_rngc.h @@ -11,11 +11,13 @@ #define IMX_RNGC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IMX_RNGC "imx.rngc" +typedef struct IMXRNGCState IMXRNGCState; #define IMX_RNGC(obj) OBJECT_CHECK(IMXRNGCState, (obj), TYPE_IMX_RNGC) =20 -typedef struct IMXRNGCState { +struct IMXRNGCState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -30,6 +32,6 @@ typedef struct IMXRNGCState { QEMUBH *self_test_bh; QEMUBH *seed_bh; qemu_irq irq; -} IMXRNGCState; +}; =20 #endif /* IMX_RNGC_H */ diff --git a/include/hw/misc/iotkit-secctl.h b/include/hw/misc/iotkit-secct= l.h index bcb0437be5..3d54d8f3de 100644 --- a/include/hw/misc/iotkit-secctl.h +++ b/include/hw/misc/iotkit-secctl.h @@ -56,8 +56,10 @@ #define IOTKIT_SECCTL_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IOTKIT_SECCTL "iotkit-secctl" +typedef struct IoTKitSecCtl IoTKitSecCtl; #define IOTKIT_SECCTL(obj) OBJECT_CHECK(IoTKitSecCtl, (obj), TYPE_IOTKIT_S= ECCTL) =20 #define IOTS_APB_PPC0_NUM_PORTS 3 @@ -70,7 +72,6 @@ #define IOTS_NUM_MPC 4 #define IOTS_NUM_EXP_MSC 16 =20 -typedef struct IoTKitSecCtl IoTKitSecCtl; =20 /* State and IRQ lines relating to a PPC. For the * PPCs in the IoTKit not all the IRQ lines are used. diff --git a/include/hw/misc/iotkit-sysctl.h b/include/hw/misc/iotkit-sysct= l.h index 601c8ecc0d..27fe6346e6 100644 --- a/include/hw/misc/iotkit-sysctl.h +++ b/include/hw/misc/iotkit-sysctl.h @@ -28,12 +28,14 @@ #define HW_MISC_IOTKIT_SYSCTL_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IOTKIT_SYSCTL "iotkit-sysctl" +typedef struct IoTKitSysCtl IoTKitSysCtl; #define IOTKIT_SYSCTL(obj) OBJECT_CHECK(IoTKitSysCtl, (obj), \ TYPE_IOTKIT_SYSCTL) =20 -typedef struct IoTKitSysCtl { +struct IoTKitSysCtl { /*< private >*/ SysBusDevice parent_obj; =20 @@ -67,6 +69,6 @@ typedef struct IoTKitSysCtl { uint32_t initsvtor1_rst; =20 bool is_sse200; -} IoTKitSysCtl; +}; =20 #endif diff --git a/include/hw/misc/iotkit-sysinfo.h b/include/hw/misc/iotkit-sysi= nfo.h index d84eb203b9..e0e610c75c 100644 --- a/include/hw/misc/iotkit-sysinfo.h +++ b/include/hw/misc/iotkit-sysinfo.h @@ -23,12 +23,14 @@ #define HW_MISC_IOTKIT_SYSINFO_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_IOTKIT_SYSINFO "iotkit-sysinfo" +typedef struct IoTKitSysInfo IoTKitSysInfo; #define IOTKIT_SYSINFO(obj) OBJECT_CHECK(IoTKitSysInfo, (obj), \ TYPE_IOTKIT_SYSINFO) =20 -typedef struct IoTKitSysInfo { +struct IoTKitSysInfo { /*< private >*/ SysBusDevice parent_obj; =20 @@ -38,6 +40,6 @@ typedef struct IoTKitSysInfo { /* Properties */ uint32_t sys_version; uint32_t sys_config; -} IoTKitSysInfo; +}; =20 #endif diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h index 0be05d649b..a59750634f 100644 --- a/include/hw/misc/mac_via.h +++ b/include/hw/misc/mac_via.h @@ -12,6 +12,7 @@ #include "exec/memory.h" #include "hw/sysbus.h" #include "hw/misc/mos6522.h" +#include "qom/object.h" =20 =20 /* VIA 1 */ @@ -31,10 +32,11 @@ =20 =20 #define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1" +typedef struct MOS6522Q800VIA1State MOS6522Q800VIA1State; #define MOS6522_Q800_VIA1(obj) OBJECT_CHECK(MOS6522Q800VIA1State, (obj), \ TYPE_MOS6522_Q800_VIA1) =20 -typedef struct MOS6522Q800VIA1State { +struct MOS6522Q800VIA1State { /*< private >*/ MOS6522State parent_obj; =20 @@ -47,7 +49,7 @@ typedef struct MOS6522Q800VIA1State { int64_t next_second; QEMUTimer *VBL_timer; int64_t next_VBL; -} MOS6522Q800VIA1State; +}; =20 =20 /* VIA 2 */ @@ -66,19 +68,21 @@ typedef struct MOS6522Q800VIA1State { #define VIA2_IRQ_ASC (1 << VIA2_IRQ_ASC_BIT) =20 #define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2" +typedef struct MOS6522Q800VIA2State MOS6522Q800VIA2State; #define MOS6522_Q800_VIA2(obj) OBJECT_CHECK(MOS6522Q800VIA2State, (obj), \ TYPE_MOS6522_Q800_VIA2) =20 -typedef struct MOS6522Q800VIA2State { +struct MOS6522Q800VIA2State { /*< private >*/ MOS6522State parent_obj; -} MOS6522Q800VIA2State; +}; =20 =20 #define TYPE_MAC_VIA "mac_via" +typedef struct MacVIAState MacVIAState; #define MAC_VIA(obj) OBJECT_CHECK(MacVIAState, (obj), TYPE_MAC_VIA) =20 -typedef struct MacVIAState { +struct MacVIAState { SysBusDevice busdev; =20 VMChangeStateEntry *vmstate; @@ -113,6 +117,6 @@ typedef struct MacVIAState { uint8_t adb_data_in[128]; uint8_t adb_data_out[16]; uint8_t adb_autopoll_cmd; -} MacVIAState; +}; =20 #endif diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h index a8cf0be1ec..f2b0069262 100644 --- a/include/hw/misc/macio/cuda.h +++ b/include/hw/misc/macio/cuda.h @@ -27,6 +27,7 @@ #define CUDA_H =20 #include "hw/misc/mos6522.h" +#include "qom/object.h" =20 /* CUDA commands (2nd byte) */ #define CUDA_WARM_START 0x0 @@ -58,10 +59,11 @@ =20 =20 /* MOS6522 CUDA */ -typedef struct MOS6522CUDAState { +struct MOS6522CUDAState { /*< private >*/ MOS6522State parent_obj; -} MOS6522CUDAState; +}; +typedef struct MOS6522CUDAState MOS6522CUDAState; =20 #define TYPE_MOS6522_CUDA "mos6522-cuda" #define MOS6522_CUDA(obj) OBJECT_CHECK(MOS6522CUDAState, (obj), \ @@ -69,9 +71,10 @@ typedef struct MOS6522CUDAState { =20 /* Cuda */ #define TYPE_CUDA "cuda" +typedef struct CUDAState CUDAState; #define CUDA(obj) OBJECT_CHECK(CUDAState, (obj), TYPE_CUDA) =20 -typedef struct CUDAState { +struct CUDAState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -97,6 +100,6 @@ typedef struct CUDAState { qemu_irq irq; uint8_t data_in[128]; uint8_t data_out[16]; -} CUDAState; +}; =20 #endif /* CUDA_H */ diff --git a/include/hw/misc/macio/gpio.h b/include/hw/misc/macio/gpio.h index 24a4364b39..2234873250 100644 --- a/include/hw/misc/macio/gpio.h +++ b/include/hw/misc/macio/gpio.h @@ -28,11 +28,13 @@ =20 #include "hw/ppc/openpic.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_MACIO_GPIO "macio-gpio" +typedef struct MacIOGPIOState MacIOGPIOState; #define MACIO_GPIO(obj) OBJECT_CHECK(MacIOGPIOState, (obj), TYPE_MACIO_GPI= O) =20 -typedef struct MacIOGPIOState { +struct MacIOGPIOState { /*< private >*/ SysBusDevice parent; /*< public >*/ @@ -43,7 +45,7 @@ typedef struct MacIOGPIOState { qemu_irq gpio_extirqs[10]; uint8_t gpio_levels[8]; uint8_t gpio_regs[36]; /* XXX Check count */ -} MacIOGPIOState; +}; =20 void macio_set_gpio(MacIOGPIOState *s, uint32_t gpio, bool state); =20 diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 87335a991c..81c28eeef7 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -36,21 +36,24 @@ #include "hw/ppc/mac.h" #include "hw/ppc/mac_dbdma.h" #include "hw/ppc/openpic.h" +#include "qom/object.h" =20 /* MacIO virtual bus */ #define TYPE_MACIO_BUS "macio-bus" +typedef struct MacIOBusState MacIOBusState; #define MACIO_BUS(obj) OBJECT_CHECK(MacIOBusState, (obj), TYPE_MACIO_BUS) =20 -typedef struct MacIOBusState { +struct MacIOBusState { /*< private >*/ BusState parent_obj; -} MacIOBusState; +}; =20 /* MacIO IDE */ #define TYPE_MACIO_IDE "macio-ide" +typedef struct MACIOIDEState MACIOIDEState; #define MACIO_IDE(obj) OBJECT_CHECK(MACIOIDEState, (obj), TYPE_MACIO_IDE) =20 -typedef struct MACIOIDEState { +struct MACIOIDEState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -68,15 +71,16 @@ typedef struct MACIOIDEState { bool dma_active; uint32_t timing_reg; uint32_t irq_reg; -} MACIOIDEState; +}; =20 void macio_ide_init_drives(MACIOIDEState *ide, DriveInfo **hd_table); void macio_ide_register_dma(MACIOIDEState *ide); =20 #define TYPE_MACIO "macio" +typedef struct MacIOState MacIOState; #define MACIO(obj) OBJECT_CHECK(MacIOState, (obj), TYPE_MACIO) =20 -typedef struct MacIOState { +struct MacIOState { /*< private >*/ PCIDevice parent; /*< public >*/ @@ -88,13 +92,14 @@ typedef struct MacIOState { DBDMAState dbdma; ESCCState escc; uint64_t frequency; -} MacIOState; +}; =20 #define TYPE_OLDWORLD_MACIO "macio-oldworld" +typedef struct OldWorldMacIOState OldWorldMacIOState; #define OLDWORLD_MACIO(obj) \ OBJECT_CHECK(OldWorldMacIOState, (obj), TYPE_OLDWORLD_MACIO) =20 -typedef struct OldWorldMacIOState { +struct OldWorldMacIOState { /*< private >*/ MacIOState parent_obj; /*< public >*/ @@ -103,13 +108,14 @@ typedef struct OldWorldMacIOState { =20 MacIONVRAMState nvram; MACIOIDEState ide[2]; -} OldWorldMacIOState; +}; =20 #define TYPE_NEWWORLD_MACIO "macio-newworld" +typedef struct NewWorldMacIOState NewWorldMacIOState; #define NEWWORLD_MACIO(obj) \ OBJECT_CHECK(NewWorldMacIOState, (obj), TYPE_NEWWORLD_MACIO) =20 -typedef struct NewWorldMacIOState { +struct NewWorldMacIOState { /*< private >*/ MacIOState parent_obj; /*< public >*/ @@ -119,6 +125,6 @@ typedef struct NewWorldMacIOState { OpenPICState *pic; MACIOIDEState ide[2]; MacIOGPIOState gpio; -} NewWorldMacIOState; +}; =20 #endif /* MACIO_H */ diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h index 72f75612b6..b3982f6f32 100644 --- a/include/hw/misc/macio/pmu.h +++ b/include/hw/misc/macio/pmu.h @@ -12,6 +12,7 @@ =20 #include "hw/misc/mos6522.h" #include "hw/misc/macio/gpio.h" +#include "qom/object.h" =20 /* * PMU commands @@ -173,10 +174,11 @@ typedef enum { } PMUCmdState; =20 /* MOS6522 PMU */ -typedef struct MOS6522PMUState { +struct MOS6522PMUState { /*< private >*/ MOS6522State parent_obj; -} MOS6522PMUState; +}; +typedef struct MOS6522PMUState MOS6522PMUState; =20 #define TYPE_MOS6522_PMU "mos6522-pmu" #define MOS6522_PMU(obj) OBJECT_CHECK(MOS6522PMUState, (obj), \ @@ -186,7 +188,7 @@ typedef struct MOS6522PMUState { * @last_b: last value of B register */ =20 -typedef struct PMUState { +struct PMUState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -228,7 +230,8 @@ typedef struct PMUState { =20 /* GPIO */ MacIOGPIOState *gpio; -} PMUState; +}; +typedef struct PMUState PMUState; =20 #define TYPE_VIA_PMU "via-pmu" #define VIA_PMU(obj) OBJECT_CHECK(PMUState, (obj), TYPE_VIA_PMU) diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h index af7f1017ef..e903a1af9c 100644 --- a/include/hw/misc/max111x.h +++ b/include/hw/misc/max111x.h @@ -14,6 +14,7 @@ #define HW_MISC_MAX111X_H =20 #include "hw/ssi/ssi.h" +#include "qom/object.h" =20 /* * This is a model of the Maxim MAX1110/1111 ADC chip, which for QEMU @@ -31,7 +32,7 @@ * + the interrupt line is not correctly implemented, and will never * be lowered once it has been asserted. */ -typedef struct { +struct MAX111xState { SSISlave parent_obj; =20 qemu_irq interrupt; @@ -43,7 +44,8 @@ typedef struct { =20 uint8_t input[8]; int inputs, com; -} MAX111xState; +}; +typedef struct MAX111xState MAX111xState; =20 #define TYPE_MAX_111X "max111x" =20 diff --git a/include/hw/misc/mips_cmgcr.h b/include/hw/misc/mips_cmgcr.h index 3e6e223273..a334be8edd 100644 --- a/include/hw/misc/mips_cmgcr.h +++ b/include/hw/misc/mips_cmgcr.h @@ -11,8 +11,10 @@ #define MIPS_CMGCR_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_MIPS_GCR "mips-gcr" +typedef struct MIPSGCRState MIPSGCRState; #define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR) =20 #define GCR_BASE_ADDR 0x1fbf8000ULL @@ -70,7 +72,6 @@ struct MIPSGCRVPState { uint64_t reset_base; }; =20 -typedef struct MIPSGCRState MIPSGCRState; struct MIPSGCRState { SysBusDevice parent_obj; =20 diff --git a/include/hw/misc/mips_cpc.h b/include/hw/misc/mips_cpc.h index 3f670578b0..b0131e4a54 100644 --- a/include/hw/misc/mips_cpc.h +++ b/include/hw/misc/mips_cpc.h @@ -21,6 +21,7 @@ #define MIPS_CPC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define CPC_ADDRSPACE_SZ 0x6000 =20 @@ -34,9 +35,10 @@ #define CPC_VP_RUNNING_OFS 0x30 =20 #define TYPE_MIPS_CPC "mips-cpc" +typedef struct MIPSCPCState MIPSCPCState; #define MIPS_CPC(obj) OBJECT_CHECK(MIPSCPCState, (obj), TYPE_MIPS_CPC) =20 -typedef struct MIPSCPCState { +struct MIPSCPCState { SysBusDevice parent_obj; =20 uint32_t num_vp; @@ -44,6 +46,6 @@ typedef struct MIPSCPCState { =20 MemoryRegion mr; uint64_t vp_running; /* Indicates which VPs are in the run state */ -} MIPSCPCState; +}; =20 #endif /* MIPS_CPC_H */ diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index c44e7672b6..9ddb04708a 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -21,8 +21,10 @@ #define MIPS_ITU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_MIPS_ITU "mips-itu" +typedef struct MIPSITUState MIPSITUState; #define MIPS_ITU(obj) OBJECT_CHECK(MIPSITUState, (obj), TYPE_MIPS_ITU) =20 #define ITC_CELL_DEPTH_SHIFT 2 @@ -51,7 +53,7 @@ typedef struct ITCStorageCell { =20 #define ITC_ADDRESSMAP_NUM 2 =20 -typedef struct MIPSITUState { +struct MIPSITUState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -74,7 +76,7 @@ typedef struct MIPSITUState { bool saar_present; void *saar; =20 -} MIPSITUState; +}; =20 /* Get ITC Configuration Tag memory region. */ MemoryRegion *mips_itu_get_tag_region(MIPSITUState *itu); diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index 6b25ffd439..b099814879 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -30,6 +30,7 @@ #include "exec/memory.h" #include "hw/sysbus.h" #include "hw/input/adb.h" +#include "qom/object.h" =20 /* Bits in ACR */ #define SR_CTRL 0x1c /* Shift register control bits */ @@ -99,7 +100,7 @@ typedef struct MOS6522Timer { * @last_b: last value of B register * @last_acr: last value of ACR register */ -typedef struct MOS6522State { +struct MOS6522State { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -120,12 +121,14 @@ typedef struct MOS6522State { uint64_t frequency; =20 qemu_irq irq; -} MOS6522State; +}; +typedef struct MOS6522State MOS6522State; =20 #define TYPE_MOS6522 "mos6522" +typedef struct MOS6522DeviceClass MOS6522DeviceClass; #define MOS6522(obj) OBJECT_CHECK(MOS6522State, (obj), TYPE_MOS6522) =20 -typedef struct MOS6522DeviceClass { +struct MOS6522DeviceClass { DeviceClass parent_class; =20 DeviceReset parent_reset; @@ -138,7 +141,7 @@ typedef struct MOS6522DeviceClass { uint64_t (*get_timer2_counter_value)(MOS6522State *dev, MOS6522Timer *= ti); uint64_t (*get_timer1_load_time)(MOS6522State *dev, MOS6522Timer *ti); uint64_t (*get_timer2_load_time)(MOS6522State *dev, MOS6522Timer *ti); -} MOS6522DeviceClass; +}; =20 #define MOS6522_CLASS(cls) \ OBJECT_CLASS_CHECK(MOS6522DeviceClass, (cls), TYPE_MOS6522) diff --git a/include/hw/misc/mps2-fpgaio.h b/include/hw/misc/mps2-fpgaio.h index 69e265cd4b..e844041bb0 100644 --- a/include/hw/misc/mps2-fpgaio.h +++ b/include/hw/misc/mps2-fpgaio.h @@ -22,11 +22,13 @@ #define MPS2_FPGAIO_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_MPS2_FPGAIO "mps2-fpgaio" +typedef struct MPS2FPGAIO MPS2FPGAIO; #define MPS2_FPGAIO(obj) OBJECT_CHECK(MPS2FPGAIO, (obj), TYPE_MPS2_FPGAIO) =20 -typedef struct { +struct MPS2FPGAIO { /*< private >*/ SysBusDevice parent_obj; =20 @@ -48,6 +50,6 @@ typedef struct { /* These hold the CLOCK_VIRTUAL ns tick when the CLK1HZ/CLK100HZ was z= ero */ int64_t clk1hz_tick_offset; int64_t clk100hz_tick_offset; -} MPS2FPGAIO; +}; =20 #endif diff --git a/include/hw/misc/mps2-scc.h b/include/hw/misc/mps2-scc.h index 7045473788..10393c4e3a 100644 --- a/include/hw/misc/mps2-scc.h +++ b/include/hw/misc/mps2-scc.h @@ -13,13 +13,15 @@ #define MPS2_SCC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_MPS2_SCC "mps2-scc" +typedef struct MPS2SCC MPS2SCC; #define MPS2_SCC(obj) OBJECT_CHECK(MPS2SCC, (obj), TYPE_MPS2_SCC) =20 #define NUM_OSCCLK 3 =20 -typedef struct { +struct MPS2SCC { /*< private >*/ SysBusDevice parent_obj; =20 @@ -38,6 +40,6 @@ typedef struct { uint32_t id; uint32_t oscclk[NUM_OSCCLK]; uint32_t oscclk_reset[NUM_OSCCLK]; -} MPS2SCC; +}; =20 #endif diff --git a/include/hw/misc/msf2-sysreg.h b/include/hw/misc/msf2-sysreg.h index 5993f67b4e..6b5d03608a 100644 --- a/include/hw/misc/msf2-sysreg.h +++ b/include/hw/misc/msf2-sysreg.h @@ -26,6 +26,7 @@ #define HW_MSF2_SYSREG_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 enum { ESRAM_CR =3D 0x00 / 4, @@ -61,9 +62,10 @@ enum { #define MSF2_SYSREG_MMIO_SIZE 0x300 =20 #define TYPE_MSF2_SYSREG "msf2-sysreg" +typedef struct MSF2SysregState MSF2SysregState; #define MSF2_SYSREG(obj) OBJECT_CHECK(MSF2SysregState, (obj), TYPE_MSF2_S= YSREG) =20 -typedef struct MSF2SysregState { +struct MSF2SysregState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -72,6 +74,6 @@ typedef struct MSF2SysregState { uint8_t apb1div; =20 uint32_t regs[MSF2_SYSREG_MMIO_SIZE / 4]; -} MSF2SysregState; +}; =20 #endif /* HW_MSF2_SYSREG_H */ diff --git a/include/hw/misc/nrf51_rng.h b/include/hw/misc/nrf51_rng.h index b0133bf665..247f167100 100644 --- a/include/hw/misc/nrf51_rng.h +++ b/include/hw/misc/nrf51_rng.h @@ -36,7 +36,9 @@ =20 #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" #define TYPE_NRF51_RNG "nrf51_soc.rng" +typedef struct NRF51RNGState NRF51RNGState; #define NRF51_RNG(obj) OBJECT_CHECK(NRF51RNGState, (obj), TYPE_NRF51_RNG) =20 #define NRF51_RNG_SIZE 0x1000 @@ -54,7 +56,7 @@ #define NRF51_RNG_REG_CONFIG_DECEN 0 #define NRF51_RNG_REG_VALUE 0x508 =20 -typedef struct { +struct NRF51RNGState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -78,7 +80,7 @@ typedef struct { uint32_t interrupt_enabled; uint32_t filter_enabled; =20 -} NRF51RNGState; +}; =20 =20 #endif /* NRF51_RNG_H */ diff --git a/include/hw/misc/pca9552.h b/include/hw/misc/pca9552.h index 600356fbf9..ebf8425903 100644 --- a/include/hw/misc/pca9552.h +++ b/include/hw/misc/pca9552.h @@ -10,15 +10,17 @@ #define PCA9552_H =20 #include "hw/i2c/i2c.h" +#include "qom/object.h" =20 #define TYPE_PCA9552 "pca9552" #define TYPE_PCA955X "pca955x" +typedef struct PCA955xState PCA955xState; #define PCA955X(obj) OBJECT_CHECK(PCA955xState, (obj), TYPE_PCA955X) =20 #define PCA955X_NR_REGS 10 #define PCA955X_PIN_COUNT_MAX 16 =20 -typedef struct PCA955xState { +struct PCA955xState { /*< private >*/ I2CSlave i2c; /*< public >*/ @@ -29,6 +31,6 @@ typedef struct PCA955xState { uint8_t regs[PCA955X_NR_REGS]; qemu_irq gpio[PCA955X_PIN_COUNT_MAX]; char *description; /* For debugging purpose only */ -} PCA955xState; +}; =20 #endif diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx= _syscfg.h index 84e06fdecf..ff7c976d66 100644 --- a/include/hw/misc/stm32f2xx_syscfg.h +++ b/include/hw/misc/stm32f2xx_syscfg.h @@ -26,6 +26,7 @@ #define HW_STM32F2XX_SYSCFG_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define SYSCFG_MEMRMP 0x00 #define SYSCFG_PMC 0x04 @@ -36,10 +37,11 @@ #define SYSCFG_CMPCR 0x20 =20 #define TYPE_STM32F2XX_SYSCFG "stm32f2xx-syscfg" +typedef struct STM32F2XXSyscfgState STM32F2XXSyscfgState; #define STM32F2XX_SYSCFG(obj) \ OBJECT_CHECK(STM32F2XXSyscfgState, (obj), TYPE_STM32F2XX_SYSCFG) =20 -typedef struct { +struct STM32F2XXSyscfgState { /* */ SysBusDevice parent_obj; =20 @@ -55,6 +57,6 @@ typedef struct { uint32_t syscfg_cmpcr; =20 qemu_irq irq; -} STM32F2XXSyscfgState; +}; =20 #endif /* HW_STM32F2XX_SYSCFG_H */ diff --git a/include/hw/misc/stm32f4xx_exti.h b/include/hw/misc/stm32f4xx_e= xti.h index 707036a41b..7132615785 100644 --- a/include/hw/misc/stm32f4xx_exti.h +++ b/include/hw/misc/stm32f4xx_exti.h @@ -27,6 +27,7 @@ =20 #include "hw/sysbus.h" #include "hw/hw.h" +#include "qom/object.h" =20 #define EXTI_IMR 0x00 #define EXTI_EMR 0x04 @@ -36,13 +37,14 @@ #define EXTI_PR 0x14 =20 #define TYPE_STM32F4XX_EXTI "stm32f4xx-exti" +typedef struct STM32F4xxExtiState STM32F4xxExtiState; #define STM32F4XX_EXTI(obj) \ OBJECT_CHECK(STM32F4xxExtiState, (obj), TYPE_STM32F4XX_EXTI) =20 #define NUM_GPIO_EVENT_IN_LINES 16 #define NUM_INTERRUPT_OUT_LINES 16 =20 -typedef struct { +struct STM32F4xxExtiState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -55,6 +57,6 @@ typedef struct { uint32_t exti_pr; =20 qemu_irq irq[NUM_INTERRUPT_OUT_LINES]; -} STM32F4xxExtiState; +}; =20 #endif diff --git a/include/hw/misc/stm32f4xx_syscfg.h b/include/hw/misc/stm32f4xx= _syscfg.h index c62c6629e5..78130cb9c3 100644 --- a/include/hw/misc/stm32f4xx_syscfg.h +++ b/include/hw/misc/stm32f4xx_syscfg.h @@ -27,6 +27,7 @@ =20 #include "hw/sysbus.h" #include "hw/hw.h" +#include "qom/object.h" =20 #define SYSCFG_MEMRMP 0x00 #define SYSCFG_PMC 0x04 @@ -37,12 +38,13 @@ #define SYSCFG_CMPCR 0x20 =20 #define TYPE_STM32F4XX_SYSCFG "stm32f4xx-syscfg" +typedef struct STM32F4xxSyscfgState STM32F4xxSyscfgState; #define STM32F4XX_SYSCFG(obj) \ OBJECT_CHECK(STM32F4xxSyscfgState, (obj), TYPE_STM32F4XX_SYSCFG) =20 #define SYSCFG_NUM_EXTICR 4 =20 -typedef struct { +struct STM32F4xxSyscfgState { /* */ SysBusDevice parent_obj; =20 @@ -56,6 +58,6 @@ typedef struct { =20 qemu_irq irq; qemu_irq gpio_out[16]; -} STM32F4xxSyscfgState; +}; =20 #endif diff --git a/include/hw/misc/tz-mpc.h b/include/hw/misc/tz-mpc.h index 6f15945410..2d3eae0834 100644 --- a/include/hw/misc/tz-mpc.h +++ b/include/hw/misc/tz-mpc.h @@ -32,15 +32,16 @@ #define TZ_MPC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_TZ_MPC "tz-mpc" +typedef struct TZMPC TZMPC; #define TZ_MPC(obj) OBJECT_CHECK(TZMPC, (obj), TYPE_TZ_MPC) =20 #define TZ_NUM_PORTS 16 =20 #define TYPE_TZ_MPC_IOMMU_MEMORY_REGION "tz-mpc-iommu-memory-region" =20 -typedef struct TZMPC TZMPC; =20 struct TZMPC { /*< private >*/ diff --git a/include/hw/misc/tz-msc.h b/include/hw/misc/tz-msc.h index 116b96ae9b..3f719833a9 100644 --- a/include/hw/misc/tz-msc.h +++ b/include/hw/misc/tz-msc.h @@ -52,11 +52,13 @@ =20 #include "hw/sysbus.h" #include "target/arm/idau.h" +#include "qom/object.h" =20 #define TYPE_TZ_MSC "tz-msc" +typedef struct TZMSC TZMSC; #define TZ_MSC(obj) OBJECT_CHECK(TZMSC, (obj), TYPE_TZ_MSC) =20 -typedef struct TZMSC { +struct TZMSC { /*< private >*/ SysBusDevice parent_obj; =20 @@ -74,6 +76,6 @@ typedef struct TZMSC { AddressSpace downstream_as; MemoryRegion upstream; IDAUInterface *idau; -} TZMSC; +}; =20 #endif diff --git a/include/hw/misc/tz-ppc.h b/include/hw/misc/tz-ppc.h index 080d6e2ec1..4646005fa5 100644 --- a/include/hw/misc/tz-ppc.h +++ b/include/hw/misc/tz-ppc.h @@ -66,13 +66,14 @@ #define TZ_PPC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_TZ_PPC "tz-ppc" +typedef struct TZPPC TZPPC; #define TZ_PPC(obj) OBJECT_CHECK(TZPPC, (obj), TYPE_TZ_PPC) =20 #define TZ_NUM_PORTS 16 =20 -typedef struct TZPPC TZPPC; =20 typedef struct TZPPCPort { TZPPC *ppc; diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index c63968a2cd..6c04c8a923 100644 --- a/include/hw/misc/unimp.h +++ b/include/hw/misc/unimp.h @@ -11,19 +11,21 @@ #include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device" =20 +typedef struct UnimplementedDeviceState UnimplementedDeviceState; #define UNIMPLEMENTED_DEVICE(obj) \ OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVIC= E) =20 -typedef struct { +struct UnimplementedDeviceState { SysBusDevice parent_obj; MemoryRegion iomem; unsigned offset_fmt_width; char *name; uint64_t size; -} UnimplementedDeviceState; +}; =20 /** * create_unimplemented_device: create and map a dummy device diff --git a/include/hw/misc/vmcoreinfo.h b/include/hw/misc/vmcoreinfo.h index d4f3d3a91c..cf0e51f863 100644 --- a/include/hw/misc/vmcoreinfo.h +++ b/include/hw/misc/vmcoreinfo.h @@ -14,18 +14,20 @@ =20 #include "hw/qdev-core.h" #include "standard-headers/linux/qemu_fw_cfg.h" +#include "qom/object.h" =20 #define VMCOREINFO_DEVICE "vmcoreinfo" +typedef struct VMCoreInfoState VMCoreInfoState; #define VMCOREINFO(obj) OBJECT_CHECK(VMCoreInfoState, (obj), VMCOREINFO_DE= VICE) =20 typedef struct fw_cfg_vmcoreinfo FWCfgVMCoreInfo; =20 -typedef struct VMCoreInfoState { +struct VMCoreInfoState { DeviceClass parent_obj; =20 bool has_vmcoreinfo; FWCfgVMCoreInfo vmcoreinfo; -} VMCoreInfoState; +}; =20 /* returns NULL unless there is exactly one device */ static inline VMCoreInfoState *vmcoreinfo_find(void) diff --git a/include/hw/misc/zynq-xadc.h b/include/hw/misc/zynq-xadc.h index f1a410a376..7e9767c74f 100644 --- a/include/hw/misc/zynq-xadc.h +++ b/include/hw/misc/zynq-xadc.h @@ -16,6 +16,7 @@ #define ZYNQ_XADC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define ZYNQ_XADC_MMIO_SIZE 0x0020 #define ZYNQ_XADC_NUM_IO_REGS (ZYNQ_XADC_MMIO_SIZE / 4) @@ -23,10 +24,11 @@ #define ZYNQ_XADC_FIFO_DEPTH 15 =20 #define TYPE_ZYNQ_XADC "xlnx,zynq-xadc" +typedef struct ZynqXADCState ZynqXADCState; #define ZYNQ_XADC(obj) \ OBJECT_CHECK(ZynqXADCState, (obj), TYPE_ZYNQ_XADC) =20 -typedef struct ZynqXADCState { +struct ZynqXADCState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -41,6 +43,6 @@ typedef struct ZynqXADCState { =20 struct IRQState *qemu_irq; =20 -} ZynqXADCState; +}; =20 #endif /* ZYNQ_XADC_H */ diff --git a/include/hw/net/allwinner-sun8i-emac.h b/include/hw/net/allwinn= er-sun8i-emac.h index dd1d7b96cd..bd38588885 100644 --- a/include/hw/net/allwinner-sun8i-emac.h +++ b/include/hw/net/allwinner-sun8i-emac.h @@ -30,6 +30,7 @@ */ =20 #define TYPE_AW_SUN8I_EMAC "allwinner-sun8i-emac" +typedef struct AwSun8iEmacState AwSun8iEmacState; #define AW_SUN8I_EMAC(obj) \ OBJECT_CHECK(AwSun8iEmacState, (obj), TYPE_AW_SUN8I_EMAC) =20 @@ -38,7 +39,7 @@ /** * Allwinner Sun8i EMAC object instance state */ -typedef struct AwSun8iEmacState { +struct AwSun8iEmacState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -100,6 +101,6 @@ typedef struct AwSun8iEmacState { =20 /** @} */ =20 -} AwSun8iEmacState; +}; =20 #endif /* HW_NET_ALLWINNER_SUN8I_H */ diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_ema= c.h index 5013207d15..e927082580 100644 --- a/include/hw/net/allwinner_emac.h +++ b/include/hw/net/allwinner_emac.h @@ -28,8 +28,10 @@ #include "qemu/fifo8.h" #include "hw/net/mii.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_AW_EMAC "allwinner-emac" +typedef struct AwEmacState AwEmacState; #define AW_EMAC(obj) OBJECT_CHECK(AwEmacState, (obj), TYPE_AW_EMAC) =20 /* @@ -144,7 +146,7 @@ typedef struct RTL8201CPState { uint16_t anlpar; } RTL8201CPState; =20 -typedef struct AwEmacState { +struct AwEmacState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -171,6 +173,6 @@ typedef struct AwEmacState { Fifo8 tx_fifo[NUM_TX_FIFOS]; uint32_t tx_length[NUM_TX_FIFOS]; uint32_t tx_channel; -} AwEmacState; +}; =20 #endif diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index 54e646ff79..04fd59a525 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -24,8 +24,10 @@ =20 #ifndef CADENCE_GEM_H #define CADENCE_GEM_H +#include "qom/object.h" =20 #define TYPE_CADENCE_GEM "cadence_gem" +typedef struct CadenceGEMState CadenceGEMState; #define CADENCE_GEM(obj) OBJECT_CHECK(CadenceGEMState, (obj), TYPE_CADENCE= _GEM) =20 #include "net/net.h" @@ -43,7 +45,7 @@ #define MAX_JUMBO_FRAME_SIZE_MASK 0x3FFF #define MAX_FRAME_SIZE MAX_JUMBO_FRAME_SIZE_MASK =20 -typedef struct CadenceGEMState { +struct CadenceGEMState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -89,6 +91,6 @@ typedef struct CadenceGEMState { uint32_t rx_desc[MAX_PRIORITY_QUEUES][DESC_MAX_NUM_WORDS]; =20 bool sar_active[4]; -} CadenceGEMState; +}; =20 #endif diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index ab37e7b2b8..6371bf60ab 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -9,8 +9,10 @@ =20 #ifndef FTGMAC100_H #define FTGMAC100_H +#include "qom/object.h" =20 #define TYPE_FTGMAC100 "ftgmac100" +typedef struct FTGMAC100State FTGMAC100State; #define FTGMAC100(obj) OBJECT_CHECK(FTGMAC100State, (obj), TYPE_FTGMAC100) =20 #include "hw/sysbus.h" @@ -21,7 +23,7 @@ */ #define FTGMAC100_MAX_FRAME_SIZE 9220 =20 -typedef struct FTGMAC100State { +struct FTGMAC100State { /*< private >*/ SysBusDevice parent_obj; =20 @@ -64,15 +66,16 @@ typedef struct FTGMAC100State { bool aspeed; uint32_t txdes0_edotr; uint32_t rxdes0_edorr; -} FTGMAC100State; +}; =20 #define TYPE_ASPEED_MII "aspeed-mmi" +typedef struct AspeedMiiState AspeedMiiState; #define ASPEED_MII(obj) OBJECT_CHECK(AspeedMiiState, (obj), TYPE_ASPEED_MI= I) =20 /* * AST2600 MII controller */ -typedef struct AspeedMiiState { +struct AspeedMiiState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -81,6 +84,6 @@ typedef struct AspeedMiiState { MemoryRegion iomem; uint32_t phycr; uint32_t phydata; -} AspeedMiiState; +}; =20 #endif diff --git a/include/hw/net/imx_fec.h b/include/hw/net/imx_fec.h index 9f03034b89..4d6ac5e408 100644 --- a/include/hw/net/imx_fec.h +++ b/include/hw/net/imx_fec.h @@ -23,8 +23,10 @@ =20 #ifndef IMX_FEC_H #define IMX_FEC_H +#include "qom/object.h" =20 #define TYPE_IMX_FEC "imx.fec" +typedef struct IMXFECState IMXFECState; #define IMX_FEC(obj) OBJECT_CHECK(IMXFECState, (obj), TYPE_IMX_FEC) =20 #define TYPE_IMX_ENET "imx.enet" @@ -247,7 +249,7 @@ typedef struct { =20 #define FSL_IMX25_FEC_SIZE 0x4000 =20 -typedef struct IMXFECState { +struct IMXFECState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -274,6 +276,6 @@ typedef struct IMXFECState { =20 /* Buffer used to assemble a Tx frame */ uint8_t frame[ENET_MAX_FRAME_SIZE]; -} IMXFECState; +}; =20 #endif diff --git a/include/hw/net/lance.h b/include/hw/net/lance.h index 0357f5f65c..fe459ffea7 100644 --- a/include/hw/net/lance.h +++ b/include/hw/net/lance.h @@ -32,15 +32,17 @@ #include "net/net.h" #include "hw/net/pcnet.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_LANCE "lance" +typedef struct SysBusPCNetState SysBusPCNetState; #define SYSBUS_PCNET(obj) \ OBJECT_CHECK(SysBusPCNetState, (obj), TYPE_LANCE) =20 -typedef struct { +struct SysBusPCNetState { SysBusDevice parent_obj; =20 PCNetState state; -} SysBusPCNetState; +}; =20 #endif diff --git a/include/hw/net/lasi_82596.h b/include/hw/net/lasi_82596.h index e76ef8308e..141e0cc17a 100644 --- a/include/hw/net/lasi_82596.h +++ b/include/hw/net/lasi_82596.h @@ -10,18 +10,20 @@ =20 #include "net/net.h" #include "hw/net/i82596.h" +#include "qom/object.h" =20 #define TYPE_LASI_82596 "lasi_82596" +typedef struct SysBusI82596State SysBusI82596State; #define SYSBUS_I82596(obj) \ OBJECT_CHECK(SysBusI82596State, (obj), TYPE_LASI_82596) =20 -typedef struct { +struct SysBusI82596State { SysBusDevice parent_obj; =20 I82596State state; uint16_t last_val; int val_index:1; -} SysBusI82596State; +}; =20 SysBusI82596State *lasi_82596_init(MemoryRegion *addr_space, hwaddr hpa, qemu_irq irq); diff --git a/include/hw/net/msf2-emac.h b/include/hw/net/msf2-emac.h index 37966d3a81..6aef711007 100644 --- a/include/hw/net/msf2-emac.h +++ b/include/hw/net/msf2-emac.h @@ -26,15 +26,17 @@ #include "exec/memory.h" #include "net/net.h" #include "net/eth.h" +#include "qom/object.h" =20 #define TYPE_MSS_EMAC "msf2-emac" +typedef struct MSF2EmacState MSF2EmacState; #define MSS_EMAC(obj) \ OBJECT_CHECK(MSF2EmacState, (obj), TYPE_MSS_EMAC) =20 #define R_MAX (0x1a0 / 4) #define PHY_MAX_REGS 32 =20 -typedef struct MSF2EmacState { +struct MSF2EmacState { SysBusDevice parent; =20 MemoryRegion mmio; @@ -50,4 +52,4 @@ typedef struct MSF2EmacState { uint16_t phy_regs[PHY_MAX_REGS]; =20 uint32_t regs[R_MAX]; -} MSF2EmacState; +}; diff --git a/include/hw/nmi.h b/include/hw/nmi.h index fe37ce3ad8..47fc036e74 100644 --- a/include/hw/nmi.h +++ b/include/hw/nmi.h @@ -26,6 +26,7 @@ =20 #define TYPE_NMI "nmi" =20 +typedef struct NMIClass NMIClass; #define NMI_CLASS(klass) \ OBJECT_CLASS_CHECK(NMIClass, (klass), TYPE_NMI) #define NMI_GET_CLASS(obj) \ @@ -35,11 +36,11 @@ =20 typedef struct NMIState NMIState; =20 -typedef struct NMIClass { +struct NMIClass { InterfaceClass parent_class; =20 void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); -} NMIClass; +}; =20 void nmi_monitor_handle(int cpu_index, Error **errp); =20 diff --git a/include/hw/nubus/mac-nubus-bridge.h b/include/hw/nubus/mac-nub= us-bridge.h index ce9c789d99..8407ad21f6 100644 --- a/include/hw/nubus/mac-nubus-bridge.h +++ b/include/hw/nubus/mac-nubus-bridge.h @@ -10,15 +10,17 @@ #define HW_NUBUS_MAC_H =20 #include "hw/nubus/nubus.h" +#include "qom/object.h" =20 #define TYPE_MAC_NUBUS_BRIDGE "mac-nubus-bridge" +typedef struct MacNubusState MacNubusState; #define MAC_NUBUS_BRIDGE(obj) OBJECT_CHECK(MacNubusState, (obj), \ TYPE_MAC_NUBUS_BRIDGE) =20 -typedef struct MacNubusState { +struct MacNubusState { SysBusDevice sysbus_dev; =20 NubusBus *bus; -} MacNubusState; +}; =20 #endif diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index c350948262..226efb2ff7 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -11,6 +11,7 @@ =20 #include "hw/qdev-properties.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 #define NUBUS_SUPER_SLOT_SIZE 0x10000000U #define NUBUS_SUPER_SLOT_NB 0x9 @@ -22,24 +23,26 @@ #define NUBUS_LAST_SLOT 0xF =20 #define TYPE_NUBUS_DEVICE "nubus-device" +typedef struct NubusDevice NubusDevice; #define NUBUS_DEVICE(obj) \ OBJECT_CHECK(NubusDevice, (obj), TYPE_NUBUS_DEVICE) =20 #define TYPE_NUBUS_BUS "nubus-bus" +typedef struct NubusBus NubusBus; #define NUBUS_BUS(obj) OBJECT_CHECK(NubusBus, (obj), TYPE_NUBUS_BUS) =20 #define TYPE_NUBUS_BRIDGE "nubus-bridge" =20 -typedef struct NubusBus { +struct NubusBus { BusState qbus; =20 MemoryRegion super_slot_io; MemoryRegion slot_io; =20 int current_slot; -} NubusBus; +}; =20 -typedef struct NubusDevice { +struct NubusDevice { DeviceState qdev; =20 int slot_nb; @@ -60,7 +63,7 @@ typedef struct NubusDevice { =20 MemoryRegion rom_io; const uint8_t *rom; -} NubusDevice; +}; =20 void nubus_register_rom(NubusDevice *dev, const uint8_t *rom, uint32_t siz= e, int revision, int format, uint8_t byte_lanes); diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index f190c428e8..5e00fdc21e 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -5,6 +5,7 @@ #include "standard-headers/linux/qemu_fw_cfg.h" #include "hw/sysbus.h" #include "sysemu/dma.h" +#include "qom/object.h" =20 #define TYPE_FW_CFG "fw_cfg" #define TYPE_FW_CFG_IO "fw_cfg_io" @@ -15,6 +16,7 @@ #define FW_CFG_IO(obj) OBJECT_CHECK(FWCfgIoState, (obj), TYPE_FW_CFG_IO) #define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM) =20 +typedef struct FWCfgDataGeneratorClass FWCfgDataGeneratorClass; #define FW_CFG_DATA_GENERATOR_CLASS(class) \ OBJECT_CLASS_CHECK(FWCfgDataGeneratorClass, (class), \ TYPE_FW_CFG_DATA_GENERATOR_INTERFACE) @@ -22,7 +24,7 @@ OBJECT_GET_CLASS(FWCfgDataGeneratorClass, (obj), \ TYPE_FW_CFG_DATA_GENERATOR_INTERFACE) =20 -typedef struct FWCfgDataGeneratorClass { +struct FWCfgDataGeneratorClass { /*< private >*/ InterfaceClass parent_class; /*< public >*/ @@ -39,7 +41,7 @@ typedef struct FWCfgDataGeneratorClass { * required. */ GByteArray *(*get_data)(Object *obj, Error **errp); -} FWCfgDataGeneratorClass; +}; =20 typedef struct fw_cfg_file FWCfgFile; =20 diff --git a/include/hw/nvram/nrf51_nvm.h b/include/hw/nvram/nrf51_nvm.h index 3792e4a9fe..48871667f1 100644 --- a/include/hw/nvram/nrf51_nvm.h +++ b/include/hw/nvram/nrf51_nvm.h @@ -23,7 +23,9 @@ #define NRF51_NVM_H =20 #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_NRF51_NVM "nrf51_soc.nvm" +typedef struct NRF51NVMState NRF51NVMState; #define NRF51_NVM(obj) OBJECT_CHECK(NRF51NVMState, (obj), TYPE_NRF51_NVM) =20 #define NRF51_UICR_FIXTURE_SIZE 64 @@ -44,7 +46,7 @@ =20 #define NRF51_UICR_SIZE 0x100 =20 -typedef struct NRF51NVMState { +struct NRF51NVMState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -58,7 +60,7 @@ typedef struct NRF51NVMState { =20 uint32_t config; =20 -} NRF51NVMState; +}; =20 =20 #endif diff --git a/include/hw/pci-bridge/simba.h b/include/hw/pci-bridge/simba.h index d8649973ee..300379b94d 100644 --- a/include/hw/pci-bridge/simba.h +++ b/include/hw/pci-bridge/simba.h @@ -28,12 +28,14 @@ #define HW_PCI_BRIDGE_SIMBA_H =20 #include "hw/pci/pci_bridge.h" +#include "qom/object.h" =20 =20 -typedef struct SimbaPCIBridge { +struct SimbaPCIBridge { /*< private >*/ PCIBridge parent_obj; -} SimbaPCIBridge; +}; +typedef struct SimbaPCIBridge SimbaPCIBridge; =20 #define TYPE_SIMBA_PCI_BRIDGE "pbm-bridge" #define SIMBA_PCI_BRIDGE(obj) \ diff --git a/include/hw/pci-host/designware.h b/include/hw/pci-host/designw= are.h index 31c41231b1..43ee5b3a12 100644 --- a/include/hw/pci-host/designware.h +++ b/include/hw/pci-host/designware.h @@ -26,17 +26,19 @@ #include "hw/pci/pci_bus.h" #include "hw/pci/pcie_host.h" #include "hw/pci/pci_bridge.h" +#include "qom/object.h" =20 #define TYPE_DESIGNWARE_PCIE_HOST "designware-pcie-host" +typedef struct DesignwarePCIEHost DesignwarePCIEHost; #define DESIGNWARE_PCIE_HOST(obj) \ OBJECT_CHECK(DesignwarePCIEHost, (obj), TYPE_DESIGNWARE_PCIE_HOST) =20 #define TYPE_DESIGNWARE_PCIE_ROOT "designware-pcie-root" +typedef struct DesignwarePCIERoot DesignwarePCIERoot; #define DESIGNWARE_PCIE_ROOT(obj) \ OBJECT_CHECK(DesignwarePCIERoot, (obj), TYPE_DESIGNWARE_PCIE_ROOT) =20 struct DesignwarePCIERoot; -typedef struct DesignwarePCIERoot DesignwarePCIERoot; =20 typedef struct DesignwarePCIEViewport { DesignwarePCIERoot *root; @@ -80,7 +82,7 @@ struct DesignwarePCIERoot { DesignwarePCIEMSI msi; }; =20 -typedef struct DesignwarePCIEHost { +struct DesignwarePCIEHost { PCIHostState parent_obj; =20 DesignwarePCIERoot root; @@ -96,6 +98,6 @@ typedef struct DesignwarePCIEHost { } pci; =20 MemoryRegion mmio; -} DesignwarePCIEHost; +}; =20 #endif /* DESIGNWARE_H */ diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index faea040a93..d70e1c69dc 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -23,24 +23,27 @@ #include "hw/sysbus.h" #include "hw/pci/pci.h" #include "hw/pci/pcie_host.h" +#include "qom/object.h" =20 #define TYPE_GPEX_HOST "gpex-pcihost" +typedef struct GPEXHost GPEXHost; #define GPEX_HOST(obj) \ OBJECT_CHECK(GPEXHost, (obj), TYPE_GPEX_HOST) =20 #define TYPE_GPEX_ROOT_DEVICE "gpex-root" +typedef struct GPEXRootState GPEXRootState; #define MCH_PCI_DEVICE(obj) \ OBJECT_CHECK(GPEXRootState, (obj), TYPE_GPEX_ROOT_DEVICE) =20 #define GPEX_NUM_IRQS 4 =20 -typedef struct GPEXRootState { +struct GPEXRootState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ -} GPEXRootState; +}; =20 -typedef struct GPEXHost { +struct GPEXHost { /*< private >*/ PCIExpressHost parent_obj; /*< public >*/ @@ -51,7 +54,7 @@ typedef struct GPEXHost { MemoryRegion io_mmio; qemu_irq irq[GPEX_NUM_IRQS]; int irq_num[GPEX_NUM_IRQS]; -} GPEXHost; +}; =20 int gpex_set_irq_num(GPEXHost *s, int index, int gsi); =20 diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index cc58d82ed4..74fe300bff 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -14,14 +14,16 @@ #include "hw/hw.h" #include "hw/pci/pci_bus.h" #include "hw/pci-host/pam.h" +#include "qom/object.h" =20 #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" #define TYPE_I440FX_PCI_DEVICE "i440FX" =20 +typedef struct PCII440FXState PCII440FXState; #define I440FX_PCI_DEVICE(obj) \ OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) =20 -typedef struct PCII440FXState { +struct PCII440FXState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -32,7 +34,7 @@ typedef struct PCII440FXState { PAMMemoryRegion pam_regions[13]; MemoryRegion smram_region; MemoryRegion smram, low_smram; -} PCII440FXState; +}; =20 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" =20 diff --git a/include/hw/pci-host/pnv_phb3.h b/include/hw/pci-host/pnv_phb3.h index 75b787867a..43f9e873ae 100644 --- a/include/hw/pci-host/pnv_phb3.h +++ b/include/hw/pci-host/pnv_phb3.h @@ -13,6 +13,7 @@ #include "hw/pci/pcie_host.h" #include "hw/pci/pcie_port.h" #include "hw/ppc/xics.h" +#include "qom/object.h" =20 typedef struct PnvPHB3 PnvPHB3; =20 @@ -20,18 +21,19 @@ typedef struct PnvPHB3 PnvPHB3; * PHB3 XICS Source for MSIs */ #define TYPE_PHB3_MSI "phb3-msi" +typedef struct Phb3MsiState Phb3MsiState; #define PHB3_MSI(obj) OBJECT_CHECK(Phb3MsiState, (obj), TYPE_PHB3_MSI) =20 #define PHB3_MAX_MSI 2048 =20 -typedef struct Phb3MsiState { +struct Phb3MsiState { ICSState ics; qemu_irq *qirqs; =20 PnvPHB3 *phb; uint64_t rba[PHB3_MAX_MSI / 64]; uint32_t rba_sum; -} Phb3MsiState; +}; =20 void pnv_phb3_msi_update_config(Phb3MsiState *msis, uint32_t base, uint32_t count); @@ -69,9 +71,10 @@ typedef struct PnvPhb3DMASpace { * PHB3 Power Bus Common Queue */ #define TYPE_PNV_PBCQ "pnv-pbcq" +typedef struct PnvPBCQState PnvPBCQState; #define PNV_PBCQ(obj) OBJECT_CHECK(PnvPBCQState, (obj), TYPE_PNV_PBCQ) =20 -typedef struct PnvPBCQState { +struct PnvPBCQState { DeviceState parent; =20 uint32_t nest_xbase; @@ -96,7 +99,7 @@ typedef struct PnvPBCQState { MemoryRegion xscom_nest_regs; MemoryRegion xscom_pci_regs; MemoryRegion xscom_spci_regs; -} PnvPBCQState; +}; =20 /* * PHB3 PCIe Root port diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index c882bfd0aa..450602cb72 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -13,6 +13,7 @@ #include "hw/pci/pcie_host.h" #include "hw/pci/pcie_port.h" #include "hw/ppc/xive.h" +#include "qom/object.h" =20 typedef struct PnvPhb4PecState PnvPhb4PecState; typedef struct PnvPhb4PecStack PnvPhb4PecStack; @@ -140,6 +141,7 @@ extern const MemoryRegionOps pnv_phb4_xscom_ops; * PHB4 PEC (PCI Express Controller) */ #define TYPE_PNV_PHB4_PEC "pnv-phb4-pec" +typedef struct PnvPhb4PecClass PnvPhb4PecClass; #define PNV_PHB4_PEC(obj) \ OBJECT_CHECK(PnvPhb4PecState, (obj), TYPE_PNV_PHB4_PEC) =20 @@ -214,7 +216,7 @@ struct PnvPhb4PecState { #define PNV_PHB4_PEC_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvPhb4PecClass, (obj), TYPE_PNV_PHB4_PEC) =20 -typedef struct PnvPhb4PecClass { +struct PnvPhb4PecClass { DeviceClass parent_class; =20 uint32_t (*xscom_nest_base)(PnvPhb4PecState *pec); @@ -225,6 +227,6 @@ typedef struct PnvPhb4PecClass { int compat_size; const char *stk_compat; int stk_compat_size; -} PnvPhb4PecClass; +}; =20 #endif /* PCI_HOST_PNV_PHB4_H */ diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index 070305f83d..5db5a763d4 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -27,16 +27,19 @@ #include "hw/pci-host/pam.h" #include "qemu/units.h" #include "qemu/range.h" +#include "qom/object.h" =20 #define TYPE_Q35_HOST_DEVICE "q35-pcihost" +typedef struct Q35PCIHost Q35PCIHost; #define Q35_HOST_DEVICE(obj) \ OBJECT_CHECK(Q35PCIHost, (obj), TYPE_Q35_HOST_DEVICE) =20 #define TYPE_MCH_PCI_DEVICE "mch" +typedef struct MCHPCIState MCHPCIState; #define MCH_PCI_DEVICE(obj) \ OBJECT_CHECK(MCHPCIState, (obj), TYPE_MCH_PCI_DEVICE) =20 -typedef struct MCHPCIState { +struct MCHPCIState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -57,16 +60,16 @@ typedef struct MCHPCIState { uint64_t pci_hole64_size; uint32_t short_root_bus; uint16_t ext_tseg_mbytes; -} MCHPCIState; +}; =20 -typedef struct Q35PCIHost { +struct Q35PCIHost { /*< private >*/ PCIExpressHost parent_obj; /*< public >*/ =20 bool pci_hole64_fix; MCHPCIState mch; -} Q35PCIHost; +}; =20 #define Q35_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) diff --git a/include/hw/pci-host/sabre.h b/include/hw/pci-host/sabre.h index 99b5aefbec..5fb508e9ce 100644 --- a/include/hw/pci-host/sabre.h +++ b/include/hw/pci-host/sabre.h @@ -4,6 +4,7 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" #include "hw/sparc/sun4u_iommu.h" +#include "qom/object.h" =20 #define MAX_IVEC 0x40 =20 @@ -16,15 +17,16 @@ #define OBIO_MSE_IRQ 0x2a #define OBIO_SER_IRQ 0x2b =20 -typedef struct SabrePCIState { +struct SabrePCIState { PCIDevice parent_obj; -} SabrePCIState; +}; +typedef struct SabrePCIState SabrePCIState; =20 #define TYPE_SABRE_PCI_DEVICE "sabre-pci" #define SABRE_PCI_DEVICE(obj) \ OBJECT_CHECK(SabrePCIState, (obj), TYPE_SABRE_PCI_DEVICE) =20 -typedef struct SabreState { +struct SabreState { PCIHostState parent_obj; =20 hwaddr special_base; @@ -45,7 +47,8 @@ typedef struct SabreState { unsigned int irq_request; uint32_t reset_control; unsigned int nr_resets; -} SabreState; +}; +typedef struct SabreState SabreState; =20 #define TYPE_SABRE "sabre" #define SABRE_DEVICE(obj) \ diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 600eb55c34..783e8905df 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -24,15 +24,16 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" #include "hw/ppc/xics.h" +#include "qom/object.h" =20 #define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" =20 +typedef struct SpaprPhbState SpaprPhbState; #define SPAPR_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(SpaprPhbState, (obj), TYPE_SPAPR_PCI_HOST_BRIDGE) =20 #define SPAPR_PCI_DMA_MAX_WINDOWS 2 =20 -typedef struct SpaprPhbState SpaprPhbState; =20 typedef struct SpaprPciMsi { uint32_t first_irq; diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h index 72d2a97355..a1f3aaaecd 100644 --- a/include/hw/pci-host/uninorth.h +++ b/include/hw/pci-host/uninorth.h @@ -27,6 +27,7 @@ =20 #include "hw/pci/pci_host.h" #include "hw/ppc/openpic.h" +#include "qom/object.h" =20 /* UniNorth version */ #define UNINORTH_VERSION_10A 0x7 @@ -36,6 +37,7 @@ #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pc= ihost" #define TYPE_U3_AGP_HOST_BRIDGE "u3-agp-pcihost" =20 +typedef struct UNINHostState UNINHostState; #define UNI_NORTH_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_PCI_HOST_BRIDGE) #define UNI_NORTH_AGP_HOST_BRIDGE(obj) \ @@ -45,7 +47,7 @@ #define U3_AGP_HOST_BRIDGE(obj) \ OBJECT_CHECK(UNINHostState, (obj), TYPE_U3_AGP_HOST_BRIDGE) =20 -typedef struct UNINHostState { +struct UNINHostState { PCIHostState parent_obj; =20 uint32_t ofw_addr; @@ -54,13 +56,14 @@ typedef struct UNINHostState { MemoryRegion pci_mmio; MemoryRegion pci_hole; MemoryRegion pci_io; -} UNINHostState; +}; =20 -typedef struct UNINState { +struct UNINState { SysBusDevice parent_obj; =20 MemoryRegion mem; -} UNINState; +}; +typedef struct UNINState UNINState; =20 #define TYPE_UNI_NORTH "uni-north" #define UNI_NORTH(obj) \ diff --git a/include/hw/pci-host/xilinx-pcie.h b/include/hw/pci-host/xilinx= -pcie.h index c0f15314be..1cbd6d2f79 100644 --- a/include/hw/pci-host/xilinx-pcie.h +++ b/include/hw/pci-host/xilinx-pcie.h @@ -24,25 +24,28 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pcie_host.h" +#include "qom/object.h" =20 #define TYPE_XILINX_PCIE_HOST "xilinx-pcie-host" +typedef struct XilinxPCIEHost XilinxPCIEHost; #define XILINX_PCIE_HOST(obj) \ OBJECT_CHECK(XilinxPCIEHost, (obj), TYPE_XILINX_PCIE_HOST) =20 #define TYPE_XILINX_PCIE_ROOT "xilinx-pcie-root" +typedef struct XilinxPCIERoot XilinxPCIERoot; #define XILINX_PCIE_ROOT(obj) \ OBJECT_CHECK(XilinxPCIERoot, (obj), TYPE_XILINX_PCIE_ROOT) =20 -typedef struct XilinxPCIERoot { +struct XilinxPCIERoot { PCIBridge parent_obj; -} XilinxPCIERoot; +}; =20 typedef struct XilinxPCIEInt { uint32_t fifo_reg1; uint32_t fifo_reg2; } XilinxPCIEInt; =20 -typedef struct XilinxPCIEHost { +struct XilinxPCIEHost { PCIExpressHost parent_obj; =20 char name[16]; @@ -62,6 +65,6 @@ typedef struct XilinxPCIEHost { XilinxPCIEInt intr_fifo[16]; unsigned int intr_fifo_r, intr_fifo_w; uint32_t rpscr; -} XilinxPCIEHost; +}; =20 #endif /* HW_XILINX_PCIE_H */ diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 4ca7258b5b..be9e298dba 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -8,6 +8,7 @@ #include "hw/isa/isa.h" =20 #include "hw/pci/pcie.h" +#include "qom/object.h" =20 extern bool pci_available; =20 @@ -195,6 +196,7 @@ enum { }; =20 #define TYPE_PCI_DEVICE "pci-device" +typedef struct PCIDeviceClass PCIDeviceClass; #define PCI_DEVICE(obj) \ OBJECT_CHECK(PCIDevice, (obj), TYPE_PCI_DEVICE) #define PCI_DEVICE_CLASS(klass) \ @@ -217,7 +219,7 @@ typedef struct PCIINTxRoute { int irq; } PCIINTxRoute; =20 -typedef struct PCIDeviceClass { +struct PCIDeviceClass { DeviceClass parent_class; =20 void (*realize)(PCIDevice *dev, Error **errp); @@ -241,7 +243,7 @@ typedef struct PCIDeviceClass { =20 /* rom bar */ const char *romfile; -} PCIDeviceClass; +}; =20 typedef void (*PCIINTxRoutingNotifier)(PCIDevice *dev); typedef int (*MSIVectorUseNotifier)(PCIDevice *dev, unsigned int vector, diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index 99c674e949..b46d37faa8 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -28,6 +28,7 @@ =20 #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" +#include "qom/object.h" =20 typedef struct PCIBridgeWindows PCIBridgeWindows; =20 diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index 6210a7e14d..51ea53908f 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -29,8 +29,10 @@ #define PCI_HOST_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_PCI_HOST_BRIDGE "pci-host-bridge" +typedef struct PCIHostBridgeClass PCIHostBridgeClass; #define PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(PCIHostState, (obj), TYPE_PCI_HOST_BRIDGE) #define PCI_HOST_BRIDGE_CLASS(klass) \ @@ -51,11 +53,11 @@ struct PCIHostState { QLIST_ENTRY(PCIHostState) next; }; =20 -typedef struct PCIHostBridgeClass { +struct PCIHostBridgeClass { SysBusDeviceClass parent_class; =20 const char *(*root_bus_path)(PCIHostState *, PCIBus *); -} PCIHostBridgeClass; +}; =20 /* common internal helpers for PCI/PCIe hosts, cut off overflows */ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr, diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h index 3f7b9886d1..c7d2ae5bf4 100644 --- a/include/hw/pci/pcie_host.h +++ b/include/hw/pci/pcie_host.h @@ -23,6 +23,7 @@ =20 #include "hw/pci/pci_host.h" #include "exec/memory.h" +#include "qom/object.h" =20 #define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge" #define PCIE_HOST_BRIDGE(obj) \ diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h index caae57573b..765399159f 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -23,6 +23,7 @@ =20 #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_bus.h" +#include "qom/object.h" =20 #define TYPE_PCIE_PORT "pcie-port" #define PCIE_PORT(obj) OBJECT_CHECK(PCIEPort, (obj), TYPE_PCIE_PORT) @@ -67,12 +68,13 @@ int pcie_chassis_add_slot(struct PCIESlot *slot); void pcie_chassis_del_slot(PCIESlot *s); =20 #define TYPE_PCIE_ROOT_PORT "pcie-root-port-base" +typedef struct PCIERootPortClass PCIERootPortClass; #define PCIE_ROOT_PORT_CLASS(klass) \ OBJECT_CLASS_CHECK(PCIERootPortClass, (klass), TYPE_PCIE_ROOT_PORT) #define PCIE_ROOT_PORT_GET_CLASS(obj) \ OBJECT_GET_CLASS(PCIERootPortClass, (obj), TYPE_PCIE_ROOT_PORT) =20 -typedef struct PCIERootPortClass { +struct PCIERootPortClass { PCIDeviceClass parent_class; DeviceRealize parent_realize; DeviceReset parent_reset; @@ -86,6 +88,6 @@ typedef struct PCIERootPortClass { int ssvid_offset; int acs_offset; /* If nonzero, optional ACS capability offset */ int ssid; -} PCIERootPortClass; +}; =20 #endif /* QEMU_PCIE_PORT_H */ diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index ebad7bc504..0f9e41db02 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -4,6 +4,7 @@ /* PCMCIA/Cardbus */ =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 typedef struct PCMCIASocket { qemu_irq irq; @@ -11,6 +12,8 @@ typedef struct PCMCIASocket { } PCMCIASocket; =20 #define TYPE_PCMCIA_CARD "pcmcia-card" +typedef struct PCMCIACardClass PCMCIACardClass; +typedef struct PCMCIACardState PCMCIACardState; #define PCMCIA_CARD(obj) \ OBJECT_CHECK(PCMCIACardState, (obj), TYPE_PCMCIA_CARD) #define PCMCIA_CARD_GET_CLASS(obj) \ @@ -18,15 +21,15 @@ typedef struct PCMCIASocket { #define PCMCIA_CARD_CLASS(cls) \ OBJECT_CLASS_CHECK(PCMCIACardClass, cls, TYPE_PCMCIA_CARD) =20 -typedef struct PCMCIACardState { +struct PCMCIACardState { /*< private >*/ DeviceState parent_obj; /*< public >*/ =20 PCMCIASocket *slot; -} PCMCIACardState; +}; =20 -typedef struct PCMCIACardClass { +struct PCMCIACardClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -45,7 +48,7 @@ typedef struct PCMCIACardClass { uint32_t address, uint16_t value); uint16_t (*io_read)(PCMCIACardState *card, uint32_t address); void (*io_write)(PCMCIACardState *card, uint32_t address, uint16_t val= ue); -} PCMCIACardClass; +}; =20 #define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */ #define CISTPL_NO_LINK 0x14 /* No Link Tuple */ diff --git a/include/hw/platform-bus.h b/include/hw/platform-bus.h index 33745a418e..cda1346a4f 100644 --- a/include/hw/platform-bus.h +++ b/include/hw/platform-bus.h @@ -23,6 +23,7 @@ */ =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 typedef struct PlatformBusDevice PlatformBusDevice; =20 diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h index 26cc469de4..e1f42cdbd3 100644 --- a/include/hw/ppc/mac_dbdma.h +++ b/include/hw/ppc/mac_dbdma.h @@ -27,6 +27,7 @@ #include "qemu/iov.h" #include "sysemu/dma.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 typedef struct DBDMA_io DBDMA_io; =20 @@ -160,13 +161,14 @@ typedef struct DBDMA_channel { dbdma_cmd current; } DBDMA_channel; =20 -typedef struct { +struct DBDMAState { SysBusDevice parent_obj; =20 MemoryRegion mem; DBDMA_channel channels[DBDMA_CHANNELS]; QEMUBH *bh; -} DBDMAState; +}; +typedef struct DBDMAState DBDMAState; =20 /* Externally callable functions */ =20 diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h index db0d29e6c2..81a0b3b1ee 100644 --- a/include/hw/ppc/openpic.h +++ b/include/hw/ppc/openpic.h @@ -3,6 +3,7 @@ =20 #include "hw/sysbus.h" #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define MAX_CPU 32 #define MAX_MSI 8 @@ -136,9 +137,10 @@ typedef struct IRQDest { } IRQDest; =20 #define TYPE_OPENPIC "openpic" +typedef struct OpenPICState OpenPICState; #define OPENPIC(obj) OBJECT_CHECK(OpenPICState, (obj), TYPE_OPENPIC) =20 -typedef struct OpenPICState { +struct OpenPICState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -183,6 +185,6 @@ typedef struct OpenPICState { uint32_t irq_ipi0; uint32_t irq_tim0; uint32_t irq_msi; -} OpenPICState; +}; =20 #endif /* OPENPIC_H */ diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index d4b0b0e2ff..64f9ee8867 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -32,15 +32,18 @@ #include "hw/ppc/pnv_core.h" #include "hw/pci-host/pnv_phb3.h" #include "hw/pci-host/pnv_phb4.h" +#include "qom/object.h" =20 #define TYPE_PNV_CHIP "pnv-chip" +typedef struct PnvChip PnvChip; +typedef struct PnvChipClass PnvChipClass; #define PNV_CHIP(obj) OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP) #define PNV_CHIP_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvChipClass, (klass), TYPE_PNV_CHIP) #define PNV_CHIP_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvChipClass, (obj), TYPE_PNV_CHIP) =20 -typedef struct PnvChip { +struct PnvChip { /*< private >*/ SysBusDevice parent_obj; =20 @@ -61,12 +64,13 @@ typedef struct PnvChip { AddressSpace xscom_as; =20 gchar *dt_isa_nodename; -} PnvChip; +}; =20 #define TYPE_PNV8_CHIP "pnv8-chip" +typedef struct Pnv8Chip Pnv8Chip; #define PNV8_CHIP(obj) OBJECT_CHECK(Pnv8Chip, (obj), TYPE_PNV8_CHIP) =20 -typedef struct Pnv8Chip { +struct Pnv8Chip { /*< private >*/ PnvChip parent_obj; =20 @@ -82,12 +86,13 @@ typedef struct Pnv8Chip { PnvPHB3 phbs[PNV8_CHIP_PHB3_MAX]; =20 XICSFabric *xics; -} Pnv8Chip; +}; =20 #define TYPE_PNV9_CHIP "pnv9-chip" +typedef struct Pnv9Chip Pnv9Chip; #define PNV9_CHIP(obj) OBJECT_CHECK(Pnv9Chip, (obj), TYPE_PNV9_CHIP) =20 -typedef struct Pnv9Chip { +struct Pnv9Chip { /*< private >*/ PnvChip parent_obj; =20 @@ -103,7 +108,7 @@ typedef struct Pnv9Chip { =20 #define PNV9_CHIP_MAX_PEC 3 PnvPhb4PecState pecs[PNV9_CHIP_MAX_PEC]; -} Pnv9Chip; +}; =20 /* * A SMT8 fused core is a pair of SMT4 cores. @@ -112,18 +117,19 @@ typedef struct Pnv9Chip { #define PNV9_PIR2CHIP(pir) (((pir) >> 8) & 0x7f) =20 #define TYPE_PNV10_CHIP "pnv10-chip" +typedef struct Pnv10Chip Pnv10Chip; #define PNV10_CHIP(obj) OBJECT_CHECK(Pnv10Chip, (obj), TYPE_PNV10_CHIP) =20 -typedef struct Pnv10Chip { +struct Pnv10Chip { /*< private >*/ PnvChip parent_obj; =20 /*< public >*/ Pnv9Psi psi; PnvLpcController lpc; -} Pnv10Chip; +}; =20 -typedef struct PnvChipClass { +struct PnvChipClass { /*< private >*/ SysBusDeviceClass parent_class; =20 @@ -144,7 +150,7 @@ typedef struct PnvChipClass { void (*pic_print_info)(PnvChip *chip, Monitor *mon); uint64_t (*xscom_core_base)(PnvChip *chip, uint32_t core_id); uint32_t (*xscom_pcba)(PnvChip *chip, uint64_t addr); -} PnvChipClass; +}; =20 #define PNV_CHIP_TYPE_SUFFIX "-" TYPE_PNV_CHIP #define PNV_CHIP_TYPE_NAME(cpu_model) cpu_model PNV_CHIP_TYPE_SUFFIX @@ -191,6 +197,8 @@ typedef struct PnvChipClass { PowerPCCPU *pnv_chip_find_cpu(PnvChip *chip, uint32_t pir); =20 #define TYPE_PNV_MACHINE MACHINE_TYPE_NAME("powernv") +typedef struct PnvMachineClass PnvMachineClass; +typedef struct PnvMachineState PnvMachineState; #define PNV_MACHINE(obj) \ OBJECT_CHECK(PnvMachineState, (obj), TYPE_PNV_MACHINE) #define PNV_MACHINE_GET_CLASS(obj) \ @@ -198,9 +206,8 @@ PowerPCCPU *pnv_chip_find_cpu(PnvChip *chip, uint32_t p= ir); #define PNV_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvMachineClass, klass, TYPE_PNV_MACHINE) =20 -typedef struct PnvMachineState PnvMachineState; =20 -typedef struct PnvMachineClass { +struct PnvMachineClass { /*< private >*/ MachineClass parent_class; =20 @@ -209,7 +216,7 @@ typedef struct PnvMachineClass { int compat_size; =20 void (*dt_power_mgt)(PnvMachineState *pnv, void *fdt); -} PnvMachineClass; +}; =20 struct PnvMachineState { /*< private >*/ diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index 113550eb7f..2d91a7d519 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -22,8 +22,11 @@ =20 #include "hw/cpu/core.h" #include "target/ppc/cpu.h" +#include "qom/object.h" =20 #define TYPE_PNV_CORE "powernv-cpu-core" +typedef struct PnvCore PnvCore; +typedef struct PnvCoreClass PnvCoreClass; #define PNV_CORE(obj) \ OBJECT_CHECK(PnvCore, (obj), TYPE_PNV_CORE) #define PNV_CORE_CLASS(klass) \ @@ -33,7 +36,7 @@ =20 typedef struct PnvChip PnvChip; =20 -typedef struct PnvCore { +struct PnvCore { /*< private >*/ CPUCore parent_obj; =20 @@ -44,13 +47,13 @@ typedef struct PnvCore { PnvChip *chip; =20 MemoryRegion xscom_regs; -} PnvCore; +}; =20 -typedef struct PnvCoreClass { +struct PnvCoreClass { DeviceClass parent_class; =20 const MemoryRegionOps *xscom_ops; -} PnvCoreClass; +}; =20 #define PNV_CORE_TYPE_SUFFIX "-" TYPE_PNV_CORE #define PNV_CORE_TYPE_NAME(cpu_model) cpu_model PNV_CORE_TYPE_SUFFIX @@ -65,13 +68,14 @@ static inline PnvCPUState *pnv_cpu_state(PowerPCCPU *cp= u) } =20 #define TYPE_PNV_QUAD "powernv-cpu-quad" +typedef struct PnvQuad PnvQuad; #define PNV_QUAD(obj) \ OBJECT_CHECK(PnvQuad, (obj), TYPE_PNV_QUAD) =20 -typedef struct PnvQuad { +struct PnvQuad { DeviceState parent_obj; =20 uint32_t id; MemoryRegion xscom_regs; -} PnvQuad; +}; #endif /* PPC_PNV_CORE_H */ diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h index 1e91c950f6..bedba94e18 100644 --- a/include/hw/ppc/pnv_homer.h +++ b/include/hw/ppc/pnv_homer.h @@ -21,28 +21,31 @@ #define PPC_PNV_HOMER_H =20 #include "hw/ppc/pnv.h" +#include "qom/object.h" =20 #define TYPE_PNV_HOMER "pnv-homer" +typedef struct PnvHomer PnvHomer; +typedef struct PnvHomerClass PnvHomerClass; #define PNV_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV_HOMER) #define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8" #define PNV8_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV8_HOMER) #define TYPE_PNV9_HOMER TYPE_PNV_HOMER "-POWER9" #define PNV9_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV9_HOMER) =20 -typedef struct PnvHomer { +struct PnvHomer { DeviceState parent; =20 struct PnvChip *chip; MemoryRegion pba_regs; MemoryRegion regs; -} PnvHomer; +}; =20 #define PNV_HOMER_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvHomerClass, (klass), TYPE_PNV_HOMER) #define PNV_HOMER_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvHomerClass, (obj), TYPE_PNV_HOMER) =20 -typedef struct PnvHomerClass { +struct PnvHomerClass { DeviceClass parent_class; =20 int pba_size; @@ -51,6 +54,6 @@ typedef struct PnvHomerClass { const MemoryRegionOps *homer_ops; =20 hwaddr core_max_base; -} PnvHomerClass; +}; =20 #endif /* PPC_PNV_HOMER_H */ diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h index c1ec85d5e2..50d92517f2 100644 --- a/include/hw/ppc/pnv_lpc.h +++ b/include/hw/ppc/pnv_lpc.h @@ -21,8 +21,11 @@ #define PPC_PNV_LPC_H =20 #include "hw/ppc/pnv_psi.h" +#include "qom/object.h" =20 #define TYPE_PNV_LPC "pnv-lpc" +typedef struct PnvLpcClass PnvLpcClass; +typedef struct PnvLpcController PnvLpcController; #define PNV_LPC(obj) \ OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV_LPC) #define TYPE_PNV8_LPC TYPE_PNV_LPC "-POWER8" @@ -34,7 +37,7 @@ #define TYPE_PNV10_LPC TYPE_PNV_LPC "-POWER10" #define PNV10_LPC(obj) OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV10_LP= C) =20 -typedef struct PnvLpcController { +struct PnvLpcController { DeviceState parent; =20 uint64_t eccb_stat_reg; @@ -79,20 +82,20 @@ typedef struct PnvLpcController { =20 /* PSI to generate interrupts */ PnvPsi *psi; -} PnvLpcController; +}; =20 #define PNV_LPC_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvLpcClass, (klass), TYPE_PNV_LPC) #define PNV_LPC_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvLpcClass, (obj), TYPE_PNV_LPC) =20 -typedef struct PnvLpcClass { +struct PnvLpcClass { DeviceClass parent_class; =20 int psi_irq; =20 DeviceRealize parent_realize; -} PnvLpcClass; +}; =20 /* * Old compilers error on typdef forward declarations. Keep them happy. diff --git a/include/hw/ppc/pnv_occ.h b/include/hw/ppc/pnv_occ.h index f8d3061419..30a9faea78 100644 --- a/include/hw/ppc/pnv_occ.h +++ b/include/hw/ppc/pnv_occ.h @@ -21,8 +21,11 @@ #define PPC_PNV_OCC_H =20 #include "hw/ppc/pnv_psi.h" +#include "qom/object.h" =20 #define TYPE_PNV_OCC "pnv-occ" +typedef struct PnvOCC PnvOCC; +typedef struct PnvOCCClass PnvOCCClass; #define PNV_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV_OCC) #define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8" #define PNV8_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV8_OCC) @@ -32,7 +35,7 @@ #define PNV_OCC_SENSOR_DATA_BLOCK_OFFSET 0x00580000 #define PNV_OCC_SENSOR_DATA_BLOCK_SIZE 0x00025800 =20 -typedef struct PnvOCC { +struct PnvOCC { DeviceState xd; =20 /* OCC Misc interrupt */ @@ -42,20 +45,20 @@ typedef struct PnvOCC { =20 MemoryRegion xscom_regs; MemoryRegion sram_regs; -} PnvOCC; +}; =20 #define PNV_OCC_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvOCCClass, (klass), TYPE_PNV_OCC) #define PNV_OCC_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvOCCClass, (obj), TYPE_PNV_OCC) =20 -typedef struct PnvOCCClass { +struct PnvOCCClass { DeviceClass parent_class; =20 int xscom_size; const MemoryRegionOps *xscom_ops; int psi_irq; -} PnvOCCClass; +}; =20 #define PNV_OCC_SENSOR_DATA_BLOCK_BASE(i) \ (PNV_OCC_SENSOR_DATA_BLOCK_OFFSET + (i) * PNV_OCC_SENSOR_DATA_BLOCK_SI= ZE) diff --git a/include/hw/ppc/pnv_pnor.h b/include/hw/ppc/pnv_pnor.h index 4f96abdfb4..8b27bf111c 100644 --- a/include/hw/ppc/pnv_pnor.h +++ b/include/hw/ppc/pnv_pnor.h @@ -8,6 +8,7 @@ */ #ifndef _PPC_PNV_PNOR_H #define _PPC_PNV_PNOR_H +#include "qom/object.h" =20 /* * PNOR offset on the LPC FW address space @@ -15,9 +16,10 @@ #define PNOR_SPI_OFFSET 0x0c000000UL =20 #define TYPE_PNV_PNOR "pnv-pnor" +typedef struct PnvPnor PnvPnor; #define PNV_PNOR(obj) OBJECT_CHECK(PnvPnor, (obj), TYPE_PNV_PNOR) =20 -typedef struct PnvPnor { +struct PnvPnor { SysBusDevice parent_obj; =20 BlockBackend *blk; @@ -25,6 +27,6 @@ typedef struct PnvPnor { uint8_t *storage; int64_t size; MemoryRegion mmio; -} PnvPnor; +}; =20 #endif /* _PPC_PNV_PNOR_H */ diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index 979fc59f33..060a7a110c 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -23,14 +23,17 @@ #include "hw/sysbus.h" #include "hw/ppc/xics.h" #include "hw/ppc/xive.h" +#include "qom/object.h" =20 #define TYPE_PNV_PSI "pnv-psi" +typedef struct PnvPsi PnvPsi; +typedef struct PnvPsiClass PnvPsiClass; #define PNV_PSI(obj) \ OBJECT_CHECK(PnvPsi, (obj), TYPE_PNV_PSI) =20 #define PSIHB_XSCOM_MAX 0x20 =20 -typedef struct PnvPsi { +struct PnvPsi { DeviceState parent; =20 MemoryRegion regs_mr; @@ -47,27 +50,29 @@ typedef struct PnvPsi { uint64_t regs[PSIHB_XSCOM_MAX]; =20 MemoryRegion xscom_regs; -} PnvPsi; +}; =20 #define TYPE_PNV8_PSI TYPE_PNV_PSI "-POWER8" +typedef struct Pnv8Psi Pnv8Psi; #define PNV8_PSI(obj) \ OBJECT_CHECK(Pnv8Psi, (obj), TYPE_PNV8_PSI) =20 -typedef struct Pnv8Psi { +struct Pnv8Psi { PnvPsi parent; =20 ICSState ics; -} Pnv8Psi; +}; =20 #define TYPE_PNV9_PSI TYPE_PNV_PSI "-POWER9" +typedef struct Pnv9Psi Pnv9Psi; #define PNV9_PSI(obj) \ OBJECT_CHECK(Pnv9Psi, (obj), TYPE_PNV9_PSI) =20 -typedef struct Pnv9Psi { +struct Pnv9Psi { PnvPsi parent; =20 XiveSource source; -} Pnv9Psi; +}; =20 #define TYPE_PNV10_PSI TYPE_PNV_PSI "-POWER10" =20 @@ -76,7 +81,7 @@ typedef struct Pnv9Psi { #define PNV_PSI_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvPsiClass, (obj), TYPE_PNV_PSI) =20 -typedef struct PnvPsiClass { +struct PnvPsiClass { SysBusDeviceClass parent_class; =20 uint32_t xscom_pcba; @@ -86,7 +91,7 @@ typedef struct PnvPsiClass { int compat_size; =20 void (*irq_set)(PnvPsi *psi, int, bool state); -} PnvPsiClass; +}; =20 /* The PSI and FSP interrupts are muxed on the same IRQ number */ typedef enum PnvPsiIrq { diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index 76cf16f644..24c37de184 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -11,10 +11,13 @@ #define PPC_PNV_XIVE_H =20 #include "hw/ppc/xive.h" +#include "qom/object.h" =20 struct PnvChip; =20 #define TYPE_PNV_XIVE "pnv-xive" +typedef struct PnvXive PnvXive; +typedef struct PnvXiveClass PnvXiveClass; #define PNV_XIVE(obj) OBJECT_CHECK(PnvXive, (obj), TYPE_PNV_XIVE) #define PNV_XIVE_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvXiveClass, (klass), TYPE_PNV_XIVE) @@ -28,7 +31,7 @@ struct PnvChip; #define XIVE_TABLE_VDT_MAX 16 /* VDT Domain Table (0-15) */ #define XIVE_TABLE_EDT_MAX 64 /* EDT Domain Table (0-63) */ =20 -typedef struct PnvXive { +struct PnvXive { XiveRouter parent_obj; =20 /* Owning chip */ @@ -87,13 +90,13 @@ typedef struct PnvXive { uint64_t mig[XIVE_TABLE_MIG_MAX]; uint64_t vdt[XIVE_TABLE_VDT_MAX]; uint64_t edt[XIVE_TABLE_EDT_MAX]; -} PnvXive; +}; =20 -typedef struct PnvXiveClass { +struct PnvXiveClass { XiveRouterClass parent_class; =20 DeviceRealize parent_realize; -} PnvXiveClass; +}; =20 void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon); =20 diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index 09156a5a7a..fb9b97f5be 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -27,16 +27,17 @@ typedef struct PnvXScomInterface PnvXScomInterface; #define TYPE_PNV_XSCOM_INTERFACE "pnv-xscom-interface" #define PNV_XSCOM_INTERFACE(obj) \ INTERFACE_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE) +typedef struct PnvXScomInterfaceClass PnvXScomInterfaceClass; #define PNV_XSCOM_INTERFACE_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvXScomInterfaceClass, (klass), \ TYPE_PNV_XSCOM_INTERFACE) #define PNV_XSCOM_INTERFACE_GET_CLASS(obj) \ OBJECT_GET_CLASS(PnvXScomInterfaceClass, (obj), TYPE_PNV_XSCOM_INTERF= ACE) =20 -typedef struct PnvXScomInterfaceClass { +struct PnvXScomInterfaceClass { InterfaceClass parent; int (*dt_xscom)(PnvXScomInterface *dev, void *fdt, int offset); -} PnvXScomInterfaceClass; +}; =20 /* * Layout of the XSCOM PCB addresses of EX core 1 (POWER 8) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index a1e230ad39..69eafe913a 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -8,6 +8,7 @@ #include "hw/mem/pc-dimm.h" #include "hw/ppc/spapr_ovec.h" #include "hw/ppc/spapr_irq.h" +#include "qom/object.h" #include "hw/ppc/spapr_xive.h" /* For SpaprXive */ #include "hw/ppc/xics.h" /* For ICSState */ #include "hw/ppc/spapr_tpm_proxy.h" @@ -27,10 +28,10 @@ typedef struct SpaprPendingHpt SpaprPendingHpt; =20 #define TYPE_SPAPR_RTC "spapr-rtc" =20 +typedef struct SpaprRtcState SpaprRtcState; #define SPAPR_RTC(obj) \ OBJECT_CHECK(SpaprRtcState, (obj), TYPE_SPAPR_RTC) =20 -typedef struct SpaprRtcState SpaprRtcState; struct SpaprRtcState { /*< private >*/ DeviceState parent_obj; diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_cor= e.h index 7aed8f555b..adcf74dbc3 100644 --- a/include/hw/ppc/spapr_cpu_core.h +++ b/include/hw/ppc/spapr_cpu_core.h @@ -13,8 +13,11 @@ #include "hw/qdev-core.h" #include "target/ppc/cpu-qom.h" #include "target/ppc/cpu.h" +#include "qom/object.h" =20 #define TYPE_SPAPR_CPU_CORE "spapr-cpu-core" +typedef struct SpaprCpuCore SpaprCpuCore; +typedef struct SpaprCpuCoreClass SpaprCpuCoreClass; #define SPAPR_CPU_CORE(obj) \ OBJECT_CHECK(SpaprCpuCore, (obj), TYPE_SPAPR_CPU_CORE) #define SPAPR_CPU_CORE_CLASS(klass) \ @@ -24,7 +27,7 @@ =20 #define SPAPR_CPU_CORE_TYPE_NAME(model) model "-" TYPE_SPAPR_CPU_CORE =20 -typedef struct SpaprCpuCore { +struct SpaprCpuCore { /*< private >*/ CPUCore parent_obj; =20 @@ -32,12 +35,12 @@ typedef struct SpaprCpuCore { PowerPCCPU **threads; int node_id; bool pre_3_0_migration; /* older machine don't know about SpaprCpuStat= e */ -} SpaprCpuCore; +}; =20 -typedef struct SpaprCpuCoreClass { +struct SpaprCpuCoreClass { DeviceClass parent_class; const char *cpu_type; -} SpaprCpuCoreClass; +}; =20 const char *spapr_get_cpu_core_type(const char *cpu_type); void spapr_cpu_set_entry_state(PowerPCCPU *cpu, target_ulong nip, diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 21af8deac1..ab799930bf 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -20,6 +20,8 @@ #include "qapi/error.h" =20 #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector" +typedef struct SpaprDrc SpaprDrc; +typedef struct SpaprDrcClass SpaprDrcClass; #define SPAPR_DR_CONNECTOR_GET_CLASS(obj) \ OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DR_CONNECTOR) #define SPAPR_DR_CONNECTOR_CLASS(klass) \ @@ -29,6 +31,7 @@ TYPE_SPAPR_DR_CONNECTOR) =20 #define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" +typedef struct SpaprDrcPhysical SpaprDrcPhysical; #define SPAPR_DRC_PHYSICAL_GET_CLASS(obj) \ OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHYSICAL) #define SPAPR_DRC_PHYSICAL_CLASS(klass) \ @@ -209,7 +212,7 @@ typedef enum { SPAPR_DRC_STATE_PHYSICAL_CONFIGURED =3D 8, } SpaprDrcState; =20 -typedef struct SpaprDrc { +struct SpaprDrc { /*< private >*/ DeviceState parent; =20 @@ -228,11 +231,11 @@ typedef struct SpaprDrc { bool unplug_requested; void *fdt; int fdt_start_offset; -} SpaprDrc; +}; =20 struct SpaprMachineState; =20 -typedef struct SpaprDrcClass { +struct SpaprDrcClass { /*< private >*/ DeviceClass parent; SpaprDrcState empty_state; @@ -250,15 +253,15 @@ typedef struct SpaprDrcClass { =20 int (*dt_populate)(SpaprDrc *drc, struct SpaprMachineState *spapr, void *fdt, int *fdt_start_offset, Error **errp); -} SpaprDrcClass; +}; =20 -typedef struct SpaprDrcPhysical { +struct SpaprDrcPhysical { /*< private >*/ SpaprDrc parent; =20 /* DR-indicator */ uint32_t dr_indicator; -} SpaprDrcPhysical; +}; =20 static inline bool spapr_drc_hotplugged(DeviceState *dev) { diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index b161ccebc2..83addd0a0b 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -11,6 +11,7 @@ #define HW_SPAPR_IRQ_H =20 #include "target/ppc/cpu-qom.h" +#include "qom/object.h" =20 /* * IRQ range offsets per device type @@ -35,12 +36,13 @@ typedef struct SpaprInterruptController SpaprInterruptC= ontroller; #define TYPE_SPAPR_INTC "spapr-interrupt-controller" #define SPAPR_INTC(obj) \ INTERFACE_CHECK(SpaprInterruptController, (obj), TYPE_SPAPR_INTC) +typedef struct SpaprInterruptControllerClass SpaprInterruptControllerClass; #define SPAPR_INTC_CLASS(klass) \ OBJECT_CLASS_CHECK(SpaprInterruptControllerClass, (klass), TYPE_SPAPR_= INTC) #define SPAPR_INTC_GET_CLASS(obj) \ OBJECT_GET_CLASS(SpaprInterruptControllerClass, (obj), TYPE_SPAPR_INTC) =20 -typedef struct SpaprInterruptControllerClass { +struct SpaprInterruptControllerClass { InterfaceClass parent; =20 int (*activate)(SpaprInterruptController *intc, uint32_t nr_servers, @@ -65,7 +67,7 @@ typedef struct SpaprInterruptControllerClass { void (*dt)(SpaprInterruptController *intc, uint32_t nr_servers, void *fdt, uint32_t phandle); int (*post_load)(SpaprInterruptController *intc, int version_id); -} SpaprInterruptControllerClass; +}; =20 void spapr_irq_update_active_intc(struct SpaprMachineState *spapr); =20 diff --git a/include/hw/ppc/spapr_tpm_proxy.h b/include/hw/ppc/spapr_tpm_pr= oxy.h index c574e22ba4..1e9890d978 100644 --- a/include/hw/ppc/spapr_tpm_proxy.h +++ b/include/hw/ppc/spapr_tpm_proxy.h @@ -17,15 +17,16 @@ #include "hw/qdev-core.h" =20 #define TYPE_SPAPR_TPM_PROXY "spapr-tpm-proxy" +typedef struct SpaprTpmProxy SpaprTpmProxy; #define SPAPR_TPM_PROXY(obj) OBJECT_CHECK(SpaprTpmProxy, (obj), \ TYPE_SPAPR_TPM_PROXY) =20 -typedef struct SpaprTpmProxy { +struct SpaprTpmProxy { /*< private >*/ DeviceState parent; =20 char *host_path; int host_fd; -} SpaprTpmProxy; +}; =20 #endif /* HW_SPAPR_TPM_PROXY_H */ diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index bed7df60e3..9c9d14e63b 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -25,8 +25,11 @@ #include "hw/ppc/spapr.h" #include "sysemu/dma.h" #include "hw/irq.h" +#include "qom/object.h" =20 #define TYPE_VIO_SPAPR_DEVICE "vio-spapr-device" +typedef struct SpaprVioDevice SpaprVioDevice; +typedef struct SpaprVioDeviceClass SpaprVioDeviceClass; #define VIO_SPAPR_DEVICE(obj) \ OBJECT_CHECK(SpaprVioDevice, (obj), TYPE_VIO_SPAPR_DEVICE) #define VIO_SPAPR_DEVICE_CLASS(klass) \ @@ -35,6 +38,7 @@ OBJECT_GET_CLASS(SpaprVioDeviceClass, (obj), TYPE_VIO_SPAPR_DEVICE) =20 #define TYPE_SPAPR_VIO_BUS "spapr-vio-bus" +typedef struct SpaprVioBus SpaprVioBus; #define SPAPR_VIO_BUS(obj) OBJECT_CHECK(SpaprVioBus, (obj), TYPE_SPAPR_VIO= _BUS) =20 #define TYPE_SPAPR_VIO_BRIDGE "spapr-vio-bridge" @@ -46,10 +50,8 @@ typedef struct SpaprVioCrq { int(*SendFunc)(struct SpaprVioDevice *vdev, uint8_t *crq); } SpaprVioCrq; =20 -typedef struct SpaprVioDevice SpaprVioDevice; -typedef struct SpaprVioBus SpaprVioBus; =20 -typedef struct SpaprVioDeviceClass { +struct SpaprVioDeviceClass { DeviceClass parent_class; =20 const char *dt_name, *dt_type, *dt_compatible; @@ -59,7 +61,7 @@ typedef struct SpaprVioDeviceClass { void (*reset)(SpaprVioDevice *dev); int (*devnode)(SpaprVioDevice *dev, void *fdt, int node_off); const char *(*get_dt_compatible)(SpaprVioDevice *dev); -} SpaprVioDeviceClass; +}; =20 struct SpaprVioDevice { DeviceState qdev; diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index a1c8540ab4..620abc6639 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -12,15 +12,18 @@ =20 #include "hw/ppc/spapr_irq.h" #include "hw/ppc/xive.h" +#include "qom/object.h" =20 #define TYPE_SPAPR_XIVE "spapr-xive" +typedef struct SpaprXive SpaprXive; +typedef struct SpaprXiveClass SpaprXiveClass; #define SPAPR_XIVE(obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE) #define SPAPR_XIVE_CLASS(klass) \ OBJECT_CLASS_CHECK(SpaprXiveClass, (klass), TYPE_SPAPR_XIVE) #define SPAPR_XIVE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SpaprXiveClass, (obj), TYPE_SPAPR_XIVE) =20 -typedef struct SpaprXive { +struct SpaprXive { XiveRouter parent; =20 /* Internal interrupt source for IPIs and virtual devices */ @@ -49,13 +52,13 @@ typedef struct SpaprXive { void *tm_mmap; MemoryRegion tm_mmio_kvm; VMChangeStateEntry *change; -} SpaprXive; +}; =20 -typedef struct SpaprXiveClass { +struct SpaprXiveClass { XiveRouterClass parent; =20 DeviceRealize parent_realize; -} SpaprXiveClass; +}; =20 /* * The sPAPR machine has a unique XIVE IC device. Assign a fixed value diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 9ed58ec7e9..e5f48faba0 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -30,6 +30,7 @@ =20 #include "exec/memory.h" #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define XICS_IPI 0x2 #define XICS_BUID 0x1 @@ -145,17 +146,18 @@ struct ICSIRQState { #define TYPE_XICS_FABRIC "xics-fabric" #define XICS_FABRIC(obj) \ INTERFACE_CHECK(XICSFabric, (obj), TYPE_XICS_FABRIC) +typedef struct XICSFabricClass XICSFabricClass; #define XICS_FABRIC_CLASS(klass) \ OBJECT_CLASS_CHECK(XICSFabricClass, (klass), TYPE_XICS_FABRIC) #define XICS_FABRIC_GET_CLASS(obj) \ OBJECT_GET_CLASS(XICSFabricClass, (obj), TYPE_XICS_FABRIC) =20 -typedef struct XICSFabricClass { +struct XICSFabricClass { InterfaceClass parent; ICSState *(*ics_get)(XICSFabric *xi, int irq); void (*ics_resend)(XICSFabric *xi); ICPState *(*icp_get)(XICSFabric *xi, int server); -} XICSFabricClass; +}; =20 ICPState *xics_icp_get(XICSFabric *xi, int server); =20 diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h index 1c65c96e3c..09e428de4e 100644 --- a/include/hw/ppc/xics_spapr.h +++ b/include/hw/ppc/xics_spapr.h @@ -28,6 +28,7 @@ #define XICS_SPAPR_H =20 #include "hw/ppc/spapr.h" +#include "qom/object.h" =20 #define TYPE_ICS_SPAPR "ics-spapr" #define ICS_SPAPR(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS_SPAPR) diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 2c42ae92d2..8ef9af1969 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -143,6 +143,7 @@ #include "sysemu/kvm.h" #include "hw/sysbus.h" #include "hw/ppc/xive_regs.h" +#include "qom/object.h" =20 /* * XIVE Notifier (Interface between Source and Router) @@ -153,21 +154,23 @@ typedef struct XiveNotifier XiveNotifier; #define TYPE_XIVE_NOTIFIER "xive-notifier" #define XIVE_NOTIFIER(obj) \ INTERFACE_CHECK(XiveNotifier, (obj), TYPE_XIVE_NOTIFIER) +typedef struct XiveNotifierClass XiveNotifierClass; #define XIVE_NOTIFIER_CLASS(klass) \ OBJECT_CLASS_CHECK(XiveNotifierClass, (klass), TYPE_XIVE_NOTIFIER) #define XIVE_NOTIFIER_GET_CLASS(obj) \ OBJECT_GET_CLASS(XiveNotifierClass, (obj), TYPE_XIVE_NOTIFIER) =20 -typedef struct XiveNotifierClass { +struct XiveNotifierClass { InterfaceClass parent; void (*notify)(XiveNotifier *xn, uint32_t lisn); -} XiveNotifierClass; +}; =20 /* * XIVE Interrupt Source */ =20 #define TYPE_XIVE_SOURCE "xive-source" +typedef struct XiveSource XiveSource; #define XIVE_SOURCE(obj) OBJECT_CHECK(XiveSource, (obj), TYPE_XIVE_SOURCE) =20 /* @@ -177,7 +180,7 @@ typedef struct XiveNotifierClass { #define XIVE_SRC_H_INT_ESB 0x1 /* ESB managed with hcall H_INT_ESB */ #define XIVE_SRC_STORE_EOI 0x2 /* Store EOI supported */ =20 -typedef struct XiveSource { +struct XiveSource { DeviceState parent; =20 /* IRQs */ @@ -198,7 +201,7 @@ typedef struct XiveSource { MemoryRegion esb_mmio_kvm; =20 XiveNotifier *xive; -} XiveSource; +}; =20 /* * ESB MMIO setting. Can be one page, for both source triggering and @@ -304,6 +307,7 @@ void xive_source_set_irq(void *opaque, int srcno, int v= al); */ =20 #define TYPE_XIVE_TCTX "xive-tctx" +typedef struct XiveTCTX XiveTCTX; #define XIVE_TCTX(obj) OBJECT_CHECK(XiveTCTX, (obj), TYPE_XIVE_TCTX) =20 /* @@ -319,7 +323,7 @@ void xive_source_set_irq(void *opaque, int srcno, int v= al); =20 typedef struct XivePresenter XivePresenter; =20 -typedef struct XiveTCTX { +struct XiveTCTX { DeviceState parent_obj; =20 CPUState *cs; @@ -329,20 +333,22 @@ typedef struct XiveTCTX { uint8_t regs[XIVE_TM_RING_COUNT * XIVE_TM_RING_SIZE]; =20 XivePresenter *xptr; -} XiveTCTX; +}; =20 /* * XIVE Router */ typedef struct XiveFabric XiveFabric; =20 -typedef struct XiveRouter { +struct XiveRouter { SysBusDevice parent; =20 XiveFabric *xfb; -} XiveRouter; +}; +typedef struct XiveRouter XiveRouter; =20 #define TYPE_XIVE_ROUTER "xive-router" +typedef struct XiveRouterClass XiveRouterClass; #define XIVE_ROUTER(obj) \ OBJECT_CHECK(XiveRouter, (obj), TYPE_XIVE_ROUTER) #define XIVE_ROUTER_CLASS(klass) \ @@ -350,7 +356,7 @@ typedef struct XiveRouter { #define XIVE_ROUTER_GET_CLASS(obj) \ OBJECT_GET_CLASS(XiveRouterClass, (obj), TYPE_XIVE_ROUTER) =20 -typedef struct XiveRouterClass { +struct XiveRouterClass { SysBusDeviceClass parent; =20 /* XIVE table accessors */ @@ -365,7 +371,7 @@ typedef struct XiveRouterClass { int (*write_nvt)(XiveRouter *xrtr, uint8_t nvt_blk, uint32_t nvt_idx, XiveNVT *nvt, uint8_t word_number); uint8_t (*get_block_id)(XiveRouter *xrtr); -} XiveRouterClass; +}; =20 int xive_router_get_eas(XiveRouter *xrtr, uint8_t eas_blk, uint32_t eas_id= x, XiveEAS *eas); @@ -391,19 +397,20 @@ typedef struct XiveTCTXMatch { #define TYPE_XIVE_PRESENTER "xive-presenter" #define XIVE_PRESENTER(obj) \ INTERFACE_CHECK(XivePresenter, (obj), TYPE_XIVE_PRESENTER) +typedef struct XivePresenterClass XivePresenterClass; #define XIVE_PRESENTER_CLASS(klass) \ OBJECT_CLASS_CHECK(XivePresenterClass, (klass), TYPE_XIVE_PRESENTER) #define XIVE_PRESENTER_GET_CLASS(obj) \ OBJECT_GET_CLASS(XivePresenterClass, (obj), TYPE_XIVE_PRESENTER) =20 -typedef struct XivePresenterClass { +struct XivePresenterClass { InterfaceClass parent; int (*match_nvt)(XivePresenter *xptr, uint8_t format, uint8_t nvt_blk, uint32_t nvt_idx, bool cam_ignore, uint8_t priority, uint32_t logic_serv, XiveTCTXMatch *match); bool (*in_kernel)(const XivePresenter *xptr); -} XivePresenterClass; +}; =20 int xive_presenter_tctx_match(XivePresenter *xptr, XiveTCTX *tctx, uint8_t format, @@ -417,28 +424,30 @@ int xive_presenter_tctx_match(XivePresenter *xptr, Xi= veTCTX *tctx, #define TYPE_XIVE_FABRIC "xive-fabric" #define XIVE_FABRIC(obj) \ INTERFACE_CHECK(XiveFabric, (obj), TYPE_XIVE_FABRIC) +typedef struct XiveFabricClass XiveFabricClass; #define XIVE_FABRIC_CLASS(klass) \ OBJECT_CLASS_CHECK(XiveFabricClass, (klass), TYPE_XIVE_FABRIC) #define XIVE_FABRIC_GET_CLASS(obj) \ OBJECT_GET_CLASS(XiveFabricClass, (obj), TYPE_XIVE_FABRIC) =20 -typedef struct XiveFabricClass { +struct XiveFabricClass { InterfaceClass parent; int (*match_nvt)(XiveFabric *xfb, uint8_t format, uint8_t nvt_blk, uint32_t nvt_idx, bool cam_ignore, uint8_t priority, uint32_t logic_serv, XiveTCTXMatch *match); -} XiveFabricClass; +}; =20 /* * XIVE END ESBs */ =20 #define TYPE_XIVE_END_SOURCE "xive-end-source" +typedef struct XiveENDSource XiveENDSource; #define XIVE_END_SOURCE(obj) \ OBJECT_CHECK(XiveENDSource, (obj), TYPE_XIVE_END_SOURCE) =20 -typedef struct XiveENDSource { +struct XiveENDSource { DeviceState parent; =20 uint32_t nr_ends; @@ -448,7 +457,7 @@ typedef struct XiveENDSource { MemoryRegion esb_mmio; =20 XiveRouter *xrtr; -} XiveENDSource; +}; =20 /* * For legacy compatibility, the exceptions define up to 256 different diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index ea3f73a282..479377f37b 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -12,6 +12,7 @@ enum { }; =20 #define TYPE_DEVICE "device" +typedef struct DeviceClass DeviceClass; #define DEVICE(obj) OBJECT_CHECK(DeviceState, (obj), TYPE_DEVICE) #define DEVICE_CLASS(klass) OBJECT_CLASS_CHECK(DeviceClass, (klass), TYPE_= DEVICE) #define DEVICE_GET_CLASS(obj) OBJECT_GET_CLASS(DeviceClass, (obj), TYPE_DE= VICE) @@ -93,7 +94,7 @@ typedef void (*BusUnrealize)(BusState *bus); * until it was marked don't hide and qdev_device_add called again. * */ -typedef struct DeviceClass { +struct DeviceClass { /*< private >*/ ObjectClass parent_class; /*< public >*/ @@ -137,7 +138,7 @@ typedef struct DeviceClass { =20 /* Private to qdev / bus. */ const char *bus_type; -} DeviceClass; +}; =20 typedef struct NamedGPIOList NamedGPIOList; =20 diff --git a/include/hw/rdma/rdma.h b/include/hw/rdma/rdma.h index fd3d70103d..aef82e58db 100644 --- a/include/hw/rdma/rdma.h +++ b/include/hw/rdma/rdma.h @@ -19,6 +19,7 @@ =20 #define INTERFACE_RDMA_PROVIDER "rdma" =20 +typedef struct RdmaProviderClass RdmaProviderClass; #define RDMA_PROVIDER_CLASS(klass) \ OBJECT_CLASS_CHECK(RdmaProviderClass, (klass), \ INTERFACE_RDMA_PROVIDER) @@ -31,10 +32,10 @@ =20 typedef struct RdmaProvider RdmaProvider; =20 -typedef struct RdmaProviderClass { +struct RdmaProviderClass { InterfaceClass parent; =20 void (*print_statistics)(Monitor *mon, RdmaProvider *obj); -} RdmaProviderClass; +}; =20 #endif diff --git a/include/hw/register.h b/include/hw/register.h index fdac5e69b5..29c669e901 100644 --- a/include/hw/register.h +++ b/include/hw/register.h @@ -14,6 +14,7 @@ #include "hw/qdev-core.h" #include "exec/memory.h" #include "hw/registerfields.h" +#include "qom/object.h" =20 typedef struct RegisterInfo RegisterInfo; typedef struct RegisterAccessInfo RegisterAccessInfo; diff --git a/include/hw/resettable.h b/include/hw/resettable.h index f4c4bab0ef..bcd36bce06 100644 --- a/include/hw/resettable.h +++ b/include/hw/resettable.h @@ -17,6 +17,7 @@ =20 #define TYPE_RESETTABLE_INTERFACE "resettable" =20 +typedef struct ResettableClass ResettableClass; #define RESETTABLE_CLASS(class) \ OBJECT_CLASS_CHECK(ResettableClass, (class), TYPE_RESETTABLE_INTERFACE) =20 @@ -119,7 +120,7 @@ typedef struct ResettablePhases { ResettableHoldPhase hold; ResettableExitPhase exit; } ResettablePhases; -typedef struct ResettableClass { +struct ResettableClass { InterfaceClass parent_class; =20 /* Phase methods */ @@ -133,7 +134,7 @@ typedef struct ResettableClass { =20 /* Hierarchy handling method */ ResettableChildForeach child_foreach; -} ResettableClass; +}; =20 /** * ResettableState: diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index 835a80f896..b42599ff54 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -22,12 +22,14 @@ #include "hw/riscv/riscv_hart.h" #include "hw/intc/ibex_plic.h" #include "hw/char/ibex_uart.h" +#include "qom/object.h" =20 #define TYPE_RISCV_IBEX_SOC "riscv.lowrisc.ibex.soc" +typedef struct LowRISCIbexSoCState LowRISCIbexSoCState; #define RISCV_IBEX_SOC(obj) \ OBJECT_CHECK(LowRISCIbexSoCState, (obj), TYPE_RISCV_IBEX_SOC) =20 -typedef struct LowRISCIbexSoCState { +struct LowRISCIbexSoCState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -38,7 +40,7 @@ typedef struct LowRISCIbexSoCState { =20 MemoryRegion flash_mem; MemoryRegion rom; -} LowRISCIbexSoCState; +}; =20 typedef struct OpenTitanState { /*< private >*/ diff --git a/include/hw/riscv/riscv_hart.h b/include/hw/riscv/riscv_hart.h index c75856fa73..617b977214 100644 --- a/include/hw/riscv/riscv_hart.h +++ b/include/hw/riscv/riscv_hart.h @@ -23,13 +23,15 @@ =20 #include "hw/sysbus.h" #include "target/riscv/cpu.h" +#include "qom/object.h" =20 #define TYPE_RISCV_HART_ARRAY "riscv.hart_array" =20 +typedef struct RISCVHartArrayState RISCVHartArrayState; #define RISCV_HART_ARRAY(obj) \ OBJECT_CHECK(RISCVHartArrayState, (obj), TYPE_RISCV_HART_ARRAY) =20 -typedef struct RISCVHartArrayState { +struct RISCVHartArrayState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -38,6 +40,6 @@ typedef struct RISCVHartArrayState { uint32_t hartid_base; char *cpu_type; RISCVCPU *harts; -} RISCVHartArrayState; +}; =20 #endif diff --git a/include/hw/riscv/sifive_clint.h b/include/hw/riscv/sifive_clin= t.h index 9f5fb3d31d..eb51b43dd6 100644 --- a/include/hw/riscv/sifive_clint.h +++ b/include/hw/riscv/sifive_clint.h @@ -21,13 +21,15 @@ #define HW_SIFIVE_CLINT_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_SIFIVE_CLINT "riscv.sifive.clint" =20 +typedef struct SiFiveCLINTState SiFiveCLINTState; #define SIFIVE_CLINT(obj) \ OBJECT_CHECK(SiFiveCLINTState, (obj), TYPE_SIFIVE_CLINT) =20 -typedef struct SiFiveCLINTState { +struct SiFiveCLINTState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -39,7 +41,7 @@ typedef struct SiFiveCLINTState { uint32_t timecmp_base; uint32_t time_base; uint32_t aperture_size; -} SiFiveCLINTState; +}; =20 DeviceState *sifive_clint_create(hwaddr addr, hwaddr size, uint32_t hartid_base, uint32_t num_harts, uint32_t sip_base, diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h index 637414130b..9dddf91a02 100644 --- a/include/hw/riscv/sifive_e.h +++ b/include/hw/riscv/sifive_e.h @@ -22,12 +22,14 @@ #include "hw/riscv/riscv_hart.h" #include "hw/riscv/sifive_cpu.h" #include "hw/riscv/sifive_gpio.h" +#include "qom/object.h" =20 #define TYPE_RISCV_E_SOC "riscv.sifive.e.soc" +typedef struct SiFiveESoCState SiFiveESoCState; #define RISCV_E_SOC(obj) \ OBJECT_CHECK(SiFiveESoCState, (obj), TYPE_RISCV_E_SOC) =20 -typedef struct SiFiveESoCState { +struct SiFiveESoCState { /*< private >*/ DeviceState parent_obj; =20 @@ -37,16 +39,17 @@ typedef struct SiFiveESoCState { SIFIVEGPIOState gpio; MemoryRegion xip_mem; MemoryRegion mask_rom; -} SiFiveESoCState; +}; =20 -typedef struct SiFiveEState { +struct SiFiveEState { /*< private >*/ SysBusDevice parent_obj; =20 /*< public >*/ SiFiveESoCState soc; bool revb; -} SiFiveEState; +}; +typedef struct SiFiveEState SiFiveEState; =20 #define TYPE_RISCV_E_MACHINE MACHINE_TYPE_NAME("sifive_e") #define RISCV_E_MACHINE(obj) \ diff --git a/include/hw/riscv/sifive_e_prci.h b/include/hw/riscv/sifive_e_p= rci.h index 698b0b451c..de1e502eea 100644 --- a/include/hw/riscv/sifive_e_prci.h +++ b/include/hw/riscv/sifive_e_prci.h @@ -18,6 +18,7 @@ =20 #ifndef HW_SIFIVE_E_PRCI_H #define HW_SIFIVE_E_PRCI_H +#include "qom/object.h" =20 enum { SIFIVE_E_PRCI_HFROSCCFG =3D 0x0, @@ -51,10 +52,11 @@ enum { =20 #define TYPE_SIFIVE_E_PRCI "riscv.sifive.e.prci" =20 +typedef struct SiFiveEPRCIState SiFiveEPRCIState; #define SIFIVE_E_PRCI(obj) \ OBJECT_CHECK(SiFiveEPRCIState, (obj), TYPE_SIFIVE_E_PRCI) =20 -typedef struct SiFiveEPRCIState { +struct SiFiveEPRCIState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -64,7 +66,7 @@ typedef struct SiFiveEPRCIState { uint32_t hfxosccfg; uint32_t pllcfg; uint32_t plloutdiv; -} SiFiveEPRCIState; +}; =20 DeviceState *sifive_e_prci_create(hwaddr addr); =20 diff --git a/include/hw/riscv/sifive_gpio.h b/include/hw/riscv/sifive_gpio.h index cf12fcfd62..af991fa44e 100644 --- a/include/hw/riscv/sifive_gpio.h +++ b/include/hw/riscv/sifive_gpio.h @@ -15,8 +15,10 @@ #define SIFIVE_GPIO_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_SIFIVE_GPIO "sifive_soc.gpio" +typedef struct SIFIVEGPIOState SIFIVEGPIOState; #define SIFIVE_GPIO(obj) OBJECT_CHECK(SIFIVEGPIOState, (obj), TYPE_SIFIVE_= GPIO) =20 #define SIFIVE_GPIO_PINS 32 @@ -41,7 +43,7 @@ #define SIFIVE_GPIO_REG_IOF_SEL 0x03C #define SIFIVE_GPIO_REG_OUT_XOR 0x040 =20 -typedef struct SIFIVEGPIOState { +struct SIFIVEGPIOState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -71,6 +73,6 @@ typedef struct SIFIVEGPIOState { =20 /* config */ uint32_t ngpio; -} SIFIVEGPIOState; +}; =20 #endif /* SIFIVE_GPIO_H */ diff --git a/include/hw/riscv/sifive_plic.h b/include/hw/riscv/sifive_plic.h index ace76d0f1b..aa6ae13c3a 100644 --- a/include/hw/riscv/sifive_plic.h +++ b/include/hw/riscv/sifive_plic.h @@ -22,9 +22,11 @@ #define HW_SIFIVE_PLIC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_SIFIVE_PLIC "riscv.sifive.plic" =20 +typedef struct SiFivePLICState SiFivePLICState; #define SIFIVE_PLIC(obj) \ OBJECT_CHECK(SiFivePLICState, (obj), TYPE_SIFIVE_PLIC) =20 @@ -41,7 +43,7 @@ typedef struct PLICAddr { PLICMode mode; } PLICAddr; =20 -typedef struct SiFivePLICState { +struct SiFivePLICState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -69,7 +71,7 @@ typedef struct SiFivePLICState { uint32_t context_base; uint32_t context_stride; uint32_t aperture_size; -} SiFivePLICState; +}; =20 DeviceState *sifive_plic_create(hwaddr addr, char *hart_config, uint32_t hartid_base, uint32_t num_sources, diff --git a/include/hw/riscv/sifive_test.h b/include/hw/riscv/sifive_test.h index 1ec416ac1b..dc54b7af0c 100644 --- a/include/hw/riscv/sifive_test.h +++ b/include/hw/riscv/sifive_test.h @@ -20,19 +20,21 @@ #define HW_SIFIVE_TEST_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_SIFIVE_TEST "riscv.sifive.test" =20 +typedef struct SiFiveTestState SiFiveTestState; #define SIFIVE_TEST(obj) \ OBJECT_CHECK(SiFiveTestState, (obj), TYPE_SIFIVE_TEST) =20 -typedef struct SiFiveTestState { +struct SiFiveTestState { /*< private >*/ SysBusDevice parent_obj; =20 /*< public >*/ MemoryRegion mmio; -} SiFiveTestState; +}; =20 enum { FINISHER_FAIL =3D 0x3333, diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index d3c0c00d10..30bd41d391 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -25,12 +25,14 @@ #include "hw/riscv/sifive_gpio.h" #include "hw/riscv/sifive_u_prci.h" #include "hw/riscv/sifive_u_otp.h" +#include "qom/object.h" =20 #define TYPE_RISCV_U_SOC "riscv.sifive.u.soc" +typedef struct SiFiveUSoCState SiFiveUSoCState; #define RISCV_U_SOC(obj) \ OBJECT_CHECK(SiFiveUSoCState, (obj), TYPE_RISCV_U_SOC) =20 -typedef struct SiFiveUSoCState { +struct SiFiveUSoCState { /*< private >*/ DeviceState parent_obj; =20 @@ -46,13 +48,14 @@ typedef struct SiFiveUSoCState { CadenceGEMState gem; =20 uint32_t serial; -} SiFiveUSoCState; +}; =20 #define TYPE_RISCV_U_MACHINE MACHINE_TYPE_NAME("sifive_u") +typedef struct SiFiveUState SiFiveUState; #define RISCV_U_MACHINE(obj) \ OBJECT_CHECK(SiFiveUState, (obj), TYPE_RISCV_U_MACHINE) =20 -typedef struct SiFiveUState { +struct SiFiveUState { /*< private >*/ MachineState parent_obj; =20 @@ -65,7 +68,7 @@ typedef struct SiFiveUState { bool start_in_flash; uint32_t msel; uint32_t serial; -} SiFiveUState; +}; =20 enum { SIFIVE_U_DEBUG, diff --git a/include/hw/riscv/sifive_u_otp.h b/include/hw/riscv/sifive_u_ot= p.h index 639297564a..4572534f50 100644 --- a/include/hw/riscv/sifive_u_otp.h +++ b/include/hw/riscv/sifive_u_otp.h @@ -18,6 +18,7 @@ =20 #ifndef HW_SIFIVE_U_OTP_H #define HW_SIFIVE_U_OTP_H +#include "qom/object.h" =20 #define SIFIVE_U_OTP_PA 0x00 #define SIFIVE_U_OTP_PAIO 0x04 @@ -49,10 +50,11 @@ =20 #define TYPE_SIFIVE_U_OTP "riscv.sifive.u.otp" =20 +typedef struct SiFiveUOTPState SiFiveUOTPState; #define SIFIVE_U_OTP(obj) \ OBJECT_CHECK(SiFiveUOTPState, (obj), TYPE_SIFIVE_U_OTP) =20 -typedef struct SiFiveUOTPState { +struct SiFiveUOTPState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -75,6 +77,6 @@ typedef struct SiFiveUOTPState { uint32_t fuse[SIFIVE_U_OTP_NUM_FUSES]; /* config */ uint32_t serial; -} SiFiveUOTPState; +}; =20 #endif /* HW_SIFIVE_U_OTP_H */ diff --git a/include/hw/riscv/sifive_u_prci.h b/include/hw/riscv/sifive_u_p= rci.h index 0a531fdadc..83eab43686 100644 --- a/include/hw/riscv/sifive_u_prci.h +++ b/include/hw/riscv/sifive_u_prci.h @@ -18,6 +18,7 @@ =20 #ifndef HW_SIFIVE_U_PRCI_H #define HW_SIFIVE_U_PRCI_H +#include "qom/object.h" =20 #define SIFIVE_U_PRCI_HFXOSCCFG 0x00 #define SIFIVE_U_PRCI_COREPLLCFG0 0x04 @@ -58,10 +59,11 @@ =20 #define TYPE_SIFIVE_U_PRCI "riscv.sifive.u.prci" =20 +typedef struct SiFiveUPRCIState SiFiveUPRCIState; #define SIFIVE_U_PRCI(obj) \ OBJECT_CHECK(SiFiveUPRCIState, (obj), TYPE_SIFIVE_U_PRCI) =20 -typedef struct SiFiveUPRCIState { +struct SiFiveUPRCIState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -76,7 +78,7 @@ typedef struct SiFiveUPRCIState { uint32_t coreclksel; uint32_t devicesreset; uint32_t clkmuxstatus; -} SiFiveUPRCIState; +}; =20 /* * Clock indexes for use by Device Tree data and the PRCI driver. diff --git a/include/hw/riscv/sifive_uart.h b/include/hw/riscv/sifive_uart.h index 65668825a3..2bb72ac80b 100644 --- a/include/hw/riscv/sifive_uart.h +++ b/include/hw/riscv/sifive_uart.h @@ -22,6 +22,7 @@ =20 #include "chardev/char-fe.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 enum { SIFIVE_UART_TXFIFO =3D 0, @@ -51,10 +52,11 @@ enum { =20 #define TYPE_SIFIVE_UART "riscv.sifive.uart" =20 +typedef struct SiFiveUARTState SiFiveUARTState; #define SIFIVE_UART(obj) \ OBJECT_CHECK(SiFiveUARTState, (obj), TYPE_SIFIVE_UART) =20 -typedef struct SiFiveUARTState { +struct SiFiveUARTState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -69,7 +71,7 @@ typedef struct SiFiveUARTState { uint32_t txctrl; uint32_t rxctrl; uint32_t div; -} SiFiveUARTState; +}; =20 SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr ba= se, Chardev *chr, qemu_irq irq); diff --git a/include/hw/riscv/spike.h b/include/hw/riscv/spike.h index b0a18a9c94..121396d07a 100644 --- a/include/hw/riscv/spike.h +++ b/include/hw/riscv/spike.h @@ -21,15 +21,17 @@ =20 #include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define SPIKE_CPUS_MAX 8 #define SPIKE_SOCKETS_MAX 8 =20 #define TYPE_SPIKE_MACHINE MACHINE_TYPE_NAME("spike") +typedef struct SpikeState SpikeState; #define SPIKE_MACHINE(obj) \ OBJECT_CHECK(SpikeState, (obj), TYPE_SPIKE_MACHINE) =20 -typedef struct { +struct SpikeState { /*< private >*/ MachineState parent; =20 @@ -37,7 +39,7 @@ typedef struct { RISCVHartArrayState soc[SPIKE_SOCKETS_MAX]; void *fdt; int fdt_size; -} SpikeState; +}; =20 enum { SPIKE_MROM, diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 1beacd7666..3069379c84 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -22,15 +22,17 @@ #include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" #include "hw/block/flash.h" +#include "qom/object.h" =20 #define VIRT_CPUS_MAX 8 #define VIRT_SOCKETS_MAX 8 =20 #define TYPE_RISCV_VIRT_MACHINE MACHINE_TYPE_NAME("virt") +typedef struct RISCVVirtState RISCVVirtState; #define RISCV_VIRT_MACHINE(obj) \ OBJECT_CHECK(RISCVVirtState, (obj), TYPE_RISCV_VIRT_MACHINE) =20 -typedef struct { +struct RISCVVirtState { /*< private >*/ MachineState parent; =20 @@ -41,7 +43,7 @@ typedef struct { =20 void *fdt; int fdt_size; -} RISCVVirtState; +}; =20 enum { VIRT_DEBUG, diff --git a/include/hw/rtc/allwinner-rtc.h b/include/hw/rtc/allwinner-rtc.h index 7893f74795..1126e05f23 100644 --- a/include/hw/rtc/allwinner-rtc.h +++ b/include/hw/rtc/allwinner-rtc.h @@ -60,6 +60,8 @@ * @{ */ =20 +typedef struct AwRtcClass AwRtcClass; +typedef struct AwRtcState AwRtcState; #define AW_RTC(obj) \ OBJECT_CHECK(AwRtcState, (obj), TYPE_AW_RTC) #define AW_RTC_CLASS(klass) \ @@ -72,7 +74,7 @@ /** * Allwinner RTC per-object instance state. */ -typedef struct AwRtcState { +struct AwRtcState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -92,7 +94,7 @@ typedef struct AwRtcState { /** Array of hardware registers */ uint32_t regs[AW_RTC_REGS_NUM]; =20 -} AwRtcState; +}; =20 /** * Allwinner RTC class-level struct. @@ -101,7 +103,7 @@ typedef struct AwRtcState { * such that the generic code can use this struct to support * all devices. */ -typedef struct AwRtcClass { +struct AwRtcClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ @@ -129,6 +131,6 @@ typedef struct AwRtcClass { */ bool (*write)(AwRtcState *s, uint32_t offset, uint32_t data); =20 -} AwRtcClass; +}; =20 #endif /* HW_MISC_ALLWINNER_RTC_H */ diff --git a/include/hw/rtc/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h index b94a710268..295f4a7d30 100644 --- a/include/hw/rtc/aspeed_rtc.h +++ b/include/hw/rtc/aspeed_rtc.h @@ -9,8 +9,9 @@ #define HW_RTC_ASPEED_RTC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 -typedef struct AspeedRtcState { +struct AspeedRtcState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -19,7 +20,8 @@ typedef struct AspeedRtcState { uint32_t reg[0x18]; int offset; =20 -} AspeedRtcState; +}; +typedef struct AspeedRtcState AspeedRtcState; =20 #define TYPE_ASPEED_RTC "aspeed.rtc" #define ASPEED_RTC(obj) OBJECT_CHECK(AspeedRtcState, (obj), TYPE_ASPEED_RT= C) diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h index 9bd8924f5f..f31b0cbb89 100644 --- a/include/hw/rtc/goldfish_rtc.h +++ b/include/hw/rtc/goldfish_rtc.h @@ -23,12 +23,14 @@ #define HW_RTC_GOLDFISH_RTC_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_GOLDFISH_RTC "goldfish_rtc" +typedef struct GoldfishRTCState GoldfishRTCState; #define GOLDFISH_RTC(obj) \ OBJECT_CHECK(GoldfishRTCState, (obj), TYPE_GOLDFISH_RTC) =20 -typedef struct GoldfishRTCState { +struct GoldfishRTCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -42,6 +44,6 @@ typedef struct GoldfishRTCState { uint32_t irq_pending; uint32_t irq_enabled; uint32_t time_high; -} GoldfishRTCState; +}; =20 #endif diff --git a/include/hw/rtc/m48t59.h b/include/hw/rtc/m48t59.h index e7ea4e8761..78aae2c072 100644 --- a/include/hw/rtc/m48t59.h +++ b/include/hw/rtc/m48t59.h @@ -31,6 +31,7 @@ =20 #define TYPE_NVRAM "nvram" =20 +typedef struct NvramClass NvramClass; #define NVRAM_CLASS(klass) \ OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM) #define NVRAM_GET_CLASS(obj) \ @@ -40,13 +41,13 @@ =20 typedef struct Nvram Nvram; =20 -typedef struct NvramClass { +struct NvramClass { InterfaceClass parent; =20 uint32_t (*read)(Nvram *obj, uint32_t addr); void (*write)(Nvram *obj, uint32_t addr, uint32_t val); void (*toggle_lock)(Nvram *obj, int lock); -} NvramClass; +}; =20 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size, int base_year, int type); diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 3713181b56..7b42d9c534 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -13,11 +13,13 @@ #include "qemu/queue.h" #include "qemu/timer.h" #include "hw/isa/isa.h" +#include "qom/object.h" =20 #define TYPE_MC146818_RTC "mc146818rtc" +typedef struct RTCState RTCState; #define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) =20 -typedef struct RTCState { +struct RTCState { ISADevice parent_obj; =20 MemoryRegion io; @@ -44,7 +46,7 @@ typedef struct RTCState { LostTickPolicy lost_tick_policy; Notifier suspend_notifier; QLIST_ENTRY(RTCState) link; -} RTCState; +}; =20 #define RTC_ISA_IRQ 8 #define RTC_ISA_BASE 0x70 diff --git a/include/hw/rtc/pl031.h b/include/hw/rtc/pl031.h index e3cb1d646f..3ddf48cc76 100644 --- a/include/hw/rtc/pl031.h +++ b/include/hw/rtc/pl031.h @@ -16,11 +16,13 @@ =20 #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" =20 #define TYPE_PL031 "pl031" +typedef struct PL031State PL031State; #define PL031(obj) OBJECT_CHECK(PL031State, (obj), TYPE_PL031) =20 -typedef struct PL031State { +struct PL031State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -42,6 +44,6 @@ typedef struct PL031State { uint32_t cr; uint32_t im; uint32_t is; -} PL031State; +}; =20 #endif diff --git a/include/hw/rtc/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-= rtc.h index 6fa1cb2f43..95c85d3bf1 100644 --- a/include/hw/rtc/xlnx-zynqmp-rtc.h +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h @@ -29,9 +29,11 @@ =20 #include "hw/register.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_XLNX_ZYNQMP_RTC "xlnx-zynmp.rtc" =20 +typedef struct XlnxZynqMPRTC XlnxZynqMPRTC; #define XLNX_ZYNQMP_RTC(obj) \ OBJECT_CHECK(XlnxZynqMPRTC, (obj), TYPE_XLNX_ZYNQMP_RTC) =20 @@ -77,7 +79,7 @@ REG32(SAFETY_CHK, 0x50) =20 #define XLNX_ZYNQMP_RTC_R_MAX (R_SAFETY_CHK + 1) =20 -typedef struct XlnxZynqMPRTC { +struct XlnxZynqMPRTC { SysBusDevice parent_obj; MemoryRegion iomem; qemu_irq irq_rtc_int; @@ -87,6 +89,6 @@ typedef struct XlnxZynqMPRTC { =20 uint32_t regs[XLNX_ZYNQMP_RTC_R_MAX]; RegisterInfo regs_info[XLNX_ZYNQMP_RTC_R_MAX]; -} XlnxZynqMPRTC; +}; =20 #endif diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h index aa94758c27..4451a9e006 100644 --- a/include/hw/rx/rx62n.h +++ b/include/hw/rx/rx62n.h @@ -30,8 +30,10 @@ #include "hw/timer/renesas_cmt.h" #include "hw/char/renesas_sci.h" #include "qemu/units.h" +#include "qom/object.h" =20 #define TYPE_RX62N_MCU "rx62n-mcu" +typedef struct RX62NState RX62NState; #define RX62N_MCU(obj) OBJECT_CHECK(RX62NState, (obj), TYPE_RX62N_MCU) =20 #define TYPE_R5F562N7_MCU "r5f562n7-mcu" @@ -45,7 +47,7 @@ #define RX62N_NR_CMT 2 #define RX62N_NR_SCI 6 =20 -typedef struct RX62NState { +struct RX62NState { /*< private >*/ DeviceState parent_obj; /*< public >*/ @@ -71,6 +73,6 @@ typedef struct RX62NState { uint32_t xtal_freq_hz; /* Peripheral Module Clock frequency */ uint32_t pclk_freq_hz; -} RX62NState; +}; =20 #endif diff --git a/include/hw/s390x/3270-ccw.h b/include/hw/s390x/3270-ccw.h index 9d1d18e2bd..ac254f95ed 100644 --- a/include/hw/s390x/3270-ccw.h +++ b/include/hw/s390x/3270-ccw.h @@ -16,6 +16,7 @@ #include "hw/sysbus.h" #include "hw/s390x/css.h" #include "hw/s390x/ccw-device.h" +#include "qom/object.h" =20 #define EMULATED_CCW_3270_CU_TYPE 0x3270 #define EMULATED_CCW_3270_CHPID_TYPE 0x1a @@ -30,6 +31,8 @@ #define TC_EWRITEA 0x0d /* Erase write alternate */ #define TC_WRITESF 0x11 /* Write structured field */ =20 +typedef struct EmulatedCcw3270Class EmulatedCcw3270Class; +typedef struct EmulatedCcw3270Device EmulatedCcw3270Device; #define EMULATED_CCW_3270(obj) \ OBJECT_CHECK(EmulatedCcw3270Device, (obj), TYPE_EMULATED_CCW_3270) #define EMULATED_CCW_3270_CLASS(klass) \ @@ -37,16 +40,16 @@ #define EMULATED_CCW_3270_GET_CLASS(obj) \ OBJECT_GET_CLASS(EmulatedCcw3270Class, (obj), TYPE_EMULATED_CCW_3270) =20 -typedef struct EmulatedCcw3270Device { +struct EmulatedCcw3270Device { CcwDevice parent_obj; -} EmulatedCcw3270Device; +}; =20 -typedef struct EmulatedCcw3270Class { +struct EmulatedCcw3270Class { CCWDeviceClass parent_class; =20 void (*init)(EmulatedCcw3270Device *, Error **); int (*read_payload_3270)(EmulatedCcw3270Device *); int (*write_payload_3270)(EmulatedCcw3270Device *, uint8_t); -} EmulatedCcw3270Class; +}; =20 #endif diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h index 8df9cd2954..b3b3e98a67 100644 --- a/include/hw/s390x/ap-device.h +++ b/include/hw/s390x/ap-device.h @@ -12,12 +12,14 @@ #define HW_S390X_AP_DEVICE_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define AP_DEVICE_TYPE "ap-device" =20 -typedef struct APDevice { +struct APDevice { DeviceState parent_obj; -} APDevice; +}; +typedef struct APDevice APDevice; =20 #define AP_DEVICE(obj) \ OBJECT_CHECK(APDevice, (obj), AP_DEVICE_TYPE) diff --git a/include/hw/s390x/css-bridge.h b/include/hw/s390x/css-bridge.h index f7ed2d9a03..05786b38de 100644 --- a/include/hw/s390x/css-bridge.h +++ b/include/hw/s390x/css-bridge.h @@ -17,19 +17,21 @@ #include "hw/sysbus.h" =20 /* virtual css bridge */ -typedef struct VirtualCssBridge { +struct VirtualCssBridge { SysBusDevice sysbus_dev; bool css_dev_path; -} VirtualCssBridge; +}; +typedef struct VirtualCssBridge VirtualCssBridge; =20 #define TYPE_VIRTUAL_CSS_BRIDGE "virtual-css-bridge" #define VIRTUAL_CSS_BRIDGE(obj) \ OBJECT_CHECK(VirtualCssBridge, (obj), TYPE_VIRTUAL_CSS_BRIDGE) =20 /* virtual css bus type */ -typedef struct VirtualCssBus { +struct VirtualCssBus { BusState parent_obj; -} VirtualCssBus; +}; +typedef struct VirtualCssBus VirtualCssBus; =20 #define TYPE_VIRTUAL_CSS_BUS "virtual-css-bus" #define VIRTUAL_CSS_BUS(obj) \ diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index e61c4651d7..dd1a6a44c0 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -18,6 +18,7 @@ #include "qemu/thread.h" #include "hw/qdev-core.h" #include "hw/s390x/sclp.h" +#include "qom/object.h" =20 /* SCLP event types */ #define SCLP_EVENT_OPRTNS_COMMAND 0x01 @@ -41,6 +42,8 @@ #define SCLP_SELECTIVE_READ 0x01 =20 #define TYPE_SCLP_EVENT "s390-sclp-event-type" +typedef struct SCLPEvent SCLPEvent; +typedef struct SCLPEventClass SCLPEventClass; #define SCLP_EVENT(obj) \ OBJECT_CHECK(SCLPEvent, (obj), TYPE_SCLP_EVENT) #define SCLP_EVENT_CLASS(klass) \ @@ -169,13 +172,13 @@ typedef struct ReadEventData { }; } QEMU_PACKED ReadEventData; =20 -typedef struct SCLPEvent { +struct SCLPEvent { DeviceState qdev; bool event_pending; char *name; -} SCLPEvent; +}; =20 -typedef struct SCLPEventClass { +struct SCLPEventClass { DeviceClass parent_class; int (*init)(SCLPEvent *event); =20 @@ -192,10 +195,11 @@ typedef struct SCLPEventClass { =20 /* can we handle this event type? */ bool (*can_handle_event)(uint8_t type); -} SCLPEventClass; +}; =20 #define TYPE_SCLP_EVENT_FACILITY "s390-sclp-event-facility" typedef struct SCLPEventFacility SCLPEventFacility; +typedef struct SCLPEventFacilityClass SCLPEventFacilityClass; #define EVENT_FACILITY(obj) \ OBJECT_CHECK(SCLPEventFacility, (obj), TYPE_SCLP_EVENT_FACILITY) #define EVENT_FACILITY_CLASS(klass) \ @@ -205,11 +209,11 @@ typedef struct SCLPEventFacility SCLPEventFacility; OBJECT_GET_CLASS(SCLPEventFacilityClass, (obj), \ TYPE_SCLP_EVENT_FACILITY) =20 -typedef struct SCLPEventFacilityClass { +struct SCLPEventFacilityClass { SysBusDeviceClass parent_class; void (*command_handler)(SCLPEventFacility *ef, SCCB *sccb, uint64_t co= de); bool (*event_pending)(SCLPEventFacility *ef); -} SCLPEventFacilityClass; +}; =20 BusState *sclp_get_event_facility_bus(void); =20 diff --git a/include/hw/s390x/s390-ccw.h b/include/hw/s390x/s390-ccw.h index d8e08b5f4c..f0f96952f1 100644 --- a/include/hw/s390x/s390-ccw.h +++ b/include/hw/s390x/s390-ccw.h @@ -14,8 +14,11 @@ #define HW_S390_CCW_H =20 #include "hw/s390x/ccw-device.h" +#include "qom/object.h" =20 #define TYPE_S390_CCW "s390-ccw" +typedef struct S390CCWDevice S390CCWDevice; +typedef struct S390CCWDeviceClass S390CCWDeviceClass; #define S390_CCW_DEVICE(obj) \ OBJECT_CHECK(S390CCWDevice, (obj), TYPE_S390_CCW) #define S390_CCW_DEVICE_CLASS(klass) \ @@ -23,14 +26,14 @@ #define S390_CCW_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(S390CCWDeviceClass, (obj), TYPE_S390_CCW) =20 -typedef struct S390CCWDevice { +struct S390CCWDevice { CcwDevice parent_obj; CssDevId hostid; char *mdevid; int32_t bootindex; -} S390CCWDevice; +}; =20 -typedef struct S390CCWDeviceClass { +struct S390CCWDeviceClass { CCWDeviceClass parent_class; void (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp); void (*unrealize)(S390CCWDevice *dev); @@ -38,6 +41,6 @@ typedef struct S390CCWDeviceClass { int (*handle_halt) (SubchDev *sch); int (*handle_clear) (SubchDev *sch); IOInstEnding (*handle_store) (SubchDev *sch); -} S390CCWDeviceClass; +}; =20 #endif diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index caf4962d29..f20c503b19 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -12,16 +12,19 @@ #define HW_S390X_S390_VIRTIO_CCW_H =20 #include "hw/boards.h" +#include "qom/object.h" =20 #define TYPE_S390_CCW_MACHINE "s390-ccw-machine" =20 +typedef struct S390CcwMachineClass S390CcwMachineClass; +typedef struct S390CcwMachineState S390CcwMachineState; #define S390_CCW_MACHINE(obj) \ OBJECT_CHECK(S390CcwMachineState, (obj), TYPE_S390_CCW_MACHINE) =20 #define S390_CCW_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(S390CcwMachineClass, (klass), TYPE_S390_CCW_MACHINE) =20 -typedef struct S390CcwMachineState { +struct S390CcwMachineState { /*< private >*/ MachineState parent_obj; =20 @@ -30,9 +33,9 @@ typedef struct S390CcwMachineState { bool dea_key_wrap; bool pv; uint8_t loadparm[8]; -} S390CcwMachineState; +}; =20 -typedef struct S390CcwMachineClass { +struct S390CcwMachineClass { /*< private >*/ MachineClass parent_class; =20 @@ -41,7 +44,7 @@ typedef struct S390CcwMachineClass { bool cpu_model_allowed; bool css_migration_enabled; bool hpage_1m_allowed; -} S390CcwMachineClass; +}; =20 /* runtime-instrumentation allowed by the machine */ bool ri_allowed(void); diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index df11de9b20..2ae7cca85b 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -17,6 +17,7 @@ #include "hw/s390x/adapter.h" #include "hw/virtio/virtio.h" #include "qemu/queue.h" +#include "qom/object.h" =20 /* * Reserve enough gsis to accommodate all virtio devices. @@ -38,22 +39,24 @@ extern const VMStateDescription vmstate_adapter_routes; VMSTATE_STRUCT(_f, _s, 1, vmstate_adapter_routes, AdapterRoutes) =20 #define TYPE_S390_FLIC_COMMON "s390-flic" +typedef struct S390FLICState S390FLICState; +typedef struct S390FLICStateClass S390FLICStateClass; #define S390_FLIC_COMMON(obj) \ OBJECT_CHECK(S390FLICState, (obj), TYPE_S390_FLIC_COMMON) =20 -typedef struct S390FLICState { +struct S390FLICState { SysBusDevice parent_obj; /* to limit AdapterRoutes.num_routes for compat */ uint32_t adapter_routes_max_batch; bool ais_supported; -} S390FLICState; +}; =20 #define S390_FLIC_COMMON_CLASS(klass) \ OBJECT_CLASS_CHECK(S390FLICStateClass, (klass), TYPE_S390_FLIC_COMMON) #define S390_FLIC_COMMON_GET_CLASS(obj) \ OBJECT_GET_CLASS(S390FLICStateClass, (obj), TYPE_S390_FLIC_COMMON) =20 -typedef struct S390FLICStateClass { +struct S390FLICStateClass { DeviceClass parent_class; =20 int (*register_io_adapter)(S390FLICState *fs, uint32_t id, uint8_t isc, @@ -72,7 +75,7 @@ typedef struct S390FLICStateClass { uint16_t subchannel_nr, uint32_t io_int_parm, uint32_t io_int_word); void (*inject_crw_mchk)(S390FLICState *fs); -} S390FLICStateClass; +}; =20 #define TYPE_KVM_S390_FLIC "s390-flic-kvm" typedef struct KVMS390FLICState KVMS390FLICState; @@ -80,6 +83,7 @@ typedef struct KVMS390FLICState KVMS390FLICState; OBJECT_CHECK(KVMS390FLICState, (obj), TYPE_KVM_S390_FLIC) =20 #define TYPE_QEMU_S390_FLIC "s390-flic-qemu" +typedef struct QEMUS390FLICState QEMUS390FLICState; #define QEMU_S390_FLIC(obj) \ OBJECT_CHECK(QEMUS390FLICState, (obj), TYPE_QEMU_S390_FLIC) =20 @@ -115,14 +119,14 @@ typedef struct QEMUS390FlicIO { QLIST_ENTRY(QEMUS390FlicIO) next; } QEMUS390FlicIO; =20 -typedef struct QEMUS390FLICState { +struct QEMUS390FLICState { S390FLICState parent_obj; uint32_t pending; uint32_t service_param; uint8_t simm; uint8_t nimm; QLIST_HEAD(, QEMUS390FlicIO) io[8]; -} QEMUS390FLICState; +}; =20 uint32_t qemu_s390_flic_dequeue_service(QEMUS390FLICState *flic); QEMUS390FlicIO *qemu_s390_flic_dequeue_io(QEMUS390FLICState *flic, diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index a87ed2a0ab..2a5bdc6dfe 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -16,6 +16,7 @@ =20 #include "hw/sysbus.h" #include "target/s390x/cpu-qom.h" +#include "qom/object.h" =20 #define SCLP_CMD_CODE_MASK 0xffff00ff =20 @@ -181,22 +182,24 @@ typedef struct SCCB { } QEMU_PACKED SCCB; =20 #define TYPE_SCLP "sclp" +typedef struct SCLPDevice SCLPDevice; +typedef struct SCLPDeviceClass SCLPDeviceClass; #define SCLP(obj) OBJECT_CHECK(SCLPDevice, (obj), TYPE_SCLP) #define SCLP_CLASS(oc) OBJECT_CLASS_CHECK(SCLPDeviceClass, (oc), TYPE_SCLP) #define SCLP_GET_CLASS(obj) OBJECT_GET_CLASS(SCLPDeviceClass, (obj), TYPE_= SCLP) =20 struct SCLPEventFacility; =20 -typedef struct SCLPDevice { +struct SCLPDevice { /* private */ DeviceState parent_obj; struct SCLPEventFacility *event_facility; int increment_size; =20 /* public */ -} SCLPDevice; +}; =20 -typedef struct SCLPDeviceClass { +struct SCLPDeviceClass { /* private */ DeviceClass parent_class; void (*read_SCP_info)(SCLPDevice *sclp, SCCB *sccb); @@ -205,7 +208,7 @@ typedef struct SCLPDeviceClass { /* public */ void (*execute)(SCLPDevice *sclp, SCCB *sccb, uint32_t code); void (*service_interrupt)(SCLPDevice *sclp, uint32_t sccb); -} SCLPDeviceClass; +}; =20 static inline int sccb_data_len(SCCB *sccb) { diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/stora= ge-attributes.h index 4f7c6c0877..b5d9663f7c 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -14,26 +14,29 @@ =20 #include "hw/qdev-core.h" #include "monitor/monitor.h" +#include "qom/object.h" =20 #define TYPE_S390_STATTRIB "s390-storage_attributes" #define TYPE_QEMU_S390_STATTRIB "s390-storage_attributes-qemu" #define TYPE_KVM_S390_STATTRIB "s390-storage_attributes-kvm" =20 +typedef struct S390StAttribClass S390StAttribClass; +typedef struct S390StAttribState S390StAttribState; #define S390_STATTRIB(obj) \ OBJECT_CHECK(S390StAttribState, (obj), TYPE_S390_STATTRIB) =20 -typedef struct S390StAttribState { +struct S390StAttribState { DeviceState parent_obj; uint64_t migration_cur_gfn; bool migration_enabled; -} S390StAttribState; +}; =20 #define S390_STATTRIB_CLASS(klass) \ OBJECT_CLASS_CHECK(S390StAttribClass, (klass), TYPE_S390_STATTRIB) #define S390_STATTRIB_GET_CLASS(obj) \ OBJECT_GET_CLASS(S390StAttribClass, (obj), TYPE_S390_STATTRIB) =20 -typedef struct S390StAttribClass { +struct S390StAttribClass { DeviceClass parent_class; /* Return value: < 0 on error, or new count */ int (*get_stattr)(S390StAttribState *sa, uint64_t *start_gfn, @@ -46,23 +49,25 @@ typedef struct S390StAttribClass { int (*set_migrationmode)(S390StAttribState *sa, bool value); int (*get_active)(S390StAttribState *sa); long long (*get_dirtycount)(S390StAttribState *sa); -} S390StAttribClass; +}; =20 +typedef struct QEMUS390StAttribState QEMUS390StAttribState; #define QEMU_S390_STATTRIB(obj) \ OBJECT_CHECK(QEMUS390StAttribState, (obj), TYPE_QEMU_S390_STATTRIB) =20 -typedef struct QEMUS390StAttribState { +struct QEMUS390StAttribState { S390StAttribState parent_obj; -} QEMUS390StAttribState; +}; =20 +typedef struct KVMS390StAttribState KVMS390StAttribState; #define KVM_S390_STATTRIB(obj) \ OBJECT_CHECK(KVMS390StAttribState, (obj), TYPE_KVM_S390_STATTRIB) =20 -typedef struct KVMS390StAttribState { +struct KVMS390StAttribState { S390StAttribState parent_obj; uint64_t still_dirty; uint8_t *incoming_buffer; -} KVMS390StAttribState; +}; =20 void s390_stattrib_init(void); =20 diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-key= s.h index 3f1ae7e778..e94a201f71 100644 --- a/include/hw/s390x/storage-keys.h +++ b/include/hw/s390x/storage-keys.h @@ -14,41 +14,45 @@ =20 #include "hw/qdev-core.h" #include "monitor/monitor.h" +#include "qom/object.h" =20 #define TYPE_S390_SKEYS "s390-skeys" +typedef struct S390SKeysClass S390SKeysClass; +typedef struct S390SKeysState S390SKeysState; #define S390_SKEYS(obj) \ OBJECT_CHECK(S390SKeysState, (obj), TYPE_S390_SKEYS) =20 -typedef struct S390SKeysState { +struct S390SKeysState { DeviceState parent_obj; bool migration_enabled; =20 -} S390SKeysState; +}; =20 #define S390_SKEYS_CLASS(klass) \ OBJECT_CLASS_CHECK(S390SKeysClass, (klass), TYPE_S390_SKEYS) #define S390_SKEYS_GET_CLASS(obj) \ OBJECT_GET_CLASS(S390SKeysClass, (obj), TYPE_S390_SKEYS) =20 -typedef struct S390SKeysClass { +struct S390SKeysClass { DeviceClass parent_class; int (*skeys_enabled)(S390SKeysState *ks); int (*get_skeys)(S390SKeysState *ks, uint64_t start_gfn, uint64_t coun= t, uint8_t *keys); int (*set_skeys)(S390SKeysState *ks, uint64_t start_gfn, uint64_t coun= t, uint8_t *keys); -} S390SKeysClass; +}; =20 #define TYPE_KVM_S390_SKEYS "s390-skeys-kvm" #define TYPE_QEMU_S390_SKEYS "s390-skeys-qemu" +typedef struct QEMUS390SKeysState QEMUS390SKeysState; #define QEMU_S390_SKEYS(obj) \ OBJECT_CHECK(QEMUS390SKeysState, (obj), TYPE_QEMU_S390_SKEYS) =20 -typedef struct QEMUS390SKeysState { +struct QEMUS390SKeysState { S390SKeysState parent_obj; uint8_t *keydata; uint32_t key_count; -} QEMUS390SKeysState; +}; =20 void s390_skeys_init(void); =20 diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h index 4251623f7f..e240faf11c 100644 --- a/include/hw/s390x/tod.h +++ b/include/hw/s390x/tod.h @@ -13,6 +13,7 @@ =20 #include "hw/qdev-core.h" #include "target/s390x/s390-tod.h" +#include "qom/object.h" =20 typedef struct S390TOD { uint8_t high; @@ -20,6 +21,8 @@ typedef struct S390TOD { } S390TOD; =20 #define TYPE_S390_TOD "s390-tod" +typedef struct S390TODClass S390TODClass; +typedef struct S390TODState S390TODState; #define S390_TOD(obj) OBJECT_CHECK(S390TODState, (obj), TYPE_S390_TOD) #define S390_TOD_CLASS(oc) OBJECT_CLASS_CHECK(S390TODClass, (oc), \ TYPE_S390_TOD) @@ -28,7 +31,7 @@ typedef struct S390TOD { #define TYPE_KVM_S390_TOD TYPE_S390_TOD "-kvm" #define TYPE_QEMU_S390_TOD TYPE_S390_TOD "-qemu" =20 -typedef struct S390TODState { +struct S390TODState { /* private */ DeviceState parent_obj; =20 @@ -39,9 +42,9 @@ typedef struct S390TODState { S390TOD base; /* Used by KVM to remember if the TOD is stopped and base is valid. */ bool stopped; -} S390TODState; +}; =20 -typedef struct S390TODClass { +struct S390TODClass { /* private */ DeviceClass parent_class; void (*parent_realize)(DeviceState *dev, Error **errp); @@ -49,7 +52,7 @@ typedef struct S390TODClass { /* public */ void (*get)(const S390TODState *td, S390TOD *tod, Error **errp); void (*set)(S390TODState *td, const S390TOD *tod, Error **errp); -} S390TODClass; +}; =20 void s390_init_tod(void); S390TODState *s390_get_todstate(void); diff --git a/include/hw/s390x/vfio-ccw.h b/include/hw/s390x/vfio-ccw.h index ee5250d0d7..7bd4640ac3 100644 --- a/include/hw/s390x/vfio-ccw.h +++ b/include/hw/s390x/vfio-ccw.h @@ -17,12 +17,13 @@ #include "hw/vfio/vfio-common.h" #include "hw/s390x/s390-ccw.h" #include "hw/s390x/ccw-device.h" +#include "qom/object.h" =20 #define TYPE_VFIO_CCW "vfio-ccw" +typedef struct VFIOCCWDevice VFIOCCWDevice; #define VFIO_CCW(obj) \ OBJECT_CHECK(VFIOCCWDevice, (obj), TYPE_VFIO_CCW) =20 #define TYPE_VFIO_CCW "vfio-ccw" -typedef struct VFIOCCWDevice VFIOCCWDevice; =20 #endif diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index 6ba47dac41..d4a4e2930c 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -3,6 +3,7 @@ =20 #include "hw/scsi/scsi.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 /* esp.c */ #define ESP_MAX_DEVS 7 @@ -65,9 +66,10 @@ struct ESPState { }; =20 #define TYPE_ESP "esp" +typedef struct SysBusESPState SysBusESPState; #define ESP_STATE(obj) OBJECT_CHECK(SysBusESPState, (obj), TYPE_ESP) =20 -typedef struct { +struct SysBusESPState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -76,7 +78,7 @@ typedef struct { MemoryRegion pdma; uint32_t it_shift; ESPState esp; -} SysBusESPState; +}; =20 #define ESP_TCLO 0x0 #define ESP_TCMID 0x1 diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 2fc23e44ba..bad4dfb223 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -6,6 +6,7 @@ #include "hw/qdev-core.h" #include "scsi/utils.h" #include "qemu/notify.h" +#include "qom/object.h" =20 #define MAX_SCSI_DEVS 255 =20 @@ -49,6 +50,7 @@ struct SCSIRequest { }; =20 #define TYPE_SCSI_DEVICE "scsi-device" +typedef struct SCSIDeviceClass SCSIDeviceClass; #define SCSI_DEVICE(obj) \ OBJECT_CHECK(SCSIDevice, (obj), TYPE_SCSI_DEVICE) #define SCSI_DEVICE_CLASS(klass) \ @@ -56,7 +58,7 @@ struct SCSIRequest { #define SCSI_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SCSIDeviceClass, (obj), TYPE_SCSI_DEVICE) =20 -typedef struct SCSIDeviceClass { +struct SCSIDeviceClass { DeviceClass parent_class; void (*realize)(SCSIDevice *dev, Error **errp); void (*unrealize)(SCSIDevice *dev); @@ -65,7 +67,7 @@ typedef struct SCSIDeviceClass { SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun, uint8_t *buf, void *hba_private); void (*unit_attention_reported)(SCSIDevice *s); -} SCSIDeviceClass; +}; =20 struct SCSIDevice { diff --git a/include/hw/sd/allwinner-sdhost.h b/include/hw/sd/allwinner-sdh= ost.h index 839732ebf3..b23de2c548 100644 --- a/include/hw/sd/allwinner-sdhost.h +++ b/include/hw/sd/allwinner-sdhost.h @@ -45,6 +45,8 @@ * @{ */ =20 +typedef struct AwSdHostClass AwSdHostClass; +typedef struct AwSdHostState AwSdHostState; #define AW_SDHOST(obj) \ OBJECT_CHECK(AwSdHostState, (obj), TYPE_AW_SDHOST) #define AW_SDHOST_CLASS(klass) \ @@ -57,7 +59,7 @@ /** * Allwinner SD Host Controller object instance state. */ -typedef struct AwSdHostState { +struct AwSdHostState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -119,7 +121,7 @@ typedef struct AwSdHostState { =20 /** @} */ =20 -} AwSdHostState; +}; =20 /** * Allwinner SD Host Controller class-level struct. @@ -128,7 +130,7 @@ typedef struct AwSdHostState { * such that the generic code can use this struct to support * all devices. */ -typedef struct AwSdHostClass { +struct AwSdHostClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ @@ -136,6 +138,6 @@ typedef struct AwSdHostClass { /** Maximum buffer size in bytes per DMA descriptor */ size_t max_desc_size; =20 -} AwSdHostClass; +}; =20 #endif /* HW_SD_ALLWINNER_SDHOST_H */ diff --git a/include/hw/sd/aspeed_sdhci.h b/include/hw/sd/aspeed_sdhci.h index dffbb46946..527075476b 100644 --- a/include/hw/sd/aspeed_sdhci.h +++ b/include/hw/sd/aspeed_sdhci.h @@ -10,8 +10,10 @@ #define ASPEED_SDHCI_H =20 #include "hw/sd/sdhci.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_SDHCI "aspeed.sdhci" +typedef struct AspeedSDHCIState AspeedSDHCIState; #define ASPEED_SDHCI(obj) OBJECT_CHECK(AspeedSDHCIState, (obj), \ TYPE_ASPEED_SDHCI) =20 @@ -20,7 +22,7 @@ #define ASPEED_SDHCI_NUM_REGS (ASPEED_SDHCI_REG_SIZE / sizeof(uint32_t= )) #define ASPEED_SDHCI_REG_SIZE 0x100 =20 -typedef struct AspeedSDHCIState { +struct AspeedSDHCIState { SysBusDevice parent; =20 SDHCIState slots[ASPEED_SDHCI_NUM_SLOTS]; @@ -30,6 +32,6 @@ typedef struct AspeedSDHCIState { qemu_irq irq; =20 uint32_t regs[ASPEED_SDHCI_NUM_REGS]; -} AspeedSDHCIState; +}; =20 #endif /* ASPEED_SDHCI_H */ diff --git a/include/hw/sd/bcm2835_sdhost.h b/include/hw/sd/bcm2835_sdhost.h index 7520dd6507..233e74b002 100644 --- a/include/hw/sd/bcm2835_sdhost.h +++ b/include/hw/sd/bcm2835_sdhost.h @@ -16,14 +16,16 @@ =20 #include "hw/sysbus.h" #include "hw/sd/sd.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_SDHOST "bcm2835-sdhost" +typedef struct BCM2835SDHostState BCM2835SDHostState; #define BCM2835_SDHOST(obj) \ OBJECT_CHECK(BCM2835SDHostState, (obj), TYPE_BCM2835_SDHOST) =20 #define BCM2835_SDHOST_FIFO_LEN 16 =20 -typedef struct { +struct BCM2835SDHostState { SysBusDevice busdev; SDBus sdbus; MemoryRegion iomem; @@ -43,6 +45,6 @@ typedef struct { uint32_t datacnt; =20 qemu_irq irq; -} BCM2835SDHostState; +}; =20 #endif diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index ac02d61a7a..850740ea92 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -31,6 +31,7 @@ #define HW_SD_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define OUT_OF_RANGE (1 << 31) #define ADDRESS_ERROR (1 << 30) @@ -92,13 +93,14 @@ typedef struct SDState SDState; typedef struct SDBus SDBus; =20 #define TYPE_SD_CARD "sd-card" +typedef struct SDCardClass SDCardClass; #define SD_CARD(obj) OBJECT_CHECK(SDState, (obj), TYPE_SD_CARD) #define SD_CARD_CLASS(klass) \ OBJECT_CLASS_CHECK(SDCardClass, (klass), TYPE_SD_CARD) #define SD_CARD_GET_CLASS(obj) \ OBJECT_GET_CLASS(SDCardClass, (obj), TYPE_SD_CARD) =20 -typedef struct { +struct SDCardClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -128,9 +130,10 @@ typedef struct { void (*enable)(SDState *sd, bool enable); bool (*get_inserted)(SDState *sd); bool (*get_readonly)(SDState *sd); -} SDCardClass; +}; =20 #define TYPE_SD_BUS "sd-bus" +typedef struct SDBusClass SDBusClass; #define SD_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SD_BUS) #define SD_BUS_CLASS(klass) OBJECT_CLASS_CHECK(SDBusClass, (klass), TYPE_S= D_BUS) #define SD_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(SDBusClass, (obj), TYPE_SD_= BUS) @@ -139,7 +142,7 @@ struct SDBus { BusState qbus; }; =20 -typedef struct { +struct SDBusClass { /*< private >*/ BusClass parent_class; /*< public >*/ @@ -149,7 +152,7 @@ typedef struct { */ void (*set_inserted)(DeviceState *dev, bool inserted); void (*set_readonly)(DeviceState *dev, bool readonly); -} SDBusClass; +}; =20 /* Functions to be used by qdevified callers (working via * an SDBus rather than directly with SDState) diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 5d9275f3d6..67b01fcb28 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -28,9 +28,10 @@ #include "hw/pci/pci.h" #include "hw/sysbus.h" #include "hw/sd/sd.h" +#include "qom/object.h" =20 /* SD/MMC host controller state */ -typedef struct SDHCIState { +struct SDHCIState { /*< private >*/ union { PCIDevice pcidev; @@ -98,7 +99,8 @@ typedef struct SDHCIState { uint8_t sd_spec_version; uint8_t uhs_mode; uint8_t vendor; /* For vendor specific functionality */ -} SDHCIState; +}; +typedef struct SDHCIState SDHCIState; =20 #define SDHCI_VENDOR_NONE 0 #define SDHCI_VENDOR_IMX 1 diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index ac1d04ddc2..21ad6327d2 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -13,6 +13,7 @@ #define HW_SOUTHBRIDGE_PIIX_H =20 #include "hw/pci/pci.h" +#include "qom/object.h" =20 #define TYPE_PIIX4_PM "PIIX4_PM" =20 @@ -35,7 +36,7 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t sm= b_io_base, #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ #define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */ =20 -typedef struct PIIXState { +struct PIIXState { PCIDevice dev; =20 /* @@ -62,7 +63,8 @@ typedef struct PIIXState { =20 /* IO memory region for Reset Control Register (PIIX_RCR_IOPORT) */ MemoryRegion rcr_mem; -} PIIX3State; +}; +typedef struct PIIXState PIIX3State; =20 #define TYPE_PIIX3_PCI_DEVICE "pci-piix3" #define PIIX3_PCI_DEVICE(obj) \ diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index ab42c5421b..9c80ef54ff 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -4,14 +4,15 @@ #include "hw/sysbus.h" #include "hw/scsi/esp.h" #include "hw/net/lance.h" +#include "qom/object.h" =20 #define DMA_REGS 4 =20 #define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" +typedef struct DMADeviceState DMADeviceState; #define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \ TYPE_SPARC32_DMA_DEVICE) =20 -typedef struct DMADeviceState DMADeviceState; =20 struct DMADeviceState { SysBusDevice parent_obj; @@ -24,37 +25,40 @@ struct DMADeviceState { }; =20 #define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" +typedef struct ESPDMADeviceState ESPDMADeviceState; #define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \ TYPE_SPARC32_ESPDMA_DEVICE) =20 -typedef struct ESPDMADeviceState { +struct ESPDMADeviceState { DMADeviceState parent_obj; =20 SysBusESPState *esp; -} ESPDMADeviceState; +}; =20 #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" +typedef struct LEDMADeviceState LEDMADeviceState; #define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \ TYPE_SPARC32_LEDMA_DEVICE) =20 -typedef struct LEDMADeviceState { +struct LEDMADeviceState { DMADeviceState parent_obj; =20 SysBusPCNetState *lance; -} LEDMADeviceState; +}; =20 #define TYPE_SPARC32_DMA "sparc32-dma" +typedef struct SPARC32DMAState SPARC32DMAState; #define SPARC32_DMA(obj) OBJECT_CHECK(SPARC32DMAState, (obj), \ TYPE_SPARC32_DMA) =20 -typedef struct SPARC32DMAState { +struct SPARC32DMAState { SysBusDevice parent_obj; =20 MemoryRegion dmamem; MemoryRegion ledma_alias; ESPDMADeviceState *espdma; LEDMADeviceState *ledma; -} SPARC32DMAState; +}; =20 /* sparc32_dma.c */ void ledma_memory_read(void *opaque, hwaddr addr, diff --git a/include/hw/sparc/sun4m_iommu.h b/include/hw/sparc/sun4m_iommu.h index 482266c6a7..6095eed0af 100644 --- a/include/hw/sparc/sun4m_iommu.h +++ b/include/hw/sparc/sun4m_iommu.h @@ -26,10 +26,11 @@ #define SUN4M_IOMMU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define IOMMU_NREGS (4 * 4096 / 4) =20 -typedef struct IOMMUState { +struct IOMMUState { SysBusDevice parent_obj; =20 AddressSpace iommu_as; @@ -40,7 +41,8 @@ typedef struct IOMMUState { hwaddr iostart; qemu_irq irq; uint32_t version; -} IOMMUState; +}; +typedef struct IOMMUState IOMMUState; =20 #define TYPE_SUN4M_IOMMU "sun4m-iommu" #define SUN4M_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4M_IOMMU) diff --git a/include/hw/sparc/sun4u_iommu.h b/include/hw/sparc/sun4u_iommu.h index 5472d489cf..dfe10459e5 100644 --- a/include/hw/sparc/sun4u_iommu.h +++ b/include/hw/sparc/sun4u_iommu.h @@ -28,10 +28,11 @@ #define SUN4U_IOMMU_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define IOMMU_NREGS 3 =20 -typedef struct IOMMUState { +struct IOMMUState { SysBusDevice parent_obj; =20 AddressSpace iommu_as; @@ -39,7 +40,8 @@ typedef struct IOMMUState { =20 MemoryRegion iomem; uint64_t regs[IOMMU_NREGS]; -} IOMMUState; +}; +typedef struct IOMMUState IOMMUState; =20 #define TYPE_SUN4U_IOMMU "sun4u-iommu" #define SUN4U_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4U_IOMMU) diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index 6fbbb238f1..a2072ffeea 100644 --- a/include/hw/ssi/aspeed_smc.h +++ b/include/hw/ssi/aspeed_smc.h @@ -27,6 +27,7 @@ =20 #include "hw/ssi/ssi.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 typedef struct AspeedSegments { hwaddr addr; @@ -67,20 +68,22 @@ typedef struct AspeedSMCFlash { } AspeedSMCFlash; =20 #define TYPE_ASPEED_SMC "aspeed.smc" +typedef struct AspeedSMCClass AspeedSMCClass; +typedef struct AspeedSMCState AspeedSMCState; #define ASPEED_SMC(obj) OBJECT_CHECK(AspeedSMCState, (obj), TYPE_ASPEED_SM= C) #define ASPEED_SMC_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedSMCClass, (klass), TYPE_ASPEED_SMC) #define ASPEED_SMC_GET_CLASS(obj) \ OBJECT_GET_CLASS(AspeedSMCClass, (obj), TYPE_ASPEED_SMC) =20 -typedef struct AspeedSMCClass { +struct AspeedSMCClass { SysBusDevice parent_obj; const AspeedSMCController *ctrl; -} AspeedSMCClass; +}; =20 #define ASPEED_SMC_R_MAX (0x100 / 4) =20 -typedef struct AspeedSMCState { +struct AspeedSMCState { SysBusDevice parent_obj; =20 const AspeedSMCController *ctrl; @@ -117,6 +120,6 @@ typedef struct AspeedSMCState { =20 uint8_t snoop_index; uint8_t snoop_dummies; -} AspeedSMCState; +}; =20 #endif /* ASPEED_SMC_H */ diff --git a/include/hw/ssi/imx_spi.h b/include/hw/ssi/imx_spi.h index 7103953581..3a966af0ec 100644 --- a/include/hw/ssi/imx_spi.h +++ b/include/hw/ssi/imx_spi.h @@ -14,6 +14,7 @@ #include "hw/ssi/ssi.h" #include "qemu/bitops.h" #include "qemu/fifo32.h" +#include "qom/object.h" =20 #define ECSPI_FIFO_SIZE 64 =20 @@ -77,9 +78,10 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 #define TYPE_IMX_SPI "imx.spi" +typedef struct IMXSPIState IMXSPIState; #define IMX_SPI(obj) OBJECT_CHECK(IMXSPIState, (obj), TYPE_IMX_SPI) =20 -typedef struct IMXSPIState { +struct IMXSPIState { /* */ SysBusDevice parent_obj; =20 @@ -98,6 +100,6 @@ typedef struct IMXSPIState { Fifo32 tx_fifo; =20 int16_t burst_length; -} IMXSPIState; +}; =20 #endif /* IMX_SPI_H */ diff --git a/include/hw/ssi/mss-spi.h b/include/hw/ssi/mss-spi.h index f0cf3243e0..40e1a5ac90 100644 --- a/include/hw/ssi/mss-spi.h +++ b/include/hw/ssi/mss-spi.h @@ -28,13 +28,15 @@ #include "hw/sysbus.h" #include "hw/ssi/ssi.h" #include "qemu/fifo32.h" +#include "qom/object.h" =20 #define TYPE_MSS_SPI "mss-spi" +typedef struct MSSSpiState MSSSpiState; #define MSS_SPI(obj) OBJECT_CHECK(MSSSpiState, (obj), TYPE_MSS_SPI) =20 #define R_SPI_MAX 16 =20 -typedef struct MSSSpiState { +struct MSSSpiState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -53,6 +55,6 @@ typedef struct MSSSpiState { bool enabled; =20 uint32_t regs[R_SPI_MAX]; -} MSSSpiState; +}; =20 #endif /* HW_MSS_SPI_H */ diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h index a080519366..64aeb61eef 100644 --- a/include/hw/ssi/pl022.h +++ b/include/hw/ssi/pl022.h @@ -22,11 +22,13 @@ #define HW_SSI_PL022_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_PL022 "pl022" +typedef struct PL022State PL022State; #define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022) =20 -typedef struct PL022State { +struct PL022State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -46,6 +48,6 @@ typedef struct PL022State { uint16_t rx_fifo[8]; qemu_irq irq; SSIBus *ssi; -} PL022State; +}; =20 #endif diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index eac168aa1d..b42765f415 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -12,6 +12,7 @@ #define QEMU_SSI_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 typedef struct SSISlave SSISlave; typedef struct SSISlaveClass SSISlaveClass; diff --git a/include/hw/ssi/stm32f2xx_spi.h b/include/hw/ssi/stm32f2xx_spi.h index e24b007abf..1c8ff7d724 100644 --- a/include/hw/ssi/stm32f2xx_spi.h +++ b/include/hw/ssi/stm32f2xx_spi.h @@ -27,6 +27,7 @@ =20 #include "hw/sysbus.h" #include "hw/ssi/ssi.h" +#include "qom/object.h" =20 #define STM_SPI_CR1 0x00 #define STM_SPI_CR2 0x04 @@ -44,10 +45,11 @@ #define STM_SPI_SR_RXNE 1 =20 #define TYPE_STM32F2XX_SPI "stm32f2xx-spi" +typedef struct STM32F2XXSPIState STM32F2XXSPIState; #define STM32F2XX_SPI(obj) \ OBJECT_CHECK(STM32F2XXSPIState, (obj), TYPE_STM32F2XX_SPI) =20 -typedef struct { +struct STM32F2XXSPIState { /* */ SysBusDevice parent_obj; =20 @@ -66,6 +68,6 @@ typedef struct { =20 qemu_irq irq; SSIBus *ssi; -} STM32F2XXSPIState; +}; =20 #endif /* HW_STM32F2XX_SPI_H */ diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index 6a39b55a7b..2171018601 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -29,6 +29,7 @@ #include "qemu/fifo32.h" #include "hw/stream.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 typedef struct XilinxSPIPS XilinxSPIPS; =20 @@ -85,16 +86,17 @@ struct XilinxSPIPS { bool man_start_com; }; =20 -typedef struct { +struct XilinxQSPIPS { XilinxSPIPS parent_obj; =20 uint8_t lqspi_buf[LQSPI_CACHE_SIZE]; hwaddr lqspi_cached_addr; Error *migration_blocker; bool mmio_execution_enabled; -} XilinxQSPIPS; +}; +typedef struct XilinxQSPIPS XilinxQSPIPS; =20 -typedef struct { +struct XlnxZynqMPQSPIPS { XilinxQSPIPS parent_obj; =20 StreamSlave *dma; @@ -117,16 +119,18 @@ typedef struct { bool man_start_com_g; uint32_t dma_burst_size; uint8_t dma_buf[QSPI_DMA_MAX_BURST_SIZE]; -} XlnxZynqMPQSPIPS; +}; +typedef struct XlnxZynqMPQSPIPS XlnxZynqMPQSPIPS; =20 -typedef struct XilinxSPIPSClass { +struct XilinxSPIPSClass { SysBusDeviceClass parent_class; =20 const MemoryRegionOps *reg_ops; =20 uint32_t rx_fifo_size; uint32_t tx_fifo_size; -} XilinxSPIPSClass; +}; +typedef struct XilinxSPIPSClass XilinxSPIPSClass; =20 #define TYPE_XILINX_SPIPS "xlnx.ps7-spi" #define TYPE_XILINX_QSPIPS "xlnx.ps7-qspi" diff --git a/include/hw/stream.h b/include/hw/stream.h index ed09e83683..bd41750e94 100644 --- a/include/hw/stream.h +++ b/include/hw/stream.h @@ -6,6 +6,7 @@ /* stream slave. Used until qdev provides a generic way. */ #define TYPE_STREAM_SLAVE "stream-slave" =20 +typedef struct StreamSlaveClass StreamSlaveClass; #define STREAM_SLAVE_CLASS(klass) \ OBJECT_CLASS_CHECK(StreamSlaveClass, (klass), TYPE_STREAM_SLAVE) #define STREAM_SLAVE_GET_CLASS(obj) \ @@ -17,7 +18,7 @@ typedef struct StreamSlave StreamSlave; =20 typedef void (*StreamCanPushNotifyFn)(void *opaque); =20 -typedef struct StreamSlaveClass { +struct StreamSlaveClass { InterfaceClass parent; /** * can push - determine if a stream slave is capable of accepting at l= east @@ -42,7 +43,7 @@ typedef struct StreamSlaveClass { * @eop: End of packet flag */ size_t (*push)(StreamSlave *obj, unsigned char *buf, size_t len, bool = eop); -} StreamSlaveClass; +}; =20 size_t stream_push(StreamSlave *sink, uint8_t *buf, size_t len, bool eop); diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index da9f85c58c..3537e43f23 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -5,6 +5,7 @@ =20 #include "hw/qdev-core.h" #include "exec/memory.h" +#include "qom/object.h" =20 #define QDEV_MAX_MMIO 32 #define QDEV_MAX_PIO 32 @@ -15,6 +16,7 @@ typedef struct SysBusDevice SysBusDevice; =20 #define TYPE_SYS_BUS_DEVICE "sys-bus-device" +typedef struct SysBusDeviceClass SysBusDeviceClass; #define SYS_BUS_DEVICE(obj) \ OBJECT_CHECK(SysBusDevice, (obj), TYPE_SYS_BUS_DEVICE) #define SYS_BUS_DEVICE_CLASS(klass) \ @@ -31,7 +33,7 @@ typedef struct SysBusDevice SysBusDevice; =20 #define SYSBUS_DEVICE_GPIO_IRQ "sysbus-irq" =20 -typedef struct SysBusDeviceClass { +struct SysBusDeviceClass { /*< private >*/ DeviceClass parent_class; =20 @@ -52,7 +54,7 @@ typedef struct SysBusDeviceClass { */ char *(*explicit_ofw_unit_address)(const SysBusDevice *dev); void (*connect_irq_notifier)(SysBusDevice *dev, qemu_irq irq); -} SysBusDeviceClass; +}; =20 struct SysBusDevice { /*< private >*/ diff --git a/include/hw/timer/a9gtimer.h b/include/hw/timer/a9gtimer.h index 81c4388784..88811c6c8f 100644 --- a/include/hw/timer/a9gtimer.h +++ b/include/hw/timer/a9gtimer.h @@ -24,10 +24,12 @@ #define A9GTIMER_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define A9_GTIMER_MAX_CPUS 4 =20 #define TYPE_A9_GTIMER "arm.cortex-a9-global-timer" +typedef struct A9GTimerState A9GTimerState; #define A9_GTIMER(obj) OBJECT_CHECK(A9GTimerState, (obj), TYPE_A9_GTIMER) =20 #define R_COUNTER_LO 0x00 @@ -55,7 +57,6 @@ #define R_AUTO_INCREMENT 0x18 =20 typedef struct A9GTimerPerCPU A9GTimerPerCPU; -typedef struct A9GTimerState A9GTimerState; =20 struct A9GTimerPerCPU { A9GTimerState *parent; diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwin= ner-a10-pit.h index 871c95b512..fa060c684d 100644 --- a/include/hw/timer/allwinner-a10-pit.h +++ b/include/hw/timer/allwinner-a10-pit.h @@ -3,8 +3,10 @@ =20 #include "hw/ptimer.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_AW_A10_PIT "allwinner-A10-timer" +typedef struct AwA10PITState AwA10PITState; #define AW_A10_PIT(obj) OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT) =20 #define AW_A10_PIT_TIMER_NR 6 @@ -36,7 +38,6 @@ =20 #define AW_A10_PIT_DEFAULT_CLOCK 0x4 =20 -typedef struct AwA10PITState AwA10PITState; =20 typedef struct AwA10TimerContext { AwA10PITState *container; diff --git a/include/hw/timer/arm_mptimer.h b/include/hw/timer/arm_mptimer.h index c46d8d2309..643a256ecf 100644 --- a/include/hw/timer/arm_mptimer.h +++ b/include/hw/timer/arm_mptimer.h @@ -22,6 +22,7 @@ #define HW_TIMER_ARM_MPTIMER_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define ARM_MPTIMER_MAX_CPUS 4 =20 @@ -35,10 +36,11 @@ typedef struct { } TimerBlock; =20 #define TYPE_ARM_MPTIMER "arm_mptimer" +typedef struct ARMMPTimerState ARMMPTimerState; #define ARM_MPTIMER(obj) \ OBJECT_CHECK(ARMMPTimerState, (obj), TYPE_ARM_MPTIMER) =20 -typedef struct { +struct ARMMPTimerState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -46,6 +48,6 @@ typedef struct { uint32_t num_cpu; TimerBlock timerblock[ARM_MPTIMER_MAX_CPUS]; MemoryRegion iomem; -} ARMMPTimerState; +}; =20 #endif diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_sy= stick.h index 25e5ceacc8..33df057958 100644 --- a/include/hw/timer/armv7m_systick.h +++ b/include/hw/timer/armv7m_systick.h @@ -13,12 +13,14 @@ #define HW_TIMER_ARMV7M_SYSTICK_H =20 #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_SYSTICK "armv7m_systick" =20 +typedef struct SysTickState SysTickState; #define SYSTICK(obj) OBJECT_CHECK(SysTickState, (obj), TYPE_SYSTICK) =20 -typedef struct SysTickState { +struct SysTickState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -29,7 +31,7 @@ typedef struct SysTickState { QEMUTimer *timer; MemoryRegion iomem; qemu_irq irq; -} SysTickState; +}; =20 /* * Multiplication factor to convert from system clock ticks to qemu timer diff --git a/include/hw/timer/aspeed_timer.h b/include/hw/timer/aspeed_time= r.h index d7c7d8ad28..c890aaa949 100644 --- a/include/hw/timer/aspeed_timer.h +++ b/include/hw/timer/aspeed_timer.h @@ -24,10 +24,13 @@ =20 #include "qemu/timer.h" #include "hw/misc/aspeed_scu.h" +#include "qom/object.h" =20 +#define TYPE_ASPEED_TIMER "aspeed.timer" +typedef struct AspeedTimerClass AspeedTimerClass; +typedef struct AspeedTimerCtrlState AspeedTimerCtrlState; #define ASPEED_TIMER(obj) \ OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER) -#define TYPE_ASPEED_TIMER "aspeed.timer" #define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400" #define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500" #define TYPE_ASPEED_2600_TIMER TYPE_ASPEED_TIMER "-ast2600" @@ -50,7 +53,7 @@ typedef struct AspeedTimer { uint64_t start; } AspeedTimer; =20 -typedef struct AspeedTimerCtrlState { +struct AspeedTimerCtrlState { /*< private >*/ SysBusDevice parent; =20 @@ -64,18 +67,18 @@ typedef struct AspeedTimerCtrlState { AspeedTimer timers[ASPEED_TIMER_NR_TIMERS]; =20 AspeedSCUState *scu; -} AspeedTimerCtrlState; +}; =20 #define ASPEED_TIMER_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedTimerClass, (klass), TYPE_ASPEED_TIMER) #define ASPEED_TIMER_GET_CLASS(obj) \ OBJECT_GET_CLASS(AspeedTimerClass, (obj), TYPE_ASPEED_TIMER) =20 -typedef struct AspeedTimerClass { +struct AspeedTimerClass { SysBusDeviceClass parent_class; =20 uint64_t (*read)(AspeedTimerCtrlState *s, hwaddr offset); void (*write)(AspeedTimerCtrlState *s, hwaddr offset, uint64_t value); -} AspeedTimerClass; +}; =20 #endif /* ASPEED_TIMER_H */ diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h index 982019d242..9efe75ce5e 100644 --- a/include/hw/timer/avr_timer16.h +++ b/include/hw/timer/avr_timer16.h @@ -31,6 +31,7 @@ #include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/hw.h" +#include "qom/object.h" =20 enum NextInterrupt { OVERFLOW, @@ -41,10 +42,11 @@ enum NextInterrupt { }; =20 #define TYPE_AVR_TIMER16 "avr-timer16" +typedef struct AVRTimer16State AVRTimer16State; #define AVR_TIMER16(obj) \ OBJECT_CHECK(AVRTimer16State, (obj), TYPE_AVR_TIMER16) =20 -typedef struct AVRTimer16State { +struct AVRTimer16State { /* */ SysBusDevice parent_obj; =20 @@ -89,6 +91,6 @@ typedef struct AVRTimer16State { uint64_t period_ns; uint64_t reset_time_ns; enum NextInterrupt next_interrupt; -} AVRTimer16State; +}; =20 #endif /* HW_TIMER_AVR_TIMER16_H */ diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index c0bc5c8127..796f62cf88 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -11,12 +11,14 @@ =20 #include "hw/sysbus.h" #include "hw/irq.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer" +typedef struct BCM2835SystemTimerState BCM2835SystemTimerState; #define BCM2835_SYSTIMER(obj) \ OBJECT_CHECK(BCM2835SystemTimerState, (obj), TYPE_BCM2835_SYSTIMER) =20 -typedef struct { +struct BCM2835SystemTimerState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -28,6 +30,6 @@ typedef struct { uint32_t status; uint32_t compare[4]; } reg; -} BCM2835SystemTimerState; +}; =20 #endif diff --git a/include/hw/timer/cmsdk-apb-dualtimer.h b/include/hw/timer/cmsd= k-apb-dualtimer.h index 9843a9dbb1..8a1137aec7 100644 --- a/include/hw/timer/cmsdk-apb-dualtimer.h +++ b/include/hw/timer/cmsdk-apb-dualtimer.h @@ -28,12 +28,13 @@ =20 #include "hw/sysbus.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define TYPE_CMSDK_APB_DUALTIMER "cmsdk-apb-dualtimer" +typedef struct CMSDKAPBDualTimer CMSDKAPBDualTimer; #define CMSDK_APB_DUALTIMER(obj) OBJECT_CHECK(CMSDKAPBDualTimer, (obj), \ TYPE_CMSDK_APB_DUALTIMER) =20 -typedef struct CMSDKAPBDualTimer CMSDKAPBDualTimer; =20 /* One of the two identical timer modules in the dual-timer module */ typedef struct CMSDKAPBDualTimerModule { diff --git a/include/hw/timer/cmsdk-apb-timer.h b/include/hw/timer/cmsdk-ap= b-timer.h index f24bda6a46..a7ca523529 100644 --- a/include/hw/timer/cmsdk-apb-timer.h +++ b/include/hw/timer/cmsdk-apb-timer.h @@ -15,12 +15,14 @@ #include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define TYPE_CMSDK_APB_TIMER "cmsdk-apb-timer" +typedef struct CMSDKAPBTIMER CMSDKAPBTIMER; #define CMSDK_APB_TIMER(obj) OBJECT_CHECK(CMSDKAPBTIMER, (obj), \ TYPE_CMSDK_APB_TIMER) =20 -typedef struct { +struct CMSDKAPBTIMER { /*< private >*/ SysBusDevice parent_obj; =20 @@ -34,7 +36,7 @@ typedef struct { uint32_t value; uint32_t reload; uint32_t intstatus; -} CMSDKAPBTIMER; +}; =20 /** * cmsdk_apb_timer_create - convenience function to create TYPE_CMSDK_APB_= TIMER diff --git a/include/hw/timer/digic-timer.h b/include/hw/timer/digic-timer.h index d9e67fe291..543bf8c6be 100644 --- a/include/hw/timer/digic-timer.h +++ b/include/hw/timer/digic-timer.h @@ -20,8 +20,10 @@ =20 #include "hw/sysbus.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define TYPE_DIGIC_TIMER "digic-timer" +typedef struct DigicTimerState DigicTimerState; #define DIGIC_TIMER(obj) OBJECT_CHECK(DigicTimerState, (obj), TYPE_DIGIC_T= IMER) =20 #define DIGIC_TIMER_CONTROL 0x00 @@ -30,7 +32,7 @@ #define DIGIC_TIMER_RELVALUE 0x08 #define DIGIC_TIMER_VALUE 0x0c =20 -typedef struct DigicTimerState { +struct DigicTimerState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -40,6 +42,6 @@ typedef struct DigicTimerState { =20 uint32_t control; uint32_t relvalue; -} DigicTimerState; +}; =20 #endif /* HW_TIMER_DIGIC_TIMER_H */ diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 206b8f8464..6adbc31e7e 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -28,6 +28,7 @@ #include "hw/qdev-properties.h" #include "hw/isa/isa.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define PIT_FREQ 1193182 =20 diff --git a/include/hw/timer/imx_epit.h b/include/hw/timer/imx_epit.h index 0730ac35e6..1ca110caf5 100644 --- a/include/hw/timer/imx_epit.h +++ b/include/hw/timer/imx_epit.h @@ -32,6 +32,7 @@ #include "hw/sysbus.h" #include "hw/ptimer.h" #include "hw/misc/imx_ccm.h" +#include "qom/object.h" =20 /* * EPIT: Enhanced periodic interrupt timer @@ -55,9 +56,10 @@ #define EPIT_TIMER_MAX 0XFFFFFFFFUL =20 #define TYPE_IMX_EPIT "imx.epit" +typedef struct IMXEPITState IMXEPITState; #define IMX_EPIT(obj) OBJECT_CHECK(IMXEPITState, (obj), TYPE_IMX_EPIT) =20 -typedef struct IMXEPITState{ +struct IMXEPITState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -75,6 +77,6 @@ typedef struct IMXEPITState{ =20 uint32_t freq; qemu_irq irq; -} IMXEPITState; +}; =20 #endif /* IMX_EPIT_H */ diff --git a/include/hw/timer/imx_gpt.h b/include/hw/timer/imx_gpt.h index 20ccb327c4..b96633d8b2 100644 --- a/include/hw/timer/imx_gpt.h +++ b/include/hw/timer/imx_gpt.h @@ -32,6 +32,7 @@ #include "hw/sysbus.h" #include "hw/ptimer.h" #include "hw/misc/imx_ccm.h" +#include "qom/object.h" =20 /* * GPT : General purpose timer @@ -81,9 +82,10 @@ =20 #define TYPE_IMX_GPT TYPE_IMX25_GPT =20 +typedef struct IMXGPTState IMXGPTState; #define IMX_GPT(obj) OBJECT_CHECK(IMXGPTState, (obj), TYPE_IMX_GPT) =20 -typedef struct IMXGPTState{ +struct IMXGPTState { /*< private >*/ SysBusDevice parent_obj; =20 @@ -111,6 +113,6 @@ typedef struct IMXGPTState{ qemu_irq irq; =20 const IMXClk *clocks; -} IMXGPTState; +}; =20 #endif /* IMX_GPT_H */ diff --git a/include/hw/timer/mss-timer.h b/include/hw/timer/mss-timer.h index e5a784b27e..011c5f1ba9 100644 --- a/include/hw/timer/mss-timer.h +++ b/include/hw/timer/mss-timer.h @@ -27,8 +27,10 @@ =20 #include "hw/sysbus.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define TYPE_MSS_TIMER "mss-timer" +typedef struct MSSTimerState MSSTimerState; #define MSS_TIMER(obj) OBJECT_CHECK(MSSTimerState, \ (obj), TYPE_MSS_TIMER) =20 @@ -52,12 +54,12 @@ struct Msf2Timer { qemu_irq irq; }; =20 -typedef struct MSSTimerState { +struct MSSTimerState { SysBusDevice parent_obj; =20 MemoryRegion mmio; uint32_t freq_hz; struct Msf2Timer timers[NUM_TIMERS]; -} MSSTimerState; +}; =20 #endif /* HW_MSS_TIMER_H */ diff --git a/include/hw/timer/nrf51_timer.h b/include/hw/timer/nrf51_timer.h index eb6815f21d..b4eb29bd76 100644 --- a/include/hw/timer/nrf51_timer.h +++ b/include/hw/timer/nrf51_timer.h @@ -15,7 +15,9 @@ =20 #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" #define TYPE_NRF51_TIMER "nrf51_soc.timer" +typedef struct NRF51TimerState NRF51TimerState; #define NRF51_TIMER(obj) OBJECT_CHECK(NRF51TimerState, (obj), TYPE_NRF51_T= IMER) =20 #define NRF51_TIMER_REG_COUNT 4 @@ -53,7 +55,7 @@ #define NRF51_TIMER_REG_CC0 0x540 #define NRF51_TIMER_REG_CC3 0x54C =20 -typedef struct NRF51TimerState { +struct NRF51TimerState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -75,7 +77,7 @@ typedef struct NRF51TimerState { uint32_t bitmode; uint32_t prescaler; =20 -} NRF51TimerState; +}; =20 =20 #endif diff --git a/include/hw/timer/renesas_cmt.h b/include/hw/timer/renesas_cmt.h index e28a15cb38..313f9e1965 100644 --- a/include/hw/timer/renesas_cmt.h +++ b/include/hw/timer/renesas_cmt.h @@ -11,8 +11,10 @@ =20 #include "qemu/timer.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_RENESAS_CMT "renesas-cmt" +typedef struct RCMTState RCMTState; #define RCMT(obj) OBJECT_CHECK(RCMTState, (obj), TYPE_RENESAS_CMT) =20 enum { @@ -20,7 +22,7 @@ enum { CMT_NR_IRQ =3D 1 * CMT_CH }; =20 -typedef struct RCMTState { +struct RCMTState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -35,6 +37,6 @@ typedef struct RCMTState { int64_t tick[CMT_CH]; qemu_irq cmi[CMT_CH]; QEMUTimer timer[CMT_CH]; -} RCMTState; +}; =20 #endif diff --git a/include/hw/timer/renesas_tmr.h b/include/hw/timer/renesas_tmr.h index cf3baa7a28..e2abcb13ad 100644 --- a/include/hw/timer/renesas_tmr.h +++ b/include/hw/timer/renesas_tmr.h @@ -11,8 +11,10 @@ =20 #include "qemu/timer.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_RENESAS_TMR "renesas-tmr" +typedef struct RTMRState RTMRState; #define RTMR(obj) OBJECT_CHECK(RTMRState, (obj), TYPE_RENESAS_TMR) =20 enum timer_event { @@ -28,7 +30,7 @@ enum { TMR_NR_IRQ =3D 3 * TMR_CH }; =20 -typedef struct RTMRState { +struct RTMRState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -50,6 +52,6 @@ typedef struct RTMRState { qemu_irq cmib[TMR_CH]; qemu_irq ovi[TMR_CH]; QEMUTimer timer[TMR_CH]; -} RTMRState; +}; =20 #endif diff --git a/include/hw/timer/stm32f2xx_timer.h b/include/hw/timer/stm32f2x= x_timer.h index a96bc08b1b..9eb9201085 100644 --- a/include/hw/timer/stm32f2xx_timer.h +++ b/include/hw/timer/stm32f2xx_timer.h @@ -27,6 +27,7 @@ =20 #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" =20 #define TIM_CR1 0x00 #define TIM_CR2 0x04 @@ -61,10 +62,11 @@ #define TIM_DIER_UIE 1 =20 #define TYPE_STM32F2XX_TIMER "stm32f2xx-timer" +typedef struct STM32F2XXTimerState STM32F2XXTimerState; #define STM32F2XXTIMER(obj) OBJECT_CHECK(STM32F2XXTimerState, \ (obj), TYPE_STM32F2XX_TIMER) =20 -typedef struct STM32F2XXTimerState { +struct STM32F2XXTimerState { /* */ SysBusDevice parent_obj; =20 @@ -95,6 +97,6 @@ typedef struct STM32F2XXTimerState { uint32_t tim_dcr; uint32_t tim_dmar; uint32_t tim_or; -} STM32F2XXTimerState; +}; =20 #endif /* HW_STM32F2XX_TIMER_H */ diff --git a/include/hw/usb.h b/include/hw/usb.h index e29a37635b..e6ec0c891c 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -29,6 +29,7 @@ #include "hw/qdev-core.h" #include "qemu/iov.h" #include "qemu/queue.h" +#include "qom/object.h" =20 /* Constants related to the USB / PCI interaction */ #define USB_SBRN 0x60 /* Serial Bus Release Number Register */ @@ -264,6 +265,7 @@ struct USBDevice { }; =20 #define TYPE_USB_DEVICE "usb-device" +typedef struct USBDeviceClass USBDeviceClass; #define USB_DEVICE(obj) \ OBJECT_CHECK(USBDevice, (obj), TYPE_USB_DEVICE) #define USB_DEVICE_CLASS(klass) \ @@ -274,7 +276,7 @@ struct USBDevice { typedef void (*USBDeviceRealize)(USBDevice *dev, Error **errp); typedef void (*USBDeviceUnrealize)(USBDevice *dev); =20 -typedef struct USBDeviceClass { +struct USBDeviceClass { DeviceClass parent_class; =20 USBDeviceRealize realize; @@ -346,7 +348,7 @@ typedef struct USBDeviceClass { const char *product_desc; const USBDesc *usb_desc; bool attached_settable; -} USBDeviceClass; +}; =20 typedef struct USBPortOps { void (*attach)(USBPort *port); diff --git a/include/hw/usb/chipidea.h b/include/hw/usb/chipidea.h index 1ec2e9dbda..1db449e1c4 100644 --- a/include/hw/usb/chipidea.h +++ b/include/hw/usb/chipidea.h @@ -2,13 +2,15 @@ #define CHIPIDEA_H =20 #include "hw/usb/hcd-ehci.h" +#include "qom/object.h" =20 -typedef struct ChipideaState { +struct ChipideaState { /*< private >*/ EHCISysBusState parent_obj; =20 MemoryRegion iomem[3]; -} ChipideaState; +}; +typedef struct ChipideaState ChipideaState; =20 #define TYPE_CHIPIDEA "usb-chipidea" #define CHIPIDEA(obj) OBJECT_CHECK(ChipideaState, (obj), TYPE_CHIPIDEA) diff --git a/include/hw/usb/imx-usb-phy.h b/include/hw/usb/imx-usb-phy.h index 07f0235d10..9861acb5ac 100644 --- a/include/hw/usb/imx-usb-phy.h +++ b/include/hw/usb/imx-usb-phy.h @@ -3,6 +3,7 @@ =20 #include "hw/sysbus.h" #include "qemu/bitops.h" +#include "qom/object.h" =20 enum IMXUsbPhyRegisters { USBPHY_PWD, @@ -38,9 +39,10 @@ enum IMXUsbPhyRegisters { #define USBPHY_CTRL_SFTRST BIT(31) =20 #define TYPE_IMX_USBPHY "imx.usbphy" +typedef struct IMXUSBPHYState IMXUSBPHYState; #define IMX_USBPHY(obj) OBJECT_CHECK(IMXUSBPHYState, (obj), TYPE_IMX_USBPH= Y) =20 -typedef struct IMXUSBPHYState { +struct IMXUSBPHYState { /* */ SysBusDevice parent_obj; =20 @@ -48,6 +50,6 @@ typedef struct IMXUSBPHYState { MemoryRegion iomem; =20 uint32_t usbphy[USBPHY_MAX]; -} IMXUSBPHYState; +}; =20 #endif /* IMX_USB_PHY_H */ diff --git a/include/hw/vfio/vfio-amd-xgbe.h b/include/hw/vfio/vfio-amd-xgb= e.h index 9fff65e99d..b860ac0446 100644 --- a/include/hw/vfio/vfio-amd-xgbe.h +++ b/include/hw/vfio/vfio-amd-xgbe.h @@ -15,6 +15,7 @@ #define HW_VFIO_VFIO_AMD_XGBE_H =20 #include "hw/vfio/vfio-platform.h" +#include "qom/object.h" =20 #define TYPE_VFIO_AMD_XGBE "vfio-amd-xgbe" =20 diff --git a/include/hw/vfio/vfio-calxeda-xgmac.h b/include/hw/vfio/vfio-ca= lxeda-xgmac.h index f994775c09..b19dc2160b 100644 --- a/include/hw/vfio/vfio-calxeda-xgmac.h +++ b/include/hw/vfio/vfio-calxeda-xgmac.h @@ -15,6 +15,7 @@ #define HW_VFIO_VFIO_CALXEDA_XGMAC_H =20 #include "hw/vfio/vfio-platform.h" +#include "qom/object.h" =20 #define TYPE_VFIO_CALXEDA_XGMAC "vfio-calxeda-xgmac" =20 @@ -23,16 +24,18 @@ * - a single MMIO region corresponding to its register space * - 3 IRQS (main and 2 power related IRQs) */ -typedef struct VFIOCalxedaXgmacDevice { +struct VFIOCalxedaXgmacDevice { VFIOPlatformDevice vdev; -} VFIOCalxedaXgmacDevice; +}; +typedef struct VFIOCalxedaXgmacDevice VFIOCalxedaXgmacDevice; =20 -typedef struct VFIOCalxedaXgmacDeviceClass { +struct VFIOCalxedaXgmacDeviceClass { /*< private >*/ VFIOPlatformDeviceClass parent_class; /*< public >*/ DeviceRealize parent_realize; -} VFIOCalxedaXgmacDeviceClass; +}; +typedef struct VFIOCalxedaXgmacDeviceClass VFIOCalxedaXgmacDeviceClass; =20 #define VFIO_CALXEDA_XGMAC_DEVICE(obj) \ OBJECT_CHECK(VFIOCalxedaXgmacDevice, (obj), TYPE_VFIO_CALXEDA_XGMAC) diff --git a/include/hw/vfio/vfio-platform.h b/include/hw/vfio/vfio-platfor= m.h index 4ec70c813a..248c23dba7 100644 --- a/include/hw/vfio/vfio-platform.h +++ b/include/hw/vfio/vfio-platform.h @@ -20,6 +20,7 @@ #include "hw/vfio/vfio-common.h" #include "qemu/event_notifier.h" #include "qemu/queue.h" +#include "qom/object.h" =20 #define TYPE_VFIO_PLATFORM "vfio-platform" =20 @@ -46,7 +47,7 @@ typedef struct VFIOINTp { /* function type for user side eventfd handler */ typedef void (*eventfd_user_side_handler_t)(VFIOINTp *intp); =20 -typedef struct VFIOPlatformDevice { +struct VFIOPlatformDevice { SysBusDevice sbdev; VFIODevice vbasedev; /* not a QOM object */ VFIORegion **regions; @@ -59,13 +60,15 @@ typedef struct VFIOPlatformDevice { QEMUTimer *mmap_timer; /* allows fast-path resume after IRQ hit */ QemuMutex intp_mutex; /* protect the intp_list IRQ state */ bool irqfd_allowed; /* debug option to force irqfd on/off */ -} VFIOPlatformDevice; +}; +typedef struct VFIOPlatformDevice VFIOPlatformDevice; =20 -typedef struct VFIOPlatformDeviceClass { +struct VFIOPlatformDeviceClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ -} VFIOPlatformDeviceClass; +}; +typedef struct VFIOPlatformDeviceClass VFIOPlatformDeviceClass; =20 #define VFIO_PLATFORM_DEVICE(obj) \ OBJECT_CHECK(VFIOPlatformDevice, (obj), TYPE_VFIO_PLATFORM) diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhos= t-scsi-common.h index 16bf1a73c1..f198f25119 100644 --- a/include/hw/virtio/vhost-scsi-common.h +++ b/include/hw/virtio/vhost-scsi-common.h @@ -17,12 +17,14 @@ #include "hw/virtio/virtio-scsi.h" #include "hw/virtio/vhost.h" #include "hw/fw-path-provider.h" +#include "qom/object.h" =20 #define TYPE_VHOST_SCSI_COMMON "vhost-scsi-common" +typedef struct VHostSCSICommon VHostSCSICommon; #define VHOST_SCSI_COMMON(obj) \ OBJECT_CHECK(VHostSCSICommon, (obj), TYPE_VHOST_SCSI_COMMON) =20 -typedef struct VHostSCSICommon { +struct VHostSCSICommon { VirtIOSCSICommon parent_obj; =20 Error *migration_blocker; @@ -35,7 +37,7 @@ typedef struct VHostSCSICommon { int lun; uint64_t host_features; bool migratable; -} VHostSCSICommon; +}; =20 int vhost_scsi_common_start(VHostSCSICommon *vsc); void vhost_scsi_common_stop(VHostSCSICommon *vsc); diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h index 23252153ff..72ae842646 100644 --- a/include/hw/virtio/vhost-scsi.h +++ b/include/hw/virtio/vhost-scsi.h @@ -17,6 +17,7 @@ #include "hw/virtio/virtio-scsi.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-scsi-common.h" +#include "qom/object.h" =20 enum vhost_scsi_vq_list { VHOST_SCSI_VQ_CONTROL =3D 0, @@ -25,11 +26,12 @@ enum vhost_scsi_vq_list { }; =20 #define TYPE_VHOST_SCSI "vhost-scsi" +typedef struct VHostSCSI VHostSCSI; #define VHOST_SCSI(obj) \ OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI) =20 -typedef struct VHostSCSI { +struct VHostSCSI { VHostSCSICommon parent_obj; -} VHostSCSI; +}; =20 #endif diff --git a/include/hw/virtio/vhost-user-blk.h b/include/hw/virtio/vhost-u= ser-blk.h index 292d17147c..9d38877907 100644 --- a/include/hw/virtio/vhost-user-blk.h +++ b/include/hw/virtio/vhost-user-blk.h @@ -20,14 +20,16 @@ #include "chardev/char-fe.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-user.h" +#include "qom/object.h" =20 #define TYPE_VHOST_USER_BLK "vhost-user-blk" +typedef struct VHostUserBlk VHostUserBlk; #define VHOST_USER_BLK(obj) \ OBJECT_CHECK(VHostUserBlk, (obj), TYPE_VHOST_USER_BLK) =20 #define VHOST_USER_BLK_AUTO_NUM_QUEUES UINT16_MAX =20 -typedef struct VHostUserBlk { +struct VHostUserBlk { VirtIODevice parent_obj; CharBackend chardev; int32_t bootindex; @@ -41,6 +43,6 @@ typedef struct VHostUserBlk { struct vhost_virtqueue *vhost_vqs; VirtQueue **virtqs; bool connected; -} VHostUserBlk; +}; =20 #endif diff --git a/include/hw/virtio/vhost-user-fs.h b/include/hw/virtio/vhost-us= er-fs.h index 6f3030d288..fa82be0e8a 100644 --- a/include/hw/virtio/vhost-user-fs.h +++ b/include/hw/virtio/vhost-user-fs.h @@ -18,8 +18,10 @@ #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-user.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define TYPE_VHOST_USER_FS "vhost-user-fs-device" +typedef struct VHostUserFS VHostUserFS; #define VHOST_USER_FS(obj) \ OBJECT_CHECK(VHostUserFS, (obj), TYPE_VHOST_USER_FS) =20 @@ -30,7 +32,7 @@ typedef struct { uint16_t queue_size; } VHostUserFSConf; =20 -typedef struct { +struct VHostUserFS { /*< private >*/ VirtIODevice parent; VHostUserFSConf conf; @@ -41,6 +43,6 @@ typedef struct { VirtQueue *hiprio_vq; =20 /*< public >*/ -} VHostUserFS; +}; =20 #endif /* _QEMU_VHOST_USER_FS_H */ diff --git a/include/hw/virtio/vhost-user-scsi.h b/include/hw/virtio/vhost-= user-scsi.h index 99ab2f2cc4..c4c4c29bf9 100644 --- a/include/hw/virtio/vhost-user-scsi.h +++ b/include/hw/virtio/vhost-user-scsi.h @@ -21,14 +21,16 @@ #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-user.h" #include "hw/virtio/vhost-scsi-common.h" +#include "qom/object.h" =20 #define TYPE_VHOST_USER_SCSI "vhost-user-scsi" +typedef struct VHostUserSCSI VHostUserSCSI; #define VHOST_USER_SCSI(obj) \ OBJECT_CHECK(VHostUserSCSI, (obj), TYPE_VHOST_USER_SCSI) =20 -typedef struct VHostUserSCSI { +struct VHostUserSCSI { VHostSCSICommon parent_obj; VhostUserState vhost_user; -} VHostUserSCSI; +}; =20 #endif /* VHOST_USER_SCSI_H */ diff --git a/include/hw/virtio/vhost-user-vsock.h b/include/hw/virtio/vhost= -user-vsock.h index 4e128a4b9f..d7eda986b6 100644 --- a/include/hw/virtio/vhost-user-vsock.h +++ b/include/hw/virtio/vhost-user-vsock.h @@ -14,8 +14,10 @@ #include "hw/virtio/vhost-vsock-common.h" #include "hw/virtio/vhost-user.h" #include "standard-headers/linux/virtio_vsock.h" +#include "qom/object.h" =20 #define TYPE_VHOST_USER_VSOCK "vhost-user-vsock-device" +typedef struct VHostUserVSock VHostUserVSock; #define VHOST_USER_VSOCK(obj) \ OBJECT_CHECK(VHostUserVSock, (obj), TYPE_VHOST_USER_VSOCK) =20 @@ -23,7 +25,7 @@ typedef struct { CharBackend chardev; } VHostUserVSockConf; =20 -typedef struct { +struct VHostUserVSock { /*< private >*/ VHostVSockCommon parent; VhostUserState vhost_user; @@ -31,6 +33,6 @@ typedef struct { struct virtio_vsock_config vsockcfg; =20 /*< public >*/ -} VHostUserVSock; +}; =20 #endif /* _QEMU_VHOST_USER_VSOCK_H */ diff --git a/include/hw/virtio/vhost-vsock-common.h b/include/hw/virtio/vho= st-vsock-common.h index f8b4aaae00..a181396215 100644 --- a/include/hw/virtio/vhost-vsock-common.h +++ b/include/hw/virtio/vhost-vsock-common.h @@ -13,8 +13,10 @@ =20 #include "hw/virtio/virtio.h" #include "hw/virtio/vhost.h" +#include "qom/object.h" =20 #define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common" +typedef struct VHostVSockCommon VHostVSockCommon; #define VHOST_VSOCK_COMMON(obj) \ OBJECT_CHECK(VHostVSockCommon, (obj), TYPE_VHOST_VSOCK_COMMON) =20 @@ -24,7 +26,7 @@ enum { VHOST_VSOCK_QUEUE_SIZE =3D 128, }; =20 -typedef struct { +struct VHostVSockCommon { VirtIODevice parent; =20 struct vhost_virtqueue vhost_vqs[2]; @@ -35,7 +37,7 @@ typedef struct { VirtQueue *trans_vq; =20 QEMUTimer *post_load_timer; -} VHostVSockCommon; +}; =20 int vhost_vsock_common_start(VirtIODevice *vdev); void vhost_vsock_common_stop(VirtIODevice *vdev); diff --git a/include/hw/virtio/vhost-vsock.h b/include/hw/virtio/vhost-vsoc= k.h index 8cbb7b90f9..e13ff85d12 100644 --- a/include/hw/virtio/vhost-vsock.h +++ b/include/hw/virtio/vhost-vsock.h @@ -15,8 +15,10 @@ #define QEMU_VHOST_VSOCK_H =20 #include "hw/virtio/vhost-vsock-common.h" +#include "qom/object.h" =20 #define TYPE_VHOST_VSOCK "vhost-vsock-device" +typedef struct VHostVSock VHostVSock; #define VHOST_VSOCK(obj) \ OBJECT_CHECK(VHostVSock, (obj), TYPE_VHOST_VSOCK) =20 @@ -25,12 +27,12 @@ typedef struct { char *vhostfd; } VHostVSockConf; =20 -typedef struct { +struct VHostVSock { /*< private >*/ VHostVSockCommon parent; VHostVSockConf conf; =20 /*< public >*/ -} VHostVSock; +}; =20 #endif /* QEMU_VHOST_VSOCK_H */ diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-= balloon.h index 28fd2b3960..a5b869a4d4 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -18,8 +18,10 @@ #include "standard-headers/linux/virtio_balloon.h" #include "hw/virtio/virtio.h" #include "sysemu/iothread.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_BALLOON "virtio-balloon-device" +typedef struct VirtIOBalloon VirtIOBalloon; #define VIRTIO_BALLOON(obj) \ OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON) =20 @@ -40,7 +42,7 @@ enum virtio_balloon_free_page_hint_status { FREE_PAGE_HINT_S_DONE =3D 3, }; =20 -typedef struct VirtIOBalloon { +struct VirtIOBalloon { VirtIODevice parent_obj; VirtQueue *ivq, *dvq, *svq, *free_page_vq, *reporting_vq; uint32_t free_page_hint_status; @@ -71,6 +73,6 @@ typedef struct VirtIOBalloon { =20 bool qemu_4_0_config_size; uint32_t poison_val; -} VirtIOBalloon; +}; =20 #endif diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index 7539c2b848..d299b55cb9 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -19,8 +19,10 @@ #include "hw/block/block.h" #include "sysemu/iothread.h" #include "sysemu/block-backend.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_BLK "virtio-blk-device" +typedef struct VirtIOBlock VirtIOBlock; #define VIRTIO_BLK(obj) \ OBJECT_CHECK(VirtIOBlock, (obj), TYPE_VIRTIO_BLK) =20 @@ -49,7 +51,7 @@ struct VirtIOBlkConf struct VirtIOBlockDataPlane; =20 struct VirtIOBlockReq; -typedef struct VirtIOBlock { +struct VirtIOBlock { VirtIODevice parent_obj; BlockBackend *blk; void *rq; @@ -63,7 +65,7 @@ typedef struct VirtIOBlock { struct VirtIOBlockDataPlane *dataplane; uint64_t host_features; size_t config_size; -} VirtIOBlock; +}; =20 typedef struct VirtIOBlockReq { VirtQueueElement elem; diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h index 0f6f215925..f3e9096370 100644 --- a/include/hw/virtio/virtio-bus.h +++ b/include/hw/virtio/virtio-bus.h @@ -27,17 +27,19 @@ =20 #include "hw/qdev-core.h" #include "hw/virtio/virtio.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_BUS "virtio-bus" +typedef struct VirtioBusClass VirtioBusClass; +typedef struct VirtioBusState VirtioBusState; #define VIRTIO_BUS_GET_CLASS(obj) \ OBJECT_GET_CLASS(VirtioBusClass, obj, TYPE_VIRTIO_BUS) #define VIRTIO_BUS_CLASS(klass) \ OBJECT_CLASS_CHECK(VirtioBusClass, klass, TYPE_VIRTIO_BUS) #define VIRTIO_BUS(obj) OBJECT_CHECK(VirtioBusState, (obj), TYPE_VIRTIO_BU= S) =20 -typedef struct VirtioBusState VirtioBusState; =20 -typedef struct VirtioBusClass { +struct VirtioBusClass { /* This is what a VirtioBus must implement */ BusClass parent; void (*notify)(DeviceState *d, uint16_t vector); @@ -94,7 +96,7 @@ typedef struct VirtioBusClass { */ bool has_variable_vring_alignment; AddressSpace *(*get_dma_as)(DeviceState *d); -} VirtioBusClass; +}; =20 struct VirtioBusState { BusState parent_obj; diff --git a/include/hw/virtio/virtio-crypto.h b/include/hw/virtio/virtio-c= rypto.h index ffe2391ece..4134e1b7ca 100644 --- a/include/hw/virtio/virtio-crypto.h +++ b/include/hw/virtio/virtio-crypto.h @@ -18,6 +18,7 @@ #include "hw/virtio/virtio.h" #include "sysemu/iothread.h" #include "sysemu/cryptodev.h" +#include "qom/object.h" =20 =20 #define DEBUG_VIRTIO_CRYPTO 0 @@ -31,6 +32,7 @@ do { \ =20 =20 #define TYPE_VIRTIO_CRYPTO "virtio-crypto-device" +typedef struct VirtIOCrypto VirtIOCrypto; #define VIRTIO_CRYPTO(obj) \ OBJECT_CHECK(VirtIOCrypto, (obj), TYPE_VIRTIO_CRYPTO) #define VIRTIO_CRYPTO_GET_PARENT_CLASS(obj) \ @@ -82,7 +84,7 @@ typedef struct VirtIOCryptoQueue { struct VirtIOCrypto *vcrypto; } VirtIOCryptoQueue; =20 -typedef struct VirtIOCrypto { +struct VirtIOCrypto { VirtIODevice parent_obj; =20 VirtQueue *ctrl_vq; @@ -97,6 +99,6 @@ typedef struct VirtIOCrypto { uint32_t curr_queues; size_t config_size; uint8_t vhost_started; -} VirtIOCrypto; +}; =20 #endif /* QEMU_VIRTIO_CRYPTO_H */ diff --git a/include/hw/virtio/virtio-gpu-pci.h b/include/hw/virtio/virtio-= gpu-pci.h index 2f69b5a9cc..d727c8cada 100644 --- a/include/hw/virtio/virtio-gpu-pci.h +++ b/include/hw/virtio/virtio-gpu-pci.h @@ -16,6 +16,7 @@ =20 #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-gpu.h" +#include "qom/object.h" =20 typedef struct VirtIOGPUPCIBase VirtIOGPUPCIBase; =20 diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 7517438e10..f464004bc2 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -22,8 +22,11 @@ #include "sysemu/vhost-user-backend.h" =20 #include "standard-headers/linux/virtio_gpu.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base" +typedef struct VirtIOGPUBase VirtIOGPUBase; +typedef struct VirtIOGPUBaseClass VirtIOGPUBaseClass; #define VIRTIO_GPU_BASE(obj) = \ OBJECT_CHECK(VirtIOGPUBase, (obj), TYPE_VIRTIO_GPU_BASE) #define VIRTIO_GPU_BASE_GET_CLASS(obj) = \ @@ -32,10 +35,12 @@ OBJECT_CLASS_CHECK(VirtIOGPUBaseClass, klass, TYPE_VIRTIO_GPU_BASE) =20 #define TYPE_VIRTIO_GPU "virtio-gpu-device" +typedef struct VirtIOGPU VirtIOGPU; #define VIRTIO_GPU(obj) \ OBJECT_CHECK(VirtIOGPU, (obj), TYPE_VIRTIO_GPU) =20 #define TYPE_VHOST_USER_GPU "vhost-user-gpu" +typedef struct VhostUserGPU VhostUserGPU; #define VHOST_USER_GPU(obj) \ OBJECT_CHECK(VhostUserGPU, (obj), TYPE_VHOST_USER_GPU) =20 @@ -100,7 +105,7 @@ struct virtio_gpu_ctrl_command { QTAILQ_ENTRY(virtio_gpu_ctrl_command) next; }; =20 -typedef struct VirtIOGPUBase { +struct VirtIOGPUBase { VirtIODevice parent_obj; =20 Error *migration_blocker; @@ -116,13 +121,13 @@ typedef struct VirtIOGPUBase { =20 int enabled_output_bitmask; struct virtio_gpu_requested_state req_state[VIRTIO_GPU_MAX_SCANOUTS]; -} VirtIOGPUBase; +}; =20 -typedef struct VirtIOGPUBaseClass { +struct VirtIOGPUBaseClass { VirtioDeviceClass parent; =20 void (*gl_unblock)(VirtIOGPUBase *g); -} VirtIOGPUBaseClass; +}; =20 #define VIRTIO_GPU_BASE_PROPERTIES(_state, _conf) \ DEFINE_PROP_UINT32("max_outputs", _state, _conf.max_outputs, 1), \ @@ -131,7 +136,7 @@ typedef struct VirtIOGPUBaseClass { DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1024), \ DEFINE_PROP_UINT32("yres", _state, _conf.yres, 768) =20 -typedef struct VirtIOGPU { +struct VirtIOGPU { VirtIOGPUBase parent_obj; =20 uint64_t conf_max_hostmem; @@ -160,9 +165,9 @@ typedef struct VirtIOGPU { uint32_t req_3d; uint32_t bytes_3d; } stats; -} VirtIOGPU; +}; =20 -typedef struct VhostUserGPU { +struct VhostUserGPU { VirtIOGPUBase parent_obj; =20 VhostUserBackend *vhost; @@ -170,7 +175,7 @@ typedef struct VhostUserGPU { CharBackend vhost_chr; QemuDmaBuf dmabuf[VIRTIO_GPU_MAX_SCANOUTS]; bool backend_blocked; -} VhostUserGPU; +}; =20 extern const GraphicHwOps virtio_gpu_ops; =20 diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-in= put.h index 4fca03e796..c15e983d36 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -9,6 +9,7 @@ =20 #include "standard-headers/linux/virtio_ids.h" #include "standard-headers/linux/virtio_input.h" +#include "qom/object.h" =20 typedef struct virtio_input_absinfo virtio_input_absinfo; typedef struct virtio_input_config virtio_input_config; @@ -18,6 +19,8 @@ typedef struct virtio_input_event virtio_input_event; /* qemu internals */ =20 #define TYPE_VIRTIO_INPUT "virtio-input-device" +typedef struct VirtIOInput VirtIOInput; +typedef struct VirtIOInputClass VirtIOInputClass; #define VIRTIO_INPUT(obj) \ OBJECT_CHECK(VirtIOInput, (obj), TYPE_VIRTIO_INPUT) #define VIRTIO_INPUT_GET_PARENT_CLASS(obj) \ @@ -32,29 +35,27 @@ typedef struct virtio_input_event virtio_input_event; #define TYPE_VIRTIO_MOUSE "virtio-mouse-device" #define TYPE_VIRTIO_TABLET "virtio-tablet-device" =20 +typedef struct VirtIOInputHID VirtIOInputHID; #define VIRTIO_INPUT_HID(obj) \ OBJECT_CHECK(VirtIOInputHID, (obj), TYPE_VIRTIO_INPUT_HID) #define VIRTIO_INPUT_HID_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HID) =20 #define TYPE_VIRTIO_INPUT_HOST "virtio-input-host-device" +typedef struct VirtIOInputHost VirtIOInputHost; #define VIRTIO_INPUT_HOST(obj) \ OBJECT_CHECK(VirtIOInputHost, (obj), TYPE_VIRTIO_INPUT_HOST) #define VIRTIO_INPUT_HOST_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HOST) =20 #define TYPE_VHOST_USER_INPUT "vhost-user-input" +typedef struct VHostUserInput VHostUserInput; #define VHOST_USER_INPUT(obj) \ OBJECT_CHECK(VHostUserInput, (obj), TYPE_VHOST_USER_INPUT) #define VHOST_USER_INPUT_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VHOST_USER_INPUT) =20 -typedef struct VirtIOInput VirtIOInput; -typedef struct VirtIOInputClass VirtIOInputClass; typedef struct VirtIOInputConfig VirtIOInputConfig; -typedef struct VirtIOInputHID VirtIOInputHID; -typedef struct VirtIOInputHost VirtIOInputHost; -typedef struct VHostUserInput VHostUserInput; =20 struct VirtIOInputConfig { virtio_input_config config; diff --git a/include/hw/virtio/virtio-iommu.h b/include/hw/virtio/virtio-io= mmu.h index 49eb105cd8..d852980b30 100644 --- a/include/hw/virtio/virtio-iommu.h +++ b/include/hw/virtio/virtio-iommu.h @@ -23,9 +23,11 @@ #include "standard-headers/linux/virtio_iommu.h" #include "hw/virtio/virtio.h" #include "hw/pci/pci.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_IOMMU "virtio-iommu-device" #define TYPE_VIRTIO_IOMMU_PCI "virtio-iommu-device-base" +typedef struct VirtIOIOMMU VirtIOIOMMU; #define VIRTIO_IOMMU(obj) \ OBJECT_CHECK(VirtIOIOMMU, (obj), TYPE_VIRTIO_IOMMU) =20 @@ -44,7 +46,7 @@ typedef struct IOMMUPciBus { IOMMUDevice *pbdev[]; /* Parent array is sparse, so dynamically alloc= */ } IOMMUPciBus; =20 -typedef struct VirtIOIOMMU { +struct VirtIOIOMMU { VirtIODevice parent_obj; VirtQueue *req_vq; VirtQueue *event_vq; @@ -58,6 +60,6 @@ typedef struct VirtIOIOMMU { GTree *domains; QemuMutex mutex; GTree *endpoints; -} VirtIOIOMMU; +}; =20 #endif diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h index 0778224964..08e37d8e84 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -17,9 +17,12 @@ #include "hw/virtio/virtio.h" #include "qapi/qapi-types-misc.h" #include "sysemu/hostmem.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_MEM "virtio-mem" =20 +typedef struct VirtIOMEM VirtIOMEM; +typedef struct VirtIOMEMClass VirtIOMEMClass; #define VIRTIO_MEM(obj) \ OBJECT_CHECK(VirtIOMEM, (obj), TYPE_VIRTIO_MEM) #define VIRTIO_MEM_CLASS(oc) \ @@ -34,7 +37,7 @@ #define VIRTIO_MEM_BLOCK_SIZE_PROP "block-size" #define VIRTIO_MEM_ADDR_PROP "memaddr" =20 -typedef struct VirtIOMEM { +struct VirtIOMEM { VirtIODevice parent_obj; =20 /* guest -> host request queue */ @@ -70,9 +73,9 @@ typedef struct VirtIOMEM { =20 /* don't migrate unplugged memory */ NotifierWithReturn precopy_notifier; -} VirtIOMEM; +}; =20 -typedef struct VirtIOMEMClass { +struct VirtIOMEMClass { /* private */ VirtIODevice parent; =20 @@ -81,6 +84,6 @@ typedef struct VirtIOMEMClass { MemoryRegion *(*get_memory_region)(VirtIOMEM *vmem, Error **errp); void (*add_size_change_notifier)(VirtIOMEM *vmem, Notifier *notifier); void (*remove_size_change_notifier)(VirtIOMEM *vmem, Notifier *notifie= r); -} VirtIOMEMClass; +}; =20 #endif diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmi= o.h index 7dbfd03dcf..947fb02d3e 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -23,6 +23,7 @@ #define HW_VIRTIO_MMIO_H =20 #include "hw/virtio/virtio-bus.h" +#include "qom/object.h" =20 /* QOM macros */ /* virtio-mmio-bus */ @@ -36,6 +37,7 @@ =20 /* virtio-mmio */ #define TYPE_VIRTIO_MMIO "virtio-mmio" +typedef struct VirtIOMMIOProxy VirtIOMMIOProxy; #define VIRTIO_MMIO(obj) \ OBJECT_CHECK(VirtIOMMIOProxy, (obj), TYPE_VIRTIO_MMIO) =20 @@ -52,7 +54,7 @@ typedef struct VirtIOMMIOQueue { uint32_t used[2]; } VirtIOMMIOQueue; =20 -typedef struct { +struct VirtIOMMIOProxy { /* Generic */ SysBusDevice parent_obj; MemoryRegion iomem; @@ -68,6 +70,6 @@ typedef struct { /* Fields only used for non-legacy (v2) devices */ uint32_t guest_features[2]; VirtIOMMIOQueue vqs[VIRTIO_QUEUE_MAX]; -} VirtIOMMIOProxy; +}; =20 #endif diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index a45ef8278e..2e81b5bfcb 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -19,8 +19,10 @@ #include "hw/virtio/virtio.h" #include "net/announce.h" #include "qemu/option_int.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_NET "virtio-net-device" +typedef struct VirtIONet VirtIONet; #define VIRTIO_NET(obj) \ OBJECT_CHECK(VirtIONet, (obj), TYPE_VIRTIO_NET) =20 @@ -109,7 +111,6 @@ typedef struct VirtioNetRscSeg { NetClientState *nc; } VirtioNetRscSeg; =20 -typedef struct VirtIONet VirtIONet; =20 /* Chain is divided by protocol(ipv4/v6) and NetClientInfo */ typedef struct VirtioNetRscChain { diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pme= m.h index 33f1999320..56bce2be7a 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -16,9 +16,12 @@ =20 #include "hw/virtio/virtio.h" #include "qapi/qapi-types-misc.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_PMEM "virtio-pmem" =20 +typedef struct VirtIOPMEM VirtIOPMEM; +typedef struct VirtIOPMEMClass VirtIOPMEMClass; #define VIRTIO_PMEM(obj) \ OBJECT_CHECK(VirtIOPMEM, (obj), TYPE_VIRTIO_PMEM) #define VIRTIO_PMEM_CLASS(oc) \ @@ -29,21 +32,21 @@ #define VIRTIO_PMEM_ADDR_PROP "memaddr" #define VIRTIO_PMEM_MEMDEV_PROP "memdev" =20 -typedef struct VirtIOPMEM { +struct VirtIOPMEM { VirtIODevice parent_obj; =20 VirtQueue *rq_vq; uint64_t start; HostMemoryBackend *memdev; -} VirtIOPMEM; +}; =20 -typedef struct VirtIOPMEMClass { +struct VirtIOPMEMClass { /* private */ VirtIODevice parent; =20 /* public */ void (*fill_device_info)(const VirtIOPMEM *pmem, VirtioPMEMDeviceInfo = *vi); MemoryRegion *(*get_memory_region)(VirtIOPMEM *pmem, Error **errp); -} VirtIOPMEMClass; +}; =20 #endif diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index bd05d734b8..34fb5f695f 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -15,8 +15,10 @@ #include "hw/virtio/virtio.h" #include "sysemu/rng.h" #include "standard-headers/linux/virtio_rng.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_RNG "virtio-rng-device" +typedef struct VirtIORNG VirtIORNG; #define VIRTIO_RNG(obj) \ OBJECT_CHECK(VirtIORNG, (obj), TYPE_VIRTIO_RNG) #define VIRTIO_RNG_GET_PARENT_CLASS(obj) \ @@ -28,7 +30,7 @@ struct VirtIORNGConf { uint32_t period_ms; }; =20 -typedef struct VirtIORNG { +struct VirtIORNG { VirtIODevice parent_obj; =20 /* Only one vq - guest puts buffer(s) on it when it needs entropy */ @@ -46,6 +48,6 @@ typedef struct VirtIORNG { bool activate_timer; =20 VMChangeStateEntry *vmstate; -} VirtIORNG; +}; =20 #endif diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index c0b8e4dd7e..bbf4b9a356 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -13,6 +13,7 @@ =20 #ifndef QEMU_VIRTIO_SCSI_H #define QEMU_VIRTIO_SCSI_H +#include "qom/object.h" =20 /* Override CDB/sense data size: they are dynamic (guest controlled) in QE= MU */ #define VIRTIO_SCSI_CDB_SIZE 0 @@ -25,10 +26,12 @@ #include "sysemu/iothread.h" =20 #define TYPE_VIRTIO_SCSI_COMMON "virtio-scsi-common" +typedef struct VirtIOSCSICommon VirtIOSCSICommon; #define VIRTIO_SCSI_COMMON(obj) \ OBJECT_CHECK(VirtIOSCSICommon, (obj), TYPE_VIRTIO_SCSI_COMMON) =20 #define TYPE_VIRTIO_SCSI "virtio-scsi-device" +typedef struct VirtIOSCSI VirtIOSCSI; #define VIRTIO_SCSI(obj) \ OBJECT_CHECK(VirtIOSCSI, (obj), TYPE_VIRTIO_SCSI) =20 @@ -67,7 +70,7 @@ struct VirtIOSCSIConf { =20 struct VirtIOSCSI; =20 -typedef struct VirtIOSCSICommon { +struct VirtIOSCSICommon { VirtIODevice parent_obj; VirtIOSCSIConf conf; =20 @@ -76,9 +79,9 @@ typedef struct VirtIOSCSICommon { VirtQueue *ctrl_vq; VirtQueue *event_vq; VirtQueue **cmd_vqs; -} VirtIOSCSICommon; +}; =20 -typedef struct VirtIOSCSI { +struct VirtIOSCSI { VirtIOSCSICommon parent_obj; =20 SCSIBus bus; @@ -93,7 +96,7 @@ typedef struct VirtIOSCSI { bool dataplane_stopping; bool dataplane_fenced; uint32_t host_features; -} VirtIOSCSI; +}; =20 typedef struct VirtIOSCSIReq { /* Note: diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-s= erial.h index 448615a6b3..94da09ec34 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -18,6 +18,7 @@ =20 #include "standard-headers/linux/virtio_console.h" #include "hw/virtio/virtio.h" +#include "qom/object.h" =20 struct virtio_serial_conf { /* Max. number of ports we can have for a virtio-serial device */ @@ -25,6 +26,8 @@ struct virtio_serial_conf { }; =20 #define TYPE_VIRTIO_SERIAL_PORT "virtio-serial-port" +typedef struct VirtIOSerialPort VirtIOSerialPort; +typedef struct VirtIOSerialPortClass VirtIOSerialPortClass; #define VIRTIO_SERIAL_PORT(obj) \ OBJECT_CHECK(VirtIOSerialPort, (obj), TYPE_VIRTIO_SERIAL_PORT) #define VIRTIO_SERIAL_PORT_CLASS(klass) \ @@ -39,9 +42,8 @@ typedef struct VirtIOSerialBus VirtIOSerialBus; #define VIRTIO_SERIAL_BUS(obj) \ OBJECT_CHECK(VirtIOSerialBus, (obj), TYPE_VIRTIO_SERIAL_BUS) =20 -typedef struct VirtIOSerialPort VirtIOSerialPort; =20 -typedef struct VirtIOSerialPortClass { +struct VirtIOSerialPortClass { DeviceClass parent_class; =20 /* Is this a device that binds with hvc in the guest? */ @@ -86,7 +88,7 @@ typedef struct VirtIOSerialPortClass { */ ssize_t (*have_data)(VirtIOSerialPort *port, const uint8_t *buf, ssize_t len); -} VirtIOSerialPortClass; +}; =20 /* * This is the state that's shared between all the ports. Some of the diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index e424df12cf..261d087de8 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -21,6 +21,7 @@ #include "qemu/event_notifier.h" #include "standard-headers/linux/virtio_config.h" #include "standard-headers/linux/virtio_ring.h" +#include "qom/object.h" =20 /* A guest should never accept this. It implies negotiation is broken. */ #define VIRTIO_F_BAD_FEATURE 30 @@ -67,6 +68,7 @@ typedef struct VirtQueueElement #define VIRTIO_NO_VECTOR 0xffff =20 #define TYPE_VIRTIO_DEVICE "virtio-device" +typedef struct VirtioDeviceClass VirtioDeviceClass; #define VIRTIO_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(VirtioDeviceClass, obj, TYPE_VIRTIO_DEVICE) #define VIRTIO_DEVICE_CLASS(klass) \ @@ -113,7 +115,7 @@ struct VirtIODevice QLIST_HEAD(, VirtQueue) *vector_queues; }; =20 -typedef struct VirtioDeviceClass { +struct VirtioDeviceClass { /*< private >*/ DeviceClass parent; /*< public >*/ @@ -163,7 +165,7 @@ typedef struct VirtioDeviceClass { int (*post_load)(VirtIODevice *vdev); const VMStateDescription *vmsd; bool (*primary_unplug_pending)(void *opaque); -} VirtioDeviceClass; +}; =20 void virtio_instance_init_common(Object *proxy_obj, void *data, size_t vdev_size, const char *vdev_name); diff --git a/include/hw/vmstate-if.h b/include/hw/vmstate-if.h index 8ff7f0f292..eabf5b05ad 100644 --- a/include/hw/vmstate-if.h +++ b/include/hw/vmstate-if.h @@ -13,6 +13,7 @@ =20 #define TYPE_VMSTATE_IF "vmstate-if" =20 +typedef struct VMStateIfClass VMStateIfClass; #define VMSTATE_IF_CLASS(klass) \ OBJECT_CLASS_CHECK(VMStateIfClass, (klass), TYPE_VMSTATE_IF) #define VMSTATE_IF_GET_CLASS(obj) \ @@ -22,11 +23,11 @@ =20 typedef struct VMStateIf VMStateIf; =20 -typedef struct VMStateIfClass { +struct VMStateIfClass { InterfaceClass parent_class; =20 char * (*get_id)(VMStateIf *obj); -} VMStateIfClass; +}; =20 static inline char *vmstate_if_get_id(VMStateIf *vmif) { diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog= /cmsdk-apb-watchdog.h index 6ae9531370..be2983eefa 100644 --- a/include/hw/watchdog/cmsdk-apb-watchdog.h +++ b/include/hw/watchdog/cmsdk-apb-watchdog.h @@ -33,8 +33,10 @@ =20 #include "hw/sysbus.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog" +typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog; #define CMSDK_APB_WATCHDOG(obj) OBJECT_CHECK(CMSDKAPBWatchdog, (obj), \ TYPE_CMSDK_APB_WATCHDOG) =20 @@ -44,7 +46,7 @@ */ #define TYPE_LUMINARY_WATCHDOG "luminary-watchdog" =20 -typedef struct CMSDKAPBWatchdog { +struct CMSDKAPBWatchdog { /*< private >*/ SysBusDevice parent_obj; =20 @@ -62,6 +64,6 @@ typedef struct CMSDKAPBWatchdog { uint32_t itop; uint32_t resetstatus; const uint32_t *id; -} CMSDKAPBWatchdog; +}; =20 #endif diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_asp= eed.h index 819c22993a..ba9a0a1fd8 100644 --- a/include/hw/watchdog/wdt_aspeed.h +++ b/include/hw/watchdog/wdt_aspeed.h @@ -12,8 +12,11 @@ =20 #include "hw/misc/aspeed_scu.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_ASPEED_WDT "aspeed.wdt" +typedef struct AspeedWDTClass AspeedWDTClass; +typedef struct AspeedWDTState AspeedWDTState; #define ASPEED_WDT(obj) \ OBJECT_CHECK(AspeedWDTState, (obj), TYPE_ASPEED_WDT) #define TYPE_ASPEED_2400_WDT TYPE_ASPEED_WDT "-ast2400" @@ -22,7 +25,7 @@ =20 #define ASPEED_WDT_REGS_MAX (0x20 / 4) =20 -typedef struct AspeedWDTState { +struct AspeedWDTState { /*< private >*/ SysBusDevice parent_obj; QEMUTimer *timer; @@ -33,14 +36,14 @@ typedef struct AspeedWDTState { =20 AspeedSCUState *scu; uint32_t pclk_freq; -} AspeedWDTState; +}; =20 #define ASPEED_WDT_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedWDTClass, (klass), TYPE_ASPEED_WDT) #define ASPEED_WDT_GET_CLASS(obj) \ OBJECT_GET_CLASS(AspeedWDTClass, (obj), TYPE_ASPEED_WDT) =20 -typedef struct AspeedWDTClass { +struct AspeedWDTClass { SysBusDeviceClass parent_class; =20 uint32_t offset; @@ -48,6 +51,6 @@ typedef struct AspeedWDTClass { uint32_t reset_ctrl_reg; void (*reset_pulse)(AspeedWDTState *s, uint32_t property); void (*wdt_reload)(AspeedWDTState *s); -} AspeedWDTClass; +}; =20 #endif /* WDT_ASPEED_H */ diff --git a/include/hw/watchdog/wdt_diag288.h b/include/hw/watchdog/wdt_di= ag288.h index 19d83a0937..e611163821 100644 --- a/include/hw/watchdog/wdt_diag288.h +++ b/include/hw/watchdog/wdt_diag288.h @@ -2,8 +2,11 @@ #define WDT_DIAG288_H =20 #include "hw/qdev-core.h" +#include "qom/object.h" =20 #define TYPE_WDT_DIAG288 "diag288" +typedef struct DIAG288Class DIAG288Class; +typedef struct DIAG288State DIAG288State; #define DIAG288(obj) \ OBJECT_CHECK(DIAG288State, (obj), TYPE_WDT_DIAG288) #define DIAG288_CLASS(klass) \ @@ -15,22 +18,22 @@ #define WDT_DIAG288_CHANGE 1 #define WDT_DIAG288_CANCEL 2 =20 -typedef struct DIAG288State { +struct DIAG288State { /*< private >*/ DeviceState parent_obj; QEMUTimer *timer; bool enabled; =20 /*< public >*/ -} DIAG288State; +}; =20 -typedef struct DIAG288Class { +struct DIAG288Class { /*< private >*/ DeviceClass parent_class; =20 /*< public >*/ int (*handle_timer)(DIAG288State *dev, uint64_t func, uint64_t timeout); -} DIAG288Class; +}; =20 #endif /* WDT_DIAG288_H */ diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h index f9af6be4b6..8757418b46 100644 --- a/include/hw/watchdog/wdt_imx2.h +++ b/include/hw/watchdog/wdt_imx2.h @@ -16,8 +16,10 @@ #include "hw/sysbus.h" #include "hw/irq.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define TYPE_IMX2_WDT "imx2.wdt" +typedef struct IMX2WdtState IMX2WdtState; #define IMX2_WDT(obj) OBJECT_CHECK(IMX2WdtState, (obj), TYPE_IMX2_WDT) =20 enum IMX2WdtRegisters { @@ -62,7 +64,7 @@ enum IMX2WdtRegisters { /* Misc Control Register definitions */ #define IMX2_WDT_WMCR_PDE BIT(0) /* Power-Down Enable */ =20 -typedef struct IMX2WdtState { +struct IMX2WdtState { /* */ SysBusDevice parent_obj; =20 @@ -85,6 +87,6 @@ typedef struct IMX2WdtState { bool wcr_locked; /* affects WDZST, WDBG, and WDW */ bool wcr_wde_locked; /* affects WDE */ bool wcr_wdt_locked; /* affects WDT (never cleared) */ -} IMX2WdtState; +}; =20 #endif /* IMX2_WDT_H */ diff --git a/include/hw/xen/xen-block.h b/include/hw/xen/xen-block.h index 2cd2fc2701..54f2e35122 100644 --- a/include/hw/xen/xen-block.h +++ b/include/hw/xen/xen-block.h @@ -12,6 +12,7 @@ #include "hw/block/block.h" #include "hw/block/dataplane/xen-block.h" #include "sysemu/iothread.h" +#include "qom/object.h" =20 typedef enum XenBlockVdevType { XEN_BLOCK_VDEV_TYPE_INVALID, @@ -46,7 +47,7 @@ typedef struct XenBlockIOThread { char *id; } XenBlockIOThread; =20 -typedef struct XenBlockDevice { +struct XenBlockDevice { XenDevice xendev; XenBlockProperties props; const char *device_type; @@ -54,18 +55,20 @@ typedef struct XenBlockDevice { XenBlockDataPlane *dataplane; XenBlockDrive *drive; XenBlockIOThread *iothread; -} XenBlockDevice; +}; +typedef struct XenBlockDevice XenBlockDevice; =20 typedef void (*XenBlockDeviceRealize)(XenBlockDevice *blockdev, Error **er= rp); typedef void (*XenBlockDeviceUnrealize)(XenBlockDevice *blockdev); =20 -typedef struct XenBlockDeviceClass { +struct XenBlockDeviceClass { /*< private >*/ XenDeviceClass parent_class; /*< public >*/ XenBlockDeviceRealize realize; XenBlockDeviceUnrealize unrealize; -} XenBlockDeviceClass; +}; +typedef struct XenBlockDeviceClass XenBlockDeviceClass; =20 #define TYPE_XEN_BLOCK_DEVICE "xen-block" #define XEN_BLOCK_DEVICE(obj) \ @@ -75,17 +78,19 @@ typedef struct XenBlockDeviceClass { #define XEN_BLOCK_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(XenBlockDeviceClass, (obj), TYPE_XEN_BLOCK_DEVICE) =20 -typedef struct XenDiskDevice { +struct XenDiskDevice { XenBlockDevice blockdev; -} XenDiskDevice; +}; +typedef struct XenDiskDevice XenDiskDevice; =20 #define TYPE_XEN_DISK_DEVICE "xen-disk" #define XEN_DISK_DEVICE(obj) \ OBJECT_CHECK(XenDiskDevice, (obj), TYPE_XEN_DISK_DEVICE) =20 -typedef struct XenCDRomDevice { +struct XenCDRomDevice { XenBlockDevice blockdev; -} XenCDRomDevice; +}; +typedef struct XenCDRomDevice XenCDRomDevice; =20 #define TYPE_XEN_CDROM_DEVICE "xen-cdrom" #define XEN_CDROM_DEVICE(obj) \ diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 4ec0bb072f..910cf49161 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -11,6 +11,7 @@ #include "hw/xen/xen_common.h" #include "hw/sysbus.h" #include "qemu/notify.h" +#include "qom/object.h" =20 typedef void (*XenWatchHandler)(void *opaque); =20 @@ -18,7 +19,7 @@ typedef struct XenWatchList XenWatchList; typedef struct XenWatch XenWatch; typedef struct XenEventChannel XenEventChannel; =20 -typedef struct XenDevice { +struct XenDevice { DeviceState qdev; domid_t frontend_id; char *name; @@ -35,7 +36,8 @@ typedef struct XenDevice { bool inactive; QLIST_HEAD(, XenEventChannel) event_channels; QLIST_ENTRY(XenDevice) list; -} XenDevice; +}; +typedef struct XenDevice XenDevice; =20 typedef char *(*XenDeviceGetName)(XenDevice *xendev, Error **errp); typedef void (*XenDeviceRealize)(XenDevice *xendev, Error **errp); @@ -44,7 +46,7 @@ typedef void (*XenDeviceFrontendChanged)(XenDevice *xende= v, Error **errp); typedef void (*XenDeviceUnrealize)(XenDevice *xendev); =20 -typedef struct XenDeviceClass { +struct XenDeviceClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -54,7 +56,8 @@ typedef struct XenDeviceClass { XenDeviceRealize realize; XenDeviceFrontendChanged frontend_changed; XenDeviceUnrealize unrealize; -} XenDeviceClass; +}; +typedef struct XenDeviceClass XenDeviceClass; =20 #define TYPE_XEN_DEVICE "xen-device" #define XEN_DEVICE(obj) \ @@ -64,19 +67,21 @@ typedef struct XenDeviceClass { #define XEN_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(XenDeviceClass, (obj), TYPE_XEN_DEVICE) =20 -typedef struct XenBus { +struct XenBus { BusState qbus; domid_t backend_id; struct xs_handle *xsh; XenWatchList *watch_list; XenWatch *backend_watch; QLIST_HEAD(, XenDevice) inactive_devices; -} XenBus; +}; +typedef struct XenBus XenBus; =20 -typedef struct XenBusClass { +struct XenBusClass { /*< private >*/ BusClass parent_class; -} XenBusClass; +}; +typedef struct XenBusClass XenBusClass; =20 #define TYPE_XEN_BUS "xen-bus" #define XEN_BUS(obj) \ diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legac= y-backend.h index 704bc7852b..89b51e05fc 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -4,6 +4,7 @@ #include "hw/xen/xen_common.h" #include "hw/xen/xen_pvdev.h" #include "net/net.h" +#include "qom/object.h" =20 #define TYPE_XENSYSDEV "xen-sysdev" #define TYPE_XENSYSBUS "xen-sysbus" diff --git a/include/io/channel-buffer.h b/include/io/channel-buffer.h index 3f4b3f29e1..344d5957fd 100644 --- a/include/io/channel-buffer.h +++ b/include/io/channel-buffer.h @@ -22,12 +22,13 @@ #define QIO_CHANNEL_BUFFER_H =20 #include "io/channel.h" +#include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_BUFFER "qio-channel-buffer" +typedef struct QIOChannelBuffer QIOChannelBuffer; #define QIO_CHANNEL_BUFFER(obj) \ OBJECT_CHECK(QIOChannelBuffer, (obj), TYPE_QIO_CHANNEL_BUFFER) =20 -typedef struct QIOChannelBuffer QIOChannelBuffer; =20 /** * QIOChannelBuffer: diff --git a/include/io/channel-command.h b/include/io/channel-command.h index 336d47fa5c..b1671062d0 100644 --- a/include/io/channel-command.h +++ b/include/io/channel-command.h @@ -22,12 +22,13 @@ #define QIO_CHANNEL_COMMAND_H =20 #include "io/channel.h" +#include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_COMMAND "qio-channel-command" +typedef struct QIOChannelCommand QIOChannelCommand; #define QIO_CHANNEL_COMMAND(obj) \ OBJECT_CHECK(QIOChannelCommand, (obj), TYPE_QIO_CHANNEL_COMMAND) =20 -typedef struct QIOChannelCommand QIOChannelCommand; =20 =20 /** diff --git a/include/io/channel-file.h b/include/io/channel-file.h index ebfe54ec70..d91c9f5bc1 100644 --- a/include/io/channel-file.h +++ b/include/io/channel-file.h @@ -22,12 +22,13 @@ #define QIO_CHANNEL_FILE_H =20 #include "io/channel.h" +#include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_FILE "qio-channel-file" +typedef struct QIOChannelFile QIOChannelFile; #define QIO_CHANNEL_FILE(obj) \ OBJECT_CHECK(QIOChannelFile, (obj), TYPE_QIO_CHANNEL_FILE) =20 -typedef struct QIOChannelFile QIOChannelFile; =20 /** * QIOChannelFile: diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h index 777ff5954e..ee898d991b 100644 --- a/include/io/channel-socket.h +++ b/include/io/channel-socket.h @@ -24,12 +24,13 @@ #include "io/channel.h" #include "io/task.h" #include "qemu/sockets.h" +#include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_SOCKET "qio-channel-socket" +typedef struct QIOChannelSocket QIOChannelSocket; #define QIO_CHANNEL_SOCKET(obj) \ OBJECT_CHECK(QIOChannelSocket, (obj), TYPE_QIO_CHANNEL_SOCKET) =20 -typedef struct QIOChannelSocket QIOChannelSocket; =20 /** * QIOChannelSocket: diff --git a/include/io/channel-tls.h b/include/io/channel-tls.h index fdbdf12feb..ebd42f981e 100644 --- a/include/io/channel-tls.h +++ b/include/io/channel-tls.h @@ -24,12 +24,13 @@ #include "io/channel.h" #include "io/task.h" #include "crypto/tlssession.h" +#include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_TLS "qio-channel-tls" +typedef struct QIOChannelTLS QIOChannelTLS; #define QIO_CHANNEL_TLS(obj) \ OBJECT_CHECK(QIOChannelTLS, (obj), TYPE_QIO_CHANNEL_TLS) =20 -typedef struct QIOChannelTLS QIOChannelTLS; =20 /** * QIOChannelTLS diff --git a/include/io/channel-websock.h b/include/io/channel-websock.h index a7e5e92e61..5ab8811306 100644 --- a/include/io/channel-websock.h +++ b/include/io/channel-websock.h @@ -24,12 +24,13 @@ #include "io/channel.h" #include "qemu/buffer.h" #include "io/task.h" +#include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_WEBSOCK "qio-channel-websock" +typedef struct QIOChannelWebsock QIOChannelWebsock; #define QIO_CHANNEL_WEBSOCK(obj) \ OBJECT_CHECK(QIOChannelWebsock, (obj), TYPE_QIO_CHANNEL_WEBSOCK) =20 -typedef struct QIOChannelWebsock QIOChannelWebsock; typedef union QIOChannelWebsockMask QIOChannelWebsockMask; =20 union QIOChannelWebsockMask { diff --git a/include/io/channel.h b/include/io/channel.h index d4557f0930..67b9768eff 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -26,6 +26,8 @@ #include "block/aio.h" =20 #define TYPE_QIO_CHANNEL "qio-channel" +typedef struct QIOChannel QIOChannel; +typedef struct QIOChannelClass QIOChannelClass; #define QIO_CHANNEL(obj) \ OBJECT_CHECK(QIOChannel, (obj), TYPE_QIO_CHANNEL) #define QIO_CHANNEL_CLASS(klass) \ @@ -33,8 +35,6 @@ #define QIO_CHANNEL_GET_CLASS(obj) \ OBJECT_GET_CLASS(QIOChannelClass, obj, TYPE_QIO_CHANNEL) =20 -typedef struct QIOChannel QIOChannel; -typedef struct QIOChannelClass QIOChannelClass; =20 #define QIO_CHANNEL_ERR_BLOCK -2 =20 diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h index a475e978c8..5e720bf267 100644 --- a/include/io/dns-resolver.h +++ b/include/io/dns-resolver.h @@ -26,6 +26,8 @@ #include "io/task.h" =20 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver" +typedef struct QIODNSResolver QIODNSResolver; +typedef struct QIODNSResolverClass QIODNSResolverClass; #define QIO_DNS_RESOLVER(obj) \ OBJECT_CHECK(QIODNSResolver, (obj), TYPE_QIO_DNS_RESOLVER) #define QIO_DNS_RESOLVER_CLASS(klass) \ @@ -33,8 +35,6 @@ #define QIO_DNS_RESOLVER_GET_CLASS(obj) \ OBJECT_GET_CLASS(QIODNSResolverClass, obj, TYPE_QIO_DNS_RESOLVER) =20 -typedef struct QIODNSResolver QIODNSResolver; -typedef struct QIODNSResolverClass QIODNSResolverClass; =20 /** * QIODNSResolver: diff --git a/include/io/net-listener.h b/include/io/net-listener.h index fb101703e3..fbdd2dbf9a 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -22,8 +22,11 @@ #define QIO_NET_LISTENER_H =20 #include "io/channel-socket.h" +#include "qom/object.h" =20 #define TYPE_QIO_NET_LISTENER "qio-net-listener" +typedef struct QIONetListener QIONetListener; +typedef struct QIONetListenerClass QIONetListenerClass; #define QIO_NET_LISTENER(obj) \ OBJECT_CHECK(QIONetListener, (obj), TYPE_QIO_NET_LISTENER) #define QIO_NET_LISTENER_CLASS(klass) \ @@ -31,8 +34,6 @@ #define QIO_NET_LISTENER_GET_CLASS(obj) \ OBJECT_GET_CLASS(QIONetListenerClass, obj, TYPE_QIO_NET_LISTENER) =20 -typedef struct QIONetListener QIONetListener; -typedef struct QIONetListenerClass QIONetListenerClass; =20 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener, QIOChannelSocket *sioc, diff --git a/include/net/can_host.h b/include/net/can_host.h index d79676746b..13b6a191dd 100644 --- a/include/net/can_host.h +++ b/include/net/can_host.h @@ -29,8 +29,11 @@ #define NET_CAN_HOST_H =20 #include "net/can_emu.h" +#include "qom/object.h" =20 #define TYPE_CAN_HOST "can-host" +typedef struct CanHostClass CanHostClass; +typedef struct CanHostState CanHostState; #define CAN_HOST_CLASS(klass) \ OBJECT_CLASS_CHECK(CanHostClass, (klass), TYPE_CAN_HOST) #define CAN_HOST_GET_CLASS(obj) \ @@ -38,18 +41,18 @@ #define CAN_HOST(obj) \ OBJECT_CHECK(CanHostState, (obj), TYPE_CAN_HOST) =20 -typedef struct CanHostState { +struct CanHostState { ObjectClass oc; =20 CanBusState *bus; CanBusClientState bus_client; -} CanHostState; +}; =20 -typedef struct CanHostClass { +struct CanHostClass { ObjectClass oc; =20 void (*connect)(CanHostState *ch, Error **errp); void (*disconnect)(CanHostState *ch); -} CanHostClass; +}; =20 #endif diff --git a/include/net/filter.h b/include/net/filter.h index 9393c59192..0d4f011bc0 100644 --- a/include/net/filter.h +++ b/include/net/filter.h @@ -15,6 +15,7 @@ #include "net/queue.h" =20 #define TYPE_NETFILTER "netfilter" +typedef struct NetFilterClass NetFilterClass; #define NETFILTER(obj) \ OBJECT_CHECK(NetFilterState, (obj), TYPE_NETFILTER) #define NETFILTER_GET_CLASS(obj) \ @@ -40,7 +41,7 @@ typedef void (FilterStatusChanged) (NetFilterState *nf, E= rror **errp); =20 typedef void (FilterHandleEvent) (NetFilterState *nf, int event, Error **e= rrp); =20 -typedef struct NetFilterClass { +struct NetFilterClass { ObjectClass parent_class; =20 /* optional */ @@ -50,7 +51,7 @@ typedef struct NetFilterClass { FilterHandleEvent *handle_event; /* mandatory */ FilterReceiveIOV *receive_iov; -} NetFilterClass; +}; =20 =20 struct NetFilterState { diff --git a/include/qom/object.h b/include/qom/object.h index 3626ae3c65..056f67ab3b 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -16,6 +16,7 @@ =20 #include "qapi/qapi-builtin-types.h" #include "qemu/module.h" +#include "qom/object.h" =20 struct TypeImpl; typedef struct TypeImpl *Type; diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index 7035829337..2be985f86e 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -6,6 +6,7 @@ =20 #define TYPE_USER_CREATABLE "user-creatable" =20 +typedef struct UserCreatableClass UserCreatableClass; #define USER_CREATABLE_CLASS(klass) \ OBJECT_CLASS_CHECK(UserCreatableClass, (klass), \ TYPE_USER_CREATABLE) @@ -40,14 +41,14 @@ typedef struct UserCreatable UserCreatable; * object's type implements USER_CREATABLE interface and needs * complete() callback to be called. */ -typedef struct UserCreatableClass { +struct UserCreatableClass { /* */ InterfaceClass parent_class; =20 /* */ void (*complete)(UserCreatable *uc, Error **errp); bool (*can_be_deleted)(UserCreatable *uc); -} UserCreatableClass; +}; =20 /** * user_creatable_complete: diff --git a/include/scsi/pr-manager.h b/include/scsi/pr-manager.h index 6ad5fd1ff7..2c699e4030 100644 --- a/include/scsi/pr-manager.h +++ b/include/scsi/pr-manager.h @@ -9,6 +9,8 @@ =20 #define TYPE_PR_MANAGER "pr-manager" =20 +typedef struct PRManager PRManager; +typedef struct PRManagerClass PRManagerClass; #define PR_MANAGER_CLASS(klass) \ OBJECT_CLASS_CHECK(PRManagerClass, (klass), TYPE_PR_MANAGER) #define PR_MANAGER_GET_CLASS(obj) \ @@ -18,24 +20,24 @@ =20 struct sg_io_hdr; =20 -typedef struct PRManager { +struct PRManager { /* */ Object parent; -} PRManager; +}; =20 /** * PRManagerClass: * @parent_class: the base class * @run: callback invoked in thread pool context */ -typedef struct PRManagerClass { +struct PRManagerClass { /* */ ObjectClass parent_class; =20 /* */ int (*run)(PRManager *pr_mgr, int fd, struct sg_io_hdr *hdr); bool (*is_connected)(PRManager *pr_mgr); -} PRManagerClass; +}; =20 bool pr_manager_is_connected(PRManager *pr_mgr); int coroutine_fn pr_manager_execute(PRManager *pr_mgr, AioContext *ctx, in= t fd, diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index e08b8ab8fa..2bda18be12 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -26,12 +26,13 @@ #include "qom/object.h" #include "exec/hwaddr.h" =20 -typedef struct AccelState { +struct AccelState { /*< private >*/ Object parent_obj; -} AccelState; +}; +typedef struct AccelState AccelState; =20 -typedef struct AccelClass { +struct AccelClass { /*< private >*/ ObjectClass parent_class; /*< public >*/ @@ -52,7 +53,8 @@ typedef struct AccelClass { * compat_props or user-provided global properties. */ GPtrArray *compat_props; -} AccelClass; +}; +typedef struct AccelClass AccelClass; =20 #define TYPE_ACCEL "accel" =20 diff --git a/include/sysemu/cryptodev.h b/include/sysemu/cryptodev.h index 35eab06d0e..e11526271a 100644 --- a/include/sysemu/cryptodev.h +++ b/include/sysemu/cryptodev.h @@ -37,6 +37,8 @@ =20 #define TYPE_CRYPTODEV_BACKEND "cryptodev-backend" =20 +typedef struct CryptoDevBackend CryptoDevBackend; +typedef struct CryptoDevBackendClass CryptoDevBackendClass; #define CRYPTODEV_BACKEND(obj) \ OBJECT_CHECK(CryptoDevBackend, \ (obj), TYPE_CRYPTODEV_BACKEND) @@ -54,7 +56,6 @@ typedef struct CryptoDevBackendConf CryptoDevBackendConf; typedef struct CryptoDevBackendPeers CryptoDevBackendPeers; typedef struct CryptoDevBackendClient CryptoDevBackendClient; -typedef struct CryptoDevBackend CryptoDevBackend; =20 enum CryptoDevBackendAlgType { CRYPTODEV_BACKEND_ALG_SYM, @@ -146,7 +147,7 @@ typedef struct CryptoDevBackendSymOpInfo { uint8_t data[]; } CryptoDevBackendSymOpInfo; =20 -typedef struct CryptoDevBackendClass { +struct CryptoDevBackendClass { ObjectClass parent_class; =20 void (*init)(CryptoDevBackend *backend, Error **errp); @@ -161,7 +162,7 @@ typedef struct CryptoDevBackendClass { int (*do_sym_op)(CryptoDevBackend *backend, CryptoDevBackendSymOpInfo *op_info, uint32_t queue_index, Error **errp); -} CryptoDevBackendClass; +}; =20 typedef enum CryptoDevBackendOptionsType { CRYPTODEV_BACKEND_TYPE_NONE =3D 0, diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 8276e53683..7b775b6687 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -20,6 +20,8 @@ #include "qemu/bitmap.h" =20 #define TYPE_MEMORY_BACKEND "memory-backend" +typedef struct HostMemoryBackend HostMemoryBackend; +typedef struct HostMemoryBackendClass HostMemoryBackendClass; #define MEMORY_BACKEND(obj) \ OBJECT_CHECK(HostMemoryBackend, (obj), TYPE_MEMORY_BACKEND) #define MEMORY_BACKEND_GET_CLASS(obj) \ @@ -42,8 +44,6 @@ */ #define TYPE_MEMORY_BACKEND_FILE "memory-backend-file" =20 -typedef struct HostMemoryBackend HostMemoryBackend; -typedef struct HostMemoryBackendClass HostMemoryBackendClass; =20 /** * HostMemoryBackendClass: diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 760d6c79a2..566b5f52fc 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -14,6 +14,7 @@ #define HVF_H =20 #include "sysemu/accel.h" +#include "qom/object.h" =20 #ifdef CONFIG_HVF uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index 6181486401..42902ffb9f 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -20,7 +20,7 @@ =20 #define TYPE_IOTHREAD "iothread" =20 -typedef struct { +struct IOThread { Object parent_obj; =20 QemuThread thread; @@ -37,7 +37,8 @@ typedef struct { int64_t poll_max_ns; int64_t poll_grow; int64_t poll_shrink; -} IOThread; +}; +typedef struct IOThread IOThread; =20 #define IOTHREAD(obj) \ OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 8445a88db1..3e89884c54 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -18,6 +18,7 @@ #include "hw/core/cpu.h" #include "exec/memattrs.h" #include "sysemu/accel.h" +#include "qom/object.h" =20 #ifdef NEED_CPU_H # ifdef CONFIG_KVM diff --git a/include/sysemu/rng-random.h b/include/sysemu/rng-random.h index 38186fe83d..87e82dd7a3 100644 --- a/include/sysemu/rng-random.h +++ b/include/sysemu/rng-random.h @@ -15,8 +15,8 @@ #include "qom/object.h" =20 #define TYPE_RNG_RANDOM "rng-random" +typedef struct RngRandom RngRandom; #define RNG_RANDOM(obj) OBJECT_CHECK(RngRandom, (obj), TYPE_RNG_RANDOM) =20 -typedef struct RngRandom RngRandom; =20 #endif diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index fa6eada78c..c38da7d342 100644 --- a/include/sysemu/rng.h +++ b/include/sysemu/rng.h @@ -17,6 +17,8 @@ #include "qom/object.h" =20 #define TYPE_RNG_BACKEND "rng-backend" +typedef struct RngBackend RngBackend; +typedef struct RngBackendClass RngBackendClass; #define RNG_BACKEND(obj) \ OBJECT_CHECK(RngBackend, (obj), TYPE_RNG_BACKEND) #define RNG_BACKEND_GET_CLASS(obj) \ @@ -27,8 +29,6 @@ #define TYPE_RNG_BUILTIN "rng-builtin" =20 typedef struct RngRequest RngRequest; -typedef struct RngBackendClass RngBackendClass; -typedef struct RngBackend RngBackend; =20 typedef void (EntropyReceiveFunc)(void *opaque, const void *data, diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 730c61ac97..04673cab53 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -26,6 +26,7 @@ typedef enum TPMVersion { } TPMVersion; =20 #define TYPE_TPM_IF "tpm-if" +typedef struct TPMIfClass TPMIfClass; #define TPM_IF_CLASS(klass) \ OBJECT_CLASS_CHECK(TPMIfClass, (klass), TYPE_TPM_IF) #define TPM_IF_GET_CLASS(obj) \ @@ -35,13 +36,13 @@ typedef enum TPMVersion { =20 typedef struct TPMIf TPMIf; =20 -typedef struct TPMIfClass { +struct TPMIfClass { InterfaceClass parent_class; =20 enum TpmModel model; void (*request_completed)(TPMIf *obj, int ret); enum TPMVersion (*get_version)(TPMIf *obj); -} TPMIfClass; +}; =20 #define TYPE_TPM_TIS_ISA "tpm-tis" #define TYPE_TPM_TIS_SYSBUS "tpm-tis-device" diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 9e7451fb52..740c94c6cd 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -19,6 +19,8 @@ #include "qapi/error.h" =20 #define TYPE_TPM_BACKEND "tpm-backend" +typedef struct TPMBackend TPMBackend; +typedef struct TPMBackendClass TPMBackendClass; #define TPM_BACKEND(obj) \ OBJECT_CHECK(TPMBackend, (obj), TYPE_TPM_BACKEND) #define TPM_BACKEND_GET_CLASS(obj) \ @@ -26,8 +28,6 @@ #define TPM_BACKEND_CLASS(klass) \ OBJECT_CLASS_CHECK(TPMBackendClass, (klass), TYPE_TPM_BACKEND) =20 -typedef struct TPMBackendClass TPMBackendClass; -typedef struct TPMBackend TPMBackend; =20 typedef struct TPMBackendCmd { uint8_t locty; diff --git a/include/sysemu/vhost-user-backend.h b/include/sysemu/vhost-use= r-backend.h index 9abf8f06a1..89eb5eaf65 100644 --- a/include/sysemu/vhost-user-backend.h +++ b/include/sysemu/vhost-user-backend.h @@ -22,6 +22,8 @@ #include "io/channel.h" =20 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend" +typedef struct VhostUserBackend VhostUserBackend; +typedef struct VhostUserBackendClass VhostUserBackendClass; #define VHOST_USER_BACKEND(obj) \ OBJECT_CHECK(VhostUserBackend, (obj), TYPE_VHOST_USER_BACKEND) #define VHOST_USER_BACKEND_GET_CLASS(obj) \ @@ -29,8 +31,6 @@ #define VHOST_USER_BACKEND_CLASS(klass) \ OBJECT_CLASS_CHECK(VhostUserBackendClass, (klass), TYPE_VHOST_USER_BAC= KEND) =20 -typedef struct VhostUserBackend VhostUserBackend; -typedef struct VhostUserBackendClass VhostUserBackendClass; =20 struct VhostUserBackendClass { ObjectClass parent_class; diff --git a/include/ui/console.h b/include/ui/console.h index f35b4fc082..2a74a27d50 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -106,6 +106,7 @@ void kbd_put_keysym(int keysym); /* consoles */ =20 #define TYPE_QEMU_CONSOLE "qemu-console" +typedef struct QemuConsoleClass QemuConsoleClass; #define QEMU_CONSOLE(obj) \ OBJECT_CHECK(QemuConsole, (obj), TYPE_QEMU_CONSOLE) #define QEMU_CONSOLE_GET_CLASS(obj) \ @@ -113,7 +114,6 @@ void kbd_put_keysym(int keysym); #define QEMU_CONSOLE_CLASS(klass) \ OBJECT_CLASS_CHECK(QemuConsoleClass, (klass), TYPE_QEMU_CONSOLE) =20 -typedef struct QemuConsoleClass QemuConsoleClass; =20 struct QemuConsoleClass { ObjectClass parent_class; diff --git a/migration/migration.h b/migration/migration.h index ae497bd45a..4103e549bb 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -21,6 +21,7 @@ #include "qemu/coroutine_int.h" #include "io/channel.h" #include "net/announce.h" +#include "qom/object.h" =20 struct PostcopyBlocktimeContext; =20 @@ -114,6 +115,7 @@ void fill_destination_postcopy_migration_info(Migration= Info *info); =20 #define TYPE_MIGRATION "migration" =20 +typedef struct MigrationClass MigrationClass; #define MIGRATION_OBJ_CLASS(klass) \ OBJECT_CLASS_CHECK(MigrationClass, (klass), TYPE_MIGRATION) #define MIGRATION_OBJ(obj) \ @@ -121,10 +123,10 @@ void fill_destination_postcopy_migration_info(Migrati= onInfo *info); #define MIGRATION_OBJ_GET_CLASS(obj) \ OBJECT_GET_CLASS(MigrationClass, (obj), TYPE_MIGRATION) =20 -typedef struct MigrationClass { +struct MigrationClass { /*< private >*/ DeviceClass parent_class; -} MigrationClass; +}; =20 struct MigrationState { diff --git a/target/alpha/cpu-qom.h b/target/alpha/cpu-qom.h index 08832fa767..1124668cf0 100644 --- a/target/alpha/cpu-qom.h +++ b/target/alpha/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_ALPHA_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_ALPHA_CPU "alpha-cpu" =20 +typedef struct AlphaCPU AlphaCPU; +typedef struct AlphaCPUClass AlphaCPUClass; #define ALPHA_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(AlphaCPUClass, (klass), TYPE_ALPHA_CPU) #define ALPHA_CPU(obj) \ @@ -38,15 +41,14 @@ * * An Alpha CPU model. */ -typedef struct AlphaCPUClass { +struct AlphaCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} AlphaCPUClass; +}; =20 -typedef struct AlphaCPU AlphaCPU; =20 #endif diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index fdef05cacf..d0c68b01c5 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -21,11 +21,14 @@ #define QEMU_ARM_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 struct arm_boot_info; =20 #define TYPE_ARM_CPU "arm-cpu" =20 +typedef struct ARMCPU ARMCPU; +typedef struct ARMCPUClass ARMCPUClass; #define ARM_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(ARMCPUClass, (klass), TYPE_ARM_CPU) #define ARM_CPU(obj) \ @@ -51,7 +54,7 @@ void aarch64_cpu_register(const ARMCPUInfo *info); * * An ARM CPU model. */ -typedef struct ARMCPUClass { +struct ARMCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -59,21 +62,21 @@ typedef struct ARMCPUClass { const ARMCPUInfo *info; DeviceRealize parent_realize; DeviceReset parent_reset; -} ARMCPUClass; +}; =20 -typedef struct ARMCPU ARMCPU; =20 #define TYPE_AARCH64_CPU "aarch64-cpu" +typedef struct AArch64CPUClass AArch64CPUClass; #define AARCH64_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(AArch64CPUClass, (klass), TYPE_AARCH64_CPU) #define AARCH64_CPU_GET_CLASS(obj) \ OBJECT_GET_CLASS(AArch64CPUClass, (obj), TYPE_AARCH64_CPU) =20 -typedef struct AArch64CPUClass { +struct AArch64CPUClass { /*< private >*/ ARMCPUClass parent_class; /*< public >*/ -} AArch64CPUClass; +}; =20 void register_cp_regs_for_features(ARMCPU *cpu); void init_cpreg_list(ARMCPU *cpu); diff --git a/target/arm/idau.h b/target/arm/idau.h index 7c0e4e3776..2f09bbb34f 100644 --- a/target/arm/idau.h +++ b/target/arm/idau.h @@ -33,6 +33,7 @@ #define TYPE_IDAU_INTERFACE "idau-interface" #define IDAU_INTERFACE(obj) \ INTERFACE_CHECK(IDAUInterface, (obj), TYPE_IDAU_INTERFACE) +typedef struct IDAUInterfaceClass IDAUInterfaceClass; #define IDAU_INTERFACE_CLASS(class) \ OBJECT_CLASS_CHECK(IDAUInterfaceClass, (class), TYPE_IDAU_INTERFACE) #define IDAU_INTERFACE_GET_CLASS(obj) \ @@ -42,7 +43,7 @@ typedef struct IDAUInterface IDAUInterface; =20 #define IREGION_NOTVALID -1 =20 -typedef struct IDAUInterfaceClass { +struct IDAUInterfaceClass { InterfaceClass parent; =20 /* Check the specified address and return the IDAU security information @@ -54,6 +55,6 @@ typedef struct IDAUInterfaceClass { */ void (*check)(IDAUInterface *ii, uint32_t address, int *iregion, bool *exempt, bool *ns, bool *nsc); -} IDAUInterfaceClass; +}; =20 #endif diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h index d23ad43a99..fac8430253 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -22,9 +22,12 @@ #define QEMU_AVR_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_AVR_CPU "avr-cpu" =20 +typedef struct AVRCPU AVRCPU; +typedef struct AVRCPUClass AVRCPUClass; #define AVR_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(AVRCPUClass, (klass), TYPE_AVR_CPU) #define AVR_CPU(obj) \ @@ -40,14 +43,13 @@ * * A AVR CPU model. */ -typedef struct AVRCPUClass { +struct AVRCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ DeviceRealize parent_realize; DeviceReset parent_reset; -} AVRCPUClass; +}; =20 -typedef struct AVRCPU AVRCPU; =20 #endif /* !defined (QEMU_AVR_CPU_QOM_H) */ diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index f1de6041dc..cac3e9af1b 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_CRIS_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_CRIS_CPU "cris-cpu" =20 +typedef struct CRISCPU CRISCPU; +typedef struct CRISCPUClass CRISCPUClass; #define CRIS_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(CRISCPUClass, (klass), TYPE_CRIS_CPU) #define CRIS_CPU(obj) \ @@ -39,7 +42,7 @@ * * A CRIS CPU model. */ -typedef struct CRISCPUClass { +struct CRISCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -48,8 +51,7 @@ typedef struct CRISCPUClass { DeviceReset parent_reset; =20 uint32_t vr; -} CRISCPUClass; +}; =20 -typedef struct CRISCPU CRISCPU; =20 #endif diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index b1f6045495..295b2aaf19 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_HPPA_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_HPPA_CPU "hppa-cpu" =20 +typedef struct HPPACPU HPPACPU; +typedef struct HPPACPUClass HPPACPUClass; #define HPPA_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(HPPACPUClass, (klass), TYPE_HPPA_CPU) #define HPPA_CPU(obj) \ @@ -38,15 +41,14 @@ * * An HPPA CPU model. */ -typedef struct HPPACPUClass { +struct HPPACPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} HPPACPUClass; +}; =20 -typedef struct HPPACPU HPPACPU; =20 #endif diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index 3e96f8d668..6b0bf476e5 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -22,6 +22,7 @@ =20 #include "hw/core/cpu.h" #include "qemu/notify.h" +#include "qom/object.h" =20 #ifdef TARGET_X86_64 #define TYPE_X86_CPU "x86_64-cpu" @@ -29,6 +30,8 @@ #define TYPE_X86_CPU "i386-cpu" #endif =20 +typedef struct X86CPU X86CPU; +typedef struct X86CPUClass X86CPUClass; #define X86_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(X86CPUClass, (klass), TYPE_X86_CPU) #define X86_CPU(obj) \ @@ -50,7 +53,7 @@ typedef struct X86CPUModel X86CPUModel; * * An x86 CPU model or family. */ -typedef struct X86CPUClass { +struct X86CPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -72,8 +75,7 @@ typedef struct X86CPUClass { DeviceRealize parent_realize; DeviceUnrealize parent_unrealize; DeviceReset parent_reset; -} X86CPUClass; +}; =20 -typedef struct X86CPU X86CPU; =20 #endif diff --git a/target/lm32/cpu-qom.h b/target/lm32/cpu-qom.h index bdedb3759a..2c0654b695 100644 --- a/target/lm32/cpu-qom.h +++ b/target/lm32/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_LM32_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_LM32_CPU "lm32-cpu" =20 +typedef struct LM32CPU LM32CPU; +typedef struct LM32CPUClass LM32CPUClass; #define LM32_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(LM32CPUClass, (klass), TYPE_LM32_CPU) #define LM32_CPU(obj) \ @@ -38,15 +41,14 @@ * * A LatticeMico32 CPU model. */ -typedef struct LM32CPUClass { +struct LM32CPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} LM32CPUClass; +}; =20 -typedef struct LM32CPU LM32CPU; =20 #endif diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index 88b11b60f1..3b199be545 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_M68K_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_M68K_CPU "m68k-cpu" =20 +typedef struct M68kCPU M68kCPU; +typedef struct M68kCPUClass M68kCPUClass; #define M68K_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(M68kCPUClass, (klass), TYPE_M68K_CPU) #define M68K_CPU(obj) \ @@ -38,15 +41,14 @@ * * A Motorola 68k CPU model. */ -typedef struct M68kCPUClass { +struct M68kCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} M68kCPUClass; +}; =20 -typedef struct M68kCPU M68kCPU; =20 #endif diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index 053ba44ee8..564fa18ccb 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_MICROBLAZE_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_MICROBLAZE_CPU "microblaze-cpu" =20 +typedef struct MicroBlazeCPU MicroBlazeCPU; +typedef struct MicroBlazeCPUClass MicroBlazeCPUClass; #define MICROBLAZE_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(MicroBlazeCPUClass, (klass), TYPE_MICROBLAZE_CPU) #define MICROBLAZE_CPU(obj) \ @@ -38,15 +41,14 @@ * * A MicroBlaze CPU model. */ -typedef struct MicroBlazeCPUClass { +struct MicroBlazeCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} MicroBlazeCPUClass; +}; =20 -typedef struct MicroBlazeCPU MicroBlazeCPU; =20 #endif diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index 9d0df6c034..3a5fd9561e 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -21,6 +21,7 @@ #define QEMU_MIPS_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #ifdef TARGET_MIPS64 #define TYPE_MIPS_CPU "mips64-cpu" @@ -28,6 +29,8 @@ #define TYPE_MIPS_CPU "mips-cpu" #endif =20 +typedef struct MIPSCPU MIPSCPU; +typedef struct MIPSCPUClass MIPSCPUClass; #define MIPS_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(MIPSCPUClass, (klass), TYPE_MIPS_CPU) #define MIPS_CPU(obj) \ @@ -42,7 +45,7 @@ * * A MIPS CPU model. */ -typedef struct MIPSCPUClass { +struct MIPSCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -50,8 +53,7 @@ typedef struct MIPSCPUClass { DeviceRealize parent_realize; DeviceReset parent_reset; const struct mips_def_t *cpu_def; -} MIPSCPUClass; +}; =20 -typedef struct MIPSCPU MIPSCPU; =20 #endif diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index 455553b794..af4d6abf16 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -21,6 +21,7 @@ #define MOXIE_CPU_H =20 #include "exec/cpu-defs.h" +#include "qom/object.h" =20 #define MOXIE_EX_DIV0 0 #define MOXIE_EX_BAD 1 @@ -50,6 +51,8 @@ typedef struct CPUMoxieState { =20 #define TYPE_MOXIE_CPU "moxie-cpu" =20 +typedef struct MoxieCPU MoxieCPU; +typedef struct MoxieCPUClass MoxieCPUClass; #define MOXIE_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(MoxieCPUClass, (klass), TYPE_MOXIE_CPU) #define MOXIE_CPU(obj) \ @@ -63,14 +66,14 @@ typedef struct CPUMoxieState { * * A Moxie CPU model. */ -typedef struct MoxieCPUClass { +struct MoxieCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} MoxieCPUClass; +}; =20 /** * MoxieCPU: @@ -78,14 +81,14 @@ typedef struct MoxieCPUClass { * * A Moxie CPU. */ -typedef struct MoxieCPU { +struct MoxieCPU { /*< private >*/ CPUState parent_obj; /*< public >*/ =20 CPUNegativeOffsetState neg; CPUMoxieState env; -} MoxieCPU; +}; =20 =20 void moxie_cpu_do_interrupt(CPUState *cs); diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 4dddf9c3a1..7162cbdf5c 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -23,6 +23,7 @@ =20 #include "exec/cpu-defs.h" #include "hw/core/cpu.h" +#include "qom/object.h" =20 typedef struct CPUNios2State CPUNios2State; #if !defined(CONFIG_USER_ONLY) @@ -31,6 +32,8 @@ typedef struct CPUNios2State CPUNios2State; =20 #define TYPE_NIOS2_CPU "nios2-cpu" =20 +typedef struct Nios2CPU Nios2CPU; +typedef struct Nios2CPUClass Nios2CPUClass; #define NIOS2_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(Nios2CPUClass, (klass), TYPE_NIOS2_CPU) #define NIOS2_CPU(obj) \ @@ -44,14 +47,14 @@ typedef struct CPUNios2State CPUNios2State; * * A Nios2 CPU model. */ -typedef struct Nios2CPUClass { +struct Nios2CPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} Nios2CPUClass; +}; =20 #define TARGET_HAS_ICE 1 =20 @@ -174,7 +177,7 @@ struct CPUNios2State { * * A Nios2 CPU. */ -typedef struct Nios2CPU { +struct Nios2CPU { /*< private >*/ CPUState parent_obj; /*< public >*/ @@ -191,7 +194,7 @@ typedef struct Nios2CPU { uint32_t reset_addr; uint32_t exception_addr; uint32_t fast_tlb_miss_addr; -} Nios2CPU; +}; =20 =20 void nios2_tcg_init(void); diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index f37a52e153..ab0dd55358 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -22,12 +22,15 @@ =20 #include "exec/cpu-defs.h" #include "hw/core/cpu.h" +#include "qom/object.h" =20 /* cpu_openrisc_map_address_* in CPUOpenRISCTLBContext need this decl. */ struct OpenRISCCPU; =20 #define TYPE_OPENRISC_CPU "or1k-cpu" =20 +typedef struct OpenRISCCPU OpenRISCCPU; +typedef struct OpenRISCCPUClass OpenRISCCPUClass; #define OPENRISC_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(OpenRISCCPUClass, (klass), TYPE_OPENRISC_CPU) #define OPENRISC_CPU(obj) \ @@ -42,14 +45,14 @@ struct OpenRISCCPU; * * A OpenRISC CPU model. */ -typedef struct OpenRISCCPUClass { +struct OpenRISCCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} OpenRISCCPUClass; +}; =20 #define TARGET_INSN_START_EXTRA_WORDS 1 =20 @@ -305,14 +308,14 @@ typedef struct CPUOpenRISCState { * * A OpenRISC CPU. */ -typedef struct OpenRISCCPU { +struct OpenRISCCPU { /*< private >*/ CPUState parent_obj; /*< public >*/ =20 CPUNegativeOffsetState neg; CPUOpenRISCState env; -} OpenRISCCPU; +}; =20 =20 void cpu_openrisc_list(void); diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 000c7d405b..017f0efc7b 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -21,6 +21,7 @@ #define QEMU_PPC_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #ifdef TARGET_PPC64 #define TYPE_POWERPC_CPU "powerpc64-cpu" @@ -28,6 +29,8 @@ #define TYPE_POWERPC_CPU "powerpc-cpu" #endif =20 +typedef struct PowerPCCPU PowerPCCPU; +typedef struct PowerPCCPUClass PowerPCCPUClass; #define POWERPC_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(PowerPCCPUClass, (klass), TYPE_POWERPC_CPU) #define POWERPC_CPU(obj) \ @@ -35,7 +38,6 @@ #define POWERPC_CPU_GET_CLASS(obj) \ OBJECT_GET_CLASS(PowerPCCPUClass, (obj), TYPE_POWERPC_CPU) =20 -typedef struct PowerPCCPU PowerPCCPU; typedef struct CPUPPCState CPUPPCState; typedef struct ppc_tb_t ppc_tb_t; typedef struct ppc_dcr_t ppc_dcr_t; @@ -159,7 +161,7 @@ typedef struct PPCHash64Options PPCHash64Options; * * A PowerPC CPU model. */ -typedef struct PowerPCCPUClass { +struct PowerPCCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -197,7 +199,7 @@ typedef struct PowerPCCPUClass { int (*check_pow)(CPUPPCState *env); int (*handle_mmu_fault)(PowerPCCPU *cpu, vaddr eaddr, int rwx, int mmu= _idx); bool (*interrupts_big_endian)(PowerPCCPU *cpu); -} PowerPCCPUClass; +}; =20 #ifndef CONFIG_USER_ONLY typedef struct PPCTimebase { diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 3c4e1b3475..1c6fbfcfdb 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -23,6 +23,7 @@ #include "qemu/int128.h" #include "exec/cpu-defs.h" #include "cpu-qom.h" +#include "qom/object.h" =20 #define TCG_GUEST_DEFAULT_MO 0 =20 diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 383808bf88..ff86613d94 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -24,6 +24,7 @@ #include "hw/registerfields.h" #include "exec/cpu-defs.h" #include "fpu/softfloat-types.h" +#include "qom/object.h" =20 #define TCG_GUEST_DEFAULT_MO 0 =20 @@ -231,6 +232,8 @@ struct CPURISCVState { QEMUTimer *timer; /* Internal timer */ }; =20 +typedef struct RISCVCPU RISCVCPU; +typedef struct RISCVCPUClass RISCVCPUClass; #define RISCV_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(RISCVCPUClass, (klass), TYPE_RISCV_CPU) #define RISCV_CPU(obj) \ @@ -245,13 +248,13 @@ struct CPURISCVState { * * A RISCV CPU model. */ -typedef struct RISCVCPUClass { +struct RISCVCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ DeviceRealize parent_realize; DeviceReset parent_reset; -} RISCVCPUClass; +}; =20 /** * RISCVCPU: @@ -259,7 +262,7 @@ typedef struct RISCVCPUClass { * * A RISCV CPU. */ -typedef struct RISCVCPU { +struct RISCVCPU { /*< private >*/ CPUState parent_obj; /*< public >*/ @@ -292,7 +295,7 @@ typedef struct RISCVCPU { bool mmu; bool pmp; } cfg; -} RISCVCPU; +}; =20 static inline int riscv_has_ext(CPURISCVState *env, target_ulong ext) { diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index 9054762326..dd96469e04 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -20,12 +20,14 @@ #define RX_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_RX_CPU "rx-cpu" =20 #define TYPE_RX62N_CPU RX_CPU_TYPE_NAME("rx62n") =20 typedef struct RXCPU RXCPU; +typedef struct RXCPUClass RXCPUClass; #define RX_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(RXCPUClass, (klass), TYPE_RX_CPU) #define RX_CPU(obj) \ @@ -40,14 +42,14 @@ typedef struct RXCPU RXCPU; * * A RX CPU model. */ -typedef struct RXCPUClass { +struct RXCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} RXCPUClass; +}; =20 #define CPUArchState struct CPURXState =20 diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 1630818c28..13f1f2659e 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -21,9 +21,12 @@ #define QEMU_S390_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_S390_CPU "s390x-cpu" =20 +typedef struct S390CPU S390CPU; +typedef struct S390CPUClass S390CPUClass; #define S390_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(S390CPUClass, (klass), TYPE_S390_CPU) #define S390_CPU(obj) \ @@ -50,7 +53,7 @@ typedef enum cpu_reset_type { * * An S/390 CPU model. */ -typedef struct S390CPUClass { +struct S390CPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -64,9 +67,8 @@ typedef struct S390CPUClass { DeviceReset parent_reset; void (*load_normal)(CPUState *cpu); void (*reset)(CPUState *cpu, cpu_reset_type type); -} S390CPUClass; +}; =20 -typedef struct S390CPU S390CPU; typedef struct CPUS390XState CPUS390XState; =20 #endif diff --git a/target/sh4/cpu-qom.h b/target/sh4/cpu-qom.h index 72a63f3fd3..bf71c0f8e5 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -21,6 +21,7 @@ #define QEMU_SUPERH_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_SUPERH_CPU "superh-cpu" =20 @@ -28,6 +29,8 @@ #define TYPE_SH7751R_CPU SUPERH_CPU_TYPE_NAME("sh7751r") #define TYPE_SH7785_CPU SUPERH_CPU_TYPE_NAME("sh7785") =20 +typedef struct SuperHCPU SuperHCPU; +typedef struct SuperHCPUClass SuperHCPUClass; #define SUPERH_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(SuperHCPUClass, (klass), TYPE_SUPERH_CPU) #define SUPERH_CPU(obj) \ @@ -45,7 +48,7 @@ * * A SuperH CPU model. */ -typedef struct SuperHCPUClass { +struct SuperHCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -56,8 +59,7 @@ typedef struct SuperHCPUClass { uint32_t pvr; uint32_t prr; uint32_t cvr; -} SuperHCPUClass; +}; =20 -typedef struct SuperHCPU SuperHCPU; =20 #endif diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index 8b4d33c21e..b7cc81e5f3 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -21,6 +21,7 @@ #define QEMU_SPARC_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #ifdef TARGET_SPARC64 #define TYPE_SPARC_CPU "sparc64-cpu" @@ -28,6 +29,8 @@ #define TYPE_SPARC_CPU "sparc-cpu" #endif =20 +typedef struct SPARCCPU SPARCCPU; +typedef struct SPARCCPUClass SPARCCPUClass; #define SPARC_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(SPARCCPUClass, (klass), TYPE_SPARC_CPU) #define SPARC_CPU(obj) \ @@ -43,7 +46,7 @@ typedef struct sparc_def_t sparc_def_t; * * A SPARC CPU model. */ -typedef struct SPARCCPUClass { +struct SPARCCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -51,8 +54,7 @@ typedef struct SPARCCPUClass { DeviceRealize parent_realize; DeviceReset parent_reset; sparc_def_t *cpu_def; -} SPARCCPUClass; +}; =20 -typedef struct SPARCCPU SPARCCPU; =20 #endif diff --git a/target/tilegx/cpu.h b/target/tilegx/cpu.h index 193b6bbccb..d6cc1d2982 100644 --- a/target/tilegx/cpu.h +++ b/target/tilegx/cpu.h @@ -21,6 +21,7 @@ #define TILEGX_CPU_H =20 #include "exec/cpu-defs.h" +#include "qom/object.h" =20 /* TILE-Gx common register alias */ #define TILEGX_R_RE 0 /* 0 register, for function/syscall return val= ue */ @@ -98,6 +99,8 @@ typedef struct CPUTLGState { =20 #define TYPE_TILEGX_CPU "tilegx-cpu" =20 +typedef struct TileGXCPU TileGXCPU; +typedef struct TileGXCPUClass TileGXCPUClass; #define TILEGX_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(TileGXCPUClass, (klass), TYPE_TILEGX_CPU) #define TILEGX_CPU(obj) \ @@ -112,14 +115,14 @@ typedef struct CPUTLGState { * * A Tile-Gx CPU model. */ -typedef struct TileGXCPUClass { +struct TileGXCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} TileGXCPUClass; +}; =20 /** * TileGXCPU: @@ -127,14 +130,14 @@ typedef struct TileGXCPUClass { * * A Tile-GX CPU. */ -typedef struct TileGXCPU { +struct TileGXCPU { /*< private >*/ CPUState parent_obj; /*< public >*/ =20 CPUNegativeOffsetState neg; CPUTLGState env; -} TileGXCPU; +}; =20 =20 /* TILE-Gx memory attributes */ diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index cd819e6f24..cef466da74 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -19,10 +19,13 @@ #define QEMU_TRICORE_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 =20 #define TYPE_TRICORE_CPU "tricore-cpu" =20 +typedef struct TriCoreCPU TriCoreCPU; +typedef struct TriCoreCPUClass TriCoreCPUClass; #define TRICORE_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(TriCoreCPUClass, (klass), TYPE_TRICORE_CPU) #define TRICORE_CPU(obj) \ @@ -30,15 +33,14 @@ #define TRICORE_CPU_GET_CLASS(obj) \ OBJECT_GET_CLASS(TriCoreCPUClass, (obj), TYPE_TRICORE_CPU) =20 -typedef struct TriCoreCPUClass { +struct TriCoreCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; -} TriCoreCPUClass; +}; =20 -typedef struct TriCoreCPU TriCoreCPU; =20 #endif /* QEMU_TRICORE_CPU_QOM_H */ diff --git a/target/unicore32/cpu-qom.h b/target/unicore32/cpu-qom.h index 7dd04515cb..6a1cb1c82d 100644 --- a/target/unicore32/cpu-qom.h +++ b/target/unicore32/cpu-qom.h @@ -12,9 +12,12 @@ #define QEMU_UC32_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_UNICORE32_CPU "unicore32-cpu" =20 +typedef struct UniCore32CPU UniCore32CPU; +typedef struct UniCore32CPUClass UniCore32CPUClass; #define UNICORE32_CPU_CLASS(klass) \ OBJECT_CLASS_CHECK(UniCore32CPUClass, (klass), TYPE_UNICORE32_CPU) #define UNICORE32_CPU(obj) \ @@ -28,14 +31,13 @@ * * A UniCore32 CPU model. */ -typedef struct UniCore32CPUClass { +struct UniCore32CPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; -} UniCore32CPUClass; +}; =20 -typedef struct UniCore32CPU UniCore32CPU; =20 #endif diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index 3ea93ce1f9..cd9f31dc84 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -30,9 +30,12 @@ #define QEMU_XTENSA_CPU_QOM_H =20 #include "hw/core/cpu.h" +#include "qom/object.h" =20 #define TYPE_XTENSA_CPU "xtensa-cpu" =20 +typedef struct XtensaCPU XtensaCPU; +typedef struct XtensaCPUClass XtensaCPUClass; #define XTENSA_CPU_CLASS(class) \ OBJECT_CLASS_CHECK(XtensaCPUClass, (class), TYPE_XTENSA_CPU) #define XTENSA_CPU(obj) \ @@ -50,7 +53,7 @@ typedef struct XtensaConfig XtensaConfig; * * An Xtensa CPU model. */ -typedef struct XtensaCPUClass { +struct XtensaCPUClass { /*< private >*/ CPUClass parent_class; /*< public >*/ @@ -59,8 +62,7 @@ typedef struct XtensaCPUClass { DeviceReset parent_reset; =20 const XtensaConfig *config; -} XtensaCPUClass; +}; =20 -typedef struct XtensaCPU XtensaCPU; =20 #endif diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index eace2c113b..7dba29cc48 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -36,12 +36,13 @@ #include "hw/boards.h" #include "qapi/qapi-builtin-visit.h" =20 -typedef struct TCGState { +struct TCGState { AccelState parent_obj; =20 bool mttcg_enabled; unsigned long tb_size; -} TCGState; +}; +typedef struct TCGState TCGState; =20 #define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg") =20 diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index 14316333fe..84bd84efe7 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -26,6 +26,7 @@ #include "qapi/error.h" #include "standard-headers/linux/virtio_crypto.h" #include "crypto/cipher.h" +#include "qom/object.h" =20 =20 /** @@ -34,12 +35,12 @@ */ #define TYPE_CRYPTODEV_BACKEND_BUILTIN "cryptodev-backend-builtin" =20 +typedef struct CryptoDevBackendBuiltin + CryptoDevBackendBuiltin; #define CRYPTODEV_BACKEND_BUILTIN(obj) \ OBJECT_CHECK(CryptoDevBackendBuiltin, \ (obj), TYPE_CRYPTODEV_BACKEND_BUILTIN) =20 -typedef struct CryptoDevBackendBuiltin - CryptoDevBackendBuiltin; =20 typedef struct CryptoDevBackendBuiltinSession { QCryptoCipher *cipher; diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index dbe5a8aae6..5e903f6507 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -30,6 +30,7 @@ #include "sysemu/cryptodev-vhost.h" #include "chardev/char-fe.h" #include "sysemu/cryptodev-vhost-user.h" +#include "qom/object.h" =20 =20 /** @@ -38,12 +39,13 @@ */ #define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user" =20 +typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser; #define CRYPTODEV_BACKEND_VHOST_USER(obj) \ OBJECT_CHECK(CryptoDevBackendVhostUser, \ (obj), TYPE_CRYPTODEV_BACKEND_VHOST_USER) =20 =20 -typedef struct CryptoDevBackendVhostUser { +struct CryptoDevBackendVhostUser { CryptoDevBackend parent_obj; =20 VhostUserState vhost_user; @@ -51,7 +53,7 @@ typedef struct CryptoDevBackendVhostUser { char *chr_name; bool opened; CryptoDevBackendVhost *vhost_crypto[MAX_CRYPTO_QUEUE_NUM]; -} CryptoDevBackendVhostUser; +}; =20 static int cryptodev_vhost_user_running( diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index 56361a6272..0473c5c335 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -19,6 +19,7 @@ #include "qapi/qmp/qerror.h" #include "migration/vmstate.h" #include "trace.h" +#include "qom/object.h" =20 typedef struct DBusVMState DBusVMState; typedef struct DBusVMStateClass DBusVMStateClass; diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 5b819020b4..2c3bcb8291 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -17,11 +17,12 @@ #include "sysemu/hostmem.h" #include "sysemu/sysemu.h" #include "qom/object_interfaces.h" +#include "qom/object.h" =20 +typedef struct HostMemoryBackendFile HostMemoryBackendFile; #define MEMORY_BACKEND_FILE(obj) \ OBJECT_CHECK(HostMemoryBackendFile, (obj), TYPE_MEMORY_BACKEND_FILE) =20 -typedef struct HostMemoryBackendFile HostMemoryBackendFile; =20 struct HostMemoryBackendFile { HostMemoryBackend parent_obj; diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 4c040a7541..45114bd641 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -17,13 +17,14 @@ #include "qemu/memfd.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd" =20 +typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd; #define MEMORY_BACKEND_MEMFD(obj) \ OBJECT_CHECK(HostMemoryBackendMemfd, (obj), TYPE_MEMORY_BACKEND_MEMFD) =20 -typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd; =20 struct HostMemoryBackendMemfd { HostMemoryBackend parent_obj; diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c index ba1b8d66b8..4bf073c963 100644 --- a/backends/rng-builtin.c +++ b/backends/rng-builtin.c @@ -9,13 +9,15 @@ #include "sysemu/rng.h" #include "qemu/main-loop.h" #include "qemu/guest-random.h" +#include "qom/object.h" =20 +typedef struct RngBuiltin RngBuiltin; #define RNG_BUILTIN(obj) OBJECT_CHECK(RngBuiltin, (obj), TYPE_RNG_BUILTIN) =20 -typedef struct RngBuiltin { +struct RngBuiltin { RngBackend parent; QEMUBH *bh; -} RngBuiltin; +}; =20 static void rng_builtin_receive_entropy_bh(void *opaque) { diff --git a/backends/rng-egd.c b/backends/rng-egd.c index 7aaa6ee239..ee1854f31c 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -16,17 +16,18 @@ #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_RNG_EGD "rng-egd" +typedef struct RngEgd RngEgd; #define RNG_EGD(obj) OBJECT_CHECK(RngEgd, (obj), TYPE_RNG_EGD) =20 -typedef struct RngEgd -{ +struct RngEgd { RngBackend parent; =20 CharBackend chr; char *chr_name; -} RngEgd; +}; =20 static void rng_egd_request_entropy(RngBackend *b, RngRequest *req) { diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index a9b0f55e67..2509c8d327 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -42,8 +42,10 @@ #include "qapi/qapi-visit-tpm.h" #include "chardev/char-fe.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_TPM_EMULATOR "tpm-emulator" +typedef struct TPMEmulator TPMEmulator; #define TPM_EMULATOR(obj) \ OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR) =20 @@ -63,7 +65,7 @@ typedef struct TPMBlobBuffers { TPMSizedBuffer savestate; } TPMBlobBuffers; =20 -typedef struct TPMEmulator { +struct TPMEmulator { TPMBackend parent; =20 TPMEmulatorOptions *options; @@ -80,7 +82,7 @@ typedef struct TPMEmulator { unsigned int established_flag_cached:1; =20 TPMBlobBuffers state_blobs; -} TPMEmulator; +}; =20 struct tpm_error { uint32_t tpm_result; diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c index 7403807ec4..b703f7e412 100644 --- a/backends/tpm/tpm_passthrough.c +++ b/backends/tpm/tpm_passthrough.c @@ -33,8 +33,10 @@ #include "qapi/clone-visitor.h" #include "qapi/qapi-visit-tpm.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_TPM_PASSTHROUGH "tpm-passthrough" +typedef struct TPMPassthruState TPMPassthruState; #define TPM_PASSTHROUGH(obj) \ OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH) =20 @@ -53,7 +55,6 @@ struct TPMPassthruState { size_t tpm_buffersize; }; =20 -typedef struct TPMPassthruState TPMPassthruState; =20 #define TPM_PASSTHROUGH_DEFAULT_DEVICE "/dev/tpm0" =20 diff --git a/chardev/baum.c b/chardev/baum.c index 9c95e7bc79..cb906060d9 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -33,6 +33,7 @@ #include #include #include +#include "qom/object.h" =20 #if 0 #define DPRINTF(fmt, ...) \ @@ -86,7 +87,7 @@ =20 #define BUF_SIZE 256 =20 -typedef struct { +struct BaumChardev { Chardev parent; =20 brlapi_handle_t *brlapi; @@ -100,7 +101,8 @@ typedef struct { uint8_t out_buf_used, out_buf_ptr; =20 QEMUTimer *cellCount_timer; -} BaumChardev; +}; +typedef struct BaumChardev BaumChardev; =20 #define TYPE_CHARDEV_BRAILLE "chardev-braille" #define BAUM_CHARDEV(obj) OBJECT_CHECK(BaumChardev, (obj), TYPE_CHARDEV_BR= AILLE) diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c index 05e7efbd6c..bebe050705 100644 --- a/chardev/char-parallel.c +++ b/chardev/char-parallel.c @@ -28,6 +28,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include +#include "qom/object.h" =20 #ifdef CONFIG_BSD #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) @@ -49,11 +50,12 @@ =20 #if defined(__linux__) =20 -typedef struct { +struct ParallelChardev { Chardev parent; int fd; int mode; -} ParallelChardev; +}; +typedef struct ParallelChardev ParallelChardev; =20 #define PARALLEL_CHARDEV(obj) \ OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL) @@ -177,10 +179,11 @@ static void qemu_chr_open_pp_fd(Chardev *chr, =20 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Drago= nFly__) =20 -typedef struct { +struct ParallelChardev { Chardev parent; int fd; -} ParallelChardev; +}; +typedef struct ParallelChardev ParallelChardev; =20 #define PARALLEL_CHARDEV(obj) \ OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL) diff --git a/chardev/char-pty.c b/chardev/char-pty.c index 1cc501a481..963fe4f0ca 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -33,15 +33,17 @@ #include "qemu/qemu-print.h" =20 #include "chardev/char-io.h" +#include "qom/object.h" =20 -typedef struct { +struct PtyChardev { Chardev parent; QIOChannel *ioc; int read_bytes; =20 int connected; GSource *timer_src; -} PtyChardev; +}; +typedef struct PtyChardev PtyChardev; =20 #define PTY_CHARDEV(obj) OBJECT_CHECK(PtyChardev, (obj), TYPE_CHARDEV_PTY) =20 diff --git a/chardev/char-ringbuf.c b/chardev/char-ringbuf.c index 67397a8ce9..301a5d8634 100644 --- a/chardev/char-ringbuf.c +++ b/chardev/char-ringbuf.c @@ -29,16 +29,18 @@ #include "qemu/base64.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qom/object.h" =20 /* Ring buffer chardev */ =20 -typedef struct { +struct RingBufChardev { Chardev parent; size_t size; size_t prod; size_t cons; uint8_t *cbuf; -} RingBufChardev; +}; +typedef struct RingBufChardev RingBufChardev; =20 #define RINGBUF_CHARDEV(obj) \ OBJECT_CHECK(RingBufChardev, (obj), TYPE_CHARDEV_RINGBUF) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index ef62dbf3d7..9435b7d643 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -36,6 +36,7 @@ #include "qapi/qapi-visit-sockets.h" =20 #include "chardev/char-io.h" +#include "qom/object.h" =20 /***********************************************************/ /* TCP Net console */ @@ -53,7 +54,7 @@ typedef enum { TCP_CHARDEV_STATE_CONNECTED, } TCPChardevState; =20 -typedef struct { +struct SocketChardev { Chardev parent; QIOChannel *ioc; /* Client I/O channel */ QIOChannelSocket *sioc; /* Client master channel */ @@ -84,7 +85,8 @@ typedef struct { bool connect_err_reported; =20 QIOTask *connect_task; -} SocketChardev; +}; +typedef struct SocketChardev SocketChardev; =20 #define SOCKET_CHARDEV(obj) \ OBJECT_CHECK(SocketChardev, (obj), TYPE_CHARDEV_SOCKET) diff --git a/chardev/char-udp.c b/chardev/char-udp.c index bba4145f96..58be3487e6 100644 --- a/chardev/char-udp.c +++ b/chardev/char-udp.c @@ -30,18 +30,20 @@ #include "qemu/option.h" =20 #include "chardev/char-io.h" +#include "qom/object.h" =20 /***********************************************************/ /* UDP Net console */ =20 -typedef struct { +struct UdpChardev { Chardev parent; QIOChannel *ioc; uint8_t buf[CHR_READ_BUF_LEN]; int bufcnt; int bufptr; int max_size; -} UdpChardev; +}; +typedef struct UdpChardev UdpChardev; =20 #define UDP_CHARDEV(obj) OBJECT_CHECK(UdpChardev, (obj), TYPE_CHARDEV_UDP) =20 diff --git a/chardev/char-win-stdio.c b/chardev/char-win-stdio.c index 99afda353c..980e0d1356 100644 --- a/chardev/char-win-stdio.c +++ b/chardev/char-win-stdio.c @@ -28,15 +28,17 @@ #include "qemu/module.h" #include "chardev/char-win.h" #include "chardev/char-win-stdio.h" +#include "qom/object.h" =20 -typedef struct { +struct WinStdioChardev { Chardev parent; HANDLE hStdIn; HANDLE hInputReadyEvent; HANDLE hInputDoneEvent; HANDLE hInputThread; uint8_t win_stdio_buf; -} WinStdioChardev; +}; +typedef struct WinStdioChardev WinStdioChardev; =20 #define WIN_STDIO_CHARDEV(obj) \ OBJECT_CHECK(WinStdioChardev, (obj), TYPE_CHARDEV_WIN_STDIO) diff --git a/chardev/msmouse.c b/chardev/msmouse.c index 6d8f06fed4..0a7926697c 100644 --- a/chardev/msmouse.c +++ b/chardev/msmouse.c @@ -27,11 +27,12 @@ #include "chardev/char.h" #include "ui/console.h" #include "ui/input.h" +#include "qom/object.h" =20 #define MSMOUSE_LO6(n) ((n) & 0x3f) #define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6) =20 -typedef struct { +struct MouseChardev { Chardev parent; =20 QemuInputHandlerState *hs; @@ -40,7 +41,8 @@ typedef struct { bool btnc[INPUT_BUTTON__MAX]; uint8_t outbuf[32]; int outlen; -} MouseChardev; +}; +typedef struct MouseChardev MouseChardev; =20 #define TYPE_CHARDEV_MSMOUSE "chardev-msmouse" #define MOUSE_CHARDEV(obj) \ diff --git a/chardev/testdev.c b/chardev/testdev.c index 368a8c041e..bbae59c941 100644 --- a/chardev/testdev.c +++ b/chardev/testdev.c @@ -27,15 +27,17 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "chardev/char.h" +#include "qom/object.h" =20 #define BUF_SIZE 32 =20 -typedef struct { +struct TestdevChardev { Chardev parent; =20 uint8_t in_buf[32]; int in_buf_used; -} TestdevChardev; +}; +typedef struct TestdevChardev TestdevChardev; =20 #define TYPE_CHARDEV_TESTDEV "chardev-testdev" #define TESTDEV_CHARDEV(obj) \ diff --git a/chardev/wctablet.c b/chardev/wctablet.c index e9cb7ca710..361a12fdd4 100644 --- a/chardev/wctablet.c +++ b/chardev/wctablet.c @@ -32,6 +32,7 @@ #include "ui/console.h" #include "ui/input.h" #include "trace.h" +#include "qom/object.h" =20 =20 #define WC_OUTPUT_BUF_MAX_LEN 512 @@ -64,7 +65,7 @@ uint8_t WC_FULL_CONFIG_STRING[WC_FULL_CONFIG_STRING_LENGT= H + 1] =3D { }; =20 /* This structure is used to save private info for Wacom Tablet. */ -typedef struct { +struct TabletChardev { Chardev parent; QemuInputHandlerState *hs; =20 @@ -81,7 +82,8 @@ typedef struct { int axis[INPUT_AXIS__MAX]; bool btns[INPUT_BUTTON__MAX]; =20 -} TabletChardev; +}; +typedef struct TabletChardev TabletChardev; =20 #define TYPE_CHARDEV_WCTABLET "chardev-wctablet" #define WCTABLET_CHARDEV(obj) \ diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index e6163bb6ce..ba39184650 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -45,6 +45,7 @@ #include "migration/vmstate.h" #include "hw/core/cpu.h" #include "trace.h" +#include "qom/object.h" =20 #define GPE_BASE 0xafe0 #define GPE_LEN 4 @@ -54,7 +55,7 @@ struct pci_status { uint32_t down; }; =20 -typedef struct PIIX4PMState { +struct PIIX4PMState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -89,7 +90,8 @@ typedef struct PIIX4PMState { CPUHotplugState cpuhp_state; =20 MemHotplugState acpi_memory_hotplug; -} PIIX4PMState; +}; +typedef struct PIIX4PMState PIIX4PMState; =20 #define PIIX4_PM(obj) \ OBJECT_CHECK(PIIX4PMState, (obj), TYPE_PIIX4_PM) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 29d44dfb06..bd484e42bd 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -15,6 +15,7 @@ #include "hw/irq.h" #include "alpha_sys.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 =20 #define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost" @@ -49,16 +50,17 @@ typedef struct TyphoonPchip { TyphoonWindow win[4]; } TyphoonPchip; =20 +typedef struct TyphoonState TyphoonState; #define TYPHOON_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(TyphoonState, (obj), TYPE_TYPHOON_PCI_HOST_BRIDGE) =20 -typedef struct TyphoonState { +struct TyphoonState { PCIHostState parent_obj; =20 TyphoonCchip cchip; TyphoonPchip pchip; MemoryRegion dchip_region; -} TyphoonState; +}; =20 /* Called when one of DRIR or DIM changes. */ static void cpu_irq_change(AlphaCPU *cpu, uint64_t req) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index 4b35ef4bed..82ffc82dc7 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -18,12 +18,14 @@ #include "hw/block/flash.h" #include "exec/address-spaces.h" #include "cpu.h" +#include "qom/object.h" =20 -typedef struct { +struct CollieMachineState { MachineState parent; =20 StrongARMState *sa1110; -} CollieMachineState; +}; +typedef struct CollieMachineState CollieMachineState; =20 #define TYPE_COLLIE_MACHINE MACHINE_TYPE_NAME("collie") #define COLLIE_MACHINE(obj) \ diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index c96f2ab9cf..cbf6e72ad6 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -36,6 +36,7 @@ #include "hw/cpu/a9mpcore.h" #include "hw/cpu/a15mpcore.h" #include "qemu/log.h" +#include "qom/object.h" =20 #define SMP_BOOT_ADDR 0x100 #define SMP_BOOT_REG 0x40 @@ -155,17 +156,18 @@ static const MemoryRegionOps hb_mem_ops =3D { }; =20 #define TYPE_HIGHBANK_REGISTERS "highbank-regs" +typedef struct HighbankRegsState HighbankRegsState; #define HIGHBANK_REGISTERS(obj) \ OBJECT_CHECK(HighbankRegsState, (obj), TYPE_HIGHBANK_REGISTERS) =20 -typedef struct { +struct HighbankRegsState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ =20 MemoryRegion iomem; uint32_t regs[NUM_REGS]; -} HighbankRegsState; +}; =20 static VMStateDescription vmstate_highbank_regs =3D { .name =3D "highbank-regs", diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index fe7c2b9d4b..75e608e68e 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -26,12 +26,14 @@ #include "hw/hw.h" #include "hw/irq.h" #include "hw/sd/sd.h" +#include "qom/object.h" =20 #define TYPE_INTEGRATOR_CM "integrator_core" +typedef struct IntegratorCMState IntegratorCMState; #define INTEGRATOR_CM(obj) \ OBJECT_CHECK(IntegratorCMState, (obj), TYPE_INTEGRATOR_CM) =20 -typedef struct IntegratorCMState { +struct IntegratorCMState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -51,7 +53,7 @@ typedef struct IntegratorCMState { uint32_t int_level; uint32_t irq_enabled; uint32_t fiq_enabled; -} IntegratorCMState; +}; =20 static uint8_t integrator_spd[128] =3D { 128, 8, 4, 11, 9, 1, 64, 0, 2, 0xa0, 0xa0, 0, 0, 8, 0, 1, @@ -326,10 +328,11 @@ static void integratorcm_realize(DeviceState *d, Erro= r **errp) /* Primary interrupt controller. */ =20 #define TYPE_INTEGRATOR_PIC "integrator_pic" +typedef struct icp_pic_state icp_pic_state; #define INTEGRATOR_PIC(obj) \ OBJECT_CHECK(icp_pic_state, (obj), TYPE_INTEGRATOR_PIC) =20 -typedef struct icp_pic_state { +struct icp_pic_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -340,7 +343,7 @@ typedef struct icp_pic_state { uint32_t fiq_enabled; qemu_irq parent_irq; qemu_irq parent_fiq; -} icp_pic_state; +}; =20 static const VMStateDescription vmstate_icp_pic =3D { .name =3D "icp_pic", @@ -465,10 +468,11 @@ static void icp_pic_init(Object *obj) /* CP control registers. */ =20 #define TYPE_ICP_CONTROL_REGS "icp-ctrl-regs" +typedef struct ICPCtrlRegsState ICPCtrlRegsState; #define ICP_CONTROL_REGS(obj) \ OBJECT_CHECK(ICPCtrlRegsState, (obj), TYPE_ICP_CONTROL_REGS) =20 -typedef struct ICPCtrlRegsState { +struct ICPCtrlRegsState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -477,7 +481,7 @@ typedef struct ICPCtrlRegsState { =20 qemu_irq mmc_irq; uint32_t intreg_state; -} ICPCtrlRegsState; +}; =20 #define ICP_GPIO_MMC_WPROT "mmc-wprot" #define ICP_GPIO_MMC_CARDIN "mmc-cardin" diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index a91acab1cb..e94f711e89 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -18,13 +18,15 @@ #include "hw/arm/nrf51_soc.h" #include "hw/i2c/microbit_i2c.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 -typedef struct { +struct MicrobitMachineState { MachineState parent; =20 NRF51State nrf51; MicrobitI2CState i2c; -} MicrobitMachineState; +}; +typedef struct MicrobitMachineState MicrobitMachineState; =20 #define TYPE_MICROBIT_MACHINE MACHINE_TYPE_NAME("microbit") =20 diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 28d9e8bfac..8870aea814 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -62,6 +62,7 @@ #include "hw/net/lan9118.h" #include "net/net.h" #include "hw/core/split-irq.h" +#include "qom/object.h" =20 #define MPS2TZ_NUMIRQ 92 =20 @@ -70,14 +71,15 @@ typedef enum MPS2TZFPGAType { FPGA_AN521, } MPS2TZFPGAType; =20 -typedef struct { +struct MPS2TZMachineClass { MachineClass parent; MPS2TZFPGAType fpga_type; uint32_t scc_id; const char *armsse_type; -} MPS2TZMachineClass; +}; +typedef struct MPS2TZMachineClass MPS2TZMachineClass; =20 -typedef struct { +struct MPS2TZMachineState { MachineState parent; =20 ARMSSE iotkit; @@ -99,7 +101,8 @@ typedef struct { qemu_or_irq uart_irq_orgate; DeviceState *lan9118; SplitIRQ cpu_irq_splitter[MPS2TZ_NUMIRQ]; -} MPS2TZMachineState; +}; +typedef struct MPS2TZMachineState MPS2TZMachineState; =20 #define TYPE_MPS2TZ_MACHINE "mps2tz" #define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505") diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 9f12934ca8..b5173e398d 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -44,19 +44,21 @@ #include "hw/net/lan9118.h" #include "net/net.h" #include "hw/watchdog/cmsdk-apb-watchdog.h" +#include "qom/object.h" =20 typedef enum MPS2FPGAType { FPGA_AN385, FPGA_AN511, } MPS2FPGAType; =20 -typedef struct { +struct MPS2MachineClass { MachineClass parent; MPS2FPGAType fpga_type; uint32_t scc_id; -} MPS2MachineClass; +}; +typedef struct MPS2MachineClass MPS2MachineClass; =20 -typedef struct { +struct MPS2MachineState { MachineState parent; =20 ARMv7MState armv7m; @@ -75,7 +77,8 @@ typedef struct { /* CMSDK APB subsystem */ CMSDKAPBDualTimer dualtimer; CMSDKAPBWatchdog watchdog; -} MPS2MachineState; +}; +typedef struct MPS2MachineState MPS2MachineState; =20 #define TYPE_MPS2_MACHINE "mps2" #define TYPE_MPS2_AN385_MACHINE MACHINE_TYPE_NAME("mps2-an385") diff --git a/hw/arm/musca.c b/hw/arm/musca.c index 4bc737f93b..7fd8634ac5 100644 --- a/hw/arm/musca.c +++ b/hw/arm/musca.c @@ -33,6 +33,7 @@ #include "hw/misc/tz-ppc.h" #include "hw/misc/unimp.h" #include "hw/rtc/pl031.h" +#include "qom/object.h" =20 #define MUSCA_NUMIRQ_MAX 96 #define MUSCA_PPC_MAX 3 @@ -45,7 +46,7 @@ typedef enum MuscaType { MUSCA_B1, } MuscaType; =20 -typedef struct { +struct MuscaMachineClass { MachineClass parent; MuscaType type; uint32_t init_svtor; @@ -53,9 +54,10 @@ typedef struct { int num_irqs; const MPCInfo *mpc_info; int num_mpcs; -} MuscaMachineClass; +}; +typedef struct MuscaMachineClass MuscaMachineClass; =20 -typedef struct { +struct MuscaMachineState { MachineState parent; =20 ARMSSE sse; @@ -81,7 +83,8 @@ typedef struct { UnimplementedDeviceState sdio; UnimplementedDeviceState gpio; UnimplementedDeviceState cryptoisland; -} MuscaMachineState; +}; +typedef struct MuscaMachineState MuscaMachineState; =20 #define TYPE_MUSCA_MACHINE "musca" #define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a") diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index f2f4fc0264..695699e01e 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -34,6 +34,7 @@ #include "exec/address-spaces.h" #include "ui/pixel_ops.h" #include "qemu/cutils.h" +#include "qom/object.h" =20 #define MP_MISC_BASE 0x80002000 #define MP_MISC_SIZE 0x00001000 @@ -154,10 +155,11 @@ typedef struct mv88w8618_rx_desc { } mv88w8618_rx_desc; =20 #define TYPE_MV88W8618_ETH "mv88w8618_eth" +typedef struct mv88w8618_eth_state mv88w8618_eth_state; #define MV88W8618_ETH(obj) \ OBJECT_CHECK(mv88w8618_eth_state, (obj), TYPE_MV88W8618_ETH) =20 -typedef struct mv88w8618_eth_state { +struct mv88w8618_eth_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -177,7 +179,7 @@ typedef struct mv88w8618_eth_state { uint32_t cur_rx[4]; NICState *nic; NICConf conf; -} mv88w8618_eth_state; +}; =20 static void eth_rx_desc_put(AddressSpace *dma_as, uint32_t addr, mv88w8618_rx_desc *desc) @@ -483,10 +485,11 @@ static const TypeInfo mv88w8618_eth_info =3D { #define MP_LCD_TEXTCOLOR 0xe0e0ff /* RRGGBB */ =20 #define TYPE_MUSICPAL_LCD "musicpal_lcd" +typedef struct musicpal_lcd_state musicpal_lcd_state; #define MUSICPAL_LCD(obj) \ OBJECT_CHECK(musicpal_lcd_state, (obj), TYPE_MUSICPAL_LCD) =20 -typedef struct musicpal_lcd_state { +struct musicpal_lcd_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -499,7 +502,7 @@ typedef struct musicpal_lcd_state { uint32_t page_off; QemuConsole *con; uint8_t video_ram[128*64/8]; -} musicpal_lcd_state; +}; =20 static uint8_t scale_lcd_color(musicpal_lcd_state *s, uint8_t col) { @@ -700,10 +703,11 @@ static const TypeInfo musicpal_lcd_info =3D { #define MP_PIC_ENABLE_CLR 0x0C =20 #define TYPE_MV88W8618_PIC "mv88w8618_pic" +typedef struct mv88w8618_pic_state mv88w8618_pic_state; #define MV88W8618_PIC(obj) \ OBJECT_CHECK(mv88w8618_pic_state, (obj), TYPE_MV88W8618_PIC) =20 -typedef struct mv88w8618_pic_state { +struct mv88w8618_pic_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -712,7 +716,7 @@ typedef struct mv88w8618_pic_state { uint32_t level; uint32_t enabled; qemu_irq parent_irq; -} mv88w8618_pic_state; +}; =20 static void mv88w8618_pic_update(mv88w8618_pic_state *s) { @@ -837,17 +841,18 @@ typedef struct mv88w8618_timer_state { } mv88w8618_timer_state; =20 #define TYPE_MV88W8618_PIT "mv88w8618_pit" +typedef struct mv88w8618_pit_state mv88w8618_pit_state; #define MV88W8618_PIT(obj) \ OBJECT_CHECK(mv88w8618_pit_state, (obj), TYPE_MV88W8618_PIT) =20 -typedef struct mv88w8618_pit_state { +struct mv88w8618_pit_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ =20 MemoryRegion iomem; mv88w8618_timer_state timer[4]; -} mv88w8618_pit_state; +}; =20 static void mv88w8618_timer_tick(void *opaque) { @@ -1004,17 +1009,18 @@ static const TypeInfo mv88w8618_pit_info =3D { #define MP_FLASHCFG_CFGR0 0x04 =20 #define TYPE_MV88W8618_FLASHCFG "mv88w8618_flashcfg" +typedef struct mv88w8618_flashcfg_state mv88w8618_flashcfg_state; #define MV88W8618_FLASHCFG(obj) \ OBJECT_CHECK(mv88w8618_flashcfg_state, (obj), TYPE_MV88W8618_FLASHCFG) =20 -typedef struct mv88w8618_flashcfg_state { +struct mv88w8618_flashcfg_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ =20 MemoryRegion iomem; uint32_t cfgr0; -} mv88w8618_flashcfg_state; +}; =20 static uint64_t mv88w8618_flashcfg_read(void *opaque, hwaddr offset, @@ -1090,10 +1096,11 @@ static const TypeInfo mv88w8618_flashcfg_info =3D { =20 #define MP_BOARD_REVISION 0x31 =20 -typedef struct { +struct MusicPalMiscState { SysBusDevice parent_obj; MemoryRegion iomem; -} MusicPalMiscState; +}; +typedef struct MusicPalMiscState MusicPalMiscState; =20 #define TYPE_MUSICPAL_MISC "musicpal-misc" #define MUSICPAL_MISC(obj) \ @@ -1202,10 +1209,11 @@ static void mv88w8618_wlan_realize(DeviceState *dev= , Error **errp) #define MP_OE_LCD_BRIGHTNESS 0x0007 =20 #define TYPE_MUSICPAL_GPIO "musicpal_gpio" +typedef struct musicpal_gpio_state musicpal_gpio_state; #define MUSICPAL_GPIO(obj) \ OBJECT_CHECK(musicpal_gpio_state, (obj), TYPE_MUSICPAL_GPIO) =20 -typedef struct musicpal_gpio_state { +struct musicpal_gpio_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -1219,7 +1227,7 @@ typedef struct musicpal_gpio_state { uint32_t isr; qemu_irq irq; qemu_irq out[5]; /* 3 brightness out + 2 lcd (data and clock ) */ -} musicpal_gpio_state; +}; =20 static void musicpal_gpio_brightness_update(musicpal_gpio_state *s) { int i; @@ -1452,10 +1460,11 @@ static const TypeInfo musicpal_gpio_info =3D { #define MP_KEY_BTN_NAVIGATION (1 << 7) =20 #define TYPE_MUSICPAL_KEY "musicpal_key" +typedef struct musicpal_key_state musicpal_key_state; #define MUSICPAL_KEY(obj) \ OBJECT_CHECK(musicpal_key_state, (obj), TYPE_MUSICPAL_KEY) =20 -typedef struct musicpal_key_state { +struct musicpal_key_state { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -1464,7 +1473,7 @@ typedef struct musicpal_key_state { uint32_t kbd_extended; uint32_t pressed_keys; qemu_irq out[8]; -} musicpal_key_state; +}; =20 static void musicpal_key_event(void *opaque, int keycode) { diff --git a/hw/arm/palm.c b/hw/arm/palm.c index e7bc9ea4c6..ddabb0e2d6 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -32,6 +32,7 @@ #include "exec/address-spaces.h" #include "cpu.h" #include "qemu/cutils.h" +#include "qom/object.h" =20 static uint64_t static_read(void *opaque, hwaddr offset, unsigned size) { @@ -132,12 +133,13 @@ static void palmte_button_event(void *opaque, int key= code) */ =20 #define TYPE_PALM_MISC_GPIO "palm-misc-gpio" +typedef struct PalmMiscGPIOState PalmMiscGPIOState; #define PALM_MISC_GPIO(obj) \ OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO) =20 -typedef struct PalmMiscGPIOState { +struct PalmMiscGPIOState { SysBusDevice parent_obj; -} PalmMiscGPIOState; +}; =20 static void palmte_onoff_gpios(void *opaque, int line, int level) { diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 76975d17a4..a48a32ee09 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -28,6 +28,7 @@ #include "sysemu/qtest.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "qom/object.h" =20 static struct { hwaddr io_base; @@ -469,11 +470,12 @@ static const VMStateDescription vmstate_pxa2xx_mm =3D= { }; =20 #define TYPE_PXA2XX_SSP "pxa2xx-ssp" +typedef struct PXA2xxSSPState PXA2xxSSPState; #define PXA2XX_SSP(obj) \ OBJECT_CHECK(PXA2xxSSPState, (obj), TYPE_PXA2XX_SSP) =20 /* Synchronous Serial Ports */ -typedef struct { +struct PXA2xxSSPState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -495,7 +497,7 @@ typedef struct { uint32_t rx_fifo[16]; uint32_t rx_level; uint32_t rx_start; -} PXA2xxSSPState; +}; =20 static bool pxa2xx_ssp_vmstate_validate(void *opaque, int version_id) { @@ -809,10 +811,11 @@ static void pxa2xx_ssp_init(Object *obj) #define PIAR 0x38 /* RTC Periodic Interrupt Alarm register */ =20 #define TYPE_PXA2XX_RTC "pxa2xx_rtc" +typedef struct PXA2xxRTCState PXA2xxRTCState; #define PXA2XX_RTC(obj) \ OBJECT_CHECK(PXA2xxRTCState, (obj), TYPE_PXA2XX_RTC) =20 -typedef struct { +struct PXA2xxRTCState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -843,7 +846,7 @@ typedef struct { QEMUTimer *rtc_swal2; QEMUTimer *rtc_pi; qemu_irq rtc_irq; -} PXA2xxRTCState; +}; =20 static inline void pxa2xx_rtc_int_update(PXA2xxRTCState *s) { @@ -1242,14 +1245,15 @@ static const TypeInfo pxa2xx_rtc_sysbus_info =3D { /* I2C Interface */ =20 #define TYPE_PXA2XX_I2C_SLAVE "pxa2xx-i2c-slave" +typedef struct PXA2xxI2CSlaveState PXA2xxI2CSlaveState; #define PXA2XX_I2C_SLAVE(obj) \ OBJECT_CHECK(PXA2xxI2CSlaveState, (obj), TYPE_PXA2XX_I2C_SLAVE) =20 -typedef struct PXA2xxI2CSlaveState { +struct PXA2xxI2CSlaveState { I2CSlave parent_obj; =20 PXA2xxI2CState *host; -} PXA2xxI2CSlaveState; +}; =20 struct PXA2xxI2CState { /*< private >*/ diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index d6d0d0b08e..2cd6dd929e 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -17,14 +17,15 @@ #include "qapi/error.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define PXA2XX_GPIO_BANKS 4 =20 #define TYPE_PXA2XX_GPIO "pxa2xx-gpio" +typedef struct PXA2xxGPIOInfo PXA2xxGPIOInfo; #define PXA2XX_GPIO(obj) \ OBJECT_CHECK(PXA2xxGPIOInfo, (obj), TYPE_PXA2XX_GPIO) =20 -typedef struct PXA2xxGPIOInfo PXA2xxGPIOInfo; struct PXA2xxGPIOInfo { /*< private >*/ SysBusDevice parent_obj; diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index ceee6aa48d..00e72fde4e 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -16,6 +16,7 @@ #include "hw/arm/pxa.h" #include "hw/sysbus.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define ICIP 0x00 /* Interrupt Controller IRQ Pending register */ #define ICMR 0x04 /* Interrupt Controller Mask register */ @@ -37,10 +38,11 @@ #define PXA2XX_PIC_SRCS 40 =20 #define TYPE_PXA2XX_PIC "pxa2xx_pic" +typedef struct PXA2xxPICState PXA2xxPICState; #define PXA2XX_PIC(obj) \ OBJECT_CHECK(PXA2xxPICState, (obj), TYPE_PXA2XX_PIC) =20 -typedef struct { +struct PXA2xxPICState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -52,7 +54,7 @@ typedef struct { uint32_t is_fiq[2]; uint32_t int_idle; uint32_t priority[PXA2XX_PIC_SRCS]; -} PXA2xxPICState; +}; =20 static void pxa2xx_pic_update(void *opaque) { diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index b2d6c9688f..d9f7eeb06b 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -24,6 +24,7 @@ #include "hw/loader.h" #include "hw/arm/boot.h" #include "sysemu/sysemu.h" +#include "qom/object.h" =20 #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS = */ #define MVBAR_ADDR 0x400 /* secure vectors */ @@ -35,19 +36,21 @@ /* Registered machine type (matches RPi Foundation bootloader and U-Boot) = */ #define MACH_TYPE_BCM2708 3138 =20 -typedef struct RaspiMachineState { +struct RaspiMachineState { /*< private >*/ MachineState parent_obj; /*< public >*/ BCM283XState soc; -} RaspiMachineState; +}; +typedef struct RaspiMachineState RaspiMachineState; =20 -typedef struct RaspiMachineClass { +struct RaspiMachineClass { /*< private >*/ MachineClass parent_obj; /*< public >*/ uint32_t board_rev; -} RaspiMachineClass; +}; +typedef struct RaspiMachineClass RaspiMachineClass; =20 #define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common") #define RASPI_MACHINE(obj) \ diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 47b5286d46..a638fb369e 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -41,6 +41,7 @@ #include "hw/usb.h" #include "hw/char/pl011.h" #include "net/net.h" +#include "qom/object.h" =20 #define RAMLIMIT_GB 8192 #define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB) @@ -84,7 +85,7 @@ typedef struct MemMapEntry { hwaddr size; } MemMapEntry; =20 -typedef struct { +struct SBSAMachineState { MachineState parent; struct arm_boot_info bootinfo; int smp_cpus; @@ -93,7 +94,8 @@ typedef struct { int psci_conduit; DeviceState *gic; PFlashCFI01 *flash[2]; -} SBSAMachineState; +}; +typedef struct SBSAMachineState SBSAMachineState; =20 #define TYPE_SBSA_MACHINE MACHINE_TYPE_NAME("sbsa-ref") #define SBSA_MACHINE(obj) \ diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 7ac8254aa6..0bf5745eb2 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -34,16 +34,18 @@ #include "migration/vmstate.h" #include "exec/address-spaces.h" #include "cpu.h" +#include "qom/object.h" =20 enum spitz_model_e { spitz, akita, borzoi, terrier }; =20 -typedef struct { +struct SpitzMachineClass { MachineClass parent; enum spitz_model_e model; int arm_id; -} SpitzMachineClass; +}; +typedef struct SpitzMachineClass SpitzMachineClass; =20 -typedef struct { +struct SpitzMachineState { MachineState parent; PXA2xxState *mpu; DeviceState *mux; @@ -53,7 +55,8 @@ typedef struct { DeviceState *scp0; DeviceState *scp1; DeviceState *misc_gpio; -} SpitzMachineState; +}; +typedef struct SpitzMachineState SpitzMachineState; =20 #define TYPE_SPITZ_MACHINE "spitz-common" #define SPITZ_MACHINE(obj) \ @@ -85,9 +88,10 @@ typedef struct { #define FLASHCTL_NCE (FLASHCTL_CE0 | FLASHCTL_CE1) =20 #define TYPE_SL_NAND "sl-nand" +typedef struct SLNANDState SLNANDState; #define SL_NAND(obj) OBJECT_CHECK(SLNANDState, (obj), TYPE_SL_NAND) =20 -typedef struct { +struct SLNANDState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -96,7 +100,7 @@ typedef struct { uint8_t manf_id; uint8_t chip_id; ECCState ecc; -} SLNANDState; +}; =20 static uint64_t sl_read(void *opaque, hwaddr addr, unsigned size) { @@ -261,10 +265,11 @@ static const int spitz_gpiomap[5] =3D { }; =20 #define TYPE_SPITZ_KEYBOARD "spitz-keyboard" +typedef struct SpitzKeyboardState SpitzKeyboardState; #define SPITZ_KEYBOARD(obj) \ OBJECT_CHECK(SpitzKeyboardState, (obj), TYPE_SPITZ_KEYBOARD) =20 -typedef struct { +struct SpitzKeyboardState { SysBusDevice parent_obj; =20 qemu_irq sense[SPITZ_KEY_SENSE_NUM]; @@ -280,7 +285,7 @@ typedef struct { uint8_t fifo[16]; int fifopos, fifolen; QEMUTimer *kbdtimer; -} SpitzKeyboardState; +}; =20 static void spitz_keyboard_sense_update(SpitzKeyboardState *s) { @@ -580,13 +585,14 @@ static void spitz_keyboard_realize(DeviceState *dev, = Error **errp) #define LCDTG_POLCTRL 0x07 =20 #define TYPE_SPITZ_LCDTG "spitz-lcdtg" +typedef struct SpitzLCDTG SpitzLCDTG; #define SPITZ_LCDTG(obj) OBJECT_CHECK(SpitzLCDTG, (obj), TYPE_SPITZ_LCDTG) =20 -typedef struct { +struct SpitzLCDTG { SSISlave ssidev; uint32_t bl_intensity; uint32_t bl_power; -} SpitzLCDTG; +}; =20 static void spitz_bl_update(SpitzLCDTG *s) { @@ -668,14 +674,15 @@ static void spitz_lcdtg_realize(SSISlave *ssi, Error = **errp) #define SPITZ_GPIO_TP_INT 11 =20 #define TYPE_CORGI_SSP "corgi-ssp" +typedef struct CorgiSSPState CorgiSSPState; #define CORGI_SSP(obj) OBJECT_CHECK(CorgiSSPState, (obj), TYPE_CORGI_SSP) =20 /* "Demux" the signal based on current chipselect */ -typedef struct { +struct CorgiSSPState { SSISlave ssidev; SSIBus *bus[3]; uint32_t enable[3]; -} CorgiSSPState; +}; =20 static uint32_t corgi_ssp_transfer(SSISlave *dev, uint32_t value) { @@ -819,14 +826,15 @@ static void spitz_akita_i2c_setup(PXA2xxState *cpu) * + named GPIO output "adc-temp": the ADC value, to be wired up to the m= ax111x */ #define TYPE_SPITZ_MISC_GPIO "spitz-misc-gpio" +typedef struct SpitzMiscGPIOState SpitzMiscGPIOState; #define SPITZ_MISC_GPIO(obj) \ OBJECT_CHECK(SpitzMiscGPIOState, (obj), TYPE_SPITZ_MISC_GPIO) =20 -typedef struct SpitzMiscGPIOState { +struct SpitzMiscGPIOState { SysBusDevice parent_obj; =20 qemu_irq adc_value; -} SpitzMiscGPIOState; +}; =20 static void spitz_misc_charging(void *opaque, int n, int level) { diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 5f9d080180..d8d7d3a43b 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -27,6 +27,7 @@ #include "migration/vmstate.h" #include "hw/misc/unimp.h" #include "cpu.h" +#include "qom/object.h" =20 #define GPIO_A 0 #define GPIO_B 1 @@ -57,10 +58,11 @@ typedef const struct { /* General purpose timer module. */ =20 #define TYPE_STELLARIS_GPTM "stellaris-gptm" +typedef struct gptm_state gptm_state; #define STELLARIS_GPTM(obj) \ OBJECT_CHECK(gptm_state, (obj), TYPE_STELLARIS_GPTM) =20 -typedef struct gptm_state { +struct gptm_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -80,7 +82,7 @@ typedef struct gptm_state { /* The timers have an alternate output used to trigger the ADC. */ qemu_irq trigger; qemu_irq irq; -} gptm_state; +}; =20 static void gptm_update_irq(gptm_state *s) { @@ -719,10 +721,11 @@ static int stellaris_sys_init(uint32_t base, qemu_irq= irq, /* I2C controller. */ =20 #define TYPE_STELLARIS_I2C "stellaris-i2c" +typedef struct stellaris_i2c_state stellaris_i2c_state; #define STELLARIS_I2C(obj) \ OBJECT_CHECK(stellaris_i2c_state, (obj), TYPE_STELLARIS_I2C) =20 -typedef struct { +struct stellaris_i2c_state { SysBusDevice parent_obj; =20 I2CBus *bus; @@ -735,7 +738,7 @@ typedef struct { uint32_t mimr; uint32_t mris; uint32_t mcr; -} stellaris_i2c_state; +}; =20 #define STELLARIS_I2C_MCS_BUSY 0x01 #define STELLARIS_I2C_MCS_ERROR 0x02 @@ -932,10 +935,11 @@ static void stellaris_i2c_init(Object *obj) #define STELLARIS_ADC_FIFO_FULL 0x1000 =20 #define TYPE_STELLARIS_ADC "stellaris-adc" +typedef struct StellarisADCState stellaris_adc_state; #define STELLARIS_ADC(obj) \ OBJECT_CHECK(stellaris_adc_state, (obj), TYPE_STELLARIS_ADC) =20 -typedef struct StellarisADCState { +struct StellarisADCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -955,7 +959,7 @@ typedef struct StellarisADCState { uint32_t ssctl[4]; uint32_t noise; qemu_irq irq[4]; -} stellaris_adc_state; +}; =20 static uint32_t stellaris_adc_fifo_read(stellaris_adc_state *s, int n) { diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 2639b9ae55..8faeaf8079 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -45,6 +45,7 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "qom/object.h" =20 //#define DEBUG =20 @@ -84,10 +85,11 @@ static struct { /* Interrupt Controller */ =20 #define TYPE_STRONGARM_PIC "strongarm_pic" +typedef struct StrongARMPICState StrongARMPICState; #define STRONGARM_PIC(obj) \ OBJECT_CHECK(StrongARMPICState, (obj), TYPE_STRONGARM_PIC) =20 -typedef struct StrongARMPICState { +struct StrongARMPICState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -98,7 +100,7 @@ typedef struct StrongARMPICState { uint32_t enabled; uint32_t is_fiq; uint32_t int_idle; -} StrongARMPICState; +}; =20 #define ICIP 0x00 #define ICMR 0x04 @@ -252,10 +254,11 @@ static const TypeInfo strongarm_pic_info =3D { * f =3D 32 768 / (RTTR_trim + 1) */ =20 #define TYPE_STRONGARM_RTC "strongarm-rtc" +typedef struct StrongARMRTCState StrongARMRTCState; #define STRONGARM_RTC(obj) \ OBJECT_CHECK(StrongARMRTCState, (obj), TYPE_STRONGARM_RTC) =20 -typedef struct StrongARMRTCState { +struct StrongARMRTCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -268,7 +271,7 @@ typedef struct StrongARMRTCState { QEMUTimer *rtc_hz; qemu_irq rtc_irq; qemu_irq rtc_hz_irq; -} StrongARMRTCState; +}; =20 static inline void strongarm_rtc_int_update(StrongARMRTCState *s) { @@ -478,10 +481,10 @@ static const TypeInfo strongarm_rtc_sysbus_info =3D { #define GAFR 0x1c =20 #define TYPE_STRONGARM_GPIO "strongarm-gpio" +typedef struct StrongARMGPIOInfo StrongARMGPIOInfo; #define STRONGARM_GPIO(obj) \ OBJECT_CHECK(StrongARMGPIOInfo, (obj), TYPE_STRONGARM_GPIO) =20 -typedef struct StrongARMGPIOInfo StrongARMGPIOInfo; struct StrongARMGPIOInfo { SysBusDevice busdev; MemoryRegion iomem; @@ -717,10 +720,10 @@ static const TypeInfo strongarm_gpio_info =3D { #define PPFR 0x10 =20 #define TYPE_STRONGARM_PPC "strongarm-ppc" +typedef struct StrongARMPPCInfo StrongARMPPCInfo; #define STRONGARM_PPC(obj) \ OBJECT_CHECK(StrongARMPPCInfo, (obj), TYPE_STRONGARM_PPC) =20 -typedef struct StrongARMPPCInfo StrongARMPPCInfo; struct StrongARMPPCInfo { SysBusDevice parent_obj; =20 @@ -918,10 +921,11 @@ static const TypeInfo strongarm_ppc_info =3D { #define RX_FIFO_ROR (1 << 10) =20 #define TYPE_STRONGARM_UART "strongarm-uart" +typedef struct StrongARMUARTState StrongARMUARTState; #define STRONGARM_UART(obj) \ OBJECT_CHECK(StrongARMUARTState, (obj), TYPE_STRONGARM_UART) =20 -typedef struct StrongARMUARTState { +struct StrongARMUARTState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -945,7 +949,7 @@ typedef struct StrongARMUARTState { bool wait_break_end; QEMUTimer *rx_timeout_timer; QEMUTimer *tx_timer; -} StrongARMUARTState; +}; =20 static void strongarm_uart_update_status(StrongARMUARTState *s) { @@ -1349,10 +1353,11 @@ static const TypeInfo strongarm_uart_info =3D { /* Synchronous Serial Ports */ =20 #define TYPE_STRONGARM_SSP "strongarm-ssp" +typedef struct StrongARMSSPState StrongARMSSPState; #define STRONGARM_SSP(obj) \ OBJECT_CHECK(StrongARMSSPState, (obj), TYPE_STRONGARM_SSP) =20 -typedef struct StrongARMSSPState { +struct StrongARMSSPState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -1365,7 +1370,7 @@ typedef struct StrongARMSSPState { uint16_t rx_fifo[8]; uint8_t rx_level; uint8_t rx_start; -} StrongARMSSPState; +}; =20 #define SSCR0 0x60 /* SSP Control register 0 */ #define SSCR1 0x64 /* SSP Control register 1 */ diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 90eef1f14d..6ec83a2e2d 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -25,6 +25,7 @@ #include "hw/ssi/ssi.h" #include "hw/sysbus.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 #define TOSA_RAM 0x04000000 #define TOSA_ROM 0x00800000 @@ -74,12 +75,13 @@ static void tosa_microdrive_attach(PXA2xxState *cpu) */ =20 #define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio" +typedef struct TosaMiscGPIOState TosaMiscGPIOState; #define TOSA_MISC_GPIO(obj) \ OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO) =20 -typedef struct TosaMiscGPIOState { +struct TosaMiscGPIOState { SysBusDevice parent_obj; -} TosaMiscGPIOState; +}; =20 static void tosa_gpio_leds(void *opaque, int line, int level) { @@ -170,14 +172,15 @@ static void tosa_ssp_realize(SSISlave *dev, Error **e= rrp) } =20 #define TYPE_TOSA_DAC "tosa_dac" +typedef struct TosaDACState TosaDACState; #define TOSA_DAC(obj) OBJECT_CHECK(TosaDACState, (obj), TYPE_TOSA_DAC) =20 -typedef struct { +struct TosaDACState { I2CSlave parent_obj; =20 int len; char buf[3]; -} TosaDACState; +}; =20 static int tosa_dac_send(I2CSlave *i2c, uint8_t data) { diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 9127579984..0e2d74cef2 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -26,6 +26,7 @@ #include "qemu/error-report.h" #include "hw/char/pl011.h" #include "hw/sd/sd.h" +#include "qom/object.h" =20 #define VERSATILE_FLASH_ADDR 0x34000000 #define VERSATILE_FLASH_SIZE (64 * 1024 * 1024) @@ -34,10 +35,11 @@ /* Primary interrupt controller. */ =20 #define TYPE_VERSATILE_PB_SIC "versatilepb_sic" +typedef struct vpb_sic_state vpb_sic_state; #define VERSATILE_PB_SIC(obj) \ OBJECT_CHECK(vpb_sic_state, (obj), TYPE_VERSATILE_PB_SIC) =20 -typedef struct vpb_sic_state { +struct vpb_sic_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -46,7 +48,7 @@ typedef struct vpb_sic_state { uint32_t pic_enable; qemu_irq parent[32]; int irq; -} vpb_sic_state; +}; =20 static const VMStateDescription vmstate_vpb_sic =3D { .name =3D "versatilepb_sic", diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 95405f5940..4c2c377823 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -44,6 +44,7 @@ #include "hw/cpu/a15mpcore.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" +#include "qom/object.h" =20 #define VEXPRESS_BOARD_ID 0x8e0 #define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024) @@ -166,16 +167,18 @@ static hwaddr motherboard_aseries_map[] =3D { =20 typedef struct VEDBoardInfo VEDBoardInfo; =20 -typedef struct { +struct VexpressMachineClass { MachineClass parent; VEDBoardInfo *daughterboard; -} VexpressMachineClass; +}; +typedef struct VexpressMachineClass VexpressMachineClass; =20 -typedef struct { +struct VexpressMachineState { MachineState parent; bool secure; bool virt; -} VexpressMachineState; +}; +typedef struct VexpressMachineState VexpressMachineState; =20 #define TYPE_VEXPRESS_MACHINE "vexpress" #define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME("vexpress-a9") diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 969ef0727c..bce99ef7be 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -37,8 +37,10 @@ #include "hw/cpu/a9mpcore.h" #include "hw/qdev-clock.h" #include "sysemu/reset.h" +#include "qom/object.h" =20 #define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") +typedef struct ZynqMachineState ZynqMachineState; #define ZYNQ_MACHINE(obj) \ OBJECT_CHECK(ZynqMachineState, (obj), TYPE_ZYNQ_MACHINE) =20 @@ -84,10 +86,10 @@ static const int dma_irqs[8] =3D { 0xe3401000 + ARMV7_IMM16(extract32((val), 16, 16)), /* movt r1 ... */ \ 0xe5801000 + (addr) =20 -typedef struct ZynqMachineState { +struct ZynqMachineState { MachineState parent; Clock *ps_clk; -} ZynqMachineState; +}; =20 static void zynq_write_board_setup(ARMCPU *cpu, const struct arm_boot_info *info) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 4b3152ee77..ffa9dd476b 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -22,12 +22,14 @@ #include "cpu.h" #include "hw/qdev-properties.h" #include "hw/arm/xlnx-versal.h" +#include "qom/object.h" =20 #define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt") +typedef struct VersalVirt VersalVirt; #define XLNX_VERSAL_VIRT_MACHINE(obj) \ OBJECT_CHECK(VersalVirt, (obj), TYPE_XLNX_VERSAL_VIRT_MACHINE) =20 -typedef struct VersalVirt { +struct VersalVirt { MachineState parent_obj; =20 Versal soc; @@ -45,7 +47,7 @@ typedef struct VersalVirt { struct { bool secure; } cfg; -} VersalVirt; +}; =20 static void fdt_create(VersalVirt *s) { diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 672d9d4bd1..74f48325ac 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -24,8 +24,9 @@ #include "qemu/log.h" #include "sysemu/qtest.h" #include "sysemu/device_tree.h" +#include "qom/object.h" =20 -typedef struct XlnxZCU102 { +struct XlnxZCU102 { MachineState parent_obj; =20 XlnxZynqMPState soc; @@ -34,7 +35,8 @@ typedef struct XlnxZCU102 { bool virt; =20 struct arm_boot_info binfo; -} XlnxZCU102; +}; +typedef struct XlnxZCU102 XlnxZCU102; =20 #define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102") #define ZCU102_MACHINE(obj) \ diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 9a9bbc653b..9c69481269 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -26,6 +26,7 @@ #include "exec/address-spaces.h" #include "sysemu/qtest.h" #include "cpu.h" +#include "qom/object.h" =20 #ifdef DEBUG_Z2 #define DPRINTF(fmt, ...) \ @@ -102,14 +103,15 @@ static struct arm_boot_info z2_binfo =3D { #define Z2_GPIO_KEY_ON 1 #define Z2_GPIO_LCD_CS 88 =20 -typedef struct { +struct ZipitLCD { SSISlave ssidev; int32_t selected; int32_t enabled; uint8_t buf[3]; uint32_t cur_reg; int pos; -} ZipitLCD; +}; +typedef struct ZipitLCD ZipitLCD; =20 #define TYPE_ZIPIT_LCD "zipit-lcd" #define ZIPIT_LCD(obj) OBJECT_CHECK(ZipitLCD, (obj), TYPE_ZIPIT_LCD) @@ -195,14 +197,15 @@ static const TypeInfo zipit_lcd_info =3D { }; =20 #define TYPE_AER915 "aer915" +typedef struct AER915State AER915State; #define AER915(obj) OBJECT_CHECK(AER915State, (obj), TYPE_AER915) =20 -typedef struct AER915State { +struct AER915State { I2CSlave parent_obj; =20 int len; uint8_t buf[3]; -} AER915State; +}; =20 static int aer915_send(I2CSlave *i2c, uint8_t data) { diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 38522cf0ba..9614419b7a 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -25,6 +25,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/dma.h" +#include "qom/object.h" =20 enum { AC97_Reset =3D 0x00, @@ -126,6 +127,7 @@ enum { #define MUTE_SHIFT 15 =20 #define TYPE_AC97 "AC97" +typedef struct AC97LinkState AC97LinkState; #define AC97(obj) \ OBJECT_CHECK(AC97LinkState, (obj), TYPE_AC97) =20 @@ -158,7 +160,7 @@ typedef struct AC97BusMasterRegs { BD bd; } AC97BusMasterRegs; =20 -typedef struct AC97LinkState { +struct AC97LinkState { PCIDevice dev; QEMUSoundCard card; uint32_t glob_cnt; @@ -175,7 +177,7 @@ typedef struct AC97LinkState { int bup_flag; MemoryRegion io_nam; MemoryRegion io_nabm; -} AC97LinkState; +}; =20 enum { BUP_SET =3D 1, diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 65dff5b6fc..a216fe1925 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -29,6 +29,7 @@ #include "audio/audio.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 //#define DEBUG =20 @@ -51,9 +52,10 @@ #define SHIFT 1 =20 #define TYPE_ADLIB "adlib" +typedef struct AdlibState AdlibState; #define ADLIB(obj) OBJECT_CHECK(AdlibState, (obj), TYPE_ADLIB) =20 -typedef struct { +struct AdlibState { ISADevice parent_obj; =20 QEMUSoundCard card; @@ -73,7 +75,7 @@ typedef struct { QEMUAudioTimeStamp ats; FM_OPL *opl; PortioList port_list; -} AdlibState; +}; =20 static void adlib_stop_opl_timer (AdlibState *s, size_t n) { diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c index 11a6328fc2..2b868051c3 100644 --- a/hw/audio/cs4231.c +++ b/hw/audio/cs4231.c @@ -27,6 +27,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 /* * In addition to Crystal CS4231 there is a DMA controller on Sparc. @@ -37,17 +38,18 @@ #define CS_MAXDREG (CS_DREGS - 1) =20 #define TYPE_CS4231 "SUNW,CS4231" +typedef struct CSState CSState; #define CS4231(obj) \ OBJECT_CHECK(CSState, (obj), TYPE_CS4231) =20 -typedef struct CSState { +struct CSState { SysBusDevice parent_obj; =20 MemoryRegion iomem; qemu_irq irq; uint32_t regs[CS_REGS]; uint8_t dregs[CS_DREGS]; -} CSState; +}; =20 #define CS_RAP(s) ((s)->regs[0] & CS_MAXDREG) #define CS_VER 0xa0 diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 59705a8d47..fc064a93d7 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -32,6 +32,7 @@ #include "qemu/module.h" #include "qemu/timer.h" #include "qapi/error.h" +#include "qom/object.h" =20 /* Missing features: @@ -62,9 +63,10 @@ static struct { #define CS_DREGS 32 =20 #define TYPE_CS4231A "cs4231a" +typedef struct CSState CSState; #define CS4231A(obj) OBJECT_CHECK (CSState, (obj), TYPE_CS4231A) =20 -typedef struct CSState { +struct CSState { ISADevice dev; QEMUSoundCard card; MemoryRegion ioports; @@ -82,7 +84,7 @@ typedef struct CSState { int aci_counter; SWVoiceOut *voice; int16_t *tab; -} CSState; +}; =20 #define MODE2 (1 << 6) #define MCE (1 << 6) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 4255463a49..bd620d5ee2 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -33,6 +33,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/dma.h" +#include "qom/object.h" =20 /* Missing stuff: SCTRL_P[12](END|ST)INC @@ -263,7 +264,7 @@ struct chan { uint32_t frame_cnt; }; =20 -typedef struct ES1370State { +struct ES1370State { PCIDevice dev; QEMUSoundCard card; MemoryRegion io; @@ -276,7 +277,8 @@ typedef struct ES1370State { uint32_t mempage; uint32_t codec; uint32_t sctl; -} ES1370State; +}; +typedef struct ES1370State ES1370State; =20 struct chan_bits { uint32_t ctl_en; diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 7e4a8cadad..3cd62d43d7 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -33,6 +33,7 @@ #include "migration/vmstate.h" #include "gusemu.h" #include "gustate.h" +#include "qom/object.h" =20 #define dolog(...) AUD_log ("audio", __VA_ARGS__) #ifdef DEBUG @@ -42,9 +43,10 @@ #endif =20 #define TYPE_GUS "gus" +typedef struct GUSState GUSState; #define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS) =20 -typedef struct GUSState { +struct GUSState { ISADevice dev; GUSEmuState emu; QEMUSoundCard card; @@ -60,7 +62,7 @@ typedef struct GUSState { IsaDma *isa_dma; PortioList portio_list1; PortioList portio_list2; -} GUSState; +}; =20 static uint32_t gus_readb(void *opaque, uint32_t nport) { diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 2d16448181..8dee2915be 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -26,6 +26,7 @@ #include "intel-hda-defs.h" #include "audio/audio.h" #include "trace.h" +#include "qom/object.h" =20 /* -----------------------------------------------------------------------= --- */ =20 diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index f6cea49686..de30443c2e 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -32,6 +32,7 @@ #include "intel-hda-defs.h" #include "sysemu/dma.h" #include "qapi/error.h" +#include "qom/object.h" =20 /* --------------------------------------------------------------------- */ /* hda bus */ diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index 8dfacec693..5f2e7f3b73 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -19,6 +19,7 @@ #include "audio/audio.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define MP_AUDIO_SIZE 0x00001000 =20 @@ -42,10 +43,11 @@ #define MP_AUDIO_CLOCK_24MHZ (1 << 9) #define MP_AUDIO_MONO (1 << 14) =20 +typedef struct mv88w8618_audio_state mv88w8618_audio_state; #define MV88W8618_AUDIO(obj) \ OBJECT_CHECK(mv88w8618_audio_state, (obj), TYPE_MV88W8618_AUDIO) =20 -typedef struct mv88w8618_audio_state { +struct mv88w8618_audio_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -60,7 +62,7 @@ typedef struct mv88w8618_audio_state { uint32_t last_free; uint32_t clock_div; void *wm; -} mv88w8618_audio_state; +}; =20 static void mv88w8618_audio_callback(void *opaque, int free_out, int free_= in) { diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c index 0fa38adbe2..4eacd4071a 100644 --- a/hw/audio/milkymist-ac97.c +++ b/hw/audio/milkymist-ac97.c @@ -29,6 +29,7 @@ #include "audio/audio.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 enum { R_AC97_CTRL =3D 0, @@ -55,6 +56,7 @@ enum { }; =20 #define TYPE_MILKYMIST_AC97 "milkymist-ac97" +typedef struct MilkymistAC97State MilkymistAC97State; #define MILKYMIST_AC97(obj) \ OBJECT_CHECK(MilkymistAC97State, (obj), TYPE_MILKYMIST_AC97) =20 @@ -74,7 +76,6 @@ struct MilkymistAC97State { qemu_irq dmar_irq; qemu_irq dmaw_irq; }; -typedef struct MilkymistAC97State MilkymistAC97State; =20 static void update_voices(MilkymistAC97State *s) { diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index ea539e7605..57edbe652c 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -33,15 +33,17 @@ #include "migration/vmstate.h" #include "hw/audio/pcspk.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define PCSPK_BUF_LEN 1792 #define PCSPK_SAMPLE_RATE 32000 #define PCSPK_MAX_FREQ (PCSPK_SAMPLE_RATE >> 1) #define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ) =20 +typedef struct PCSpkState PCSpkState; #define PC_SPEAKER(obj) OBJECT_CHECK(PCSpkState, (obj), TYPE_PC_SPEAKER) =20 -typedef struct { +struct PCSpkState { ISADevice parent_obj; =20 MemoryRegion ioport; @@ -56,7 +58,7 @@ typedef struct { uint8_t data_on; uint8_t dummy_refresh_clock; bool migrate; -} PCSpkState; +}; =20 static const char *s_spk =3D "pcspk"; static PCSpkState *pcspk_state; diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c index c3d3eab6ed..e514a8cd70 100644 --- a/hw/audio/pl041.c +++ b/hw/audio/pl041.c @@ -30,6 +30,7 @@ #include "pl041.h" #include "lm4549.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #if 0 #define PL041_DEBUG_LEVEL 1 @@ -77,9 +78,10 @@ typedef struct { } pl041_channel; =20 #define TYPE_PL041 "pl041" +typedef struct PL041State PL041State; #define PL041(obj) OBJECT_CHECK(PL041State, (obj), TYPE_PL041) =20 -typedef struct PL041State { +struct PL041State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -90,7 +92,7 @@ typedef struct PL041State { pl041_regfile regs; pl041_channel fifo1; lm4549_state codec; -} PL041State; +}; =20 =20 static const unsigned char pl041_default_id[8] =3D { diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 2d9e50f99b..840f743e41 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -34,6 +34,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define dolog(...) AUD_log ("sb16", __VA_ARGS__) =20 @@ -49,9 +50,10 @@ static const char e3[] =3D "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992."; =20 #define TYPE_SB16 "sb16" +typedef struct SB16State SB16State; #define SB16(obj) OBJECT_CHECK (SB16State, (obj), TYPE_SB16) =20 -typedef struct SB16State { +struct SB16State { ISADevice parent_obj; =20 QEMUSoundCard card; @@ -112,7 +114,7 @@ typedef struct SB16State { int mixer_nreg; uint8_t mixer_regs[256]; PortioList portio_list; -} SB16State; +}; =20 static void SB_audio_callback (void *opaque, int free); =20 diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 92b2902a10..dae23f43a4 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -13,6 +13,7 @@ #include "qemu/module.h" #include "hw/audio/wm8750.h" #include "audio/audio.h" +#include "qom/object.h" =20 #define IN_PORT_N 3 #define OUT_PORT_N 3 @@ -26,9 +27,10 @@ typedef struct { int dac_hz; } WMRate; =20 +typedef struct WM8750State WM8750State; #define WM8750(obj) OBJECT_CHECK(WM8750State, (obj), TYPE_WM8750) =20 -typedef struct WM8750State { +struct WM8750State { I2CSlave parent_obj; =20 uint8_t i2c_data[2]; @@ -54,7 +56,7 @@ typedef struct WM8750State { const WMRate *rate; uint8_t rate_vmstate; int adc_hz, dac_hz, ext_adc_hz, ext_dac_hz, master; -} WM8750State; +}; =20 /* pow(10.0, -i / 20.0) * 255, i =3D 0..42 */ static const uint8_t wm8750_vol_db_table[] =3D { diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c index 65093ab6fd..c24183c07f 100644 --- a/hw/avr/arduino.c +++ b/hw/avr/arduino.c @@ -15,21 +15,24 @@ #include "hw/boards.h" #include "atmega.h" #include "boot.h" +#include "qom/object.h" =20 -typedef struct ArduinoMachineState { +struct ArduinoMachineState { /*< private >*/ MachineState parent_obj; /*< public >*/ AtmegaMcuState mcu; -} ArduinoMachineState; +}; +typedef struct ArduinoMachineState ArduinoMachineState; =20 -typedef struct ArduinoMachineClass { +struct ArduinoMachineClass { /*< private >*/ MachineClass parent_class; /*< public >*/ const char *mcu_type; uint64_t xtal_hz; -} ArduinoMachineClass; +}; +typedef struct ArduinoMachineClass ArduinoMachineClass; =20 #define TYPE_ARDUINO_MACHINE \ MACHINE_TYPE_NAME("arduino") diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c index 7131224431..c3b8e05110 100644 --- a/hw/avr/atmega.c +++ b/hw/avr/atmega.c @@ -17,6 +17,7 @@ #include "sysemu/sysemu.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "qom/object.h" #include "hw/boards.h" /* FIXME memory_region_allocate_system_memory for s= ram */ #include "hw/misc/unimp.h" #include "atmega.h" @@ -45,7 +46,7 @@ typedef struct { bool is_timer16; } peripheral_cfg; =20 -typedef struct AtmegaMcuClass { +struct AtmegaMcuClass { /*< private >*/ SysBusDeviceClass parent_class; /*< public >*/ @@ -59,7 +60,8 @@ typedef struct AtmegaMcuClass { size_t adc_count; const uint8_t *irq; const peripheral_cfg *dev; -} AtmegaMcuClass; +}; +typedef struct AtmegaMcuClass AtmegaMcuClass; =20 #define ATMEGA_MCU_CLASS(klass) \ OBJECT_CLASS_CHECK(AtmegaMcuClass, (klass), TYPE_ATMEGA_MCU) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index e9ed3eef45..70bfb136e4 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -46,6 +46,7 @@ #include "qemu/main-loop.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 /********************************************************/ /* debug Floppy devices */ @@ -64,16 +65,17 @@ /* qdev floppy bus */ =20 #define TYPE_FLOPPY_BUS "floppy-bus" +typedef struct FloppyBus FloppyBus; #define FLOPPY_BUS(obj) OBJECT_CHECK(FloppyBus, (obj), TYPE_FLOPPY_BUS) =20 typedef struct FDCtrl FDCtrl; typedef struct FDrive FDrive; static FDrive *get_drv(FDCtrl *fdctrl, int unit); =20 -typedef struct FloppyBus { +struct FloppyBus { BusState bus; FDCtrl *fdc; -} FloppyBus; +}; =20 static const TypeInfo floppy_bus_info =3D { .name =3D TYPE_FLOPPY_BUS, @@ -494,15 +496,16 @@ static const BlockDevOps fd_block_ops =3D { =20 =20 #define TYPE_FLOPPY_DRIVE "floppy" +typedef struct FloppyDrive FloppyDrive; #define FLOPPY_DRIVE(obj) \ OBJECT_CHECK(FloppyDrive, (obj), TYPE_FLOPPY_DRIVE) =20 -typedef struct FloppyDrive { +struct FloppyDrive { DeviceState qdev; uint32_t unit; BlockConf conf; FloppyDriveType type; -} FloppyDrive; +}; =20 static Property floppy_drive_properties[] =3D { DEFINE_PROP_UINT32("unit", FloppyDrive, unit, -1), @@ -886,19 +889,21 @@ static FloppyDriveType get_fallback_drive_type(FDrive= *drv) } =20 #define TYPE_SYSBUS_FDC "base-sysbus-fdc" +typedef struct FDCtrlSysBus FDCtrlSysBus; #define SYSBUS_FDC(obj) OBJECT_CHECK(FDCtrlSysBus, (obj), TYPE_SYSBUS_FDC) =20 -typedef struct FDCtrlSysBus { +struct FDCtrlSysBus { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ =20 struct FDCtrl state; -} FDCtrlSysBus; +}; =20 +typedef struct FDCtrlISABus FDCtrlISABus; #define ISA_FDC(obj) OBJECT_CHECK(FDCtrlISABus, (obj), TYPE_ISA_FDC) =20 -typedef struct FDCtrlISABus { +struct FDCtrlISABus { ISADevice parent_obj; =20 uint32_t iobase; @@ -907,7 +912,7 @@ typedef struct FDCtrlISABus { struct FDCtrl state; int32_t bootindexA; int32_t bootindexB; -} FDCtrlISABus; +}; =20 static uint32_t fdctrl_read (void *opaque, uint32_t reg) { diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 15824450cd..9de4f9b274 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -33,6 +33,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "trace.h" +#include "qom/object.h" =20 /* Fields for FlashPartInfo->flags */ =20 @@ -414,7 +415,7 @@ typedef enum { =20 #define M25P80_INTERNAL_DATA_BUFFER_SZ 16 =20 -typedef struct Flash { +struct Flash { SSISlave parent_obj; =20 BlockBackend *blk; @@ -454,12 +455,14 @@ typedef struct Flash { =20 const FlashPartInfo *pi; =20 -} Flash; +}; +typedef struct Flash Flash; =20 -typedef struct M25P80Class { +struct M25P80Class { SSISlaveClass parent_class; FlashPartInfo *pi; -} M25P80Class; +}; +typedef struct M25P80Class M25P80Class; =20 #define TYPE_M25P80 "m25p80-generic" #define M25P80(obj) \ diff --git a/hw/block/nand.c b/hw/block/nand.c index 654e0cb5d1..7c7a08b7aa 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -27,6 +27,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 # define NAND_CMD_READ0 0x00 # define NAND_CMD_READ1 0x01 diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 898ac563a3..5fe235d11d 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -31,6 +31,7 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* 11 for 2kB-page OneNAND ("2nd generation") and 10 for 1kB-page chips */ #define PAGE_SHIFT 11 @@ -39,9 +40,10 @@ #define BLOCK_SHIFT (PAGE_SHIFT + 6) =20 #define TYPE_ONE_NAND "onenand" +typedef struct OneNANDState OneNANDState; #define ONE_NAND(obj) OBJECT_CHECK(OneNANDState, (obj), TYPE_ONE_NAND) =20 -typedef struct OneNANDState { +struct OneNANDState { SysBusDevice parent_obj; =20 struct { @@ -85,7 +87,7 @@ typedef struct OneNANDState { int secs_cur; int blocks; uint8_t *blockwp; -} OneNANDState; +}; =20 enum { ONEN_BUF_BLOCK =3D 0, diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c index c8d938efb5..219e88efee 100644 --- a/hw/char/debugcon.c +++ b/hw/char/debugcon.c @@ -30,8 +30,10 @@ #include "chardev/char-fe.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon" +typedef struct ISADebugconState ISADebugconState; #define ISA_DEBUGCON_DEVICE(obj) \ OBJECT_CHECK(ISADebugconState, (obj), TYPE_ISA_DEBUGCON_DEVICE) =20 @@ -43,12 +45,12 @@ typedef struct DebugconState { uint32_t readback; } DebugconState; =20 -typedef struct ISADebugconState { +struct ISADebugconState { ISADevice parent_obj; =20 uint32_t iobase; DebugconState state; -} ISADebugconState; +}; =20 static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val, unsigned width) diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index 947bdb649a..9ca9f21c4d 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -29,6 +29,7 @@ #include "chardev/char-fe.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define D(x) =20 @@ -49,10 +50,11 @@ #define STAT_TR_RDY 24 =20 #define TYPE_ETRAX_FS_SERIAL "etraxfs,serial" +typedef struct ETRAXSerial ETRAXSerial; #define ETRAX_SERIAL(obj) \ OBJECT_CHECK(ETRAXSerial, (obj), TYPE_ETRAX_FS_SERIAL) =20 -typedef struct ETRAXSerial { +struct ETRAXSerial { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -67,7 +69,7 @@ typedef struct ETRAXSerial { =20 /* Control registers. */ uint32_t regs[R_MAX]; -} ETRAXSerial; +}; =20 static void ser_update_irq(ETRAXSerial *s) { diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index 9c8ab3a77d..e3a21dfdb8 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -34,6 +34,7 @@ #include "hw/qdev-properties.h" =20 #include "trace.h" +#include "qom/object.h" =20 /* * Offsets for UART registers relative to SFR base address @@ -138,10 +139,11 @@ typedef struct { } Exynos4210UartFIFO; =20 #define TYPE_EXYNOS4210_UART "exynos4210.uart" +typedef struct Exynos4210UartState Exynos4210UartState; #define EXYNOS4210_UART(obj) \ OBJECT_CHECK(Exynos4210UartState, (obj), TYPE_EXYNOS4210_UART) =20 -typedef struct Exynos4210UartState { +struct Exynos4210UartState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -159,7 +161,7 @@ typedef struct Exynos4210UartState { =20 uint32_t channel; =20 -} Exynos4210UartState; +}; =20 =20 /* Used only for tracing */ diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index 16d0feac59..f48ad21c7c 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -31,6 +31,7 @@ #include "chardev/char-fe.h" =20 #include "trace.h" +#include "qom/object.h" =20 #define UART_REG_SIZE 20 /* Size of memory mapped registers */ =20 @@ -72,10 +73,11 @@ =20 #define FIFO_LENGTH 1024 =20 +typedef struct UART UART; #define GRLIB_APB_UART(obj) \ OBJECT_CHECK(UART, (obj), TYPE_GRLIB_APB_UART) =20 -typedef struct UART { +struct UART { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -91,7 +93,7 @@ typedef struct UART { char buffer[FIFO_LENGTH]; int len; int current; -} UART; +}; =20 static int uart_data_to_read(UART *uart) { diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index d7c497b939..c7ea7f8da9 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -16,6 +16,7 @@ #include "qemu/bitops.h" #include "qemu/module.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 /* #define DEBUG_IPOCTAL */ =20 diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c index 3f34861233..e7af76ad1a 100644 --- a/hw/char/lm32_juart.c +++ b/hw/char/lm32_juart.c @@ -26,6 +26,7 @@ =20 #include "hw/char/lm32_juart.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 enum { LM32_JUART_MIN_SAVE_VERSION =3D 0, @@ -41,6 +42,7 @@ enum { JRX_FULL =3D (1<<8), }; =20 +typedef struct LM32JuartState LM32JuartState; #define LM32_JUART(obj) OBJECT_CHECK(LM32JuartState, (obj), TYPE_LM32_JUAR= T) =20 struct LM32JuartState { @@ -51,7 +53,6 @@ struct LM32JuartState { uint32_t jtx; uint32_t jrx; }; -typedef struct LM32JuartState LM32JuartState; =20 uint32_t lm32_juart_get_jtx(DeviceState *d) { diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index b0b1092889..8aff78592b 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -31,6 +31,7 @@ #include "chardev/char-fe.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 enum { R_RXTX =3D 0, @@ -94,6 +95,7 @@ enum { }; =20 #define TYPE_LM32_UART "lm32-uart" +typedef struct LM32UartState LM32UartState; #define LM32_UART(obj) OBJECT_CHECK(LM32UartState, (obj), TYPE_LM32_UART) =20 struct LM32UartState { @@ -105,7 +107,6 @@ struct LM32UartState { =20 uint32_t regs[R_MAX]; }; -typedef struct LM32UartState LM32UartState; =20 static void uart_update_irq(LM32UartState *s) { diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index 8d1b7f2bca..d6745da72a 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -14,8 +14,9 @@ #include "hw/m68k/mcf.h" #include "hw/qdev-properties.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 -typedef struct { +struct mcf_uart_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -33,7 +34,8 @@ typedef struct { int rx_enabled; qemu_irq irq; CharBackend chr; -} mcf_uart_state; +}; +typedef struct mcf_uart_state mcf_uart_state; =20 #define TYPE_MCF_UART "mcf-uart" #define MCF_UART(obj) OBJECT_CHECK(mcf_uart_state, (obj), TYPE_MCF_UART) diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index 1439efb42a..300a9150cf 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -30,6 +30,7 @@ #include "chardev/char-fe.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 enum { R_RXTX =3D 0, @@ -57,6 +58,7 @@ enum { }; =20 #define TYPE_MILKYMIST_UART "milkymist-uart" +typedef struct MilkymistUartState MilkymistUartState; #define MILKYMIST_UART(obj) \ OBJECT_CHECK(MilkymistUartState, (obj), TYPE_MILKYMIST_UART) =20 @@ -69,7 +71,6 @@ struct MilkymistUartState { =20 uint32_t regs[R_MAX]; }; -typedef struct MilkymistUartState MilkymistUartState; =20 static void uart_update_irq(MilkymistUartState *s) { diff --git a/hw/char/parallel.c b/hw/char/parallel.c index c0f34bf924..73ac5ee9e3 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -37,6 +37,7 @@ #include "sysemu/reset.h" #include "sysemu/sysemu.h" #include "trace.h" +#include "qom/object.h" =20 //#define DEBUG_PARALLEL =20 @@ -92,17 +93,18 @@ typedef struct ParallelState { } ParallelState; =20 #define TYPE_ISA_PARALLEL "isa-parallel" +typedef struct ISAParallelState ISAParallelState; #define ISA_PARALLEL(obj) \ OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL) =20 -typedef struct ISAParallelState { +struct ISAParallelState { ISADevice parent_obj; =20 uint32_t index; uint32_t iobase; uint32_t isairq; ParallelState state; -} ISAParallelState; +}; =20 static void parallel_update_irq(ParallelState *s) { diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 5848b4e9c5..0b77af68a4 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -24,6 +24,7 @@ #include "hw/s390x/event-facility.h" #include "hw/qdev-properties.h" #include "hw/s390x/ebcdic.h" +#include "qom/object.h" =20 #define SIZE_BUFFER 4096 #define NEWLINE "\n" @@ -37,14 +38,15 @@ typedef struct OprtnsCommand { /* max size for line-mode data in 4K SCCB page */ #define SIZE_CONSOLE_BUFFER (SCCB_DATA_LEN - sizeof(OprtnsCommand)) =20 -typedef struct SCLPConsoleLM { +struct SCLPConsoleLM { SCLPEvent event; CharBackend chr; bool echo; /* immediate echo of input if true = */ uint32_t write_errors; /* errors writing to char layer = */ uint32_t length; /* length of byte stream in buffer = */ uint8_t buf[SIZE_CONSOLE_BUFFER]; -} SCLPConsoleLM; +}; +typedef struct SCLPConsoleLM SCLPConsoleLM; =20 #define TYPE_SCLPLM_CONSOLE "sclplmconsole" #define SCLPLM_CONSOLE(obj) \ diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index d6f7da0818..3919368570 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -22,6 +22,7 @@ #include "hw/qdev-properties.h" #include "hw/s390x/event-facility.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 typedef struct ASCIIConsoleData { EventBufferHeader ebh; @@ -31,7 +32,7 @@ typedef struct ASCIIConsoleData { /* max size for ASCII data in 4K SCCB page */ #define SIZE_BUFFER_VT220 4080 =20 -typedef struct SCLPConsole { +struct SCLPConsole { SCLPEvent event; CharBackend chr; uint8_t iov[SIZE_BUFFER_VT220]; @@ -40,7 +41,8 @@ typedef struct SCLPConsole { uint32_t iov_data_len; /* length of byte stream in buffer = */ uint32_t iov_sclp_rest; /* length of byte stream not read via SCLP = */ bool notify; /* qemu_notify_event() req'd if true = */ -} SCLPConsole; +}; +typedef struct SCLPConsole SCLPConsole; =20 #define TYPE_SCLP_CONSOLE "sclpconsole" #define SCLP_CONSOLE(obj) \ diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index b4c65949cd..3d1c9a2d75 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -32,17 +32,19 @@ #include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 +typedef struct ISASerialState ISASerialState; #define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIA= L) =20 -typedef struct ISASerialState { +struct ISASerialState { ISADevice parent_obj; =20 uint32_t index; uint32_t iobase; uint32_t isairq; SerialState state; -} ISASerialState; +}; =20 static const int isa_serial_io[MAX_ISA_SERIAL_PORTS] =3D { 0x3f8, 0x2f8, 0x3e8, 0x2e8 diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index cd56924a43..649f08c20e 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -33,12 +33,14 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 -typedef struct PCISerialState { +struct PCISerialState { PCIDevice dev; SerialState state; uint8_t prog_if; -} PCISerialState; +}; +typedef struct PCISerialState PCISerialState; =20 #define TYPE_PCI_SERIAL "pci-serial" #define PCI_SERIAL(s) OBJECT_CHECK(PCISerialState, (s), TYPE_PCI_SERIAL) diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index 464a52342a..9944933c16 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -8,15 +8,17 @@ #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define VTERM_BUFSIZE 16 =20 -typedef struct SpaprVioVty { +struct SpaprVioVty { SpaprVioDevice sdev; CharBackend chardev; uint32_t in, out; uint8_t buf[VTERM_BUFSIZE]; -} SpaprVioVty; +}; +typedef struct SpaprVioVty SpaprVioVty; =20 #define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty" #define VIO_SPAPR_VTY_DEVICE(obj) \ diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 2c47ebf007..4efd6a9433 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -17,6 +17,7 @@ #include "chardev/char-fe.h" #include "hw/qdev-properties.h" #include "hw/s390x/3270-ccw.h" +#include "qom/object.h" =20 /* Enough spaces for different window sizes. */ #define INPUT_BUFFER_SIZE 1000 @@ -26,7 +27,7 @@ */ #define OUTPUT_BUFFER_SIZE 2051 =20 -typedef struct Terminal3270 { +struct Terminal3270 { EmulatedCcw3270Device cdev; CharBackend chr; uint8_t inv[INPUT_BUFFER_SIZE]; @@ -34,7 +35,8 @@ typedef struct Terminal3270 { int in_len; bool handshake_done; guint timer_tag; -} Terminal3270; +}; +typedef struct Terminal3270 Terminal3270; =20 #define TYPE_TERMINAL_3270 "x-terminal3270" #define TERMINAL_3270(obj) \ diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index 4f46753ea3..31144c68b6 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -19,17 +19,19 @@ #include "hw/virtio/virtio-serial.h" #include "qapi/error.h" #include "qapi/qapi-events-char.h" +#include "qom/object.h" =20 #define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport" +typedef struct VirtConsole VirtConsole; #define VIRTIO_CONSOLE(obj) \ OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE_SERIAL_PORT) =20 -typedef struct VirtConsole { +struct VirtConsole { VirtIOSerialPort parent_obj; =20 CharBackend chr; guint watch; -} VirtConsole; +}; =20 /* * Callback function that's called from chardevs when backend becomes diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index ae4ccd00c7..e7ab97d58d 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -29,6 +29,7 @@ #include "hw/sysbus.h" #include "qemu/module.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 #define DUART(x) =20 @@ -52,10 +53,11 @@ #define CONTROL_IE 0x10 =20 #define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite" +typedef struct XilinxUARTLite XilinxUARTLite; #define XILINX_UARTLITE(obj) \ OBJECT_CHECK(XilinxUARTLite, (obj), TYPE_XILINX_UARTLITE) =20 -typedef struct XilinxUARTLite { +struct XilinxUARTLite { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -67,7 +69,7 @@ typedef struct XilinxUARTLite { unsigned int rx_fifo_len; =20 uint32_t regs[R_MAX]; -} XilinxUARTLite; +}; =20 static void uart_update_irq(XilinxUARTLite *s) { diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index 96f4d2517a..1f1df08cfa 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -15,15 +15,17 @@ #include "hw/intc/realview_gic.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore" +typedef struct mpcore_rirq_state mpcore_rirq_state; #define REALVIEW_MPCORE_RIRQ(obj) \ OBJECT_CHECK(mpcore_rirq_state, (obj), TYPE_REALVIEW_MPCORE_RIRQ) =20 /* Dummy PIC to route IRQ lines. The baseboard has 4 independent IRQ controllers. The output of these, plus some of the raw input lines are fed into a single SMP-aware interrupt controller on the CPU. */ -typedef struct { +struct mpcore_rirq_state { SysBusDevice parent_obj; =20 qemu_irq cpuic[32]; @@ -32,7 +34,7 @@ typedef struct { =20 ARM11MPCorePriveState priv; RealViewGICState gic[4]; -} mpcore_rirq_state; +}; =20 /* Map baseboard IRQs onto CPU IRQ lines. */ static const int mpcore_irq_map[32] =3D { diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c index 56bf82fe07..59bbce3979 100644 --- a/hw/display/ads7846.c +++ b/hw/display/ads7846.c @@ -16,8 +16,9 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "ui/console.h" +#include "qom/object.h" =20 -typedef struct { +struct ADS7846State { SSISlave ssidev; qemu_irq interrupt; =20 @@ -27,7 +28,8 @@ typedef struct { =20 int cycle; int output; -} ADS7846State; +}; +typedef struct ADS7846State ADS7846State; =20 #define TYPE_ADS7846 "ads7846" #define ADS7846(obj) OBJECT_CHECK(ADS7846State, (obj), TYPE_ADS7846) diff --git a/hw/display/artist.c b/hw/display/artist.c index 71982559c6..b2fc642002 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -22,8 +22,10 @@ #include "ui/console.h" #include "trace.h" #include "framebuffer.h" +#include "qom/object.h" =20 #define TYPE_ARTIST "artist" +typedef struct ARTISTState ARTISTState; #define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST) =20 #ifdef HOST_WORDS_BIGENDIAN @@ -40,7 +42,7 @@ struct vram_buffer { unsigned int height; }; =20 -typedef struct ARTISTState { +struct ARTISTState { SysBusDevice parent_obj; =20 QemuConsole *con; @@ -103,7 +105,7 @@ typedef struct ARTISTState { uint32_t font_write_pos_y; =20 int draw_line_pattern; -} ARTISTState; +}; =20 typedef enum { ARTIST_BUFFER_AP =3D 1, diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index a8e8ab8325..ef92f3a4e7 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -18,6 +18,7 @@ =20 #include "ui/console.h" #include "ui/qemu-pixman.h" +#include "qom/object.h" =20 typedef struct BochsDisplayMode { pixman_format_code_t format; @@ -29,7 +30,7 @@ typedef struct BochsDisplayMode { uint64_t size; } BochsDisplayMode; =20 -typedef struct BochsDisplayState { +struct BochsDisplayState { /* parent */ PCIDevice pci; =20 @@ -53,7 +54,8 @@ typedef struct BochsDisplayState { =20 /* device state */ BochsDisplayMode mode; -} BochsDisplayState; +}; +typedef struct BochsDisplayState BochsDisplayState; =20 #define TYPE_BOCHS_DISPLAY "bochs-display" #define BOCHS_DISPLAY(obj) OBJECT_CHECK(BochsDisplayState, (obj), \ diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 7cbe6e56ff..49d7e777f9 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -36,6 +36,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 /* Change to 1 to enable debugging */ #define DEBUG_CG3 0 @@ -65,9 +66,10 @@ #define CG3_VRAM_OFFSET 0x800000 =20 #define TYPE_CG3 "cgthree" +typedef struct CG3State CG3State; #define CG3(obj) OBJECT_CHECK(CG3State, (obj), TYPE_CG3) =20 -typedef struct CG3State { +struct CG3State { SysBusDevice parent_obj; =20 QemuConsole *con; @@ -82,7 +84,7 @@ typedef struct CG3State { uint8_t r[256], g[256], b[256]; uint16_t width, height, depth; uint8_t dac_index, dac_state; -} CG3State; +}; =20 static void cg3_update_display(void *opaque) { diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 02d9ed0bd4..6a15f926ad 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -44,6 +44,7 @@ #include "migration/vmstate.h" #include "ui/pixel_ops.h" #include "cirrus_vga_internal.h" +#include "qom/object.h" =20 /* * TODO: @@ -178,10 +179,11 @@ typedef void (*cirrus_fill_t)(struct CirrusVGAState *= s, uint32_t dstaddr, int dst_pitch, int width, int height); =20 -typedef struct PCICirrusVGAState { +struct PCICirrusVGAState { PCIDevice dev; CirrusVGAState cirrus_vga; -} PCICirrusVGAState; +}; +typedef struct PCICirrusVGAState PCICirrusVGAState; =20 #define TYPE_PCI_CIRRUS_VGA "cirrus-vga" #define PCI_CIRRUS_VGA(obj) \ diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c index 825ba57298..28d1fa41e7 100644 --- a/hw/display/cirrus_vga_isa.c +++ b/hw/display/cirrus_vga_isa.c @@ -30,16 +30,18 @@ #include "hw/qdev-properties.h" #include "hw/isa/isa.h" #include "cirrus_vga_internal.h" +#include "qom/object.h" =20 #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga" +typedef struct ISACirrusVGAState ISACirrusVGAState; #define ISA_CIRRUS_VGA(obj) \ OBJECT_CHECK(ISACirrusVGAState, (obj), TYPE_ISA_CIRRUS_VGA) =20 -typedef struct ISACirrusVGAState { +struct ISACirrusVGAState { ISADevice parent_obj; =20 CirrusVGAState cirrus_vga; -} ISACirrusVGAState; +}; =20 static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp) { diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 4b7286b7c9..993b7e9dae 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -32,6 +32,7 @@ #include "qemu/bswap.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qom/object.h" =20 /* Debug messages configuration */ #define EXYNOS4210_FIMD_DEBUG 0 @@ -293,10 +294,11 @@ struct Exynos4210fimdWindow { }; =20 #define TYPE_EXYNOS4210_FIMD "exynos4210.fimd" +typedef struct Exynos4210fimdState Exynos4210fimdState; #define EXYNOS4210_FIMD(obj) \ OBJECT_CHECK(Exynos4210fimdState, (obj), TYPE_EXYNOS4210_FIMD) =20 -typedef struct { +struct Exynos4210fimdState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -325,7 +327,7 @@ typedef struct { uint8_t *ifb; /* Internal frame buffer */ bool invalidate; /* Image needs to be redrawn */ bool enabled; /* Display controller is enabled */ -} Exynos4210fimdState; +}; =20 /* Perform byte/halfword/word swap of data according to WINCON */ static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data) diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index adcba96e34..df674c3c01 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -29,6 +29,7 @@ #include "trace.h" #include "hw/sysbus.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 typedef struct G364State { /* hardware */ @@ -486,13 +487,14 @@ static void g364fb_init(DeviceState *dev, G364State *= s) } =20 #define TYPE_G364 "sysbus-g364" +typedef struct G364SysBusState G364SysBusState; #define G364(obj) OBJECT_CHECK(G364SysBusState, (obj), TYPE_G364) =20 -typedef struct { +struct G364SysBusState { SysBusDevice parent_obj; =20 G364State g364; -} G364SysBusState; +}; =20 static void g364fb_sysbus_realize(DeviceState *dev, Error **errp) { diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c index 1d845597f9..97ec36878b 100644 --- a/hw/display/jazz_led.c +++ b/hw/display/jazz_led.c @@ -29,22 +29,24 @@ #include "trace.h" #include "hw/sysbus.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 typedef enum { REDRAW_NONE =3D 0, REDRAW_SEGMENTS =3D 1, REDRAW_BACKGROUND =3D 2, } screen_state_t; =20 #define TYPE_JAZZ_LED "jazz-led" +typedef struct LedState LedState; #define JAZZ_LED(obj) OBJECT_CHECK(LedState, (obj), TYPE_JAZZ_LED) =20 -typedef struct LedState { +struct LedState { SysBusDevice parent_obj; =20 MemoryRegion iomem; uint8_t segments; QemuConsole *con; screen_state_t state; -} LedState; +}; =20 static uint64_t jazz_led_read(void *opaque, hwaddr addr, unsigned int size) diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c index c34ef1a1bf..66cb8e6a60 100644 --- a/hw/display/milkymist-tmu2.c +++ b/hw/display/milkymist-tmu2.c @@ -38,6 +38,7 @@ #include #include #include +#include "qom/object.h" =20 enum { R_CTL =3D 0, @@ -82,6 +83,7 @@ struct vertex { } QEMU_PACKED; =20 #define TYPE_MILKYMIST_TMU2 "milkymist-tmu2" +typedef struct MilkymistTMU2State MilkymistTMU2State; #define MILKYMIST_TMU2(obj) \ OBJECT_CHECK(MilkymistTMU2State, (obj), TYPE_MILKYMIST_TMU2) =20 @@ -98,7 +100,6 @@ struct MilkymistTMU2State { GLXFBConfig glx_fb_config; GLXContext glx_context; }; -typedef struct MilkymistTMU2State MilkymistTMU2State; =20 static const int glx_fbconfig_attr[] =3D { GLX_GREEN_SIZE, 5, diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c index 6a6441e6ea..bbf412d9a0 100644 --- a/hw/display/milkymist-vgafb.c +++ b/hw/display/milkymist-vgafb.c @@ -32,6 +32,7 @@ #include "ui/pixel_ops.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define BITS 8 #include "migration/vmstate.h" @@ -68,6 +69,7 @@ enum { }; =20 #define TYPE_MILKYMIST_VGAFB "milkymist-vgafb" +typedef struct MilkymistVgafbState MilkymistVgafbState; #define MILKYMIST_VGAFB(obj) \ OBJECT_CHECK(MilkymistVgafbState, (obj), TYPE_MILKYMIST_VGAFB) =20 @@ -84,7 +86,6 @@ struct MilkymistVgafbState { =20 uint32_t regs[R_MAX]; }; -typedef struct MilkymistVgafbState MilkymistVgafbState; =20 static int vgafb_enabled(MilkymistVgafbState *s) { diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c index b0513a8fba..068dc0656f 100644 --- a/hw/display/next-fb.c +++ b/hw/display/next-fb.c @@ -30,7 +30,9 @@ #include "framebuffer.h" #include "ui/pixel_ops.h" #include "hw/m68k/next-cube.h" +#include "qom/object.h" =20 +typedef struct NeXTFbState NeXTFbState; #define NEXTFB(obj) OBJECT_CHECK(NeXTFbState, (obj), TYPE_NEXTFB) =20 struct NeXTFbState { @@ -44,7 +46,6 @@ struct NeXTFbState { uint32_t rows; int invalidate; }; -typedef struct NeXTFbState NeXTFbState; =20 static void nextfb_draw_line(void *opaque, uint8_t *d, const uint8_t *s, int width, int pitch) diff --git a/hw/display/pl110.c b/hw/display/pl110.c index 61fefbffb3..4cf953c2f4 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -17,6 +17,7 @@ #include "qemu/timer.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define PL110_CR_EN 0x001 #define PL110_CR_BGR 0x100 @@ -48,9 +49,10 @@ enum pl110_version }; =20 #define TYPE_PL110 "pl110" +typedef struct PL110State PL110State; #define PL110(obj) OBJECT_CHECK(PL110State, (obj), TYPE_PL110) =20 -typedef struct PL110State { +struct PL110State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -73,7 +75,7 @@ typedef struct PL110State { uint32_t palette[256]; uint32_t raw_palette[128]; qemu_irq irq; -} PL110State; +}; =20 static int vmstate_pl110_post_load(void *opaque, int version_id); =20 diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c index b18db97eeb..dae32b9fda 100644 --- a/hw/display/ramfb-standalone.c +++ b/hw/display/ramfb-standalone.c @@ -5,14 +5,16 @@ #include "hw/qdev-properties.h" #include "hw/display/ramfb.h" #include "ui/console.h" +#include "qom/object.h" =20 +typedef struct RAMFBStandaloneState RAMFBStandaloneState; #define RAMFB(obj) OBJECT_CHECK(RAMFBStandaloneState, (obj), TYPE_RAMFB_DE= VICE) =20 -typedef struct RAMFBStandaloneState { +struct RAMFBStandaloneState { SysBusDevice parent_obj; QemuConsole *con; RAMFBState *state; -} RAMFBStandaloneState; +}; =20 static void display_update_wrapper(void *dev) { diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c index 3b82a8567f..4bf2c559cd 100644 --- a/hw/display/sii9022.c +++ b/hw/display/sii9022.c @@ -19,6 +19,7 @@ #include "migration/vmstate.h" #include "hw/display/i2c-ddc.h" #include "trace.h" +#include "qom/object.h" =20 #define SII9022_SYS_CTRL_DATA 0x1a #define SII9022_SYS_CTRL_PWR_DWN 0x10 @@ -35,16 +36,17 @@ #define SII9022_INT_STATUS_PLUGGED 0x04; =20 #define TYPE_SII9022 "sii9022" +typedef struct sii9022_state sii9022_state; #define SII9022(obj) OBJECT_CHECK(sii9022_state, (obj), TYPE_SII9022) =20 -typedef struct sii9022_state { +struct sii9022_state { I2CSlave parent_obj; uint8_t ptr; bool addr_byte; bool ddc_req; bool ddc_skip_finish; bool ddc; -} sii9022_state; +}; =20 static const VMStateDescription vmstate_sii9022 =3D { .name =3D "sii9022", diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 9cccc68c35..f886c1e51b 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -40,6 +40,7 @@ #include "ui/pixel_ops.h" #include "qemu/bswap.h" #include "trace.h" +#include "qom/object.h" =20 #define MMIO_BASE_OFFSET 0x3e00000 #define MMIO_SIZE 0x200000 @@ -1931,10 +1932,11 @@ static const VMStateDescription vmstate_sm501_state= =3D { }; =20 #define TYPE_SYSBUS_SM501 "sysbus-sm501" +typedef struct SM501SysBusState SM501SysBusState; #define SYSBUS_SM501(obj) \ OBJECT_CHECK(SM501SysBusState, (obj), TYPE_SYSBUS_SM501) =20 -typedef struct { +struct SM501SysBusState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -1942,7 +1944,7 @@ typedef struct { uint32_t vram_size; uint32_t base; SerialMM serial; -} SM501SysBusState; +}; =20 static void sm501_realize_sysbus(DeviceState *dev, Error **errp) { @@ -2034,15 +2036,16 @@ static const TypeInfo sm501_sysbus_info =3D { }; =20 #define TYPE_PCI_SM501 "sm501" +typedef struct SM501PCIState SM501PCIState; #define PCI_SM501(obj) OBJECT_CHECK(SM501PCIState, (obj), TYPE_PCI_SM501) =20 -typedef struct { +struct SM501PCIState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ SM501State state; uint32_t vram_size; -} SM501PCIState; +}; =20 static void sm501_realize_pci(PCIDevice *dev, Error **errp) { diff --git a/hw/display/ssd0303.c b/hw/display/ssd0303.c index 718378f6de..8804567c1f 100644 --- a/hw/display/ssd0303.c +++ b/hw/display/ssd0303.c @@ -16,6 +16,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "ui/console.h" +#include "qom/object.h" =20 //#define DEBUG_SSD0303 1 =20 @@ -46,9 +47,10 @@ enum ssd0303_cmd { }; =20 #define TYPE_SSD0303 "ssd0303" +typedef struct ssd0303_state ssd0303_state; #define SSD0303(obj) OBJECT_CHECK(ssd0303_state, (obj), TYPE_SSD0303) =20 -typedef struct { +struct ssd0303_state { I2CSlave parent_obj; =20 QemuConsole *con; @@ -63,7 +65,7 @@ typedef struct { enum ssd0303_mode mode; enum ssd0303_cmd cmd_state; uint8_t framebuffer[132*8]; -} ssd0303_state; +}; =20 static uint8_t ssd0303_recv(I2CSlave *i2c) { diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c index 32d27f008a..c9d79cfcd3 100644 --- a/hw/display/ssd0323.c +++ b/hw/display/ssd0323.c @@ -16,6 +16,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "ui/console.h" +#include "qom/object.h" =20 //#define DEBUG_SSD0323 1 =20 @@ -47,7 +48,7 @@ enum ssd0323_mode SSD0323_DATA }; =20 -typedef struct { +struct ssd0323_state { SSISlave ssidev; QemuConsole *con; =20 @@ -64,7 +65,8 @@ typedef struct { int32_t remap; uint32_t mode; uint8_t framebuffer[128 * 80 / 2]; -} ssd0323_state; +}; +typedef struct ssd0323_state ssd0323_state; =20 #define TYPE_SSD0323 "ssd0323" #define SSD0323(obj) OBJECT_CHECK(ssd0323_state, (obj), TYPE_SSD0323) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 1fb45b1aab..5c75589919 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -33,6 +33,7 @@ #include "migration/vmstate.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TCX_ROM_FILE "QEMU,tcx.bin" #define FCODE_MAX_ROM_SIZE 0x10000 @@ -55,9 +56,10 @@ #define TCX_THC_CURSBITS 0x980 =20 #define TYPE_TCX "SUNW,tcx" +typedef struct TCXState TCXState; #define TCX(obj) OBJECT_CHECK(TCXState, (obj), TYPE_TCX) =20 -typedef struct TCXState { +struct TCXState { SysBusDevice parent_obj; =20 QemuConsole *con; @@ -93,7 +95,7 @@ typedef struct TCXState { uint32_t cursbits[32]; uint16_t cursx; uint16_t cursy; -} TCXState; +}; =20 static void tcx_set_dirty(TCXState *s, ram_addr_t addr, int len) { diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c index 3aaeeeca1e..50efc3760a 100644 --- a/hw/display/vga-isa.c +++ b/hw/display/vga-isa.c @@ -32,17 +32,19 @@ #include "qemu/timer.h" #include "hw/loader.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define TYPE_ISA_VGA "isa-vga" +typedef struct ISAVGAState ISAVGAState; #define ISA_VGA(obj) OBJECT_CHECK(ISAVGAState, (obj), TYPE_ISA_VGA) =20 -typedef struct ISAVGAState { +struct ISAVGAState { ISADevice parent_obj; =20 struct VGACommonState state; PortioList portio_vga; PortioList portio_vbe; -} ISAVGAState; +}; =20 static void vga_isa_reset(DeviceState *dev) { diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index a640fd866d..852cbf36e9 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -34,6 +34,7 @@ #include "qemu/timer.h" #include "hw/loader.h" #include "hw/display/edid.h" +#include "qom/object.h" =20 enum vga_pci_flags { PCI_VGA_FLAG_ENABLE_MMIO =3D 1, @@ -41,7 +42,7 @@ enum vga_pci_flags { PCI_VGA_FLAG_ENABLE_EDID =3D 3, }; =20 -typedef struct PCIVGAState { +struct PCIVGAState { PCIDevice dev; VGACommonState vga; uint32_t flags; @@ -49,7 +50,8 @@ typedef struct PCIVGAState { MemoryRegion mmio; MemoryRegion mrs[4]; uint8_t edid[256]; -} PCIVGAState; +}; +typedef struct PCIVGAState PCIVGAState; =20 #define TYPE_PCI_VGA "pci-vga" #define PCI_VGA(obj) OBJECT_CHECK(PCIVGAState, (obj), TYPE_PCI_VGA) diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pc= i.c index 23ce655e0f..678b762bbb 100644 --- a/hw/display/vhost-user-gpu-pci.c +++ b/hw/display/vhost-user-gpu-pci.c @@ -11,16 +11,18 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/virtio/virtio-gpu-pci.h" +#include "qom/object.h" =20 #define TYPE_VHOST_USER_GPU_PCI "vhost-user-gpu-pci" +typedef struct VhostUserGPUPCI VhostUserGPUPCI; #define VHOST_USER_GPU_PCI(obj) \ OBJECT_CHECK(VhostUserGPUPCI, (obj), TYPE_VHOST_USER_GPU_PCI) =20 -typedef struct VhostUserGPUPCI { +struct VhostUserGPUPCI { VirtIOGPUPCIBase parent_obj; =20 VhostUserGPU vdev; -} VhostUserGPUPCI; +}; =20 static void vhost_user_gpu_pci_initfn(Object *obj) { diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c index 1690f6b610..2cc9616bea 100644 --- a/hw/display/vhost-user-vga.c +++ b/hw/display/vhost-user-vga.c @@ -11,17 +11,19 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "virtio-vga.h" +#include "qom/object.h" =20 #define TYPE_VHOST_USER_VGA "vhost-user-vga" =20 +typedef struct VhostUserVGA VhostUserVGA; #define VHOST_USER_VGA(obj) \ OBJECT_CHECK(VhostUserVGA, (obj), TYPE_VHOST_USER_VGA) =20 -typedef struct VhostUserVGA { +struct VhostUserVGA { VirtIOVGABase parent_obj; =20 VhostUserGPU vdev; -} VhostUserVGA; +}; =20 static void vhost_user_vga_inst_initfn(Object *obj) { diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index 34d8e93f28..7248ec30c7 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -19,6 +19,7 @@ #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-gpu-pci.h" +#include "qom/object.h" =20 static Property virtio_gpu_pci_base_properties[] =3D { DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy), @@ -65,13 +66,14 @@ static const TypeInfo virtio_gpu_pci_base_info =3D { }; =20 #define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci" +typedef struct VirtIOGPUPCI VirtIOGPUPCI; #define VIRTIO_GPU_PCI(obj) \ OBJECT_CHECK(VirtIOGPUPCI, (obj), TYPE_VIRTIO_GPU_PCI) =20 -typedef struct VirtIOGPUPCI { +struct VirtIOGPUPCI { VirtIOGPUPCIBase parent_obj; VirtIOGPU vdev; -} VirtIOGPUPCI; +}; =20 static void virtio_gpu_initfn(Object *obj) { diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index f533d7d1b4..0bb98ede75 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -5,6 +5,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "virtio-vga.h" +#include "qom/object.h" =20 static void virtio_vga_base_invalidate_display(void *opaque) { @@ -202,14 +203,15 @@ static TypeInfo virtio_vga_base_info =3D { =20 #define TYPE_VIRTIO_VGA "virtio-vga" =20 +typedef struct VirtIOVGA VirtIOVGA; #define VIRTIO_VGA(obj) \ OBJECT_CHECK(VirtIOVGA, (obj), TYPE_VIRTIO_VGA) =20 -typedef struct VirtIOVGA { +struct VirtIOVGA { VirtIOVGABase parent_obj; =20 VirtIOGPU vdev; -} VirtIOVGA; +}; =20 static void virtio_vga_inst_initfn(Object *obj) { diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 2579f6b218..076dfcedd7 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -33,6 +33,7 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #undef VERBOSE #define HW_RECT_ACCEL diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 6977d85ef8..c12946aaef 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -29,8 +29,10 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/dma/i8257.h" +#include "qom/object.h" =20 #define TYPE_I82374 "i82374" +typedef struct I82374State I82374State; #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374) =20 //#define DEBUG_I82374 @@ -45,13 +47,13 @@ do {} while (0) #define BADF(fmt, ...) \ do { fprintf(stderr, "i82374 ERROR: " fmt , ## __VA_ARGS__); } while (0) =20 -typedef struct I82374State { +struct I82374State { ISADevice parent_obj; =20 uint32_t iobase; uint8_t commands[8]; PortioList port_list; -} I82374State; +}; =20 static const VMStateDescription vmstate_i82374 =3D { .name =3D "i82374", diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 0bd63a43f5..380d45db8f 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -26,6 +26,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 #ifndef PL330_ERR_DEBUG #define PL330_ERR_DEBUG 0 diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c index 7fa979180f..72e7b395b0 100644 --- a/hw/dma/puv3_dma.c +++ b/hw/dma/puv3_dma.c @@ -11,6 +11,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" @@ -22,14 +23,15 @@ #define PUV3_DMA_CH(offset) ((offset) >> 8) =20 #define TYPE_PUV3_DMA "puv3_dma" +typedef struct PUV3DMAState PUV3DMAState; #define PUV3_DMA(obj) OBJECT_CHECK(PUV3DMAState, (obj), TYPE_PUV3_DMA) =20 -typedef struct PUV3DMAState { +struct PUV3DMAState { SysBusDevice parent_obj; =20 MemoryRegion iomem; uint32_t reg_CFG[PUV3_DMA_CH_NR]; -} PUV3DMAState; +}; =20 static uint64_t puv3_dma_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index 78b2849bcb..6ae8035831 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -18,6 +18,7 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define PXA255_DMA_NUM_CHANNELS 16 #define PXA27X_DMA_NUM_CHANNELS 32 @@ -34,9 +35,10 @@ typedef struct { } PXA2xxDMAChannel; =20 #define TYPE_PXA2XX_DMA "pxa2xx-dma" +typedef struct PXA2xxDMAState PXA2xxDMAState; #define PXA2XX_DMA(obj) OBJECT_CHECK(PXA2xxDMAState, (obj), TYPE_PXA2XX_DM= A) =20 -typedef struct PXA2xxDMAState { +struct PXA2xxDMAState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -58,7 +60,7 @@ typedef struct PXA2xxDMAState { =20 /* Flag to avoid recursive DMA invocations. */ int running; -} PXA2xxDMAState; +}; =20 #define DCSR0 0x0000 /* DMA Control / Status register for Channel 0 */ #define DCSR31 0x007c /* DMA Control / Status register for Channel 31 */ diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 7eddc9a776..7d6eaf5e96 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -34,6 +34,7 @@ #include "qemu/module.h" #include "exec/address-spaces.h" #include "trace.h" +#include "qom/object.h" =20 /********************************************************/ /* rc4030 emulation */ @@ -55,12 +56,13 @@ typedef struct dma_pagetable_entry { #define DMA_FLAG_ADDR_INTR 0x0400 =20 #define TYPE_RC4030 "rc4030" +typedef struct rc4030State rc4030State; #define RC4030(obj) \ OBJECT_CHECK(rc4030State, (obj), TYPE_RC4030) =20 #define TYPE_RC4030_IOMMU_MEMORY_REGION "rc4030-iommu-memory-region" =20 -typedef struct rc4030State { +struct rc4030State { =20 SysBusDevice parent; =20 @@ -101,7 +103,7 @@ typedef struct rc4030State { =20 MemoryRegion iomem_chipset; MemoryRegion iomem_jazzio; -} rc4030State; +}; =20 static void set_next_tick(rc4030State *s) { diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index a4812e480a..6d48fea8fe 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -35,6 +35,7 @@ =20 #include "sysemu/dma.h" #include "hw/stream.h" +#include "qom/object.h" =20 #define D(x) =20 @@ -42,9 +43,11 @@ #define TYPE_XILINX_AXI_DMA_DATA_STREAM "xilinx-axi-dma-data-stream" #define TYPE_XILINX_AXI_DMA_CONTROL_STREAM "xilinx-axi-dma-control-stream" =20 +typedef struct XilinxAXIDMA XilinxAXIDMA; #define XILINX_AXI_DMA(obj) \ OBJECT_CHECK(XilinxAXIDMA, (obj), TYPE_XILINX_AXI_DMA) =20 +typedef struct XilinxAXIDMAStreamSlave XilinxAXIDMAStreamSlave; #define XILINX_AXI_DMA_DATA_STREAM(obj) \ OBJECT_CHECK(XilinxAXIDMAStreamSlave, (obj),\ TYPE_XILINX_AXI_DMA_DATA_STREAM) @@ -62,8 +65,6 @@ #define CONTROL_PAYLOAD_WORDS 5 #define CONTROL_PAYLOAD_SIZE (CONTROL_PAYLOAD_WORDS * (sizeof(uint32_t))) =20 -typedef struct XilinxAXIDMA XilinxAXIDMA; -typedef struct XilinxAXIDMAStreamSlave XilinxAXIDMAStreamSlave; =20 enum { DMACR_RUNSTOP =3D 1, diff --git a/hw/gpio/gpio_key.c b/hw/gpio/gpio_key.c index 46bbd42772..2500a23c6e 100644 --- a/hw/gpio/gpio_key.c +++ b/hw/gpio/gpio_key.c @@ -28,17 +28,19 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qom/object.h" =20 #define TYPE_GPIOKEY "gpio-key" +typedef struct GPIOKEYState GPIOKEYState; #define GPIOKEY(obj) OBJECT_CHECK(GPIOKEYState, (obj), TYPE_GPIOKEY) #define GPIO_KEY_LATENCY 100 /* 100ms */ =20 -typedef struct GPIOKEYState { +struct GPIOKEYState { SysBusDevice parent_obj; =20 QEMUTimer *timer; qemu_irq irq; -} GPIOKEYState; +}; =20 static const VMStateDescription vmstate_gpio_key =3D { .name =3D "gpio-key", diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index 4f78774dc8..dd7e7f293d 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -14,11 +14,13 @@ #include "hw/irq.h" #include "migration/vmstate.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_MAX7310 "max7310" +typedef struct MAX7310State MAX7310State; #define MAX7310(obj) OBJECT_CHECK(MAX7310State, (obj), TYPE_MAX7310) =20 -typedef struct MAX7310State { +struct MAX7310State { I2CSlave parent_obj; =20 int i2c_command_byte; @@ -31,7 +33,7 @@ typedef struct MAX7310State { uint8_t command; qemu_irq handler[8]; qemu_irq *gpio_in; -} MAX7310State; +}; =20 static void max7310_reset(DeviceState *dev) { diff --git a/hw/gpio/mpc8xxx.c b/hw/gpio/mpc8xxx.c index 1d99667094..b33462e4db 100644 --- a/hw/gpio/mpc8xxx.c +++ b/hw/gpio/mpc8xxx.c @@ -24,11 +24,13 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_MPC8XXX_GPIO "mpc8xxx_gpio" +typedef struct MPC8XXXGPIOState MPC8XXXGPIOState; #define MPC8XXX_GPIO(obj) OBJECT_CHECK(MPC8XXXGPIOState, (obj), TYPE_MPC8X= XX_GPIO) =20 -typedef struct MPC8XXXGPIOState { +struct MPC8XXXGPIOState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -41,7 +43,7 @@ typedef struct MPC8XXXGPIOState { uint32_t ier; uint32_t imr; uint32_t icr; -} MPC8XXXGPIOState; +}; =20 static const VMStateDescription vmstate_mpc8xxx_gpio =3D { .name =3D "mpc8xxx_gpio", diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c index 6d3c36bc16..6c36407079 100644 --- a/hw/gpio/pl061.c +++ b/hw/gpio/pl061.c @@ -14,6 +14,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 //#define DEBUG_PL061 1 =20 @@ -34,11 +35,12 @@ static const uint8_t pl061_id_luminary[12] =3D { 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x18, 0x01, 0x0d, 0xf0, 0x05, 0xb1= }; =20 #define TYPE_PL061 "pl061" +typedef struct PL061State PL061State; #define PL061(obj) OBJECT_CHECK(PL061State, (obj), TYPE_PL061) =20 #define N_GPIOS 8 =20 -typedef struct PL061State { +struct PL061State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -67,7 +69,7 @@ typedef struct PL061State { qemu_irq out[N_GPIOS]; const unsigned char *id; uint32_t rsvd_start; /* reserved area: [rsvd_start, 0xfcc] */ -} PL061State; +}; =20 static const VMStateDescription vmstate_pl061 =3D { .name =3D "pl061", diff --git a/hw/gpio/puv3_gpio.c b/hw/gpio/puv3_gpio.c index 7362b6715f..5e0ee783dc 100644 --- a/hw/gpio/puv3_gpio.c +++ b/hw/gpio/puv3_gpio.c @@ -11,6 +11,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" @@ -18,9 +19,10 @@ #include "qemu/log.h" =20 #define TYPE_PUV3_GPIO "puv3_gpio" +typedef struct PUV3GPIOState PUV3GPIOState; #define PUV3_GPIO(obj) OBJECT_CHECK(PUV3GPIOState, (obj), TYPE_PUV3_GPIO) =20 -typedef struct PUV3GPIOState { +struct PUV3GPIOState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -29,7 +31,7 @@ typedef struct PUV3GPIOState { uint32_t reg_GPLR; uint32_t reg_GPDR; uint32_t reg_GPIR; -} PUV3GPIOState; +}; =20 static uint64_t puv3_gpio_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c index 258e926493..048e40c072 100644 --- a/hw/gpio/zaurus.c +++ b/hw/gpio/zaurus.c @@ -23,13 +23,14 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qom/object.h" =20 /* SCOOP devices */ =20 #define TYPE_SCOOP "scoop" +typedef struct ScoopInfo ScoopInfo; #define SCOOP(obj) OBJECT_CHECK(ScoopInfo, (obj), TYPE_SCOOP) =20 -typedef struct ScoopInfo ScoopInfo; struct ScoopInfo { SysBusDevice parent_obj; =20 diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 7f0c6223a8..fa739adc7b 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -22,6 +22,7 @@ #include "hppa_sys.h" #include "exec/address-spaces.h" #include "trace.h" +#include "qom/object.h" =20 =20 #define TYPE_DINO_PCI_HOST_BRIDGE "dino-pcihost" @@ -80,6 +81,7 @@ =20 #define DINO_MEM_CHUNK_SIZE (8 * MiB) =20 +typedef struct DinoState DinoState; #define DINO_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE) =20 @@ -100,7 +102,7 @@ static const uint32_t reg800_keep_bits[DINO800_REGS] = =3D { MAKE_64BIT_MASK(0, 9), /* TLTIM */ }; =20 -typedef struct DinoState { +struct DinoState { PCIHostState parent_obj; =20 /* PCI_CONFIG_ADDR is parent_obj.config_reg, via pci_host_conf_be_ops, @@ -129,7 +131,7 @@ typedef struct DinoState { MemoryRegion bm_ram_alias; MemoryRegion bm_pci_alias; MemoryRegion bm_cpu_alias; -} DinoState; +}; =20 /* * Dino can forward memory accesses from the CPU in the range between diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 194aa3e619..1acb9ce631 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -26,6 +26,7 @@ #include "hw/input/lasips2.h" #include "exec/address-spaces.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define TYPE_LASI_CHIP "lasi-chip" =20 @@ -52,10 +53,11 @@ #define ICR_BUS_ERROR_BIT LASI_BIT(8) /* bit 8 in ICR */ #define ICR_TOC_BIT LASI_BIT(1) /* bit 1 in ICR */ =20 +typedef struct LasiState LasiState; #define LASI_CHIP(obj) \ OBJECT_CHECK(LasiState, (obj), TYPE_LASI_CHIP) =20 -typedef struct LasiState { +struct LasiState { PCIHostState parent_obj; =20 uint32_t irr; @@ -70,7 +72,7 @@ typedef struct LasiState { time_t rtc_ref; =20 MemoryRegion this_mem; -} LasiState; +}; =20 static bool lasi_chip_mem_valid(void *opaque, hwaddr addr, unsigned size, bool is_write, diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c index 844d00776d..5dfa9d77e1 100644 --- a/hw/hyperv/hyperv.c +++ b/hw/hyperv/hyperv.c @@ -20,8 +20,9 @@ #include "qemu/rcu.h" #include "qemu/rcu_queue.h" #include "hw/hyperv/hyperv.h" +#include "qom/object.h" =20 -typedef struct SynICState { +struct SynICState { DeviceState parent_obj; =20 CPUState *cs; @@ -33,7 +34,8 @@ typedef struct SynICState { MemoryRegion event_page_mr; struct hyperv_message_page *msg_page; struct hyperv_event_flags_page *event_page; -} SynICState; +}; +typedef struct SynICState SynICState; =20 #define TYPE_SYNIC "hyperv-synic" #define SYNIC(obj) OBJECT_CHECK(SynICState, (obj), TYPE_SYNIC) diff --git a/hw/hyperv/hyperv_testdev.c b/hw/hyperv/hyperv_testdev.c index 88a5a63782..8f78fce088 100644 --- a/hw/hyperv/hyperv_testdev.c +++ b/hw/hyperv/hyperv_testdev.c @@ -17,6 +17,7 @@ #include "qemu/queue.h" #include "hw/isa/isa.h" #include "hw/hyperv/hyperv.h" +#include "qom/object.h" =20 typedef struct TestSintRoute { QLIST_ENTRY(TestSintRoute) le; diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index b000952b98..4ff3c0b4ec 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -15,6 +15,7 @@ #include "hw/i2c/bitbang_i2c.h" #include "hw/sysbus.h" #include "qemu/module.h" +#include "qom/object.h" =20 //#define DEBUG_BITBANG_I2C =20 @@ -162,16 +163,17 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBu= s *bus) /* GPIO interface. */ =20 #define TYPE_GPIO_I2C "gpio_i2c" +typedef struct GPIOI2CState GPIOI2CState; #define GPIO_I2C(obj) OBJECT_CHECK(GPIOI2CState, (obj), TYPE_GPIO_I2C) =20 -typedef struct GPIOI2CState { +struct GPIOI2CState { SysBusDevice parent_obj; =20 MemoryRegion dummy_iomem; bitbang_i2c_interface bitbang; int last_level; qemu_irq out; -} GPIOI2CState; +}; =20 static void bitbang_i2c_gpio_set(void *opaque, int irq, int level) { diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c index a600f65560..9d2f780d2a 100644 --- a/hw/i2c/exynos4210_i2c.c +++ b/hw/i2c/exynos4210_i2c.c @@ -27,12 +27,14 @@ #include "migration/vmstate.h" #include "hw/i2c/i2c.h" #include "hw/irq.h" +#include "qom/object.h" =20 #ifndef EXYNOS4_I2C_DEBUG #define EXYNOS4_I2C_DEBUG 0 #endif =20 #define TYPE_EXYNOS4_I2C "exynos4210.i2c" +typedef struct Exynos4210I2CState Exynos4210I2CState; #define EXYNOS4_I2C(obj) \ OBJECT_CHECK(Exynos4210I2CState, (obj), TYPE_EXYNOS4_I2C) =20 @@ -83,7 +85,7 @@ static const char *exynos4_i2c_get_regname(unsigned offse= t) #define DPRINT(fmt, args...) do { } while (0) #endif =20 -typedef struct Exynos4210I2CState { +struct Exynos4210I2CState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -96,7 +98,7 @@ typedef struct Exynos4210I2CState { uint8_t i2cds; uint8_t i2clc; bool scl_free; -} Exynos4210I2CState; +}; =20 static inline void exynos4210_i2c_raise_interrupt(Exynos4210I2CState *s) { diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 9a724f3a3e..232a277da4 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -24,6 +24,7 @@ #include "qemu/module.h" #include "hw/sysbus.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 /* #define DEBUG_I2C */ =20 @@ -36,6 +37,7 @@ #endif =20 #define TYPE_MPC_I2C "mpc-i2c" +typedef struct MPCI2CState MPCI2CState; #define MPC_I2C(obj) \ OBJECT_CHECK(MPCI2CState, (obj), TYPE_MPC_I2C) =20 @@ -70,7 +72,7 @@ =20 #define CYCLE_RESET 0xFF =20 -typedef struct MPCI2CState { +struct MPCI2CState { SysBusDevice parent_obj; =20 I2CBus *bus; @@ -84,7 +86,7 @@ typedef struct MPCI2CState { uint8_t sr; uint8_t dr; uint8_t dfssr; -} MPCI2CState; +}; =20 static bool mpc_i2c_is_enabled(MPCI2CState *s) { diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index b7def9eeb8..4f98012f1c 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -31,23 +31,25 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/i2c/smbus_eeprom.h" +#include "qom/object.h" =20 //#define DEBUG =20 #define TYPE_SMBUS_EEPROM "smbus-eeprom" =20 +typedef struct SMBusEEPROMDevice SMBusEEPROMDevice; #define SMBUS_EEPROM(obj) \ OBJECT_CHECK(SMBusEEPROMDevice, (obj), TYPE_SMBUS_EEPROM) =20 #define SMBUS_EEPROM_SIZE 256 =20 -typedef struct SMBusEEPROMDevice { +struct SMBusEEPROMDevice { SMBusDevice smbusdev; uint8_t data[SMBUS_EEPROM_SIZE]; uint8_t *init_data; uint8_t offset; bool accessed; -} SMBusEEPROMDevice; +}; =20 static uint8_t eeprom_receive_byte(SMBusDevice *dev) { diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 48f1ff4191..44d26fcf39 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -28,17 +28,19 @@ #include "qemu/module.h" =20 #include "hw/i386/ich9.h" +#include "qom/object.h" =20 +typedef struct ICH9SMBState ICH9SMBState; #define ICH9_SMB_DEVICE(obj) \ OBJECT_CHECK(ICH9SMBState, (obj), TYPE_ICH9_SMB_DEVICE) =20 -typedef struct ICH9SMBState { +struct ICH9SMBState { PCIDevice dev; =20 bool irq_enabled; =20 PMSMBus smb; -} ICH9SMBState; +}; =20 static bool ich9_vmstate_need_smbus(void *opaque, int version_id) { diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index da8cda2ec1..3ab386d671 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -27,11 +27,12 @@ #include "hw/registerfields.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 +typedef ArmSbconI2CState VersatileI2CState; #define VERSATILE_I2C(obj) \ OBJECT_CHECK(VersatileI2CState, (obj), TYPE_VERSATILE_I2C) =20 -typedef ArmSbconI2CState VersatileI2CState; =20 =20 REG32(CONTROL_GET, 0) diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 64283358f9..94ece445af 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -29,11 +29,13 @@ =20 #include #include "standard-headers/asm-x86/kvm_para.h" +#include "qom/object.h" =20 #define TYPE_KVM_CLOCK "kvmclock" +typedef struct KVMClockState KVMClockState; #define KVM_CLOCK(obj) OBJECT_CHECK(KVMClockState, (obj), TYPE_KVM_CLOCK) =20 -typedef struct KVMClockState { +struct KVMClockState { /*< private >*/ SysBusDevice busdev; /*< public >*/ @@ -50,7 +52,7 @@ typedef struct KVMClockState { /* whether the 'clock' value was obtained in a host with * reliable KVM_GET_CLOCK */ bool clock_is_reliable; -} KVMClockState; +}; =20 struct pvclock_vcpu_time_info { uint32_t version; diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index 876f5aa6fa..d3e4142b16 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -33,30 +33,33 @@ #include "hw/timer/i8254.h" #include "hw/timer/i8254_internal.h" #include "sysemu/kvm.h" +#include "qom/object.h" =20 #define KVM_PIT_REINJECT_BIT 0 =20 #define CALIBRATION_ROUNDS 3 =20 +typedef struct KVMPITClass KVMPITClass; +typedef struct KVMPITState KVMPITState; #define KVM_PIT(obj) OBJECT_CHECK(KVMPITState, (obj), TYPE_KVM_I8254) #define KVM_PIT_CLASS(class) \ OBJECT_CLASS_CHECK(KVMPITClass, (class), TYPE_KVM_I8254) #define KVM_PIT_GET_CLASS(obj) \ OBJECT_GET_CLASS(KVMPITClass, (obj), TYPE_KVM_I8254) =20 -typedef struct KVMPITState { +struct KVMPITState { PITCommonState parent_obj; =20 LostTickPolicy lost_tick_policy; bool vm_stopped; int64_t kernel_clock_offset; -} KVMPITState; +}; =20 -typedef struct KVMPITClass { +struct KVMPITClass { PITCommonClass parent_class; =20 DeviceRealize parent_realize; -} KVMPITClass; +}; =20 static int64_t abs64(int64_t v) { diff --git a/hw/i386/kvm/i8259.c b/hw/i386/kvm/i8259.c index e404fdcdac..b256f97c83 100644 --- a/hw/i386/kvm/i8259.c +++ b/hw/i386/kvm/i8259.c @@ -17,8 +17,10 @@ #include "hw/i386/apic_internal.h" #include "hw/irq.h" #include "sysemu/kvm.h" +#include "qom/object.h" =20 #define TYPE_KVM_I8259 "kvm-i8259" +typedef struct KVMPICClass KVMPICClass; #define KVM_PIC_CLASS(class) \ OBJECT_CLASS_CHECK(KVMPICClass, (class), TYPE_KVM_I8259) #define KVM_PIC_GET_CLASS(obj) \ @@ -28,11 +30,11 @@ * KVMPICClass: * @parent_realize: The parent's realizefn. */ -typedef struct KVMPICClass { +struct KVMPICClass { PICCommonClass parent_class; =20 DeviceRealize parent_realize; -} KVMPICClass; +}; =20 static void kvm_pic_get(PICCommonState *s) { diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 51639202c2..857d9f4a61 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -22,6 +22,7 @@ #include "hw/boards.h" #include "migration/vmstate.h" #include "tcg/tcg.h" +#include "qom/object.h" =20 #define VAPIC_IO_PORT 0x7e =20 @@ -56,7 +57,7 @@ typedef struct GuestROMState { VAPICHandlers mp; } QEMU_PACKED GuestROMState; =20 -typedef struct VAPICROMState { +struct VAPICROMState { SysBusDevice busdev; MemoryRegion io; MemoryRegion rom; @@ -69,7 +70,8 @@ typedef struct VAPICROMState { size_t rom_size; bool rom_mapped_writable; VMChangeStateEntry *vmsentry; -} VAPICROMState; +}; +typedef struct VAPICROMState VAPICROMState; =20 #define TYPE_VAPIC "kvmvapic" #define VAPIC(obj) OBJECT_CHECK(VAPICROMState, (obj), TYPE_VAPIC) diff --git a/hw/i386/port92.c b/hw/i386/port92.c index 19866c44ef..48200def5d 100644 --- a/hw/i386/port92.c +++ b/hw/i386/port92.c @@ -12,16 +12,18 @@ #include "hw/irq.h" #include "hw/i386/pc.h" #include "trace.h" +#include "qom/object.h" =20 +typedef struct Port92State Port92State; #define PORT92(obj) OBJECT_CHECK(Port92State, (obj), TYPE_PORT92) =20 -typedef struct Port92State { +struct Port92State { ISADevice parent_obj; =20 MemoryRegion io; uint8_t outport; qemu_irq a20_out; -} Port92State; +}; =20 static void port92_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index ba5c987bd2..d187de3745 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -30,6 +30,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "cpu.h" +#include "qom/object.h" =20 /* debug only vmmouse */ //#define DEBUG_VMMOUSE @@ -50,10 +51,10 @@ #endif =20 #define TYPE_VMMOUSE "vmmouse" +typedef struct VMMouseState VMMouseState; #define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE) =20 -typedef struct VMMouseState -{ +struct VMMouseState { ISADevice parent_obj; =20 uint32_t queue[VMMOUSE_QUEUE_SIZE]; @@ -63,7 +64,7 @@ typedef struct VMMouseState uint8_t absolute; QEMUPutMouseEntry *entry; ISAKBDState *i8042; -} VMMouseState; +}; =20 static void vmmouse_get_data(uint32_t *data) { diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index 89bda9108e..3720834630 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -38,6 +38,7 @@ #include "qemu/log.h" #include "cpu.h" #include "trace.h" +#include "qom/object.h" =20 #define VMPORT_MAGIC 0x564D5868 =20 @@ -62,9 +63,10 @@ #define VCPU_INFO_LEGACY_X2APIC_BIT 3 #define VCPU_INFO_RESERVED_BIT 31 =20 +typedef struct VMPortState VMPortState; #define VMPORT(obj) OBJECT_CHECK(VMPortState, (obj), TYPE_VMPORT) =20 -typedef struct VMPortState { +struct VMPortState { ISADevice parent_obj; =20 MemoryRegion io; @@ -75,7 +77,7 @@ typedef struct VMPortState { uint8_t vmware_vmx_type; =20 uint32_t compat_flags; -} VMPortState; +}; =20 static VMPortState *port_state; =20 diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index a1492fdecd..e8dbd580c5 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -39,6 +39,7 @@ #include "qemu/module.h" =20 #include +#include "qom/object.h" =20 //#define DEBUG_PLATFORM =20 @@ -52,7 +53,7 @@ =20 #define PFFLAG_ROM_LOCK 1 /* Sets whether ROM memory area is RW or RO */ =20 -typedef struct PCIXenPlatformState { +struct PCIXenPlatformState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -67,7 +68,8 @@ typedef struct PCIXenPlatformState { /* Log from guest drivers */ char log_buffer[4096]; int log_buffer_off; -} PCIXenPlatformState; +}; +typedef struct PCIXenPlatformState PCIXenPlatformState; =20 #define TYPE_XEN_PLATFORM "xen-platform" #define XEN_PLATFORM(obj) \ diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index ee2610c7a0..518c66d0bf 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -36,13 +36,15 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_XEN_PV_DEVICE "xen-pvdevice" =20 +typedef struct XenPVDevice XenPVDevice; #define XEN_PV_DEVICE(obj) \ OBJECT_CHECK(XenPVDevice, (obj), TYPE_XEN_PV_DEVICE) =20 -typedef struct XenPVDevice { +struct XenPVDevice { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -51,7 +53,7 @@ typedef struct XenPVDevice { uint8_t revision; uint32_t size; MemoryRegion mmio; -} XenPVDevice; +}; =20 static uint64_t xen_pv_mmio_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/ide/isa.c b/hw/ide/isa.c index f28c8fba6c..438f74e67c 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -32,14 +32,16 @@ #include "sysemu/dma.h" =20 #include "hw/ide/internal.h" +#include "qom/object.h" =20 /***********************************************************/ /* ISA IDE definitions */ =20 #define TYPE_ISA_IDE "isa-ide" +typedef struct ISAIDEState ISAIDEState; #define ISA_IDE(obj) OBJECT_CHECK(ISAIDEState, (obj), TYPE_ISA_IDE) =20 -typedef struct ISAIDEState { +struct ISAIDEState { ISADevice parent_obj; =20 IDEBus bus; @@ -47,7 +49,7 @@ typedef struct ISAIDEState { uint32_t iobase2; uint32_t isairq; qemu_irq irq; -} ISAIDEState; +}; =20 static void isa_ide_reset(DeviceState *d) { diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index c4cc0a84eb..28f171bf15 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -31,8 +31,10 @@ #include "sysemu/dma.h" =20 #include "hw/ide/internal.h" +#include "qom/object.h" =20 #define TYPE_MICRODRIVE "microdrive" +typedef struct MicroDriveState MicroDriveState; #define MICRODRIVE(obj) OBJECT_CHECK(MicroDriveState, (obj), TYPE_MICRODRI= VE) =20 /***********************************************************/ @@ -42,7 +44,7 @@ =20 /* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface. */ =20 -typedef struct MicroDriveState { +struct MicroDriveState { /*< private >*/ PCMCIACardState parent_obj; /*< public >*/ @@ -59,7 +61,7 @@ typedef struct MicroDriveState { uint8_t ctrl; uint16_t io; uint8_t cycle; -} MicroDriveState; +}; =20 /* Register bitfields */ enum md_opt { diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index d233bd8c01..501afdfaaa 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -31,6 +31,7 @@ =20 #include "hw/ide/internal.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 /***********************************************************/ /* MMIO based ide port @@ -39,9 +40,10 @@ */ =20 #define TYPE_MMIO_IDE "mmio-ide" +typedef struct MMIOIDEState MMIOState; #define MMIO_IDE(obj) OBJECT_CHECK(MMIOState, (obj), TYPE_MMIO_IDE) =20 -typedef struct MMIOIDEState { +struct MMIOIDEState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -51,7 +53,7 @@ typedef struct MMIOIDEState { uint32_t shift; qemu_irq irq; MemoryRegion iomem1, iomem2; -} MMIOState; +}; =20 static void mmio_ide_reset(DeviceState *dev) { diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 94d2b57f95..11c5b88bbf 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -16,8 +16,10 @@ #include "hw/ide/pci.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_SII3112_PCI "sii3112" +typedef struct SiI3112PCIState SiI3112PCIState; #define SII3112_PCI(obj) OBJECT_CHECK(SiI3112PCIState, (obj), \ TYPE_SII3112_PCI) =20 @@ -28,11 +30,11 @@ typedef struct SiI3112Regs { uint8_t swdata; } SiI3112Regs; =20 -typedef struct SiI3112PCIState { +struct SiI3112PCIState { PCIIDEState i; MemoryRegion mmio; SiI3112Regs regs[2]; -} SiI3112PCIState; +}; =20 /* The sii3112_reg_read and sii3112_reg_write functions implement the * Internal Register Space - BAR5 (section 6.7 of the data sheet). diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c index 3cfb6a7a20..a439bf6361 100644 --- a/hw/input/adb-kbd.c +++ b/hw/input/adb-kbd.c @@ -30,30 +30,33 @@ #include "hw/input/adb-keys.h" #include "adb-internal.h" #include "trace.h" +#include "qom/object.h" =20 +typedef struct ADBKeyboardClass ADBKeyboardClass; +typedef struct KBDState KBDState; #define ADB_KEYBOARD(obj) OBJECT_CHECK(KBDState, (obj), TYPE_ADB_KEYBOARD) =20 -typedef struct KBDState { +struct KBDState { /*< private >*/ ADBDevice parent_obj; /*< public >*/ =20 uint8_t data[128]; int rptr, wptr, count; -} KBDState; +}; =20 #define ADB_KEYBOARD_CLASS(class) \ OBJECT_CLASS_CHECK(ADBKeyboardClass, (class), TYPE_ADB_KEYBOARD) #define ADB_KEYBOARD_GET_CLASS(obj) \ OBJECT_GET_CLASS(ADBKeyboardClass, (obj), TYPE_ADB_KEYBOARD) =20 -typedef struct ADBKeyboardClass { +struct ADBKeyboardClass { /*< private >*/ ADBDeviceClass parent_class; /*< public >*/ =20 DeviceRealize parent_realize; -} ADBKeyboardClass; +}; =20 /* The adb keyboard doesn't have every key imaginable */ #define NO_KEY 0xff diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c index 577a38ff2e..8e4cf470d4 100644 --- a/hw/input/adb-mouse.c +++ b/hw/input/adb-mouse.c @@ -29,30 +29,33 @@ #include "qemu/module.h" #include "adb-internal.h" #include "trace.h" +#include "qom/object.h" =20 +typedef struct ADBMouseClass ADBMouseClass; +typedef struct MouseState MouseState; #define ADB_MOUSE(obj) OBJECT_CHECK(MouseState, (obj), TYPE_ADB_MOUSE) =20 -typedef struct MouseState { +struct MouseState { /*< public >*/ ADBDevice parent_obj; /*< private >*/ =20 int buttons_state, last_buttons_state; int dx, dy, dz; -} MouseState; +}; =20 #define ADB_MOUSE_CLASS(class) \ OBJECT_CLASS_CHECK(ADBMouseClass, (class), TYPE_ADB_MOUSE) #define ADB_MOUSE_GET_CLASS(obj) \ OBJECT_GET_CLASS(ADBMouseClass, (obj), TYPE_ADB_MOUSE) =20 -typedef struct ADBMouseClass { +struct ADBMouseClass { /*< public >*/ ADBDeviceClass parent_class; /*< private >*/ =20 DeviceRealize parent_realize; -} ADBMouseClass; +}; =20 static void adb_mouse_event(void *opaque, int dx1, int dy1, int dz1, int buttons_state) diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index aa629ddbf1..aab94d2815 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -25,11 +25,13 @@ #include "qemu/module.h" #include "qemu/timer.h" #include "ui/console.h" +#include "qom/object.h" =20 #define TYPE_LM8323 "lm8323" +typedef struct LM823KbdState LM823KbdState; #define LM8323(obj) OBJECT_CHECK(LM823KbdState, (obj), TYPE_LM8323) =20 -typedef struct { +struct LM823KbdState { I2CSlave parent_obj; =20 uint8_t i2c_dir; @@ -72,7 +74,7 @@ typedef struct { uint8_t addr[3]; QEMUTimer *tm[3]; } pwm; -} LM823KbdState; +}; =20 #define INT_KEYPAD (1 << 0) #define INT_ERROR (1 << 3) diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c index 3e0a7eb0bd..8b5ffd28f2 100644 --- a/hw/input/milkymist-softusb.c +++ b/hw/input/milkymist-softusb.c @@ -32,6 +32,7 @@ #include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 enum { R_CTRL =3D 0, @@ -50,6 +51,7 @@ enum { #define COMLOC_KEVT_BASE 0x1143 =20 #define TYPE_MILKYMIST_SOFTUSB "milkymist-softusb" +typedef struct MilkymistSoftUsbState MilkymistSoftUsbState; #define MILKYMIST_SOFTUSB(obj) \ OBJECT_CHECK(MilkymistSoftUsbState, (obj), TYPE_MILKYMIST_SOFTUSB) =20 @@ -80,7 +82,6 @@ struct MilkymistSoftUsbState { /* keyboard state */ uint8_t kbd_hid_buffer[8]; }; -typedef struct MilkymistSoftUsbState MilkymistSoftUsbState; =20 static uint64_t softusb_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 1123037b38..8eb6866953 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -14,11 +14,13 @@ #include "hw/irq.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_PL050 "pl050" +typedef struct PL050State PL050State; #define PL050(obj) OBJECT_CHECK(PL050State, (obj), TYPE_PL050) =20 -typedef struct PL050State { +struct PL050State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -29,7 +31,7 @@ typedef struct PL050State { int pending; qemu_irq irq; bool is_mouse; -} PL050State; +}; =20 static const VMStateDescription vmstate_pl050 =3D { .name =3D "pl050", diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 38aabd60cd..e055bb3af2 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -28,6 +28,7 @@ #include "trace.h" #include "hw/i386/apic-msidef.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define MAX_APICS 255 #define MAX_APIC_WORDS 8 diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index 07b95143c9..6e5a2b8fe0 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -29,8 +29,10 @@ #include "kvm_arm.h" #include "gic_internal.h" #include "vgic_common.h" +#include "qom/object.h" =20 #define TYPE_KVM_ARM_GIC "kvm-arm-gic" +typedef struct KVMARMGICClass KVMARMGICClass; #define KVM_ARM_GIC(obj) \ OBJECT_CHECK(GICState, (obj), TYPE_KVM_ARM_GIC) #define KVM_ARM_GIC_CLASS(klass) \ @@ -38,11 +40,11 @@ #define KVM_ARM_GIC_GET_CLASS(obj) \ OBJECT_GET_CLASS(KVMARMGICClass, (obj), TYPE_KVM_ARM_GIC) =20 -typedef struct KVMARMGICClass { +struct KVMARMGICClass { ARMGICCommonClass parent_class; DeviceRealize parent_realize; void (*parent_reset)(DeviceState *dev); -} KVMARMGICClass; +}; =20 void kvm_arm_gic_set_irq(uint32_t num_irq, int irq, int level) { diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index 0b7e2b4f84..8fb566d187 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -34,8 +34,10 @@ #include "sysemu/kvm.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_ARM_GICV2M "arm-gicv2m" +typedef struct ARMGICv2mState ARMGICv2mState; #define ARM_GICV2M(obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2= M) =20 #define GICV2M_NUM_SPI_MAX 128 @@ -48,7 +50,7 @@ =20 #define PRODUCT_ID_QEMU 0x51 /* ASCII code Q */ =20 -typedef struct ARMGICv2mState { +struct ARMGICv2mState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -56,7 +58,7 @@ typedef struct ARMGICv2mState { =20 uint32_t base_spi; uint32_t num_spi; -} ARMGICv2mState; +}; =20 static void gicv2m_set_irq(void *opaque, int irq) { diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index 46835ed085..631adc34b6 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -27,18 +27,20 @@ #include "sysemu/kvm.h" #include "kvm_arm.h" #include "migration/blocker.h" +#include "qom/object.h" =20 #define TYPE_KVM_ARM_ITS "arm-its-kvm" +typedef struct KVMARMITSClass KVMARMITSClass; #define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_I= TS) #define KVM_ARM_ITS_CLASS(klass) \ OBJECT_CLASS_CHECK(KVMARMITSClass, (klass), TYPE_KVM_ARM_ITS) #define KVM_ARM_ITS_GET_CLASS(obj) \ OBJECT_GET_CLASS(KVMARMITSClass, (obj), TYPE_KVM_ARM_ITS) =20 -typedef struct KVMARMITSClass { +struct KVMARMITSClass { GICv3ITSCommonClass parent_class; void (*parent_reset)(DeviceState *dev); -} KVMARMITSClass; +}; =20 =20 static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t dev= id) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index eddd07c743..5733936334 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -31,6 +31,7 @@ #include "gicv3_internal.h" #include "vgic_common.h" #include "migration/blocker.h" +#include "qom/object.h" =20 #ifdef DEBUG_GICV3_KVM #define DPRINTF(fmt, ...) \ @@ -41,6 +42,7 @@ #endif =20 #define TYPE_KVM_ARM_GICV3 "kvm-arm-gicv3" +typedef struct KVMARMGICv3Class KVMARMGICv3Class; #define KVM_ARM_GICV3(obj) \ OBJECT_CHECK(GICv3State, (obj), TYPE_KVM_ARM_GICV3) #define KVM_ARM_GICV3_CLASS(klass) \ @@ -74,11 +76,11 @@ #define ICC_IGRPEN1_EL1 \ KVM_DEV_ARM_VGIC_SYSREG(3, 0, 12, 12, 7) =20 -typedef struct KVMARMGICv3Class { +struct KVMARMGICv3Class { ARMGICv3CommonClass parent_class; DeviceRealize parent_realize; void (*parent_reset)(DeviceState *dev); -} KVMARMGICv3Class; +}; =20 static void kvm_arm_gicv3_set_irq(void *opaque, int irq, int level) { diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c index 12988c7aa9..cf4b3c5850 100644 --- a/hw/intc/etraxfs_pic.c +++ b/hw/intc/etraxfs_pic.c @@ -27,6 +27,7 @@ #include "qemu/module.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define D(x) =20 diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index 59dd27fb16..8e54f156c4 100644 --- a/hw/intc/exynos4210_combiner.c +++ b/hw/intc/exynos4210_combiner.c @@ -36,6 +36,7 @@ #include "hw/hw.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 //#define DEBUG_COMBINER =20 @@ -63,10 +64,11 @@ typedef struct CombinerGroupState { } CombinerGroupState; =20 #define TYPE_EXYNOS4210_COMBINER "exynos4210.combiner" +typedef struct Exynos4210CombinerState Exynos4210CombinerState; #define EXYNOS4210_COMBINER(obj) \ OBJECT_CHECK(Exynos4210CombinerState, (obj), TYPE_EXYNOS4210_COMBINER) =20 -typedef struct Exynos4210CombinerState { +struct Exynos4210CombinerState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -77,7 +79,7 @@ typedef struct Exynos4210CombinerState { uint32_t external; /* 1 means that this combiner is external = */ =20 qemu_irq output_irq[IIC_NGRP]; -} Exynos4210CombinerState; +}; =20 static const VMStateDescription vmstate_exynos4210_combiner_group_state = =3D { .name =3D "exynos4210.combiner.groupstate", diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index 0aa3b843a9..ded31466ce 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -28,6 +28,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/arm/exynos4210.h" +#include "qom/object.h" =20 enum ExtGicId { EXT_GIC_ID_MDMA_LCD0 =3D 66, @@ -264,10 +265,11 @@ uint32_t exynos4210_get_irq(uint32_t grp, uint32_t bi= t) /********* GIC part *********/ =20 #define TYPE_EXYNOS4210_GIC "exynos4210.gic" +typedef struct Exynos4210GicState Exynos4210GicState; #define EXYNOS4210_GIC(obj) \ OBJECT_CHECK(Exynos4210GicState, (obj), TYPE_EXYNOS4210_GIC) =20 -typedef struct { +struct Exynos4210GicState { SysBusDevice parent_obj; =20 MemoryRegion cpu_container; @@ -276,7 +278,7 @@ typedef struct { MemoryRegion dist_alias[EXYNOS4210_NCPUS]; uint32_t num_cpu; DeviceState *gic; -} Exynos4210GicState; +}; =20 static void exynos4210_gic_set_irq(void *opaque, int irq, int level) { @@ -382,16 +384,17 @@ type_init(exynos4210_gic_register_types) */ =20 #define TYPE_EXYNOS4210_IRQ_GATE "exynos4210.irq_gate" +typedef struct Exynos4210IRQGateState Exynos4210IRQGateState; #define EXYNOS4210_IRQ_GATE(obj) \ OBJECT_CHECK(Exynos4210IRQGateState, (obj), TYPE_EXYNOS4210_IRQ_GATE) =20 -typedef struct Exynos4210IRQGateState { +struct Exynos4210IRQGateState { SysBusDevice parent_obj; =20 uint32_t n_in; /* inputs amount */ uint32_t *level; /* input levels */ qemu_irq out; /* output IRQ */ -} Exynos4210IRQGateState; +}; =20 static Property exynos4210_irq_gate_properties[] =3D { DEFINE_PROP_UINT32("n_in", Exynos4210IRQGateState, n_in, 1), diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c index 794c643af2..5a60396390 100644 --- a/hw/intc/grlib_irqmp.c +++ b/hw/intc/grlib_irqmp.c @@ -35,6 +35,7 @@ #include "trace.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define IRQMP_MAX_CPU 16 #define IRQMP_REG_SIZE 256 /* Size of memory mapped registers */ @@ -50,18 +51,19 @@ #define FORCE_OFFSET 0x80 #define EXTENDED_OFFSET 0xC0 =20 +typedef struct IRQMP IRQMP; #define GRLIB_IRQMP(obj) OBJECT_CHECK(IRQMP, (obj), TYPE_GRLIB_IRQMP) =20 typedef struct IRQMPState IRQMPState; =20 -typedef struct IRQMP { +struct IRQMP { SysBusDevice parent_obj; =20 MemoryRegion iomem; =20 IRQMPState *state; qemu_irq irq; -} IRQMP; +}; =20 struct IRQMPState { uint32_t level; diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index 51b27f6a34..9663207d34 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -30,6 +30,7 @@ #include "qemu/log.h" #include "hw/isa/i8259_internal.h" #include "trace.h" +#include "qom/object.h" =20 /* debug PIC */ //#define DEBUG_PIC @@ -37,6 +38,7 @@ //#define DEBUG_IRQ_LATENCY =20 #define TYPE_I8259 "isa-i8259" +typedef struct PICClass PICClass; #define PIC_CLASS(class) OBJECT_CLASS_CHECK(PICClass, (class), TYPE_I8259) #define PIC_GET_CLASS(obj) OBJECT_GET_CLASS(PICClass, (obj), TYPE_I8259) =20 @@ -44,11 +46,11 @@ * PICClass: * @parent_realize: The parent's realizefn. */ -typedef struct PICClass { +struct PICClass { PICCommonClass parent_class; =20 DeviceRealize parent_realize; -} PICClass; +}; =20 #ifdef DEBUG_IRQ_LATENCY static int64_t irq_time[16]; diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c index 36de670c9e..b08d9822ab 100644 --- a/hw/intc/lm32_pic.c +++ b/hw/intc/lm32_pic.c @@ -27,8 +27,10 @@ #include "hw/lm32/lm32_pic.h" #include "hw/intc/intc.h" #include "hw/irq.h" +#include "qom/object.h" =20 #define TYPE_LM32_PIC "lm32-pic" +typedef struct LM32PicState LM32PicState; #define LM32_PIC(obj) OBJECT_CHECK(LM32PicState, (obj), TYPE_LM32_PIC) =20 struct LM32PicState { @@ -42,7 +44,6 @@ struct LM32PicState { /* statistics */ uint64_t stats_irq_count[32]; }; -typedef struct LM32PicState LM32PicState; =20 static void update_irq(LM32PicState *s) { diff --git a/hw/intc/loongson_liointc.c b/hw/intc/loongson_liointc.c index 23ca51cc2e..e11ca68647 100644 --- a/hw/intc/loongson_liointc.c +++ b/hw/intc/loongson_liointc.c @@ -23,6 +23,7 @@ #include "qemu/module.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define D(x) =20 diff --git a/hw/intc/nios2_iic.c b/hw/intc/nios2_iic.c index 86d088f9b5..2594381a95 100644 --- a/hw/intc/nios2_iic.c +++ b/hw/intc/nios2_iic.c @@ -25,16 +25,18 @@ #include "hw/irq.h" #include "hw/sysbus.h" #include "cpu.h" +#include "qom/object.h" =20 #define TYPE_ALTERA_IIC "altera,iic" +typedef struct AlteraIIC AlteraIIC; #define ALTERA_IIC(obj) \ OBJECT_CHECK(AlteraIIC, (obj), TYPE_ALTERA_IIC) =20 -typedef struct AlteraIIC { +struct AlteraIIC { SysBusDevice parent_obj; void *cpu; qemu_irq parent_irq; -} AlteraIIC; +}; =20 static void update_irq(AlteraIIC *pv) { diff --git a/hw/intc/ompic.c b/hw/intc/ompic.c index c354427a61..8dd763d6c5 100644 --- a/hw/intc/ompic.c +++ b/hw/intc/ompic.c @@ -15,8 +15,10 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "exec/memory.h" +#include "qom/object.h" =20 #define TYPE_OR1K_OMPIC "or1k-ompic" +typedef struct OR1KOMPICState OR1KOMPICState; #define OR1K_OMPIC(obj) OBJECT_CHECK(OR1KOMPICState, (obj), TYPE_OR1K_OMPI= C) =20 #define OMPIC_CTRL_IRQ_ACK (1 << 31) @@ -37,7 +39,6 @@ #define OMPIC_MAX_CPUS 4 /* Real max is much higher, but dont waste memory= */ #define OMPIC_ADDRSPACE_SZ (OMPIC_MAX_CPUS * 2 * 4) /* 2 32-bit regs per c= pu */ =20 -typedef struct OR1KOMPICState OR1KOMPICState; typedef struct OR1KOMPICCPUState OR1KOMPICCPUState; =20 struct OR1KOMPICCPUState { diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index e4bf47d885..3f5891a8a1 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -35,13 +35,15 @@ #include "sysemu/kvm.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define GCR_RESET 0x80000000 =20 +typedef struct KVMOpenPICState KVMOpenPICState; #define KVM_OPENPIC(obj) \ OBJECT_CHECK(KVMOpenPICState, (obj), TYPE_KVM_OPENPIC) =20 -typedef struct KVMOpenPICState { +struct KVMOpenPICState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -51,7 +53,7 @@ typedef struct KVMOpenPICState { uint32_t fd; uint32_t model; hwaddr mapped; -} KVMOpenPICState; +}; =20 static void kvm_openpic_set_irq(void *opaque, int n_IRQ, int level) { diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c index e3bd3dd121..4f2aa58642 100644 --- a/hw/intc/pl190.c +++ b/hw/intc/pl190.c @@ -13,6 +13,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* The number of virtual priority levels. 16 user vectors plus the unvectored IRQ. Chained interrupts would require an additional level @@ -21,9 +22,10 @@ #define PL190_NUM_PRIO 17 =20 #define TYPE_PL190 "pl190" +typedef struct PL190State PL190State; #define PL190(obj) OBJECT_CHECK(PL190State, (obj), TYPE_PL190) =20 -typedef struct PL190State { +struct PL190State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -41,7 +43,7 @@ typedef struct PL190State { int prev_prio[PL190_NUM_PRIO]; qemu_irq irq; qemu_irq fiq; -} PL190State; +}; =20 static const unsigned char pl190_id[] =3D { 0x90, 0x11, 0x04, 0x00, 0x0D, 0xf0, 0x05, 0xb1 }; diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c index 090d4839d1..3a8bc154ba 100644 --- a/hw/intc/puv3_intc.c +++ b/hw/intc/puv3_intc.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "hw/irq.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" @@ -19,9 +20,10 @@ #include "qemu/log.h" =20 #define TYPE_PUV3_INTC "puv3_intc" +typedef struct PUV3INTCState PUV3INTCState; #define PUV3_INTC(obj) OBJECT_CHECK(PUV3INTCState, (obj), TYPE_PUV3_INTC) =20 -typedef struct PUV3INTCState { +struct PUV3INTCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -29,7 +31,7 @@ typedef struct PUV3INTCState { =20 uint32_t reg_ICMR; uint32_t reg_ICPR; -} PUV3INTCState; +}; =20 /* Update interrupt status after enabled or pending bits have been changed= . */ static void puv3_intc_update(PUV3INTCState *s) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index dbd4e682ce..c4ae10d978 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -24,6 +24,7 @@ #include "hw/s390x/css.h" #include "migration/qemu-file-types.h" #include "trace.h" +#include "qom/object.h" =20 #define FLIC_SAVE_INITIAL_SIZE qemu_real_host_page_size #define FLIC_FAILED (-1UL) @@ -569,10 +570,11 @@ static const VMStateDescription kvm_s390_flic_vmstate= =3D { } }; =20 -typedef struct KVMS390FLICStateClass { +struct KVMS390FLICStateClass { S390FLICStateClass parent_class; DeviceRealize parent_realize; -} KVMS390FLICStateClass; +}; +typedef struct KVMS390FLICStateClass KVMS390FLICStateClass; =20 #define KVM_S390_FLIC_GET_CLASS(obj) \ OBJECT_GET_CLASS(KVMS390FLICStateClass, (obj), TYPE_KVM_S390_FLIC) diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index c4cf9096eb..7675556868 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -30,6 +30,7 @@ #include "hw/intc/intc.h" #include "hw/irq.h" #include "trace.h" +#include "qom/object.h" =20 //#define DEBUG_IRQ_COUNT =20 @@ -58,10 +59,11 @@ typedef struct SLAVIO_CPUINTCTLState { } SLAVIO_CPUINTCTLState; =20 #define TYPE_SLAVIO_INTCTL "slavio_intctl" +typedef struct SLAVIO_INTCTLState SLAVIO_INTCTLState; #define SLAVIO_INTCTL(obj) \ OBJECT_CHECK(SLAVIO_INTCTLState, (obj), TYPE_SLAVIO_INTCTL) =20 -typedef struct SLAVIO_INTCTLState { +struct SLAVIO_INTCTLState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -73,7 +75,7 @@ typedef struct SLAVIO_INTCTLState { uint32_t intregm_pending; uint32_t intregm_disabled; uint32_t target_cpu; -} SLAVIO_INTCTLState; +}; =20 #define INTCTL_MAXADDR 0xf #define INTCTL_SIZE (INTCTL_MAXADDR + 1) diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 3e65e68619..ed1c2bcfb8 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -27,6 +27,7 @@ #include "qemu/module.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define D(x) =20 diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index f931d4df62..81d3521d8f 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -16,6 +16,7 @@ #include "migration/vmstate.h" #include "qemu/bitops.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* #define DEBUG_TPCI */ =20 @@ -54,7 +55,7 @@ #define REG_STATUS 0x0C #define IP_N_FROM_REG(REG) ((REG) / 2 - 1) =20 -typedef struct { +struct TPCI200State { PCIDevice dev; IPackBus bus; MemoryRegion mmio; @@ -67,7 +68,8 @@ typedef struct { uint8_t ctrl[N_MODULES]; uint16_t status; uint8_t int_set; -} TPCI200State; +}; +typedef struct TPCI200State TPCI200State; =20 #define TYPE_TPCI200 "tpci200" =20 diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index f9a13e0a44..018667e0ca 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -36,6 +36,7 @@ #include "hw/ipmi/ipmi.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define VM_MSG_CHAR 0xA0 /* Marks end of message */ #define VM_CMD_CHAR 0xA1 /* Marks end of a command */ @@ -61,9 +62,10 @@ #define VM_CMD_GRACEFUL_SHUTDOWN 0x09 =20 #define TYPE_IPMI_BMC_EXTERN "ipmi-bmc-extern" +typedef struct IPMIBmcExtern IPMIBmcExtern; #define IPMI_BMC_EXTERN(obj) OBJECT_CHECK(IPMIBmcExtern, (obj), \ TYPE_IPMI_BMC_EXTERN) -typedef struct IPMIBmcExtern { +struct IPMIBmcExtern { IPMIBmc parent; =20 CharBackend chr; @@ -85,7 +87,7 @@ typedef struct IPMIBmcExtern { =20 /* A reset event is pending to be sent upstream. */ bool send_reset; -} IPMIBmcExtern; +}; =20 static unsigned char ipmb_checksum(const unsigned char *data, int size, unsigned char start) diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index c8dc0a09dc..90b3ba1232 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -31,18 +31,20 @@ #include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define TYPE_ISA_IPMI_BT "isa-ipmi-bt" +typedef struct ISAIPMIBTDevice ISAIPMIBTDevice; #define ISA_IPMI_BT(obj) OBJECT_CHECK(ISAIPMIBTDevice, (obj), \ TYPE_ISA_IPMI_BT) =20 -typedef struct ISAIPMIBTDevice { +struct ISAIPMIBTDevice { ISADevice dev; int32_t isairq; qemu_irq irq; IPMIBT bt; uint32_t uuid; -} ISAIPMIBTDevice; +}; =20 static void isa_ipmi_bt_get_fwinfo(struct IPMIInterface *ii, IPMIFwInfo *i= nfo) { diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index 4b421c33f4..ac7caa26ec 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -31,18 +31,20 @@ #include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define TYPE_ISA_IPMI_KCS "isa-ipmi-kcs" +typedef struct ISAIPMIKCSDevice ISAIPMIKCSDevice; #define ISA_IPMI_KCS(obj) OBJECT_CHECK(ISAIPMIKCSDevice, (obj), \ TYPE_ISA_IPMI_KCS) =20 -typedef struct ISAIPMIKCSDevice { +struct ISAIPMIKCSDevice { ISADevice dev; int32_t isairq; qemu_irq irq; IPMIKCS kcs; uint32_t uuid; -} ISAIPMIKCSDevice; +}; =20 static void isa_ipmi_kcs_get_fwinfo(IPMIInterface *ii, IPMIFwInfo *info) { diff --git a/hw/ipmi/pci_ipmi_bt.c b/hw/ipmi/pci_ipmi_bt.c index ba9cf016b5..cfc7275042 100644 --- a/hw/ipmi/pci_ipmi_bt.c +++ b/hw/ipmi/pci_ipmi_bt.c @@ -26,17 +26,19 @@ #include "qapi/error.h" #include "hw/ipmi/ipmi_bt.h" #include "hw/pci/pci.h" +#include "qom/object.h" =20 #define TYPE_PCI_IPMI_BT "pci-ipmi-bt" +typedef struct PCIIPMIBTDevice PCIIPMIBTDevice; #define PCI_IPMI_BT(obj) OBJECT_CHECK(PCIIPMIBTDevice, (obj), \ TYPE_PCI_IPMI_BT) =20 -typedef struct PCIIPMIBTDevice { +struct PCIIPMIBTDevice { PCIDevice dev; IPMIBT bt; bool irq_enabled; uint32_t uuid; -} PCIIPMIBTDevice; +}; =20 static void pci_ipmi_raise_irq(IPMIBT *ik) { diff --git a/hw/ipmi/pci_ipmi_kcs.c b/hw/ipmi/pci_ipmi_kcs.c index 99f46152f4..e4a1603d4e 100644 --- a/hw/ipmi/pci_ipmi_kcs.c +++ b/hw/ipmi/pci_ipmi_kcs.c @@ -26,17 +26,19 @@ #include "qapi/error.h" #include "hw/ipmi/ipmi_kcs.h" #include "hw/pci/pci.h" +#include "qom/object.h" =20 #define TYPE_PCI_IPMI_KCS "pci-ipmi-kcs" +typedef struct PCIIPMIKCSDevice PCIIPMIKCSDevice; #define PCI_IPMI_KCS(obj) OBJECT_CHECK(PCIIPMIKCSDevice, (obj), \ TYPE_PCI_IPMI_KCS) =20 -typedef struct PCIIPMIKCSDevice { +struct PCIIPMIKCSDevice { PCIDevice dev; IPMIKCS kcs; bool irq_enabled; uint32_t uuid; -} PCIIPMIKCSDevice; +}; =20 static void pci_ipmi_raise_irq(IPMIKCS *ik) { diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c index f1a0148755..baa8389331 100644 --- a/hw/ipmi/smbus_ipmi.c +++ b/hw/ipmi/smbus_ipmi.c @@ -27,8 +27,10 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/ipmi/ipmi.h" +#include "qom/object.h" =20 #define TYPE_SMBUS_IPMI "smbus-ipmi" +typedef struct SMBusIPMIDevice SMBusIPMIDevice; #define SMBUS_IPMI(obj) OBJECT_CHECK(SMBusIPMIDevice, (obj), TYPE_SMBUS_IP= MI) =20 #define SSIF_IPMI_REQUEST 2 @@ -44,7 +46,7 @@ =20 #define IPMI_GET_SYS_INTF_CAP_CMD 0x57 =20 -typedef struct SMBusIPMIDevice { +struct SMBusIPMIDevice { SMBusDevice parent; =20 IPMIBmc *bmc; @@ -67,7 +69,7 @@ typedef struct SMBusIPMIDevice { uint8_t waiting_rsp; =20 uint32_t uuid; -} SMBusIPMIDevice; +}; =20 static void smbus_ipmi_handle_event(IPMIInterface *ii) { diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 75a2da2881..4060d22c07 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -24,18 +24,20 @@ #include "hw/timer/i8254.h" #include "migration/vmstate.h" #include "hw/audio/pcspk.h" +#include "qom/object.h" =20 #define TYPE_I82378 "i82378" +typedef struct I82378State I82378State; #define I82378(obj) \ OBJECT_CHECK(I82378State, (obj), TYPE_I82378) =20 -typedef struct I82378State { +struct I82378State { PCIDevice parent_obj; =20 qemu_irq out[2]; qemu_irq *i8259; MemoryRegion io; -} I82378State; +}; =20 static const VMStateDescription vmstate_i82378 =3D { .name =3D "pci-i82378", diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index ac044afa95..fdbc20e30a 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -38,10 +38,11 @@ #include "migration/vmstate.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" +#include "qom/object.h" =20 PCIDevice *piix4_dev; =20 -typedef struct PIIX4State { +struct PIIX4State { PCIDevice dev; qemu_irq cpu_intr; qemu_irq *isa; @@ -50,7 +51,8 @@ typedef struct PIIX4State { /* Reset Control Register */ MemoryRegion rcr_mem; uint8_t rcr; -} PIIX4State; +}; +typedef struct PIIX4State PIIX4State; =20 #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 18160ca445..24047538d0 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -27,6 +27,7 @@ #include "qemu/module.h" #include "qemu/timer.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 /* #define DEBUG_VT82C686B */ =20 @@ -42,11 +43,12 @@ typedef struct SuperIOConfig { uint8_t data; } SuperIOConfig; =20 -typedef struct VT82C686BState { +struct VT82C686BState { PCIDevice dev; MemoryRegion superio; SuperIOConfig superio_conf; -} VT82C686BState; +}; +typedef struct VT82C686BState VT82C686BState; =20 #define TYPE_VT82C686B_DEVICE "VT82C686B" #define VT82C686B_DEVICE(obj) \ @@ -159,22 +161,25 @@ static void vt82c686b_write_config(PCIDevice *d, uint= 32_t address, =20 #define ACPI_DBG_IO_ADDR 0xb044 =20 -typedef struct VT686PMState { +struct VT686PMState { PCIDevice dev; MemoryRegion io; ACPIREGS ar; APMState apm; PMSMBus smb; uint32_t smb_io_base; -} VT686PMState; +}; +typedef struct VT686PMState VT686PMState; =20 -typedef struct VT686AC97State { +struct VT686AC97State { PCIDevice dev; -} VT686AC97State; +}; +typedef struct VT686AC97State VT686AC97State; =20 -typedef struct VT686MC97State { +struct VT686MC97State { PCIDevice dev; -} VT686MC97State; +}; +typedef struct VT686MC97State VT686MC97State; =20 #define TYPE_VT82C686B_PM_DEVICE "VT82C686B_PM" #define VT82C686B_PM_DEVICE(obj) \ diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c index e01e2e111b..e628567cf3 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -15,11 +15,13 @@ #include "hw/irq.h" #include "hw/sysbus.h" #include "hw/m68k/mcf.h" +#include "qom/object.h" =20 #define TYPE_MCF_INTC "mcf-intc" +typedef struct mcf_intc_state mcf_intc_state; #define MCF_INTC(obj) OBJECT_CHECK(mcf_intc_state, (obj), TYPE_MCF_INTC) =20 -typedef struct { +struct mcf_intc_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -30,7 +32,7 @@ typedef struct { uint8_t icr[64]; M68kCPU *cpu; int active_vector; -} mcf_intc_state; +}; =20 static void mcf_intc_update(mcf_intc_state *s) { diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index d3f25cd6d7..25168c449f 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -21,6 +21,7 @@ #include "hw/loader.h" #include "hw/scsi/esp.h" #include "hw/sysbus.h" +#include "qom/object.h" #include "hw/char/escc.h" /* ZILOG 8530 Serial Emulation */ #include "hw/block/fdc.h" #include "hw/qdev-properties.h" @@ -37,6 +38,7 @@ #endif =20 #define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube") +typedef struct NeXTState NeXTState; #define NEXT_MACHINE(obj) OBJECT_CHECK(NeXTState, (obj), TYPE_NEXT_MACHINE) =20 #define ENTRY 0x0100001e @@ -69,7 +71,7 @@ typedef struct NextRtc { uint8_t retval; } NextRtc; =20 -typedef struct { +struct NeXTState { MachineState parent; =20 uint32_t int_mask; @@ -87,7 +89,7 @@ typedef struct { uint32_t scr2; =20 NextRtc rtc; -} NeXTState; +}; =20 /* Thanks to NeXT forums for this */ /* diff --git a/hw/m68k/next-kbd.c b/hw/m68k/next-kbd.c index 2dff87be15..a6316314ea 100644 --- a/hw/m68k/next-kbd.c +++ b/hw/m68k/next-kbd.c @@ -36,7 +36,9 @@ #include "ui/console.h" #include "sysemu/sysemu.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 +typedef struct NextKBDState NextKBDState; #define NEXTKBD(obj) OBJECT_CHECK(NextKBDState, (obj), TYPE_NEXTKBD) =20 /* following defintions from next68k netbsd */ @@ -63,12 +65,12 @@ typedef struct { } KBDQueue; =20 =20 -typedef struct NextKBDState { +struct NextKBDState { SysBusDevice sbd; MemoryRegion mr; KBDQueue queue; uint16_t shift; -} NextKBDState; +}; =20 static void queue_code(void *opaque, int code); =20 diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pm= u.c index 5f994547f7..f679aeee0d 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -24,10 +24,12 @@ =20 #include "hw/intc/xlnx-zynqmp-ipi.h" #include "hw/intc/xlnx-pmu-iomod-intc.h" +#include "qom/object.h" =20 /* Define the PMU device */ =20 #define TYPE_XLNX_ZYNQMP_PMU_SOC "xlnx,zynqmp-pmu-soc" +typedef struct XlnxZynqMPPMUSoCState XlnxZynqMPPMUSoCState; #define XLNX_ZYNQMP_PMU_SOC(obj) OBJECT_CHECK(XlnxZynqMPPMUSoCState, (obj)= , \ TYPE_XLNX_ZYNQMP_PMU_SOC) =20 @@ -46,7 +48,7 @@ static const uint64_t ipi_irq[XLNX_ZYNQMP_PMU_NUM_IPIS] = =3D { 19, 20, 21, 22, }; =20 -typedef struct XlnxZynqMPPMUSoCState { +struct XlnxZynqMPPMUSoCState { /*< private >*/ DeviceState parent_obj; =20 @@ -54,7 +56,7 @@ typedef struct XlnxZynqMPPMUSoCState { MicroBlazeCPU cpu; XlnxPMUIOIntc intc; XlnxZynqMPIPI ipi[XLNX_ZYNQMP_PMU_NUM_IPIS]; -} XlnxZynqMPPMUSoCState; +}; =20 =20 static void xlnx_zynqmp_pmu_soc_init(Object *obj) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 766458c015..e2c35b4fd8 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -41,11 +41,13 @@ #include "sysemu/runstate.h" =20 #include +#include "qom/object.h" =20 #define TYPE_MIPS_BOSTON "mips-boston" +typedef struct BostonState BostonState; #define BOSTON(obj) OBJECT_CHECK(BostonState, (obj), TYPE_MIPS_BOSTON) =20 -typedef struct { +struct BostonState { SysBusDevice parent_obj; =20 MachineState *mach; @@ -58,7 +60,7 @@ typedef struct { =20 hwaddr kernel_entry; hwaddr fdt_base; -} BostonState; +}; =20 enum boston_plat_reg { PLAT_FPGA_BUILD =3D 0x00, diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 756ac9ae12..bd7ec182fb 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -35,6 +35,7 @@ #include "hw/irq.h" #include "exec/address-spaces.h" #include "trace.h" +#include "qom/object.h" =20 #define GT_REGS (0x1000 >> 2) =20 @@ -230,10 +231,11 @@ =20 #define TYPE_GT64120_PCI_HOST_BRIDGE "gt64120" =20 +typedef struct GT64120State GT64120State; #define GT64120_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(GT64120State, (obj), TYPE_GT64120_PCI_HOST_BRIDGE) =20 -typedef struct GT64120State { +struct GT64120State { PCIHostState parent_obj; =20 uint32_t regs[GT_REGS]; @@ -243,7 +245,7 @@ typedef struct GT64120State { PCI_MAPPING_ENTRY(ISD); MemoryRegion pci0_mem; AddressSpace pci0_mem_as; -} GT64120State; +}; =20 /* Adjust range to avoid touching space which isn't mappable via PCI */ /* diff --git a/hw/mips/malta.c b/hw/mips/malta.c index a59e20c81c..86ae544104 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -45,6 +45,7 @@ #include "hw/loader.h" #include "elf.h" #include "exec/address-spaces.h" +#include "qom/object.h" #include "hw/sysbus.h" /* SysBusDevice */ #include "qemu/host-utils.h" #include "sysemu/qtest.h" @@ -88,14 +89,15 @@ typedef struct { } MaltaFPGAState; =20 #define TYPE_MIPS_MALTA "mips-malta" +typedef struct MaltaState MaltaState; #define MIPS_MALTA(obj) OBJECT_CHECK(MaltaState, (obj), TYPE_MIPS_MALTA) =20 -typedef struct { +struct MaltaState { SysBusDevice parent_obj; =20 MIPSCPSState cps; qemu_irq i8259[ISA_NUM_IRQS]; -} MaltaState; +}; =20 static struct _loaderparams { int ram_size, ram_low_size; diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 1c4addb201..e3c7b1765c 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -36,6 +36,7 @@ #include "ui/console.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qom/object.h" =20 /* #define DEBUG_SMC */ =20 @@ -89,9 +90,9 @@ struct AppleSMCData { QLIST_ENTRY(AppleSMCData) node; }; =20 +typedef struct AppleSMCState AppleSMCState; #define APPLE_SMC(obj) OBJECT_CHECK(AppleSMCState, (obj), TYPE_APPLE_SMC) =20 -typedef struct AppleSMCState AppleSMCState; struct AppleSMCState { ISADevice parent_obj; =20 diff --git a/hw/misc/arm_integrator_debug.c b/hw/misc/arm_integrator_debug.c index 3e23201ae6..4ad2b6a98b 100644 --- a/hw/misc/arm_integrator_debug.c +++ b/hw/misc/arm_integrator_debug.c @@ -19,15 +19,17 @@ #include "hw/misc/arm_integrator_debug.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 +typedef struct IntegratorDebugState IntegratorDebugState; #define INTEGRATOR_DEBUG(obj) \ OBJECT_CHECK(IntegratorDebugState, (obj), TYPE_INTEGRATOR_DEBUG) =20 -typedef struct { +struct IntegratorDebugState { SysBusDevice parent_obj; =20 MemoryRegion iomem; -} IntegratorDebugState; +}; =20 static uint64_t intdbg_control_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c index 2066c97f5f..f75d7988cc 100644 --- a/hw/misc/arm_l2x0.c +++ b/hw/misc/arm_l2x0.c @@ -24,14 +24,16 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* L2C-310 r3p2 */ #define CACHE_ID 0x410000c8 =20 #define TYPE_ARM_L2X0 "l2x0" +typedef struct L2x0State L2x0State; #define ARM_L2X0(obj) OBJECT_CHECK(L2x0State, (obj), TYPE_ARM_L2X0) =20 -typedef struct L2x0State { +struct L2x0State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -42,7 +44,7 @@ typedef struct L2x0State { uint32_t tag_ctrl; uint32_t filter_start; uint32_t filter_end; -} L2x0State; +}; =20 static const VMStateDescription vmstate_l2x0 =3D { .name =3D "l2x0", diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index a474bbdd19..a3faa516d6 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -18,14 +18,16 @@ #include "hw/arm/primecell.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define LOCK_VALUE 0xa05f =20 #define TYPE_ARM_SYSCTL "realview_sysctl" +typedef struct arm_sysctl_state arm_sysctl_state; #define ARM_SYSCTL(obj) \ OBJECT_CHECK(arm_sysctl_state, (obj), TYPE_ARM_SYSCTL) =20 -typedef struct { +struct arm_sysctl_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -51,7 +53,7 @@ typedef struct { uint32_t *db_voltage; uint32_t db_num_clocks; uint32_t *db_clock_reset; -} arm_sysctl_state; +}; =20 static const VMStateDescription vmstate_arm_sysctl =3D { .name =3D "realview_sysctl", diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index 99a814f10c..6c1f9adc38 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -11,18 +11,20 @@ #include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit" +typedef struct ISADebugExitState ISADebugExitState; #define ISA_DEBUG_EXIT_DEVICE(obj) \ OBJECT_CHECK(ISADebugExitState, (obj), TYPE_ISA_DEBUG_EXIT_DEVICE) =20 -typedef struct ISADebugExitState { +struct ISADebugExitState { ISADevice parent_obj; =20 uint32_t iobase; uint32_t iosize; MemoryRegion io; -} ISADebugExitState; +}; =20 static uint64_t debug_exit_read(void *opaque, hwaddr addr, unsigned size) { diff --git a/hw/misc/eccmemctl.c b/hw/misc/eccmemctl.c index aec447368e..47bec04c8e 100644 --- a/hw/misc/eccmemctl.c +++ b/hw/misc/eccmemctl.c @@ -29,6 +29,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 /* There are 3 versions of this chip used in SMP sun4m systems: * MCC (version 0, implementation 0) SS-600MP @@ -126,9 +127,10 @@ #define ECC_DIAG_MASK (ECC_DIAG_SIZE - 1) =20 #define TYPE_ECC_MEMCTL "eccmemctl" +typedef struct ECCState ECCState; #define ECC_MEMCTL(obj) OBJECT_CHECK(ECCState, (obj), TYPE_ECC_MEMCTL) =20 -typedef struct ECCState { +struct ECCState { SysBusDevice parent_obj; =20 MemoryRegion iomem, iomem_diag; @@ -136,7 +138,7 @@ typedef struct ECCState { uint32_t regs[ECC_NREGS]; uint8_t diag[ECC_DIAG_SIZE]; uint32_t version; -} ECCState; +}; =20 static void ecc_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index ec617e63f3..2db9d63eeb 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -28,11 +28,13 @@ #include "hw/hw.h" #include "hw/pci/msi.h" #include "qemu/timer.h" +#include "qom/object.h" #include "qemu/main-loop.h" /* iothread mutex */ #include "qemu/module.h" #include "qapi/visitor.h" =20 #define TYPE_PCI_EDU_DEVICE "edu" +typedef struct EduState EduState; #define EDU(obj) OBJECT_CHECK(EduState, obj, TYPE_PCI_EDU_DEVICE) =20 #define FACT_IRQ 0x00000001 @@ -41,7 +43,7 @@ #define DMA_START 0x40000 #define DMA_SIZE 4096 =20 -typedef struct { +struct EduState { PCIDevice pdev; MemoryRegion mmio; =20 @@ -72,7 +74,7 @@ typedef struct { QEMUTimer dma_timer; char dma_buf[DMA_SIZE]; uint64_t dma_mask; -} EduState; +}; =20 static bool edu_msi_enabled(EduState *edu) { diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index 9a011b1c11..ec3e510b3e 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -15,17 +15,19 @@ #include "hw/misc/empty_slot.h" #include "qapi/error.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_EMPTY_SLOT "empty_slot" +typedef struct EmptySlot EmptySlot; #define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT) =20 -typedef struct EmptySlot { +struct EmptySlot { SysBusDevice parent_obj; =20 MemoryRegion iomem; char *name; uint64_t size; -} EmptySlot; +}; =20 static uint64_t empty_slot_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/misc/exynos4210_clk.c b/hw/misc/exynos4210_clk.c index bc1463ff89..c54f360aa8 100644 --- a/hw/misc/exynos4210_clk.c +++ b/hw/misc/exynos4210_clk.c @@ -22,8 +22,10 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_EXYNOS4210_CLK "exynos4210.clk" +typedef struct Exynos4210ClkState Exynos4210ClkState; #define EXYNOS4210_CLK(obj) \ OBJECT_CHECK(Exynos4210ClkState, (obj), TYPE_EXYNOS4210_CLK) =20 @@ -55,12 +57,12 @@ static const Exynos4210Reg exynos4210_clk_regs[] =3D { =20 #define EXYNOS4210_REGS_NUM ARRAY_SIZE(exynos4210_clk_regs) =20 -typedef struct Exynos4210ClkState { +struct Exynos4210ClkState { SysBusDevice parent_obj; =20 MemoryRegion iomem; uint32_t reg[EXYNOS4210_REGS_NUM]; -} Exynos4210ClkState; +}; =20 static uint64_t exynos4210_clk_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/misc/exynos4210_pmu.c b/hw/misc/exynos4210_pmu.c index 500f28343f..e6bbb1f7c8 100644 --- a/hw/misc/exynos4210_pmu.c +++ b/hw/misc/exynos4210_pmu.c @@ -29,6 +29,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/runstate.h" +#include "qom/object.h" =20 #ifndef DEBUG_PMU #define DEBUG_PMU 0 @@ -394,15 +395,16 @@ static const Exynos4210PmuReg exynos4210_pmu_regs[] = =3D { #define PMU_NUM_OF_REGISTERS ARRAY_SIZE(exynos4210_pmu_regs) =20 #define TYPE_EXYNOS4210_PMU "exynos4210.pmu" +typedef struct Exynos4210PmuState Exynos4210PmuState; #define EXYNOS4210_PMU(obj) \ OBJECT_CHECK(Exynos4210PmuState, (obj), TYPE_EXYNOS4210_PMU) =20 -typedef struct Exynos4210PmuState { +struct Exynos4210PmuState { SysBusDevice parent_obj; =20 MemoryRegion iomem; uint32_t reg[PMU_NUM_OF_REGISTERS]; -} Exynos4210PmuState; +}; =20 static void exynos4210_pmu_poweroff(void) { diff --git a/hw/misc/exynos4210_rng.c b/hw/misc/exynos4210_rng.c index 38cd61c7ea..3e2ec4f543 100644 --- a/hw/misc/exynos4210_rng.c +++ b/hw/misc/exynos4210_rng.c @@ -24,6 +24,7 @@ #include "qemu/log.h" #include "qemu/guest-random.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define DEBUG_EXYNOS_RNG 0 =20 @@ -35,6 +36,7 @@ } while (0) =20 #define TYPE_EXYNOS4210_RNG "exynos4210.rng" +typedef struct Exynos4210RngState Exynos4210RngState; #define EXYNOS4210_RNG(obj) \ OBJECT_CHECK(Exynos4210RngState, (obj), TYPE_EXYNOS4210_RNG) =20 @@ -68,7 +70,7 @@ =20 #define EXYNOS4210_RNG_REGS_MEM_SIZE 0x200 =20 -typedef struct Exynos4210RngState { +struct Exynos4210RngState { SysBusDevice parent_obj; MemoryRegion iomem; =20 @@ -79,7 +81,7 @@ typedef struct Exynos4210RngState { /* Register values */ uint32_t reg_control; uint32_t reg_status; -} Exynos4210RngState; +}; =20 static bool exynos4210_rng_seed_ready(const Exynos4210RngState *s) { diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 2b6882face..1f65f6f2ac 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -38,6 +38,7 @@ #include "qapi/visitor.h" =20 #include "hw/misc/ivshmem.h" +#include "qom/object.h" =20 #define PCI_VENDOR_ID_IVSHMEM PCI_VENDOR_ID_REDHAT_QUMRANET #define PCI_DEVICE_ID_IVSHMEM 0x1110 @@ -57,6 +58,7 @@ } while (0) =20 #define TYPE_IVSHMEM_COMMON "ivshmem-common" +typedef struct IVShmemState IVShmemState; #define IVSHMEM_COMMON(obj) \ OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_COMMON) =20 @@ -83,7 +85,7 @@ typedef struct MSIVector { bool unmasked; } MSIVector; =20 -typedef struct IVShmemState { +struct IVShmemState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -115,7 +117,7 @@ typedef struct IVShmemState { /* migration stuff */ OnOffAuto master; Error *migration_blocker; -} IVShmemState; +}; =20 /* registers for the Inter-VM shared memory device */ enum ivshmem_registers { diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c index 61e86e6b34..cf3ed5a49c 100644 --- a/hw/misc/milkymist-hpdmc.c +++ b/hw/misc/milkymist-hpdmc.c @@ -27,6 +27,7 @@ #include "trace.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 enum { R_SYSTEM =3D 0, @@ -43,6 +44,7 @@ enum { }; =20 #define TYPE_MILKYMIST_HPDMC "milkymist-hpdmc" +typedef struct MilkymistHpdmcState MilkymistHpdmcState; #define MILKYMIST_HPDMC(obj) \ OBJECT_CHECK(MilkymistHpdmcState, (obj), TYPE_MILKYMIST_HPDMC) =20 @@ -53,7 +55,6 @@ struct MilkymistHpdmcState { =20 uint32_t regs[R_MAX]; }; -typedef struct MilkymistHpdmcState MilkymistHpdmcState; =20 static uint64_t hpdmc_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c index 516825e83d..81251792c1 100644 --- a/hw/misc/milkymist-pfpu.c +++ b/hw/misc/milkymist-pfpu.c @@ -31,6 +31,7 @@ #include "qemu/module.h" #include "qemu/error-report.h" #include +#include "qom/object.h" =20 /* #define TRACE_EXEC */ =20 @@ -120,6 +121,7 @@ static const char *opcode_to_str[] =3D { #endif =20 #define TYPE_MILKYMIST_PFPU "milkymist-pfpu" +typedef struct MilkymistPFPUState MilkymistPFPUState; #define MILKYMIST_PFPU(obj) \ OBJECT_CHECK(MilkymistPFPUState, (obj), TYPE_MILKYMIST_PFPU) =20 @@ -137,7 +139,6 @@ struct MilkymistPFPUState { int output_queue_pos; uint32_t output_queue[MAX_LATENCY]; }; -typedef struct MilkymistPFPUState MilkymistPFPUState; =20 static inline uint32_t get_dma_address(uint32_t base, uint32_t x, uint32_t y) diff --git a/hw/misc/mst_fpga.c b/hw/misc/mst_fpga.c index 81abdf8ede..314dd5fcbd 100644 --- a/hw/misc/mst_fpga.c +++ b/hw/misc/mst_fpga.c @@ -16,6 +16,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* Mainstone FPGA for extern irqs */ #define FPGA_GPIO_PIN 0 @@ -40,10 +41,11 @@ #define MST_PCMCIA_CD1_IRQ 13 =20 #define TYPE_MAINSTONE_FPGA "mainstone-fpga" +typedef struct mst_irq_state mst_irq_state; #define MAINSTONE_FPGA(obj) \ OBJECT_CHECK(mst_irq_state, (obj), TYPE_MAINSTONE_FPGA) =20 -typedef struct mst_irq_state{ +struct mst_irq_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -63,7 +65,7 @@ typedef struct mst_irq_state{ uint32_t intsetclr; uint32_t pcmcia0; uint32_t pcmcia1; -}mst_irq_state; +}; =20 static void mst_fpga_set_irq(void *opaque, int irq, int level) diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c index 8aa8e6549f..b7f3fcb254 100644 --- a/hw/misc/pc-testdev.c +++ b/hw/misc/pc-testdev.c @@ -39,10 +39,11 @@ #include "qemu/module.h" #include "hw/irq.h" #include "hw/isa/isa.h" +#include "qom/object.h" =20 #define IOMEM_LEN 0x10000 =20 -typedef struct PCTestdev { +struct PCTestdev { ISADevice parent_obj; =20 MemoryRegion ioport; @@ -52,7 +53,8 @@ typedef struct PCTestdev { MemoryRegion iomem; uint32_t ioport_data; char iomem_buf[IOMEM_LEN]; -} PCTestdev; +}; +typedef struct PCTestdev PCTestdev; =20 #define TYPE_TESTDEV "pc-testdev" #define TESTDEV(obj) \ diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c index e4ccdeaf78..9cd51b1afd 100644 --- a/hw/misc/pca9552.c +++ b/hw/misc/pca9552.c @@ -22,15 +22,17 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "trace.h" +#include "qom/object.h" =20 -typedef struct PCA955xClass { +struct PCA955xClass { /*< private >*/ I2CSlaveClass parent_class; /*< public >*/ =20 uint8_t pin_count; uint8_t max_reg; -} PCA955xClass; +}; +typedef struct PCA955xClass PCA955xClass; =20 #define PCA955X_CLASS(klass) \ OBJECT_CLASS_CHECK(PCA955xClass, (klass), TYPE_PCA955X) diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 188de4d9cc..db6d0d5a71 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -24,6 +24,7 @@ #include "qemu/event_notifier.h" #include "qemu/module.h" #include "sysemu/kvm.h" +#include "qom/object.h" =20 typedef struct PCITestDevHdr { uint8_t test; @@ -78,7 +79,7 @@ enum { #define IOTEST_ACCESS_TYPE uint8_t #define IOTEST_ACCESS_WIDTH (sizeof(uint8_t)) =20 -typedef struct PCITestDevState { +struct PCITestDevState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -90,7 +91,8 @@ typedef struct PCITestDevState { =20 uint64_t membar_size; MemoryRegion membar; -} PCITestDevState; +}; +typedef struct PCITestDevState PCITestDevState; =20 #define TYPE_PCI_TEST_DEV "pci-testdev" =20 diff --git a/hw/misc/puv3_pm.c b/hw/misc/puv3_pm.c index 8989d363cd..e549c0ff21 100644 --- a/hw/misc/puv3_pm.c +++ b/hw/misc/puv3_pm.c @@ -11,6 +11,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" @@ -18,9 +19,10 @@ #include "qemu/log.h" =20 #define TYPE_PUV3_PM "puv3_pm" +typedef struct PUV3PMState PUV3PMState; #define PUV3_PM(obj) OBJECT_CHECK(PUV3PMState, (obj), TYPE_PUV3_PM) =20 -typedef struct PUV3PMState { +struct PUV3PMState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -31,7 +33,7 @@ typedef struct PUV3PMState { uint32_t reg_PLL_DDR_CFG; uint32_t reg_PLL_VGA_CFG; uint32_t reg_DIVCFG; -} PUV3PMState; +}; =20 static uint64_t puv3_pm_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index abb10bbcaf..894c67e6cc 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -20,6 +20,7 @@ #include "hw/nvram/fw_cfg.h" #include "hw/qdev-properties.h" #include "hw/misc/pvpanic.h" +#include "qom/object.h" =20 /* The bit of supported pv event, TODO: include uapi header and remove thi= s */ #define PVPANIC_F_PANICKED 0 @@ -29,6 +30,7 @@ #define PVPANIC_PANICKED (1 << PVPANIC_F_PANICKED) #define PVPANIC_CRASHLOADED (1 << PVPANIC_F_CRASHLOADED) =20 +typedef struct PVPanicState PVPanicState; #define ISA_PVPANIC_DEVICE(obj) \ OBJECT_CHECK(PVPanicState, (obj), TYPE_PVPANIC) =20 @@ -54,12 +56,12 @@ static void handle_event(int event) =20 #include "hw/isa/isa.h" =20 -typedef struct PVPanicState { +struct PVPanicState { ISADevice parent_obj; =20 MemoryRegion io; uint16_t ioport; -} PVPanicState; +}; =20 /* return supported events on read */ static uint64_t pvpanic_ioport_read(void *opaque, hwaddr addr, unsigned si= ze) diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 6866bf72cb..e5cc2da3d3 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -29,15 +29,17 @@ #include "hw/isa/isa.h" #include "hw/loader.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define SGABIOS_FILENAME "sgabios.bin" =20 #define TYPE_SGA "sga" +typedef struct ISASGAState ISASGAState; #define SGA(obj) OBJECT_CHECK(ISASGAState, (obj), TYPE_SGA) =20 -typedef struct ISASGAState { +struct ISASGAState { ISADevice parent_obj; -} ISASGAState; +}; =20 static void sga_realizefn(DeviceState *dev, Error **errp) { diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c index 279b38dfc7..f1a039b5a9 100644 --- a/hw/misc/slavio_misc.c +++ b/hw/misc/slavio_misc.c @@ -29,6 +29,7 @@ #include "qemu/module.h" #include "sysemu/runstate.h" #include "trace.h" +#include "qom/object.h" =20 /* * This is the auxio port, chip control and system control part of @@ -39,9 +40,10 @@ */ =20 #define TYPE_SLAVIO_MISC "slavio_misc" +typedef struct MiscState MiscState; #define SLAVIO_MISC(obj) OBJECT_CHECK(MiscState, (obj), TYPE_SLAVIO_MISC) =20 -typedef struct MiscState { +struct MiscState { SysBusDevice parent_obj; =20 MemoryRegion cfg_iomem; @@ -59,17 +61,18 @@ typedef struct MiscState { uint8_t diag, mctrl; uint8_t sysctrl; uint16_t leds; -} MiscState; +}; =20 #define TYPE_APC "apc" +typedef struct APCState APCState; #define APC(obj) OBJECT_CHECK(APCState, (obj), TYPE_APC) =20 -typedef struct APCState { +struct APCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; qemu_irq cpu_halt; -} APCState; +}; =20 #define MISC_SIZE 1 #define LED_SIZE 2 diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c index 49abe2d246..a289c83360 100644 --- a/hw/misc/tmp421.c +++ b/hw/misc/tmp421.c @@ -30,6 +30,7 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* Manufacturer / Device ID's */ #define TMP421_MANUFACTURER_ID 0x55 @@ -48,7 +49,7 @@ static const DeviceInfo devices[] =3D { { TMP423_DEVICE_ID, "tmp423" }, }; =20 -typedef struct TMP421State { +struct TMP421State { /*< private >*/ I2CSlave i2c; /*< public >*/ @@ -63,12 +64,14 @@ typedef struct TMP421State { uint8_t buf[2]; uint8_t pointer; =20 -} TMP421State; +}; +typedef struct TMP421State TMP421State; =20 -typedef struct TMP421Class { +struct TMP421Class { I2CSlaveClass parent_class; DeviceInfo *dev; -} TMP421Class; +}; +typedef struct TMP421Class TMP421Class; =20 #define TYPE_TMP421 "tmp421-generic" #define TMP421(obj) OBJECT_CHECK(TMP421State, (obj), TYPE_TMP421) diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c index f7472d1f3c..223f533ce8 100644 --- a/hw/misc/zynq_slcr.c +++ b/hw/misc/zynq_slcr.c @@ -23,6 +23,7 @@ #include "qemu/module.h" #include "hw/registerfields.h" #include "hw/qdev-clock.h" +#include "qom/object.h" =20 #ifndef ZYNQ_SLCR_ERR_DEBUG #define ZYNQ_SLCR_ERR_DEBUG 0 @@ -182,9 +183,10 @@ REG32(DDRIOB, 0xb40) #define ZYNQ_SLCR_NUM_REGS (ZYNQ_SLCR_MMIO_SIZE / 4) =20 #define TYPE_ZYNQ_SLCR "xilinx,zynq_slcr" +typedef struct ZynqSLCRState ZynqSLCRState; #define ZYNQ_SLCR(obj) OBJECT_CHECK(ZynqSLCRState, (obj), TYPE_ZYNQ_SLCR) =20 -typedef struct ZynqSLCRState { +struct ZynqSLCRState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -194,7 +196,7 @@ typedef struct ZynqSLCRState { Clock *ps_clk; Clock *uart0_ref_clk; Clock *uart1_ref_clk; -} ZynqSLCRState; +}; =20 /* * return the output frequency of ARM/DDR/IO pll diff --git a/hw/net/can/can_kvaser_pci.c b/hw/net/can/can_kvaser_pci.c index 4b941370d0..a84d98817c 100644 --- a/hw/net/can/can_kvaser_pci.c +++ b/hw/net/can/can_kvaser_pci.c @@ -43,9 +43,11 @@ #include "net/can_emu.h" =20 #include "can_sja1000.h" +#include "qom/object.h" =20 #define TYPE_CAN_PCI_DEV "kvaser_pci" =20 +typedef struct KvaserPCIState KvaserPCIState; #define KVASER_PCI_DEV(obj) \ OBJECT_CHECK(KvaserPCIState, (obj), TYPE_CAN_PCI_DEV) =20 @@ -78,7 +80,7 @@ =20 #define KVASER_PCI_XILINX_VERSION_NUMBER 13 =20 -typedef struct KvaserPCIState { +struct KvaserPCIState { /*< private >*/ PCIDevice dev; /*< public >*/ @@ -93,7 +95,7 @@ typedef struct KvaserPCIState { uint32_t s5920_irqstate; =20 CanBusState *canbus; -} KvaserPCIState; +}; =20 static void kvaser_pci_irq_handler(void *opaque, int irq_num, int level) { diff --git a/hw/net/can/can_mioe3680_pci.c b/hw/net/can/can_mioe3680_pci.c index 695e762a8d..8ded64c9b8 100644 --- a/hw/net/can/can_mioe3680_pci.c +++ b/hw/net/can/can_mioe3680_pci.c @@ -39,9 +39,11 @@ #include "net/can_emu.h" =20 #include "can_sja1000.h" +#include "qom/object.h" =20 #define TYPE_CAN_PCI_DEV "mioe3680_pci" =20 +typedef struct Mioe3680PCIState Mioe3680PCIState; #define MIOe3680_PCI_DEV(obj) \ OBJECT_CHECK(Mioe3680PCIState, (obj), TYPE_CAN_PCI_DEV) =20 @@ -59,7 +61,7 @@ =20 #define MIOe3680_PCI_BYTES_PER_SJA 0x80 =20 -typedef struct Mioe3680PCIState { +struct Mioe3680PCIState { /*< private >*/ PCIDevice dev; /*< public >*/ @@ -70,7 +72,7 @@ typedef struct Mioe3680PCIState { =20 char *model; /* The model that support, only SJA1000 now. */ CanBusState *canbus[MIOe3680_PCI_SJA_COUNT]; -} Mioe3680PCIState; +}; =20 static void mioe3680_pci_reset(DeviceState *dev) { diff --git a/hw/net/can/can_pcm3680_pci.c b/hw/net/can/can_pcm3680_pci.c index 4218e63eb2..f39228da89 100644 --- a/hw/net/can/can_pcm3680_pci.c +++ b/hw/net/can/can_pcm3680_pci.c @@ -39,9 +39,11 @@ #include "net/can_emu.h" =20 #include "can_sja1000.h" +#include "qom/object.h" =20 #define TYPE_CAN_PCI_DEV "pcm3680_pci" =20 +typedef struct Pcm3680iPCIState Pcm3680iPCIState; #define PCM3680i_PCI_DEV(obj) \ OBJECT_CHECK(Pcm3680iPCIState, (obj), TYPE_CAN_PCI_DEV) =20 @@ -59,7 +61,7 @@ =20 #define PCM3680i_PCI_BYTES_PER_SJA 0x20 =20 -typedef struct Pcm3680iPCIState { +struct Pcm3680iPCIState { /*< private >*/ PCIDevice dev; /*< public >*/ @@ -70,7 +72,7 @@ typedef struct Pcm3680iPCIState { =20 char *model; /* The model that support, only SJA1000 now. */ CanBusState *canbus[PCM3680i_PCI_SJA_COUNT]; -} Pcm3680iPCIState; +}; =20 static void pcm3680i_pci_reset(DeviceState *dev) { diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index c54db0d62d..b065d428ee 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -27,6 +27,7 @@ #include "qemu/module.h" #include "qemu/timer.h" #include +#include "qom/object.h" =20 //#define DEBUG_SONIC =20 @@ -150,9 +151,10 @@ do { printf("sonic ERROR: %s: " fmt, __func__ , ## __V= A_ARGS__); } while (0) #define SONIC_DESC_ADDR 0xFFFE =20 #define TYPE_DP8393X "dp8393x" +typedef struct dp8393xState dp8393xState; #define DP8393X(obj) OBJECT_CHECK(dp8393xState, (obj), TYPE_DP8393X) =20 -typedef struct dp8393xState { +struct dp8393xState { SysBusDevice parent_obj; =20 /* Hardware */ @@ -182,7 +184,7 @@ typedef struct dp8393xState { /* Memory access */ MemoryRegion *dma_mr; AddressSpace as; -} dp8393xState; +}; =20 /* Accessor functions for values which are formed by * concatenating two 16 bit device registers. By putting these diff --git a/hw/net/e1000.c b/hw/net/e1000.c index c4d896a9e6..f8925a10e6 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -39,6 +39,7 @@ =20 #include "e1000x_common.h" #include "trace.h" +#include "qom/object.h" =20 static const uint8_t bcast[] =3D {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; =20 @@ -76,7 +77,7 @@ static int debugflags =3D DBGBIT(TXERR) | DBGBIT(GENERAL); * Others never tested */ =20 -typedef struct E1000State_st { +struct E1000State_st { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -137,14 +138,16 @@ typedef struct E1000State_st { bool received_tx_tso; bool use_tso_for_migration; e1000x_txd_props mig_props; -} E1000State; +}; +typedef struct E1000State_st E1000State; =20 #define chkflag(x) (s->compat_flags & E1000_FLAG_##x) =20 -typedef struct E1000BaseClass { +struct E1000BaseClass { PCIDeviceClass parent_class; uint16_t phy_id2; -} E1000BaseClass; +}; +typedef struct E1000BaseClass E1000BaseClass; =20 #define TYPE_E1000_BASE "e1000-base" =20 diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index fda34518c9..d631765f2a 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -53,11 +53,13 @@ =20 #include "trace.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define TYPE_E1000E "e1000e" +typedef struct E1000EState E1000EState; #define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E) =20 -typedef struct E1000EState { +struct E1000EState { PCIDevice parent_obj; NICState *nic; NICConf conf; @@ -79,7 +81,7 @@ typedef struct E1000EState { =20 E1000ECore core; =20 -} E1000EState; +}; =20 #define E1000E_MMIO_IDX 0 #define E1000E_FLASH_IDX 1 diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index 3408ceacb5..2bd37f6d0f 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -30,6 +30,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 #define D(x) =20 @@ -323,11 +324,11 @@ static void mdio_cycle(struct qemu_mdio *bus) #define FS_ETH_MAX_REGS 0x17 =20 #define TYPE_ETRAX_FS_ETH "etraxfs-eth" +typedef struct ETRAXFSEthState ETRAXFSEthState; #define ETRAX_FS_ETH(obj) \ OBJECT_CHECK(ETRAXFSEthState, (obj), TYPE_ETRAX_FS_ETH) =20 -typedef struct ETRAXFSEthState -{ +struct ETRAXFSEthState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -348,7 +349,7 @@ typedef struct ETRAXFSEthState =20 /* PHY. */ struct qemu_phy phy; -} ETRAXFSEthState; +}; =20 static void eth_validate_duplex(ETRAXFSEthState *eth) { diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index e35f00fb9f..5d7f966aea 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -25,6 +25,7 @@ #include "qemu/module.h" /* For crc32 */ #include +#include "qom/object.h" =20 //#define DEBUG_LAN9118 =20 @@ -180,9 +181,10 @@ static const VMStateDescription vmstate_lan9118_packet= =3D { } }; =20 +typedef struct lan9118_state lan9118_state; #define LAN9118(obj) OBJECT_CHECK(lan9118_state, (obj), TYPE_LAN9118) =20 -typedef struct { +struct lan9118_state { SysBusDevice parent_obj; =20 NICState *nic; @@ -258,7 +260,7 @@ typedef struct { uint32_t read_long; =20 uint32_t mode_16bit; -} lan9118_state; +}; =20 static const VMStateDescription vmstate_lan9118 =3D { .name =3D "lan9118", diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 1ba01754ee..0ed01fec90 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qom/object.h" #include "cpu.h" /* FIXME: why does this use TARGET_PAGE_ALIGN? */ #include "hw/irq.h" #include "hw/qdev-properties.h" @@ -98,6 +99,7 @@ struct MilkymistMinimac2MdioState { typedef struct MilkymistMinimac2MdioState MilkymistMinimac2MdioState; =20 #define TYPE_MILKYMIST_MINIMAC2 "milkymist-minimac2" +typedef struct MilkymistMinimac2State MilkymistMinimac2State; #define MILKYMIST_MINIMAC2(obj) \ OBJECT_CHECK(MilkymistMinimac2State, (obj), TYPE_MILKYMIST_MINIMAC2) =20 @@ -123,7 +125,6 @@ struct MilkymistMinimac2State { uint8_t *rx1_buf; uint8_t *tx_buf; }; -typedef struct MilkymistMinimac2State MilkymistMinimac2State; =20 static const uint8_t preamble_sfd[] =3D { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5 diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c index 0c578c430c..094951abb3 100644 --- a/hw/net/mipsnet.c +++ b/hw/net/mipsnet.c @@ -6,6 +6,7 @@ #include "trace.h" #include "hw/sysbus.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 /* MIPSnet register offsets */ =20 @@ -24,9 +25,10 @@ #define MAX_ETH_FRAME_SIZE 1514 =20 #define TYPE_MIPS_NET "mipsnet" +typedef struct MIPSnetState MIPSnetState; #define MIPS_NET(obj) OBJECT_CHECK(MIPSnetState, (obj), TYPE_MIPS_NET) =20 -typedef struct MIPSnetState { +struct MIPSnetState { SysBusDevice parent_obj; =20 uint32_t busy; @@ -41,7 +43,7 @@ typedef struct MIPSnetState { qemu_irq irq; NICState *nic; NICConf conf; -} MIPSnetState; +}; =20 static void mipsnet_reset(MIPSnetState *s) { diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index a878056426..716f3b6618 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -31,16 +31,18 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/module.h" +#include "qom/object.h" =20 +typedef struct ISANE2000State ISANE2000State; #define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE200= 0) =20 -typedef struct ISANE2000State { +struct ISANE2000State { ISADevice parent_obj; =20 uint32_t iobase; uint32_t isairq; NE2000State ne2000; -} ISANE2000State; +}; =20 static NetClientInfo net_ne2000_isa_info =3D { .type =3D NET_CLIENT_DRIVER_NIC, diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c index 2ba0dc8c2f..6e3257d2f7 100644 --- a/hw/net/opencores_eth.c +++ b/hw/net/opencores_eth.c @@ -40,6 +40,7 @@ #include "qemu/module.h" #include "net/eth.h" #include "trace.h" +#include "qom/object.h" =20 /* RECSMALL is not used because it breaks tap networking in linux: * incoming ARP responses are too short @@ -271,9 +272,10 @@ typedef struct desc { #define DEFAULT_PHY 1 =20 #define TYPE_OPEN_ETH "open_eth" +typedef struct OpenEthState OpenEthState; #define OPEN_ETH(obj) OBJECT_CHECK(OpenEthState, (obj), TYPE_OPEN_ETH) =20 -typedef struct OpenEthState { +struct OpenEthState { SysBusDevice parent_obj; =20 NICState *nic; @@ -287,7 +289,7 @@ typedef struct OpenEthState { unsigned tx_desc; unsigned rx_desc; desc desc[128]; -} OpenEthState; +}; =20 static desc *rx_desc(OpenEthState *s) { diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 49d3e42e83..27f6566d5f 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -40,6 +40,7 @@ #include "trace.h" =20 #include "pcnet.h" +#include "qom/object.h" =20 //#define PCNET_DEBUG //#define PCNET_DEBUG_IO @@ -51,17 +52,18 @@ =20 #define TYPE_PCI_PCNET "pcnet" =20 +typedef struct PCIPCNetState PCIPCNetState; #define PCI_PCNET(obj) \ OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET) =20 -typedef struct { +struct PCIPCNetState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ =20 PCNetState state; MemoryRegion io_bar; -} PCIPCNetState; +}; =20 static void pcnet_aprom_writeb(void *opaque, uint32_t addr, uint32_t val) { diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index ab93d78ab3..69d7f36e98 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -62,6 +62,7 @@ #include "net/net.h" #include "net/eth.h" #include "sysemu/sysemu.h" +#include "qom/object.h" =20 /* debug RTL8139 card */ //#define DEBUG_RTL8139 1 @@ -93,6 +94,7 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *= fmt, ...) =20 #define TYPE_RTL8139 "rtl8139" =20 +typedef struct RTL8139State RTL8139State; #define RTL8139(obj) \ OBJECT_CHECK(RTL8139State, (obj), TYPE_RTL8139) =20 @@ -431,7 +433,7 @@ typedef struct RTL8139TallyCounters /* Clears all tally counters */ static void RTL8139TallyCounters_clear(RTL8139TallyCounters* counters); =20 -typedef struct RTL8139State { +struct RTL8139State { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -513,7 +515,7 @@ typedef struct RTL8139State { =20 /* Support migration to/from old versions */ int rtl8139_mmio_io_addr_dummy; -} RTL8139State; +}; =20 /* Writes tally counters to memory via DMA */ static void RTL8139TallyCounters_dma_write(RTL8139State *s, dma_addr_t tc_= addr); diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index a347b6a4d5..12da4b1f73 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -19,14 +19,16 @@ #include "qemu/module.h" /* For crc32 */ #include +#include "qom/object.h" =20 /* Number of 2k memory pages available. */ #define NUM_PACKETS 4 =20 #define TYPE_SMC91C111 "smc91c111" +typedef struct smc91c111_state smc91c111_state; #define SMC91C111(obj) OBJECT_CHECK(smc91c111_state, (obj), TYPE_SMC91C111) =20 -typedef struct { +struct smc91c111_state { SysBusDevice parent_obj; =20 NICState *nic; @@ -55,7 +57,7 @@ typedef struct { uint8_t int_level; uint8_t int_mask; MemoryRegion mmio; -} smc91c111_state; +}; =20 static const VMStateDescription vmstate_smc91c111 =3D { .name =3D "smc91c111", diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index 4cd02dda01..94b61a646c 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -38,6 +38,7 @@ #include "trace.h" =20 #include +#include "qom/object.h" =20 #define ETH_ALEN 6 #define MAX_PACKET_SIZE 65536 @@ -84,6 +85,7 @@ typedef uint64_t vlan_bd_t; #define VLAN_MAX_BUFS (VLAN_RX_BDS_LEN / 8) =20 #define TYPE_VIO_SPAPR_VLAN_DEVICE "spapr-vlan" +typedef struct SpaprVioVlan SpaprVioVlan; #define VIO_SPAPR_VLAN_DEVICE(obj) \ OBJECT_CHECK(SpaprVioVlan, (obj), TYPE_VIO_SPAPR_VLAN_DEVICE) =20 @@ -96,7 +98,7 @@ typedef struct { vlan_bd_t bds[RX_POOL_MAX_BDS]; } RxBufPool; =20 -typedef struct SpaprVioVlan { +struct SpaprVioVlan { SpaprVioDevice sdev; NICConf nicconf; NICState *nic; @@ -108,7 +110,7 @@ typedef struct SpaprVioVlan { QEMUTimer *rxp_timer; uint32_t compat_flags; /* Compatibility flags for migratio= n */ RxBufPool *rx_pool[RX_MAX_POOLS]; /* Receive buffer descriptor pools = */ -} SpaprVioVlan; +}; =20 static bool spapr_vlan_can_receive(NetClientState *nc) { diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index cb6e2509ea..786dc9a6c6 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -16,6 +16,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include +#include "qom/object.h" =20 //#define DEBUG_STELLARIS_ENET 1 =20 @@ -50,6 +51,7 @@ do { fprintf(stderr, "stellaris_enet: error: " fmt , ## _= _VA_ARGS__);} while (0) #define SE_TCTL_DUPLEX 0x08 =20 #define TYPE_STELLARIS_ENET "stellaris_enet" +typedef struct stellaris_enet_state stellaris_enet_state; #define STELLARIS_ENET(obj) \ OBJECT_CHECK(stellaris_enet_state, (obj), TYPE_STELLARIS_ENET) =20 @@ -58,7 +60,7 @@ typedef struct { uint32_t len; } StellarisEnetRxFrame; =20 -typedef struct { +struct stellaris_enet_state { SysBusDevice parent_obj; =20 uint32_t ris; @@ -82,7 +84,7 @@ typedef struct { NICConf conf; qemu_irq irq; MemoryRegion mmio; -} stellaris_enet_state; +}; =20 static const VMStateDescription vmstate_rx_frame =3D { .name =3D "stellaris_enet/rx_frame", diff --git a/hw/net/sungem.c b/hw/net/sungem.c index e4b7b57704..103a4e19d9 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -19,9 +19,11 @@ #include "hw/net/mii.h" #include "sysemu/sysemu.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_SUNGEM "sungem" =20 +typedef struct SunGEMState SunGEMState; #define SUNGEM(obj) OBJECT_CHECK(SunGEMState, (obj), TYPE_SUNGEM) =20 #define MAX_PACKET_SIZE 9016 @@ -192,7 +194,7 @@ struct gem_rxd { #define RXDCTRL_ALTMAC 0x2000000000000000ULL /* Matched ALT MAC */ =20 =20 -typedef struct { +struct SunGEMState { PCIDevice pdev; =20 MemoryRegion sungem; @@ -221,7 +223,7 @@ typedef struct { uint8_t tx_data[MAX_PACKET_SIZE]; uint32_t tx_size; uint64_t tx_first_ctl; -} SunGEMState; +}; =20 =20 static void sungem_eval_irq(SunGEMState *s) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index bc48d46b9f..43fb8da97c 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -33,6 +33,7 @@ #include "net/eth.h" #include "sysemu/sysemu.h" #include "trace.h" +#include "qom/object.h" =20 #define HME_REG_SIZE 0x8000 =20 @@ -129,6 +130,7 @@ #define MII_COMMAND_WRITE 0x1 =20 #define TYPE_SUNHME "sunhme" +typedef struct SunHMEState SunHMEState; #define SUNHME(obj) OBJECT_CHECK(SunHMEState, (obj), TYPE_SUNHME) =20 /* Maximum size of buffer */ @@ -153,7 +155,7 @@ =20 #define HME_MII_REGS_SIZE 0x20 =20 -typedef struct SunHMEState { +struct SunHMEState { /*< private >*/ PCIDevice parent_obj; =20 @@ -174,7 +176,7 @@ typedef struct SunHMEState { uint32_t mifregs[HME_MIF_REG_SIZE >> 2]; =20 uint16_t miiregs[HME_MII_REGS_SIZE]; -} SunHMEState; +}; =20 static Property sunhme_properties[] =3D { DEFINE_NIC_PROPERTIES(SunHMEState, conf), diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 7a6ca4ec35..ca3dddad92 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -35,6 +35,7 @@ #include "vmware_utils.h" #include "net_tx_pkt.h" #include "net_rx_pkt.h" +#include "qom/object.h" =20 #define PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION 0x1 #define VMXNET3_MSIX_BAR_SIZE 0x2000 @@ -128,10 +129,11 @@ =20 #define VMXNET_FLAG_IS_SET(field, flag) (((field) & (flag)) =3D=3D (flag)) =20 -typedef struct VMXNET3Class { +struct VMXNET3Class { PCIDeviceClass parent_class; DeviceRealize parent_dc_realize; -} VMXNET3Class; +}; +typedef struct VMXNET3Class VMXNET3Class; =20 #define VMXNET3_DEVICE_CLASS(klass) \ OBJECT_CLASS_CHECK(VMXNET3Class, (klass), TYPE_VMXNET3) diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index 5bf1b61012..10eebebe52 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -32,6 +32,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "net/net.h" +#include "qom/object.h" =20 #ifdef DEBUG_XGMAC #define DEBUGF_BRK(message, args...) do { \ @@ -139,9 +140,10 @@ typedef struct RxTxStats { } RxTxStats; =20 #define TYPE_XGMAC "xgmac" +typedef struct XgmacState XgmacState; #define XGMAC(obj) OBJECT_CHECK(XgmacState, (obj), TYPE_XGMAC) =20 -typedef struct XgmacState { +struct XgmacState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -153,7 +155,7 @@ typedef struct XgmacState { =20 struct RxTxStats stats; uint32_t regs[R_MAX]; -} XgmacState; +}; =20 static const VMStateDescription vmstate_rxtx_stats =3D { .name =3D "xgmac_stats", diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 2e89f236b4..18f28a386e 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -35,6 +35,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/stream.h" +#include "qom/object.h" =20 #define DPHY(x) =20 @@ -42,9 +43,11 @@ #define TYPE_XILINX_AXI_ENET_DATA_STREAM "xilinx-axienet-data-stream" #define TYPE_XILINX_AXI_ENET_CONTROL_STREAM "xilinx-axienet-control-stream" =20 +typedef struct XilinxAXIEnet XilinxAXIEnet; #define XILINX_AXI_ENET(obj) \ OBJECT_CHECK(XilinxAXIEnet, (obj), TYPE_XILINX_AXI_ENET) =20 +typedef struct XilinxAXIEnetStreamSlave XilinxAXIEnetStreamSlave; #define XILINX_AXI_ENET_DATA_STREAM(obj) \ OBJECT_CHECK(XilinxAXIEnetStreamSlave, (obj),\ TYPE_XILINX_AXI_ENET_DATA_STREAM) @@ -310,8 +313,6 @@ struct TEMAC { void *parent; }; =20 -typedef struct XilinxAXIEnetStreamSlave XilinxAXIEnetStreamSlave; -typedef struct XilinxAXIEnet XilinxAXIEnet; =20 struct XilinxAXIEnetStreamSlave { Object parent; diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 71d16fef3d..adf477960e 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" +#include "qom/object.h" #include "cpu.h" /* FIXME should not use tswap* */ #include "hw/sysbus.h" #include "hw/irq.h" diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c index d5cb922287..99e27e9174 100644 --- a/hw/nvram/ds1225y.c +++ b/hw/nvram/ds1225y.c @@ -29,6 +29,7 @@ #include "trace.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct { MemoryRegion iomem; @@ -109,13 +110,14 @@ static const VMStateDescription vmstate_nvram =3D { }; =20 #define TYPE_DS1225Y "ds1225y" +typedef struct SysBusNvRamState SysBusNvRamState; #define DS1225Y(obj) OBJECT_CHECK(SysBusNvRamState, (obj), TYPE_DS1225Y) =20 -typedef struct { +struct SysBusNvRamState { SysBusDevice parent_obj; =20 NvRamState nvram; -} SysBusNvRamState; +}; =20 static void nvram_sysbus_realize(DeviceState *dev, Error **errp) { diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c index d46a2bec3f..4bf7519bc7 100644 --- a/hw/nvram/eeprom_at24c.c +++ b/hw/nvram/eeprom_at24c.c @@ -14,6 +14,7 @@ #include "hw/i2c/i2c.h" #include "hw/qdev-properties.h" #include "sysemu/block-backend.h" +#include "qom/object.h" =20 /* #define DEBUG_AT24C */ =20 @@ -27,9 +28,10 @@ ## __VA_ARGS__) =20 #define TYPE_AT24C_EE "at24c-eeprom" +typedef struct EEPROMState EEPROMState; #define AT24C_EE(obj) OBJECT_CHECK(EEPROMState, (obj), TYPE_AT24C_EE) =20 -typedef struct EEPROMState { +struct EEPROMState { I2CSlave parent_obj; =20 /* address counter */ @@ -45,7 +47,7 @@ typedef struct EEPROMState { uint8_t *mem; =20 BlockBackend *blk; -} EEPROMState; +}; =20 static int at24c_eeprom_event(I2CSlave *s, enum i2c_event event) diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index 386513499f..b9218e0b89 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -39,14 +39,16 @@ #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 -typedef struct SpaprNvram { +struct SpaprNvram { SpaprVioDevice sdev; uint32_t size; uint8_t *buf; BlockBackend *blk; VMChangeStateEntry *vmstate; -} SpaprNvram; +}; +typedef struct SpaprNvram SpaprNvram; =20 #define TYPE_VIO_SPAPR_NVRAM "spapr-nvram" #define VIO_SPAPR_NVRAM(obj) \ diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c index 677a310b96..b35866d8d1 100644 --- a/hw/pci-bridge/dec.c +++ b/hw/pci-bridge/dec.c @@ -32,12 +32,14 @@ #include "hw/pci/pci_host.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_bus.h" +#include "qom/object.h" =20 +typedef struct DECState DECState; #define DEC_21154(obj) OBJECT_CHECK(DECState, (obj), TYPE_DEC_21154) =20 -typedef struct DECState { +struct DECState { PCIHostState parent_obj; -} DECState; +}; =20 static int dec_map_irq(PCIDevice *pci_dev, int irq_num) { diff --git a/hw/pci-bridge/gen_pcie_root_port.c b/hw/pci-bridge/gen_pcie_ro= ot_port.c index bb26e272c1..b62e20a648 100644 --- a/hw/pci-bridge/gen_pcie_root_port.c +++ b/hw/pci-bridge/gen_pcie_root_port.c @@ -17,8 +17,10 @@ #include "hw/pci/pcie_port.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define TYPE_GEN_PCIE_ROOT_PORT "pcie-root-port" +typedef struct GenPCIERootPort GenPCIERootPort; #define GEN_PCIE_ROOT_PORT(obj) \ OBJECT_CHECK(GenPCIERootPort, (obj), TYPE_GEN_PCIE_ROOT_PORT) =20 @@ -28,7 +30,7 @@ =20 #define GEN_PCIE_ROOT_PORT_MSIX_NR_VECTOR 1 =20 -typedef struct GenPCIERootPort { +struct GenPCIERootPort { /*< private >*/ PCIESlot parent_obj; /*< public >*/ @@ -37,7 +39,7 @@ typedef struct GenPCIERootPort { =20 /* additional resources to reserve */ PCIResReserve res_reserve; -} GenPCIERootPort; +}; =20 static uint8_t gen_rp_aer_vector(const PCIDevice *d) { diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 4a080b7c7b..bd1b10c848 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -31,9 +31,11 @@ #include "exec/memory.h" #include "hw/pci/pci_bus.h" #include "hw/hotplug.h" +#include "qom/object.h" =20 #define TYPE_PCI_BRIDGE_DEV "pci-bridge" #define TYPE_PCI_BRIDGE_SEAT_DEV "pci-bridge-seat" +typedef struct PCIBridgeDev PCIBridgeDev; #define PCI_BRIDGE_DEV(obj) \ OBJECT_CHECK(PCIBridgeDev, (obj), TYPE_PCI_BRIDGE_DEV) =20 @@ -52,7 +54,6 @@ struct PCIBridgeDev { /* additional resources to reserve */ PCIResReserve res_reserve; }; -typedef struct PCIBridgeDev PCIBridgeDev; =20 static void pci_bridge_dev_realize(PCIDevice *dev, Error **errp) { diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 22f9fc223b..4a31ee3748 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -22,35 +22,38 @@ #include "qemu/module.h" #include "sysemu/numa.h" #include "hw/boards.h" +#include "qom/object.h" =20 #define TYPE_PXB_BUS "pxb-bus" +typedef struct PXBBus PXBBus; #define PXB_BUS(obj) OBJECT_CHECK(PXBBus, (obj), TYPE_PXB_BUS) =20 #define TYPE_PXB_PCIE_BUS "pxb-pcie-bus" #define PXB_PCIE_BUS(obj) OBJECT_CHECK(PXBBus, (obj), TYPE_PXB_PCIE_BUS) =20 -typedef struct PXBBus { +struct PXBBus { /*< private >*/ PCIBus parent_obj; /*< public >*/ =20 char bus_path[8]; -} PXBBus; +}; =20 #define TYPE_PXB_DEVICE "pxb" +typedef struct PXBDev PXBDev; #define PXB_DEV(obj) OBJECT_CHECK(PXBDev, (obj), TYPE_PXB_DEVICE) =20 #define TYPE_PXB_PCIE_DEVICE "pxb-pcie" #define PXB_PCIE_DEV(obj) OBJECT_CHECK(PXBDev, (obj), TYPE_PXB_PCIE_DEVICE) =20 -typedef struct PXBDev { +struct PXBDev { /*< private >*/ PCIDevice parent_obj; /*< public >*/ =20 uint8_t bus_nr; uint16_t numa_node; -} PXBDev; +}; =20 static PXBDev *convert_to_pxb(PCIDevice *dev) { diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridg= e.c index eade133968..1178cd8620 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -17,15 +17,17 @@ #include "hw/pci/shpc.h" #include "hw/pci/slotid_cap.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 -typedef struct PCIEPCIBridge { +struct PCIEPCIBridge { /*< private >*/ PCIBridge parent_obj; =20 OnOffAuto msi; MemoryRegion shpc_bar; /*< public >*/ -} PCIEPCIBridge; +}; +typedef struct PCIEPCIBridge PCIEPCIBridge; =20 #define TYPE_PCIE_PCI_BRIDGE_DEV "pcie-pci-bridge" #define PCIE_PCI_BRIDGE_DEV(obj) \ diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 1405b3fc70..3b37f4f542 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -52,6 +52,7 @@ #include "exec/address-spaces.h" #include "hw/misc/unimp.h" #include "hw/registerfields.h" +#include "qom/object.h" =20 /* #define DEBUG_BONITO */ =20 @@ -200,7 +201,7 @@ FIELD(BONGENCFG, PCIQUEUE, 12, 1) =20 typedef struct BonitoState BonitoState; =20 -typedef struct PCIBonitoState { +struct PCIBonitoState { PCIDevice dev; =20 BonitoState *pcihost; @@ -228,7 +229,8 @@ typedef struct PCIBonitoState { MemoryRegion bonito_pciio; MemoryRegion bonito_localio; =20 -} PCIBonitoState; +}; +typedef struct PCIBonitoState PCIBonitoState; =20 struct BonitoState { PCIHostState parent_obj; diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 4b3af0c704..48a16269ad 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -33,11 +33,13 @@ #include "qapi/error.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 +typedef struct GrackleState GrackleState; #define GRACKLE_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(GrackleState, (obj), TYPE_GRACKLE_PCI_HOST_BRIDGE) =20 -typedef struct GrackleState { +struct GrackleState { PCIHostState parent_obj; =20 uint32_t ofw_addr; @@ -46,7 +48,7 @@ typedef struct GrackleState { MemoryRegion pci_mmio; MemoryRegion pci_hole; MemoryRegion pci_io; -} GrackleState; +}; =20 /* Don't know if this matches real hardware, but it agrees with OHW. */ static int pci_grackle_map_irq(PCIDevice *pci_dev, int irq_num) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 8ed2417f0c..ead7b7ef1c 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -35,22 +35,24 @@ #include "migration/vmstate.h" #include "qapi/visitor.h" #include "qemu/error-report.h" +#include "qom/object.h" =20 /* * I440FX chipset data sheet. * https://wiki.qemu.org/File:29054901.pdf */ =20 +typedef struct I440FXState I440FXState; #define I440FX_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_PCI_HOST_BRIDGE) =20 -typedef struct I440FXState { +struct I440FXState { PCIHostState parent_obj; Range pci_hole; uint64_t pci_hole64_size; bool pci_hole64_fix; uint32_t short_root_bus; -} I440FXState; +}; =20 #define I440FX_PAM 0x59 #define I440FX_PAM_SIZE 7 diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 82132c12ca..180a91a846 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -18,6 +18,7 @@ #include "hw/ppc/pnv.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define phb3_error(phb, fmt, ...) \ qemu_log_mask(LOG_GUEST_ERROR, "phb3[%d:%d]: " fmt "\n", \ diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 75ad766fe0..ec85de5c74 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -21,6 +21,7 @@ #include "hw/ppc/pnv_xscom.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define phb_error(phb, fmt, ...) \ qemu_log_mask(LOG_GUEST_ERROR, "phb4[%d:%d]: " fmt "\n", \ diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 1a62b2f8cc..b29e2be9ae 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -24,6 +24,7 @@ #include "qemu/bswap.h" #include "qemu/module.h" #include "hw/pci-host/ppce500.h" +#include "qom/object.h" =20 #ifdef DEBUG_PCI #define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) @@ -91,6 +92,7 @@ struct pci_inbound { =20 #define TYPE_PPC_E500_PCI_HOST_BRIDGE "e500-pcihost" =20 +typedef struct PPCE500PCIState PPCE500PCIState; #define PPC_E500_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(PPCE500PCIState, (obj), TYPE_PPC_E500_PCI_HOST_BRIDGE) =20 @@ -114,6 +116,7 @@ struct PPCE500PCIState { }; =20 #define TYPE_PPC_E500_PCI_BRIDGE "e500-host-bridge" +typedef struct PPCE500PCIBridgeState PPCE500PCIBridgeState; #define PPC_E500_PCI_BRIDGE(obj) \ OBJECT_CHECK(PPCE500PCIBridgeState, (obj), TYPE_PPC_E500_PCI_BRIDGE) =20 @@ -125,8 +128,6 @@ struct PPCE500PCIBridgeState { MemoryRegion bar0; }; =20 -typedef struct PPCE500PCIBridgeState PPCE500PCIBridgeState; -typedef struct PPCE500PCIState PPCE500PCIState; =20 static uint64_t pci_reg_read4(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 4b93fd2b01..af0c2eb941 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -38,25 +38,28 @@ #include "hw/or-irq.h" #include "exec/address-spaces.h" #include "elf.h" +#include "qom/object.h" =20 #define TYPE_RAVEN_PCI_DEVICE "raven" #define TYPE_RAVEN_PCI_HOST_BRIDGE "raven-pcihost" =20 +typedef struct RavenPCIState RavenPCIState; #define RAVEN_PCI_DEVICE(obj) \ OBJECT_CHECK(RavenPCIState, (obj), TYPE_RAVEN_PCI_DEVICE) =20 -typedef struct RavenPCIState { +struct RavenPCIState { PCIDevice dev; =20 uint32_t elf_machine; char *bios_name; MemoryRegion bios; -} RavenPCIState; +}; =20 +typedef struct PRePPCIState PREPPCIState; #define RAVEN_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(PREPPCIState, (obj), TYPE_RAVEN_PCI_HOST_BRIDGE) =20 -typedef struct PRePPCIState { +struct PRePPCIState { PCIHostState parent_obj; =20 qemu_or_irq *or_irq; @@ -75,7 +78,7 @@ typedef struct PRePPCIState { =20 int contiguous_map; bool is_legacy_prep; -} PREPPCIState; +}; =20 #define BIOS_SIZE (1 * MiB) =20 diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index 7e4aa467a2..e0d00baf94 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -18,6 +18,7 @@ #include "hw/qdev-properties.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* Old and buggy versions of QEMU used the wrong mapping from * PCI IRQs to system interrupt lines. Unfortunately the Linux @@ -71,7 +72,7 @@ enum { PCI_VPB_IRQMAP_FORCE_OK, }; =20 -typedef struct { +struct PCIVPBState { PCIHostState parent_obj; =20 qemu_irq irq[4]; @@ -100,7 +101,8 @@ typedef struct { uint32_t selfid; uint32_t flags; uint8_t irq_mapping; -} PCIVPBState; +}; +typedef struct PCIVPBState PCIVPBState; =20 static void pci_vpb_update_window(PCIVPBState *s, int i) { diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index b96ea36f98..f74bcdca16 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -22,6 +22,7 @@ #include "sysemu/runstate.h" #include "cpu.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define MPC8544_GUTS_MMIO_SIZE 0x1000 #define MPC8544_GUTS_RSTCR_RESET 0x02 @@ -54,6 +55,7 @@ #define MPC8544_GUTS_ADDR_SRDS2CR3 0xF18 =20 #define TYPE_MPC8544_GUTS "mpc8544-guts" +typedef struct GutsState GutsState; #define MPC8544_GUTS(obj) OBJECT_CHECK(GutsState, (obj), TYPE_MPC8544_GUTS) =20 struct GutsState { @@ -64,7 +66,6 @@ struct GutsState { MemoryRegion iomem; }; =20 -typedef struct GutsState GutsState; =20 static uint64_t mpc8544_guts_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index 2ee2d4f4fc..f82d520d25 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -30,6 +30,7 @@ #include "hw/pci/pci_host.h" #include "exec/address-spaces.h" #include "trace.h" +#include "qom/object.h" =20 struct PLBOutMap { uint64_t la; @@ -45,13 +46,14 @@ struct PLBInMap { }; =20 #define TYPE_PPC440_PCIX_HOST_BRIDGE "ppc440-pcix-host" +typedef struct PPC440PCIXState PPC440PCIXState; #define PPC440_PCIX_HOST_BRIDGE(obj) \ OBJECT_CHECK(PPC440PCIXState, (obj), TYPE_PPC440_PCIX_HOST_BRIDGE) =20 #define PPC440_PCIX_NR_POMS 3 #define PPC440_PCIX_NR_PIMS 3 =20 -typedef struct PPC440PCIXState { +struct PPC440PCIXState { PCIHostState parent_obj; =20 PCIDevice *dev; @@ -65,7 +67,7 @@ typedef struct PPC440PCIXState { MemoryRegion container; MemoryRegion iomem; MemoryRegion busmem; -} PPC440PCIXState; +}; =20 #define PPC440_REG_BASE 0x80000 #define PPC440_REG_SIZE 0xff diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 38fc392438..73cb93a3a5 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -24,6 +24,7 @@ #include "sysemu/block-backend.h" #include "sysemu/reset.h" #include "ppc440.h" +#include "qom/object.h" =20 /*************************************************************************= ****/ /* L2 Cache as SRAM */ @@ -1032,10 +1033,11 @@ void ppc4xx_dma_init(CPUPPCState *env, int dcr_base) #include "hw/pci/pcie_host.h" =20 #define TYPE_PPC460EX_PCIE_HOST "ppc460ex-pcie-host" +typedef struct PPC460EXPCIEState PPC460EXPCIEState; #define PPC460EX_PCIE_HOST(obj) \ OBJECT_CHECK(PPC460EXPCIEState, (obj), TYPE_PPC460EX_PCIE_HOST) =20 -typedef struct PPC460EXPCIEState { +struct PPC460EXPCIEState { PCIExpressHost host; =20 MemoryRegion iomem; @@ -1056,7 +1058,7 @@ typedef struct PPC460EXPCIEState { uint32_t reg_mask; uint32_t special; uint32_t cfg; -} PPC460EXPCIEState; +}; =20 #define DCRN_PCIE0_BASE 0x100 #define DCRN_PCIE1_BASE 0x120 diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 3ea47df71f..77ec675960 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -30,6 +30,7 @@ #include "hw/pci/pci_host.h" #include "exec/address-spaces.h" #include "trace.h" +#include "qom/object.h" =20 struct PCIMasterMap { uint32_t la; @@ -43,6 +44,7 @@ struct PCITargetMap { uint32_t la; }; =20 +typedef struct PPC4xxPCIState PPC4xxPCIState; #define PPC4xx_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(PPC4xxPCIState, (obj), TYPE_PPC4xx_PCI_HOST_BRIDGE) =20 @@ -59,7 +61,6 @@ struct PPC4xxPCIState { MemoryRegion container; MemoryRegion iomem; }; -typedef struct PPC4xxPCIState PPC4xxPCIState; =20 #define PCIC0_CFGADDR 0x0 #define PCIC0_CFGDATA 0x4 diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c index 66c1065db2..b1b6d559c4 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -34,6 +34,7 @@ #include "hw/sysbus.h" #include "sysemu/hw_accel.h" #include "e500.h" +#include "qom/object.h" =20 #define MAX_CPUS 32 =20 @@ -46,14 +47,15 @@ typedef struct spin_info { } QEMU_PACKED SpinInfo; =20 #define TYPE_E500_SPIN "e500-spin" +typedef struct SpinState SpinState; #define E500_SPIN(obj) OBJECT_CHECK(SpinState, (obj), TYPE_E500_SPIN) =20 -typedef struct SpinState { +struct SpinState { SysBusDevice parent_obj; =20 MemoryRegion iomem; SpinInfo spin[MAX_CPUS]; -} SpinState; +}; =20 static void spin_reset(DeviceState *dev) { diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index bbc51b6e9a..d13044acce 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -28,6 +28,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "exec/address-spaces.h" +#include "qom/object.h" #include "qemu/error-report.h" /* for error_report() */ #include "qemu/module.h" #include "sysemu/runstate.h" @@ -35,13 +36,14 @@ #include "trace.h" =20 #define TYPE_PREP_SYSTEMIO "prep-systemio" +typedef struct PrepSystemIoState PrepSystemIoState; #define PREP_SYSTEMIO(obj) \ OBJECT_CHECK(PrepSystemIoState, (obj), TYPE_PREP_SYSTEMIO) =20 /* Bit as defined in PowerPC Reference Plaform v1.1, sect. 6.1.5, p. 132 */ #define PREP_BIT(n) (1 << (7 - (n))) =20 -typedef struct PrepSystemIoState { +struct PrepSystemIoState { ISADevice parent_obj; MemoryRegion ppc_parity_mem; =20 @@ -53,7 +55,7 @@ typedef struct PrepSystemIoState { uint8_t ibm_planar_id; /* 0x0852 */ qemu_irq softreset_irq; PortioList portio; -} PrepSystemIoState; +}; =20 /* PORT 0092 -- Special Port 92 (Read/Write) */ =20 diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index ce97365f5e..ec25a701dc 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -26,12 +26,14 @@ #include "hw/boards.h" #include "qapi/error.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_RS6000MC "rs6000-mc" +typedef struct RS6000MCState RS6000MCState; #define RS6000MC_DEVICE(obj) \ OBJECT_CHECK(RS6000MCState, (obj), TYPE_RS6000MC) =20 -typedef struct RS6000MCState { +struct RS6000MCState { ISADevice parent_obj; /* see US patent 5,684,979 for details (expired 2001-11-04) */ uint32_t ram_size; @@ -41,7 +43,7 @@ typedef struct RS6000MCState { uint32_t end_address[8]; uint8_t port0820_index; PortioList portio; -} RS6000MCState; +}; =20 /* P0RT 0803 -- SIMM ID Register (32/8 MB) (Read Only) */ =20 diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index 85bf64d68e..b400438394 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -28,7 +28,9 @@ #include "hw/ppc/spapr.h" #include "hw/qdev-properties.h" #include "kvm_ppc.h" +#include "qom/object.h" =20 +typedef struct SpaprRngState SpaprRngState; #define SPAPR_RNG(obj) \ OBJECT_CHECK(SpaprRngState, (obj), TYPE_SPAPR_RNG) =20 @@ -38,7 +40,6 @@ struct SpaprRngState { RngBackend *backend; bool use_kvm; }; -typedef struct SpaprRngState SpaprRngState; =20 struct HRandomData { QemuSemaphore sem; diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c index 588a9ba9be..8b2b7973d8 100644 --- a/hw/rtc/ds1338.c +++ b/hw/rtc/ds1338.c @@ -16,6 +16,7 @@ #include "migration/vmstate.h" #include "qemu/bcd.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* Size of NVRAM including both the user-accessible area and the * secondary register area. @@ -29,9 +30,10 @@ #define CTRL_OSF 0x20 =20 #define TYPE_DS1338 "ds1338" +typedef struct DS1338State DS1338State; #define DS1338(obj) OBJECT_CHECK(DS1338State, (obj), TYPE_DS1338) =20 -typedef struct DS1338State { +struct DS1338State { I2CSlave parent_obj; =20 int64_t offset; @@ -39,7 +41,7 @@ typedef struct DS1338State { uint8_t nvram[NVRAM_SIZE]; int32_t ptr; bool addr_byte; -} DS1338State; +}; =20 static const VMStateDescription vmstate_ds1338 =3D { .name =3D "ds1338", diff --git a/hw/rtc/exynos4210_rtc.c b/hw/rtc/exynos4210_rtc.c index f85483a07f..a95f07ef0b 100644 --- a/hw/rtc/exynos4210_rtc.c +++ b/hw/rtc/exynos4210_rtc.c @@ -38,6 +38,7 @@ #include "hw/irq.h" =20 #include "hw/arm/exynos4210.h" +#include "qom/object.h" =20 #define DEBUG_RTC 0 =20 @@ -84,10 +85,11 @@ #define RTC_BASE_FREQ 32768 =20 #define TYPE_EXYNOS4210_RTC "exynos4210.rtc" +typedef struct Exynos4210RTCState Exynos4210RTCState; #define EXYNOS4210_RTC(obj) \ OBJECT_CHECK(Exynos4210RTCState, (obj), TYPE_EXYNOS4210_RTC) =20 -typedef struct Exynos4210RTCState { +struct Exynos4210RTCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -113,7 +115,7 @@ typedef struct Exynos4210RTCState { qemu_irq alm_irq; /* alarm irq */ =20 struct tm current_tm; /* current time */ -} Exynos4210RTCState; +}; =20 #define TICCKSEL(value) ((value & (0x0F << 4)) >> 4) =20 diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c index 914ecac8f4..31445e9691 100644 --- a/hw/rtc/m41t80.c +++ b/hw/rtc/m41t80.c @@ -14,14 +14,16 @@ #include "qemu/timer.h" #include "qemu/bcd.h" #include "hw/i2c/i2c.h" +#include "qom/object.h" =20 #define TYPE_M41T80 "m41t80" +typedef struct M41t80State M41t80State; #define M41T80(obj) OBJECT_CHECK(M41t80State, (obj), TYPE_M41T80) =20 -typedef struct M41t80State { +struct M41t80State { I2CSlave parent_obj; int8_t addr; -} M41t80State; +}; =20 static void m41t80_realize(DeviceState *dev, Error **errp) { diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index 50430b7a85..dc608e0b02 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -30,8 +30,11 @@ #include "m48t59-internal.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_M48TXX_ISA "isa-m48txx" +typedef struct M48txxISADeviceClass M48txxISADeviceClass; +typedef struct M48txxISAState M48txxISAState; #define M48TXX_ISA_GET_CLASS(obj) \ OBJECT_GET_CLASS(M48txxISADeviceClass, (obj), TYPE_M48TXX_ISA) #define M48TXX_ISA_CLASS(klass) \ @@ -39,17 +42,17 @@ #define M48TXX_ISA(obj) \ OBJECT_CHECK(M48txxISAState, (obj), TYPE_M48TXX_ISA) =20 -typedef struct M48txxISAState { +struct M48txxISAState { ISADevice parent_obj; M48t59State state; uint32_t io_base; MemoryRegion io; -} M48txxISAState; +}; =20 -typedef struct M48txxISADeviceClass { +struct M48txxISADeviceClass { ISADeviceClass parent_class; M48txxInfo info; -} M48txxISADeviceClass; +}; =20 static M48txxInfo m48txx_isa_info[] =3D { { diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index b428a06045..9f5a96af82 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -40,8 +40,11 @@ =20 #include "m48t59-internal.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define TYPE_M48TXX_SYS_BUS "sysbus-m48txx" +typedef struct M48txxSysBusDeviceClass M48txxSysBusDeviceClass; +typedef struct M48txxSysBusState M48txxSysBusState; #define M48TXX_SYS_BUS_GET_CLASS(obj) \ OBJECT_GET_CLASS(M48txxSysBusDeviceClass, (obj), TYPE_M48TXX_SYS_BUS) #define M48TXX_SYS_BUS_CLASS(klass) \ @@ -56,16 +59,16 @@ * http://www.st.com/stonline/products/literature/od/7001/m48t59y.pdf */ =20 -typedef struct M48txxSysBusState { +struct M48txxSysBusState { SysBusDevice parent_obj; M48t59State state; MemoryRegion io; -} M48txxSysBusState; +}; =20 -typedef struct M48txxSysBusDeviceClass { +struct M48txxSysBusDeviceClass { SysBusDeviceClass parent_class; M48txxInfo info; -} M48txxSysBusDeviceClass; +}; =20 static M48txxInfo m48txx_sysbus_info[] =3D { { diff --git a/hw/rtc/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c index 52caea8654..b5ebefd1b2 100644 --- a/hw/rtc/sun4v-rtc.c +++ b/hw/rtc/sun4v-rtc.c @@ -16,16 +16,18 @@ #include "qemu/timer.h" #include "hw/rtc/sun4v-rtc.h" #include "trace.h" +#include "qom/object.h" =20 =20 #define TYPE_SUN4V_RTC "sun4v_rtc" +typedef struct Sun4vRtc Sun4vRtc; #define SUN4V_RTC(obj) OBJECT_CHECK(Sun4vRtc, (obj), TYPE_SUN4V_RTC) =20 -typedef struct Sun4vRtc { +struct Sun4vRtc { SysBusDevice parent_obj; =20 MemoryRegion iomem; -} Sun4vRtc; +}; =20 static uint64_t sun4v_rtc_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c index d0011be89e..d46f21430c 100644 --- a/hw/rtc/twl92230.c +++ b/hw/rtc/twl92230.c @@ -29,13 +29,15 @@ #include "sysemu/sysemu.h" #include "qemu/bcd.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define VERBOSE 1 =20 #define TYPE_TWL92230 "twl92230" +typedef struct MenelausState MenelausState; #define TWL92230(obj) OBJECT_CHECK(MenelausState, (obj), TYPE_TWL92230) =20 -typedef struct MenelausState { +struct MenelausState { I2CSlave parent_obj; =20 int firstbyte; @@ -71,7 +73,7 @@ typedef struct MenelausState { uint16_t rtc_next_vmstate; qemu_irq out[4]; uint8_t pwrbtn_state; -} MenelausState; +}; =20 static inline void menelaus_update(MenelausState *s) { diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index 6914de2e59..ed7f695c2a 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -30,24 +30,27 @@ #include "sysemu/qtest.h" #include "sysemu/device_tree.h" #include "hw/boards.h" +#include "qom/object.h" =20 /* Same address of GDB integrated simulator */ #define SDRAM_BASE EXT_CS_BASE =20 -typedef struct RxGdbSimMachineClass { +struct RxGdbSimMachineClass { /*< private >*/ MachineClass parent_class; /*< public >*/ const char *mcu_name; uint32_t xtal_freq_hz; -} RxGdbSimMachineClass; +}; +typedef struct RxGdbSimMachineClass RxGdbSimMachineClass; =20 -typedef struct RxGdbSimMachineState { +struct RxGdbSimMachineState { /*< private >*/ MachineState parent_obj; /*< public >*/ RX62NState mcu; -} RxGdbSimMachineState; +}; +typedef struct RxGdbSimMachineState RxGdbSimMachineState; =20 #define TYPE_RX_GDBSIM_MACHINE MACHINE_TYPE_NAME("rx62n-common") =20 diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index b9c217ebfa..d2935c5429 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -31,6 +31,7 @@ #include "sysemu/sysemu.h" #include "sysemu/qtest.h" #include "cpu.h" +#include "qom/object.h" =20 /* * RX62N Internal Memory @@ -60,7 +61,7 @@ #define RX62N_XTAL_MAX_HZ (14 * 1000 * 1000) #define RX62N_PCLK_MAX_HZ (50 * 1000 * 1000) =20 -typedef struct RX62NClass { +struct RX62NClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -68,7 +69,8 @@ typedef struct RX62NClass { uint64_t ram_size; uint64_t rom_flash_size; uint64_t data_flash_size; -} RX62NClass; +}; +typedef struct RX62NClass RX62NClass; =20 #define RX62N_MCU_CLASS(klass) \ OBJECT_CLASS_CHECK(RX62NClass, (klass), TYPE_RX62N_MCU) diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 90432ef107..544f5f19b3 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -33,9 +33,11 @@ #include "qapi/error.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define TYPE_AM53C974_DEVICE "am53c974" =20 +typedef struct PCIESPState PCIESPState; #define PCI_ESP(obj) \ OBJECT_CHECK(PCIESPState, (obj), TYPE_AM53C974_DEVICE) =20 @@ -64,7 +66,7 @@ =20 #define SBAC_STATUS (1 << 24) =20 -typedef struct PCIESPState { +struct PCIESPState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -73,7 +75,7 @@ typedef struct PCIESPState { uint32_t dma_regs[8]; uint32_t sbac; ESPState esp; -} PCIESPState; +}; =20 static void esp_pci_handle_idle(PCIESPState *pci, uint32_t val) { @@ -408,10 +410,11 @@ static const TypeInfo esp_pci_info =3D { }, }; =20 -typedef struct { +struct DC390State { PCIESPState pci; eeprom_t *eeprom; -} DC390State; +}; +typedef struct DC390State DC390State; =20 #define TYPE_DC390_DEVICE "dc390" #define DC390(obj) \ diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 63ff4181de..0e40587c18 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -23,6 +23,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 static const char *names[] =3D { "SCNTL0", "SCNTL1", "SCNTL2", "SCNTL3", "SCID", "SXFER", "SDID", "GPRE= G", @@ -213,7 +214,7 @@ enum { LSI_MSG_ACTION_DIN =3D 3, }; =20 -typedef struct { +struct LSIState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -303,7 +304,8 @@ typedef struct { uint32_t adder; =20 uint8_t script_ram[2048 * sizeof(uint32_t)]; -} LSIState; +}; +typedef struct LSIState LSIState; =20 #define TYPE_LSI53C810 "lsi53c810" #define TYPE_LSI53C895A "lsi53c895a" diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 390c2f2edb..aab0b36598 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -34,6 +34,7 @@ #include "qapi/error.h" #include "mfi.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 #define MEGASAS_VERSION_GEN1 "1.70" #define MEGASAS_VERSION_GEN2 "1.80" @@ -72,7 +73,7 @@ typedef struct MegasasCmd { struct MegasasState *state; } MegasasCmd; =20 -typedef struct MegasasState { +struct MegasasState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -116,16 +117,18 @@ typedef struct MegasasState { MegasasCmd frames[MEGASAS_MAX_FRAMES]; DECLARE_BITMAP(frame_map, MEGASAS_MAX_FRAMES); SCSIBus bus; -} MegasasState; +}; +typedef struct MegasasState MegasasState; =20 -typedef struct MegasasBaseClass { +struct MegasasBaseClass { PCIDeviceClass parent_class; const char *product_name; const char *product_version; int mmio_bar; int ioport_bar; int osts; -} MegasasBaseClass; +}; +typedef struct MegasasBaseClass MegasasBaseClass; =20 #define TYPE_MEGASAS_BASE "megasas-base" #define TYPE_MEGASAS_GEN1 "megasas" diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 7612035a4e..ea66422c2b 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -38,6 +38,7 @@ #include "sysemu/sysemu.h" #include "qemu/cutils.h" #include "trace.h" +#include "qom/object.h" =20 #ifdef __linux #include @@ -54,6 +55,8 @@ =20 #define TYPE_SCSI_DISK_BASE "scsi-disk-base" =20 +typedef struct SCSIDiskClass SCSIDiskClass; +typedef struct SCSIDiskState SCSIDiskState; #define SCSI_DISK_BASE(obj) \ OBJECT_CHECK(SCSIDiskState, (obj), TYPE_SCSI_DISK_BASE) #define SCSI_DISK_BASE_CLASS(klass) \ @@ -61,13 +64,13 @@ #define SCSI_DISK_BASE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SCSIDiskClass, (obj), TYPE_SCSI_DISK_BASE) =20 -typedef struct SCSIDiskClass { +struct SCSIDiskClass { SCSIDeviceClass parent_class; DMAIOFunc *dma_readv; DMAIOFunc *dma_writev; bool (*need_fua_emulation)(SCSICommand *cmd); void (*update_sense)(SCSIRequest *r); -} SCSIDiskClass; +}; =20 typedef struct SCSIDiskReq { SCSIRequest req; @@ -87,8 +90,7 @@ typedef struct SCSIDiskReq { #define SCSI_DISK_F_DPOFUA 1 #define SCSI_DISK_F_NO_REMOVABLE_DEVOPS 2 =20 -typedef struct SCSIDiskState -{ +struct SCSIDiskState { SCSIDevice qdev; uint32_t features; bool media_changed; @@ -113,7 +115,7 @@ typedef struct SCSIDiskState * 0xffff - reserved */ uint16_t rotation_rate; -} SCSIDiskState; +}; =20 static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_fail= ed); =20 diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index d17dc03c73..b6ab78d08a 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -46,6 +46,7 @@ #include "trace.h" =20 #include +#include "qom/object.h" =20 /* * Virtual SCSI device @@ -90,14 +91,15 @@ typedef struct vscsi_req { } vscsi_req; =20 #define TYPE_VIO_SPAPR_VSCSI_DEVICE "spapr-vscsi" +typedef struct VSCSIState VSCSIState; #define VIO_SPAPR_VSCSI_DEVICE(obj) \ OBJECT_CHECK(VSCSIState, (obj), TYPE_VIO_SPAPR_VSCSI_DEVICE) =20 -typedef struct { +struct VSCSIState { SpaprVioDevice vdev; SCSIBus bus; vscsi_req reqs[VSCSI_REQ_LIMIT]; -} VSCSIState; +}; =20 static union viosrp_iu *req_iu(vscsi_req *req) { diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index c071e0c7aa..aa0d57b970 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -36,6 +36,7 @@ #include "hw/qdev-properties.h" #include "vmw_pvscsi.h" #include "trace.h" +#include "qom/object.h" =20 =20 #define PVSCSI_USE_64BIT (true) @@ -56,12 +57,14 @@ (stl_le_pci_dma(&container_of(m, PVSCSIState, rings)->parent_obj, \ (m)->rs_pa + offsetof(struct PVSCSIRingsState, field), va= l)) =20 -typedef struct PVSCSIClass { +struct PVSCSIClass { PCIDeviceClass parent_class; DeviceRealize parent_dc_realize; -} PVSCSIClass; +}; +typedef struct PVSCSIClass PVSCSIClass; =20 #define TYPE_PVSCSI "pvscsi" +typedef struct PVSCSIState PVSCSIState; #define PVSCSI(obj) OBJECT_CHECK(PVSCSIState, (obj), TYPE_PVSCSI) =20 #define PVSCSI_CLASS(klass) \ @@ -104,7 +107,7 @@ typedef struct PVSCSISGState { =20 typedef QTAILQ_HEAD(, PVSCSIRequest) PVSCSIRequestList; =20 -typedef struct { +struct PVSCSIState { PCIDevice parent_obj; MemoryRegion io_space; SCSIBus bus; @@ -132,7 +135,7 @@ typedef struct { uint32_t resetting; /* Reset in progress = */ =20 uint32_t compat_flags; -} PVSCSIState; +}; =20 typedef struct PVSCSIRequest { SCSIRequest *sreq; diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c index e82afb75eb..e0cc5847f3 100644 --- a/hw/sd/allwinner-sdhost.c +++ b/hw/sd/allwinner-sdhost.c @@ -29,6 +29,7 @@ #include "hw/sd/allwinner-sdhost.h" #include "migration/vmstate.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_AW_SDHOST_BUS "allwinner-sdhost-bus" #define AW_SDHOST_BUS(obj) \ diff --git a/hw/sd/bcm2835_sdhost.c b/hw/sd/bcm2835_sdhost.c index 2c7a675a2d..743abccbae 100644 --- a/hw/sd/bcm2835_sdhost.c +++ b/hw/sd/bcm2835_sdhost.c @@ -19,6 +19,7 @@ #include "hw/sd/bcm2835_sdhost.h" #include "migration/vmstate.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_BCM2835_SDHOST_BUS "bcm2835-sdhost-bus" #define BCM2835_SDHOST_BUS(obj) \ diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index be89a93876..0da5b84398 100644 --- a/hw/sd/milkymist-memcard.c +++ b/hw/sd/milkymist-memcard.c @@ -32,6 +32,7 @@ #include "sysemu/blockdev.h" #include "hw/qdev-properties.h" #include "hw/sd/sd.h" +#include "qom/object.h" =20 enum { ENABLE_CMD_TX =3D (1<<0), @@ -63,6 +64,7 @@ enum { }; =20 #define TYPE_MILKYMIST_MEMCARD "milkymist-memcard" +typedef struct MilkymistMemcardState MilkymistMemcardState; #define MILKYMIST_MEMCARD(obj) \ OBJECT_CHECK(MilkymistMemcardState, (obj), TYPE_MILKYMIST_MEMCARD) =20 @@ -83,7 +85,6 @@ struct MilkymistMemcardState { uint8_t response[17]; uint32_t regs[R_MAX]; }; -typedef struct MilkymistMemcardState MilkymistMemcardState; =20 static void update_pending_bits(MilkymistMemcardState *s) { diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 579d68ad83..cb2ef0fb39 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -18,15 +18,17 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "trace.h" +#include "qom/object.h" =20 #define PL181_FIFO_LEN 16 =20 #define TYPE_PL181 "pl181" +typedef struct PL181State PL181State; #define PL181(obj) OBJECT_CHECK(PL181State, (obj), TYPE_PL181) =20 #define TYPE_PL181_BUS "pl181-bus" =20 -typedef struct PL181State { +struct PL181State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -56,7 +58,7 @@ typedef struct PL181State { /* GPIO outputs for 'card is readonly' and 'card inserted' */ qemu_irq card_readonly; qemu_irq card_inserted; -} PL181State; +}; =20 static const VMStateDescription vmstate_pl181 =3D { .name =3D "pl181", diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 3a47b380dd..757a6a3c63 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -21,6 +21,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_PXA2XX_MMCI_BUS "pxa2xx-mmci-bus" #define PXA2XX_MMCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_PXA2XX_MMCI_B= US) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 1785d7e1f7..63772bfab6 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -37,6 +37,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" +#include "qom/object.h" =20 #define TYPE_SDHCI_BUS "sdhci-bus" #define SDHCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SDHCI_BUS) diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index a7ef9cb922..517c17a2c4 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -18,6 +18,7 @@ #include "hw/sd/sd.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 //#define DEBUG_SSI_SD 1 =20 @@ -40,7 +41,7 @@ typedef enum { SSI_SD_DATA_READ, } ssi_sd_mode; =20 -typedef struct { +struct ssi_sd_state { SSISlave ssidev; uint32_t mode; int cmd; @@ -50,7 +51,8 @@ typedef struct { int32_t response_pos; int32_t stopping; SDBus sdbus; -} ssi_sd_state; +}; +typedef struct ssi_sd_state ssi_sd_state; =20 #define TYPE_SSI_SD "ssi-sd" #define SSI_SD(obj) OBJECT_CHECK(ssi_sd_state, (obj), TYPE_SSI_SD) diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c index 0a3e86f949..378d44b946 100644 --- a/hw/sh4/sh_pci.c +++ b/hw/sh4/sh_pci.c @@ -31,13 +31,15 @@ #include "qemu/bswap.h" #include "qemu/module.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 #define TYPE_SH_PCI_HOST_BRIDGE "sh_pci" =20 +typedef struct SHPCIState SHPCIState; #define SH_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(SHPCIState, (obj), TYPE_SH_PCI_HOST_BRIDGE) =20 -typedef struct SHPCIState { +struct SHPCIState { PCIHostState parent_obj; =20 PCIDevice *dev; @@ -48,7 +50,7 @@ typedef struct SHPCIState { uint32_t par; uint32_t mbr; uint32_t iobr; -} SHPCIState; +}; =20 static void sh_pci_reg_write (void *p, hwaddr addr, uint64_t val, unsigned size) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index cf7dfa4af5..5772e2f336 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -52,6 +52,7 @@ #include "hw/loader.h" #include "elf.h" #include "trace.h" +#include "qom/object.h" =20 /* * Sun4m architecture was used in the following machines: @@ -591,14 +592,15 @@ static void idreg_init(hwaddr addr) idreg_data, sizeof(idreg_data)); } =20 +typedef struct IDRegState IDRegState; #define MACIO_ID_REGISTER(obj) \ OBJECT_CHECK(IDRegState, (obj), TYPE_MACIO_ID_REGISTER) =20 -typedef struct IDRegState { +struct IDRegState { SysBusDevice parent_obj; =20 MemoryRegion mem; -} IDRegState; +}; =20 static void idreg_realize(DeviceState *ds, Error **errp) { @@ -633,13 +635,14 @@ static const TypeInfo idreg_info =3D { }; =20 #define TYPE_TCX_AFX "tcx_afx" +typedef struct AFXState AFXState; #define TCX_AFX(obj) OBJECT_CHECK(AFXState, (obj), TYPE_TCX_AFX) =20 -typedef struct AFXState { +struct AFXState { SysBusDevice parent_obj; =20 MemoryRegion mem; -} AFXState; +}; =20 /* SS-5 TCX AFX register */ static void afx_init(hwaddr addr) @@ -686,13 +689,14 @@ static const TypeInfo afx_info =3D { }; =20 #define TYPE_OPENPROM "openprom" +typedef struct PROMState PROMState; #define OPENPROM(obj) OBJECT_CHECK(PROMState, (obj), TYPE_OPENPROM) =20 -typedef struct PROMState { +struct PROMState { SysBusDevice parent_obj; =20 MemoryRegion prom; -} PROMState; +}; =20 /* Boot PROM (OpenBIOS) */ static uint64_t translate_prom_address(void *opaque, uint64_t addr) @@ -774,12 +778,13 @@ static const TypeInfo prom_info =3D { }; =20 #define TYPE_SUN4M_MEMORY "memory" +typedef struct RamDevice RamDevice; #define SUN4M_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4M_MEMORY) =20 -typedef struct RamDevice { +struct RamDevice { SysBusDevice parent_obj; HostMemoryBackend *memdev; -} RamDevice; +}; =20 /* System RAM */ static void ram_realize(DeviceState *dev, Error **errp) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 37310b73e6..7aab59dea9 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -55,6 +55,7 @@ #include "hw/fw-path-provider.h" #include "elf.h" #include "trace.h" +#include "qom/object.h" =20 #define KERNEL_LOAD_ADDR 0x00404000 #define CMDLINE_ADDR 0x003ff000 @@ -79,7 +80,7 @@ struct hwdef { uint64_t console_serial_base; }; =20 -typedef struct EbusState { +struct EbusState { /*< private >*/ PCIDevice parent_obj; =20 @@ -88,7 +89,8 @@ typedef struct EbusState { uint64_t console_serial_base; MemoryRegion bar0; MemoryRegion bar1; -} EbusState; +}; +typedef struct EbusState EbusState; =20 #define TYPE_EBUS "ebus" #define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS) @@ -226,13 +228,14 @@ typedef struct ResetData { } ResetData; =20 #define TYPE_SUN4U_POWER "power" +typedef struct PowerDevice PowerDevice; #define SUN4U_POWER(obj) OBJECT_CHECK(PowerDevice, (obj), TYPE_SUN4U_POWER) =20 -typedef struct PowerDevice { +struct PowerDevice { SysBusDevice parent_obj; =20 MemoryRegion power_mmio; -} PowerDevice; +}; =20 /* Power */ static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) @@ -399,13 +402,14 @@ static const TypeInfo ebus_info =3D { }; =20 #define TYPE_OPENPROM "openprom" +typedef struct PROMState PROMState; #define OPENPROM(obj) OBJECT_CHECK(PROMState, (obj), TYPE_OPENPROM) =20 -typedef struct PROMState { +struct PROMState { SysBusDevice parent_obj; =20 MemoryRegion prom; -} PROMState; +}; =20 static uint64_t translate_prom_address(void *opaque, uint64_t addr) { @@ -487,14 +491,15 @@ static const TypeInfo prom_info =3D { =20 =20 #define TYPE_SUN4U_MEMORY "memory" +typedef struct RamDevice RamDevice; #define SUN4U_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4U_MEMORY) =20 -typedef struct RamDevice { +struct RamDevice { SysBusDevice parent_obj; =20 MemoryRegion ram; uint64_t size; -} RamDevice; +}; =20 /* System RAM */ static void ram_realize(DeviceState *dev, Error **errp) diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index a35d7ebb26..5366a80d45 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -17,6 +17,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qom/object.h" =20 struct SSIBus { BusState parent_obj; diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c index 80d1488dc7..8ed83bec8a 100644 --- a/hw/ssi/xilinx_spi.c +++ b/hw/ssi/xilinx_spi.c @@ -34,6 +34,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/ssi/ssi.h" +#include "qom/object.h" =20 #ifdef XILINX_SPI_ERR_DEBUG #define DB_PRINT(...) do { \ @@ -78,9 +79,10 @@ #define FIFO_CAPACITY 256 =20 #define TYPE_XILINX_SPI "xlnx.xps-spi" +typedef struct XilinxSPI XilinxSPI; #define XILINX_SPI(obj) OBJECT_CHECK(XilinxSPI, (obj), TYPE_XILINX_SPI) =20 -typedef struct XilinxSPI { +struct XilinxSPI { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -97,7 +99,7 @@ typedef struct XilinxSPI { Fifo8 tx_fifo; =20 uint32_t regs[R_MAX]; -} XilinxSPI; +}; =20 static void txfifo_reset(XilinxSPI *s) { diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c index be81b7a518..93bd5b9587 100644 --- a/hw/timer/altera_timer.c +++ b/hw/timer/altera_timer.c @@ -26,6 +26,7 @@ #include "hw/irq.h" #include "hw/ptimer.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 #define R_STATUS 0 #define R_CONTROL 1 @@ -44,17 +45,18 @@ #define CONTROL_STOP 0x0008 =20 #define TYPE_ALTERA_TIMER "ALTR.timer" +typedef struct AlteraTimer AlteraTimer; #define ALTERA_TIMER(obj) \ OBJECT_CHECK(AlteraTimer, (obj), TYPE_ALTERA_TIMER) =20 -typedef struct AlteraTimer { +struct AlteraTimer { SysBusDevice busdev; MemoryRegion mmio; qemu_irq irq; uint32_t freq_hz; ptimer_state *ptimer; uint32_t regs[R_MAX]; -} AlteraTimer; +}; =20 static int timer_irq_state(AlteraTimer *t) { diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 9607366d78..d728a80937 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -16,6 +16,7 @@ #include "hw/qdev-properties.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qom/object.h" =20 /* Common timer implementation. */ =20 @@ -190,9 +191,10 @@ static arm_timer_state *arm_timer_init(uint32_t freq) */ =20 #define TYPE_SP804 "sp804" +typedef struct SP804State SP804State; #define SP804(obj) OBJECT_CHECK(SP804State, (obj), TYPE_SP804) =20 -typedef struct SP804State { +struct SP804State { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -200,7 +202,7 @@ typedef struct SP804State { uint32_t freq0, freq1; int level[2]; qemu_irq irq; -} SP804State; +}; =20 static const uint8_t sp804_ids[] =3D { /* Timer ID */ @@ -310,15 +312,16 @@ static void sp804_realize(DeviceState *dev, Error **e= rrp) /* Integrator/CP timer module. */ =20 #define TYPE_INTEGRATOR_PIT "integrator_pit" +typedef struct icp_pit_state icp_pit_state; #define INTEGRATOR_PIT(obj) \ OBJECT_CHECK(icp_pit_state, (obj), TYPE_INTEGRATOR_PIT) =20 -typedef struct { +struct icp_pit_state { SysBusDevice parent_obj; =20 MemoryRegion iomem; arm_timer_state *timer[3]; -} icp_pit_state; +}; =20 static uint64_t icp_pit_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c index b0ba6b2bba..24de679d9c 100644 --- a/hw/timer/cadence_ttc.c +++ b/hw/timer/cadence_ttc.c @@ -22,6 +22,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qom/object.h" =20 #ifdef CADENCE_TTC_ERR_DEBUG #define DB_PRINT(...) do { \ @@ -69,15 +70,16 @@ typedef struct { } CadenceTimerState; =20 #define TYPE_CADENCE_TTC "cadence_ttc" +typedef struct CadenceTTCState CadenceTTCState; #define CADENCE_TTC(obj) \ OBJECT_CHECK(CadenceTTCState, (obj), TYPE_CADENCE_TTC) =20 -typedef struct CadenceTTCState { +struct CadenceTTCState { SysBusDevice parent_obj; =20 MemoryRegion iomem; CadenceTimerState timer[3]; -} CadenceTTCState; +}; =20 static void cadence_timer_update(CadenceTimerState *s) { diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index afe3d30a8e..92b8999b79 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -30,6 +30,7 @@ #include "qemu/timer.h" #include "hw/irq.h" #include "hw/ptimer.h" +#include "qom/object.h" =20 #define D(x) =20 @@ -48,10 +49,11 @@ #define R_MASKED_INTR 0x54 =20 #define TYPE_ETRAX_FS_TIMER "etraxfs,timer" +typedef struct ETRAXTimerState ETRAXTimerState; #define ETRAX_TIMER(obj) \ OBJECT_CHECK(ETRAXTimerState, (obj), TYPE_ETRAX_FS_TIMER) =20 -typedef struct ETRAXTimerState { +struct ETRAXTimerState { SysBusDevice parent_obj; =20 MemoryRegion mmio; @@ -79,7 +81,7 @@ typedef struct ETRAXTimerState { uint32_t rw_ack_intr; uint32_t r_intr; uint32_t r_masked_intr; -} ETRAXTimerState; +}; =20 static uint64_t timer_read(void *opaque, hwaddr addr, unsigned int size) diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c index 29a4b10676..aa8753ded8 100644 --- a/hw/timer/exynos4210_mct.c +++ b/hw/timer/exynos4210_mct.c @@ -62,6 +62,7 @@ =20 #include "hw/arm/exynos4210.h" #include "hw/irq.h" +#include "qom/object.h" =20 //#define DEBUG_MCT =20 @@ -242,10 +243,11 @@ typedef struct { } Exynos4210MCTLT; =20 #define TYPE_EXYNOS4210_MCT "exynos4210.mct" +typedef struct Exynos4210MCTState Exynos4210MCTState; #define EXYNOS4210_MCT(obj) \ OBJECT_CHECK(Exynos4210MCTState, (obj), TYPE_EXYNOS4210_MCT) =20 -typedef struct Exynos4210MCTState { +struct Exynos4210MCTState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -257,7 +259,7 @@ typedef struct Exynos4210MCTState { Exynos4210MCTGT g_timer; =20 uint32_t freq; /* all timers tick frequency, TCLK= */ -} Exynos4210MCTState; +}; =20 /*** VMState ***/ static const VMStateDescription vmstate_tick_timer =3D { diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c index 59a8c08db0..34224020c0 100644 --- a/hw/timer/exynos4210_pwm.c +++ b/hw/timer/exynos4210_pwm.c @@ -30,6 +30,7 @@ =20 #include "hw/arm/exynos4210.h" #include "hw/irq.h" +#include "qom/object.h" =20 //#define DEBUG_PWM =20 @@ -102,10 +103,11 @@ typedef struct { } Exynos4210PWM; =20 #define TYPE_EXYNOS4210_PWM "exynos4210.pwm" +typedef struct Exynos4210PWMState Exynos4210PWMState; #define EXYNOS4210_PWM(obj) \ OBJECT_CHECK(Exynos4210PWMState, (obj), TYPE_EXYNOS4210_PWM) =20 -typedef struct Exynos4210PWMState { +struct Exynos4210PWMState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -116,7 +118,7 @@ typedef struct Exynos4210PWMState { =20 Exynos4210PWM timer[EXYNOS4210_PWM_TIMERS_NUM]; =20 -} Exynos4210PWMState; +}; =20 /*** VMState ***/ static const VMStateDescription vmstate_exynos4210_pwm =3D { diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c index eff0ee3491..91d42837c9 100644 --- a/hw/timer/grlib_gptimer.c +++ b/hw/timer/grlib_gptimer.c @@ -32,6 +32,7 @@ #include "qemu/module.h" =20 #include "trace.h" +#include "qom/object.h" =20 #define UNIT_REG_SIZE 16 /* Size of memory mapped regs for the unit= */ #define GPTIMER_REG_SIZE 16 /* Size of memory mapped regs for a GPTime= r */ @@ -55,11 +56,11 @@ #define COUNTER_RELOAD_OFFSET 0x04 #define TIMER_BASE 0x10 =20 +typedef struct GPTimerUnit GPTimerUnit; #define GRLIB_GPTIMER(obj) \ OBJECT_CHECK(GPTimerUnit, (obj), TYPE_GRLIB_GPTIMER) =20 typedef struct GPTimer GPTimer; -typedef struct GPTimerUnit GPTimerUnit; =20 struct GPTimer { struct ptimer_state *ptimer; diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 380acfa7c8..07b3c0f9be 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -37,6 +37,7 @@ #include "migration/vmstate.h" #include "hw/timer/i8254.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 //#define HPET_DEBUG #ifdef HPET_DEBUG @@ -47,6 +48,7 @@ =20 #define HPET_MSI_SUPPORT 0 =20 +typedef struct HPETState HPETState; #define HPET(obj) OBJECT_CHECK(HPETState, (obj), TYPE_HPET) =20 struct HPETState; @@ -65,7 +67,7 @@ typedef struct HPETTimer { /* timers */ */ } HPETTimer; =20 -typedef struct HPETState { +struct HPETState { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ @@ -87,7 +89,7 @@ typedef struct HPETState { uint64_t isr; /* interrupt status reg */ uint64_t hpet_counter; /* main counter */ uint8_t hpet_id; /* instance id */ -} HPETState; +}; =20 static uint32_t hpet_in_legacy_mode(HPETState *s) { diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c index 29f62e5356..54639d13d8 100644 --- a/hw/timer/i8254.c +++ b/hw/timer/i8254.c @@ -28,6 +28,7 @@ #include "qemu/timer.h" #include "hw/timer/i8254.h" #include "hw/timer/i8254_internal.h" +#include "qom/object.h" =20 //#define DEBUG_PIT =20 @@ -36,14 +37,15 @@ #define RW_STATE_WORD0 3 #define RW_STATE_WORD1 4 =20 +typedef struct PITClass PITClass; #define PIT_CLASS(class) OBJECT_CLASS_CHECK(PITClass, (class), TYPE_I8254) #define PIT_GET_CLASS(obj) OBJECT_GET_CLASS(PITClass, (obj), TYPE_I8254) =20 -typedef struct PITClass { +struct PITClass { PITCommonClass parent_class; =20 DeviceRealize parent_realize; -} PITClass; +}; =20 static void pit_irq_timer_update(PITChannelState *s, int64_t current_time); =20 diff --git a/hw/timer/lm32_timer.c b/hw/timer/lm32_timer.c index f703f407f5..807ceb514c 100644 --- a/hw/timer/lm32_timer.c +++ b/hw/timer/lm32_timer.c @@ -31,6 +31,7 @@ #include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define DEFAULT_FREQUENCY (50*1000000) =20 @@ -55,6 +56,7 @@ enum { }; =20 #define TYPE_LM32_TIMER "lm32-timer" +typedef struct LM32TimerState LM32TimerState; #define LM32_TIMER(obj) OBJECT_CHECK(LM32TimerState, (obj), TYPE_LM32_TIME= R) =20 struct LM32TimerState { @@ -69,7 +71,6 @@ struct LM32TimerState { =20 uint32_t regs[R_MAX]; }; -typedef struct LM32TimerState LM32TimerState; =20 static void timer_update_irq(LM32TimerState *s) { diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c index 94389820b2..3667a09c99 100644 --- a/hw/timer/milkymist-sysctl.c +++ b/hw/timer/milkymist-sysctl.c @@ -32,6 +32,7 @@ #include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 enum { CTRL_ENABLE =3D (1<<0), @@ -62,6 +63,7 @@ enum { }; =20 #define TYPE_MILKYMIST_SYSCTL "milkymist-sysctl" +typedef struct MilkymistSysctlState MilkymistSysctlState; #define MILKYMIST_SYSCTL(obj) \ OBJECT_CHECK(MilkymistSysctlState, (obj), TYPE_MILKYMIST_SYSCTL) =20 @@ -84,7 +86,6 @@ struct MilkymistSysctlState { qemu_irq timer0_irq; qemu_irq timer1_irq; }; -typedef struct MilkymistSysctlState MilkymistSysctlState; =20 static void sysctl_icap_write(MilkymistSysctlState *s, uint32_t value) { diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index f76b0bb1ca..8d61c670de 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -15,15 +15,17 @@ #include "hw/ptimer.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qom/object.h" =20 #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" =20 #define TYPE_PUV3_OST "puv3_ost" +typedef struct PUV3OSTState PUV3OSTState; #define PUV3_OST(obj) OBJECT_CHECK(PUV3OSTState, (obj), TYPE_PUV3_OST) =20 /* puv3 ostimer implementation. */ -typedef struct PUV3OSTState { +struct PUV3OSTState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -34,7 +36,7 @@ typedef struct PUV3OSTState { uint32_t reg_OSCR; uint32_t reg_OSSR; uint32_t reg_OIER; -} PUV3OSTState; +}; =20 static uint64_t puv3_ost_read(void *opaque, hwaddr offset, unsigned size) diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c index 944c165889..c73cc721e1 100644 --- a/hw/timer/pxa2xx_timer.c +++ b/hw/timer/pxa2xx_timer.c @@ -17,6 +17,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define OSMR0 0x00 #define OSMR1 0x04 @@ -66,10 +67,10 @@ static int pxa2xx_timer4_freq[8] =3D { }; =20 #define TYPE_PXA2XX_TIMER "pxa2xx-timer" +typedef struct PXA2xxTimerInfo PXA2xxTimerInfo; #define PXA2XX_TIMER(obj) \ OBJECT_CHECK(PXA2xxTimerInfo, (obj), TYPE_PXA2XX_TIMER) =20 -typedef struct PXA2xxTimerInfo PXA2xxTimerInfo; =20 typedef struct { uint32_t value; diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index 4c5d65e391..28d612372b 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -31,6 +31,7 @@ #include "migration/vmstate.h" #include "trace.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* * Registers of hardware timer in sun4m. @@ -59,16 +60,17 @@ typedef struct CPUTimerState { } CPUTimerState; =20 #define TYPE_SLAVIO_TIMER "slavio_timer" +typedef struct SLAVIO_TIMERState SLAVIO_TIMERState; #define SLAVIO_TIMER(obj) \ OBJECT_CHECK(SLAVIO_TIMERState, (obj), TYPE_SLAVIO_TIMER) =20 -typedef struct SLAVIO_TIMERState { +struct SLAVIO_TIMERState { SysBusDevice parent_obj; =20 uint32_t num_cpus; uint32_t cputimer_mode; CPUTimerState cputimer[MAX_CPUS + 1]; -} SLAVIO_TIMERState; +}; =20 typedef struct TimerContext { MemoryRegion iomem; diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 0190aa47d0..c262f6d96f 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -29,6 +29,7 @@ #include "hw/qdev-properties.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define D(x) =20 diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index 60247295d4..53e89b43e5 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm/tpm_crb.c @@ -29,8 +29,9 @@ #include "tpm_prop.h" #include "tpm_ppi.h" #include "trace.h" +#include "qom/object.h" =20 -typedef struct CRBState { +struct CRBState { DeviceState parent_obj; =20 TPMBackend *tpmbe; @@ -43,7 +44,8 @@ typedef struct CRBState { =20 bool ppi_enabled; TPMPPI ppi; -} CRBState; +}; +typedef struct CRBState CRBState; =20 #define CRB(obj) OBJECT_CHECK(CRBState, (obj), TYPE_TPM_CRB) =20 diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c index 8288ab0a15..08db85baea 100644 --- a/hw/tpm/tpm_spapr.c +++ b/hw/tpm/tpm_spapr.c @@ -26,9 +26,11 @@ #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" #include "trace.h" +#include "qom/object.h" =20 #define DEBUG_SPAPR 0 =20 +typedef struct SpaprTpmState SpaprTpmState; #define VIO_SPAPR_VTPM(obj) \ OBJECT_CHECK(SpaprTpmState, (obj), TYPE_TPM_SPAPR) =20 @@ -64,7 +66,7 @@ typedef struct TpmCrq { =20 #define TPM_SPAPR_BUFFER_MAX 4096 =20 -typedef struct { +struct SpaprTpmState { SpaprVioDevice vdev; =20 TpmCrq crq; /* track single TPM command */ @@ -84,7 +86,7 @@ typedef struct { TPMVersion be_tpm_version; =20 size_t be_buffer_size; -} SpaprTpmState; +}; =20 /* * Send a request to the TPM. diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index 5faf6231c0..9a0ab24a27 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -29,14 +29,16 @@ #include "hw/acpi/tpm.h" #include "tpm_prop.h" #include "tpm_tis.h" +#include "qom/object.h" =20 -typedef struct TPMStateISA { +struct TPMStateISA { /*< private >*/ ISADevice parent_obj; =20 /*< public >*/ TPMState state; /* not a QOM object */ -} TPMStateISA; +}; +typedef struct TPMStateISA TPMStateISA; =20 #define TPM_TIS_ISA(obj) OBJECT_CHECK(TPMStateISA, (obj), TYPE_TPM_TIS_ISA) =20 diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c index 4a3bc70625..46a92182fc 100644 --- a/hw/tpm/tpm_tis_sysbus.c +++ b/hw/tpm/tpm_tis_sysbus.c @@ -29,14 +29,16 @@ #include "tpm_prop.h" #include "hw/sysbus.h" #include "tpm_tis.h" +#include "qom/object.h" =20 -typedef struct TPMStateSysBus { +struct TPMStateSysBus { /*< private >*/ SysBusDevice parent_obj; =20 /*< public >*/ TPMState state; /* not a QOM object */ -} TPMStateSysBus; +}; +typedef struct TPMStateSysBus TPMStateSysBus; =20 #define TPM_TIS_SYSBUS(obj) OBJECT_CHECK(TPMStateSysBus, (obj), TYPE_TPM_T= IS_SYSBUS) =20 diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 0f1afd66be..a84f5783dc 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -35,6 +35,7 @@ #include "ccid.h" #include "hw/qdev-properties.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define DPRINTF(card, lvl, fmt, ...) \ do {\ @@ -45,6 +46,7 @@ do {\ =20 =20 #define TYPE_EMULATED_CCID "ccid-card-emulated" +typedef struct EmulatedState EmulatedState; #define EMULATED_CCID_CARD(obj) \ OBJECT_CHECK(EmulatedState, (obj), TYPE_EMULATED_CCID) =20 @@ -58,7 +60,6 @@ enum { =20 #define DEFAULT_BACKEND BACKEND_NSS_EMULATED =20 -typedef struct EmulatedState EmulatedState; =20 enum { EMUL_READER_INSERT =3D 0, diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index bb325dbc4a..9c9d6857da 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -20,6 +20,7 @@ #include "qemu/sockets.h" #include "ccid.h" #include "qapi/error.h" +#include "qom/object.h" =20 #define DPRINTF(card, lvl, fmt, ...) \ do { \ diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 1371c44f48..3fc8addae1 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -36,6 +36,7 @@ #include "migration/vmstate.h" #include "desc.h" #include "audio/audio.h" +#include "qom/object.h" =20 static void usb_audio_reinit(USBDevice *dev, unsigned channels); =20 @@ -633,7 +634,7 @@ static uint8_t *streambuf_get(struct streambuf *buf, si= ze_t *len) return data; } =20 -typedef struct USBAudioState { +struct USBAudioState { /* qemu interfaces */ USBDevice dev; QEMUSoundCard card; @@ -652,7 +653,8 @@ typedef struct USBAudioState { uint32_t debug; uint32_t buffer_user, buffer; bool multi; -} USBAudioState; +}; +typedef struct USBAudioState USBAudioState; =20 #define TYPE_USB_AUDIO "usb-audio" #define USB_AUDIO(obj) OBJECT_CHECK(USBAudioState, (obj), TYPE_USB_AUDIO) diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index c73f7b2fe2..4d1de647bc 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -34,15 +34,17 @@ #include "hw/input/hid.h" #include "hw/usb/hid.h" #include "hw/qdev-properties.h" +#include "qom/object.h" =20 -typedef struct USBHIDState { +struct USBHIDState { USBDevice dev; USBEndpoint *intr; HIDState hid; uint32_t usb_version; char *display; uint32_t head; -} USBHIDState; +}; +typedef struct USBHIDState USBHIDState; =20 #define TYPE_USB_HID "usb-hid" #define USB_HID(obj) OBJECT_CHECK(USBHIDState, (obj), TYPE_USB_HID) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 5f19dd9fb5..07e395aa5f 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -32,6 +32,7 @@ #include "desc.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define MAX_PORTS 8 =20 @@ -41,14 +42,15 @@ typedef struct USBHubPort { uint16_t wPortChange; } USBHubPort; =20 -typedef struct USBHubState { +struct USBHubState { USBDevice dev; USBEndpoint *intr; uint32_t num_ports; bool port_power; QEMUTimer *port_timer; USBHubPort ports[MAX_PORTS]; -} USBHubState; +}; +typedef struct USBHubState USBHubState; =20 #define TYPE_USB_HUB "usb-hub" #define USB_HUB(obj) OBJECT_CHECK(USBHubState, (obj), TYPE_USB_HUB) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 15a2243101..6df70a0844 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -28,6 +28,7 @@ #include "migration/vmstate.h" #include "desc.h" #include "qemu/units.h" +#include "qom/object.h" =20 /* -----------------------------------------------------------------------= */ =20 diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index c69756709b..b60f8e52f5 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -37,6 +37,7 @@ #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qom/object.h" =20 /*#define TRAFFIC_DEBUG*/ /* Thanks to NetChip Technologies for donating this product ID. @@ -629,7 +630,7 @@ struct rndis_response { uint8_t buf[]; }; =20 -typedef struct USBNetState { +struct USBNetState { USBDevice dev; =20 enum rndis_state rndis_state; @@ -651,7 +652,8 @@ typedef struct USBNetState { NICState *nic; NICConf conf; QTAILQ_HEAD(, rndis_response) rndis_resp; -} USBNetState; +}; +typedef struct USBNetState USBNetState; =20 #define TYPE_USB_NET "usb-net" #define USB_NET(obj) OBJECT_CHECK(USBNetState, (obj), TYPE_USB_NET) diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 7e50e3ba47..8f13f2fd31 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -19,6 +19,7 @@ #include "desc.h" #include "chardev/char-serial.h" #include "chardev/char-fe.h" +#include "qom/object.h" =20 //#define DEBUG_Serial =20 @@ -96,7 +97,7 @@ do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while= (0) #define FTDI_TEMT (1<<6) // Transmitter Empty #define FTDI_FIFO (1<<7) // Error in FIFO =20 -typedef struct { +struct USBSerialState { USBDevice dev; USBEndpoint *intr; uint8_t recv_buf[RECV_BUF]; @@ -108,7 +109,8 @@ typedef struct { QEMUSerialSetParams params; int latency; /* ms */ CharBackend cs; -} USBSerialState; +}; +typedef struct USBSerialState USBSerialState; =20 #define TYPE_USB_SERIAL "usb-serial-dev" #define USB_SERIAL_DEV(obj) OBJECT_CHECK(USBSerialState, (obj), TYPE_USB_S= ERIAL) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index fcfe216594..a9898187b8 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -46,6 +46,7 @@ #include "desc.h" =20 #include "ccid.h" +#include "qom/object.h" =20 #define DPRINTF(s, lvl, fmt, ...) \ do { \ @@ -60,6 +61,7 @@ do { \ #define D_VERBOSE 4 =20 #define CCID_DEV_NAME "usb-ccid" +typedef struct USBCCIDState USBCCIDState; #define USB_CCID_DEV(obj) OBJECT_CHECK(USBCCIDState, (obj), CCID_DEV_NAME) /* * The two options for variable sized buffers: @@ -274,14 +276,15 @@ typedef struct BulkIn { uint32_t pos; } BulkIn; =20 -typedef struct CCIDBus { +struct CCIDBus { BusState qbus; -} CCIDBus; +}; +typedef struct CCIDBus CCIDBus; =20 /* * powered - defaults to true, changed by PowerOn/PowerOff messages */ -typedef struct USBCCIDState { +struct USBCCIDState { USBDevice dev; USBEndpoint *intr; USBEndpoint *bulk; @@ -309,7 +312,7 @@ typedef struct USBCCIDState { uint8_t powered; uint8_t notify_slot_change; uint8_t debug; -} USBCCIDState; +}; =20 /* * CCID Spec chapter 4: CCID uses a standard device descriptor per Chapter= 9, diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 405a4ccfe7..55a04293a4 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -22,6 +22,7 @@ #include "sysemu/block-backend.h" #include "qapi/visitor.h" #include "qemu/cutils.h" +#include "qom/object.h" =20 //#define DEBUG_MSD =20 @@ -50,7 +51,7 @@ struct usb_msd_csw { uint8_t status; }; =20 -typedef struct { +struct MSDState { USBDevice dev; enum USBMSDMode mode; uint32_t scsi_off; @@ -65,7 +66,8 @@ typedef struct { BlockConf conf; uint32_t removable; SCSIDevice *scsi_dev; -} MSDState; +}; +typedef struct MSDState MSDState; =20 #define TYPE_USB_STORAGE "usb-storage-dev" #define USB_STORAGE_DEV(obj) OBJECT_CHECK(MSDState, (obj), TYPE_USB_STORAG= E) diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index a3a4d41c07..1d27bb942b 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -23,6 +23,7 @@ #include "hw/qdev-properties.h" #include "hw/scsi/scsi.h" #include "scsi/constants.h" +#include "qom/object.h" =20 /* --------------------------------------------------------------------- */ =20 diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c index 76fc5a5dab..e2dae6a86d 100644 --- a/hw/usb/dev-wacom.c +++ b/hw/usb/dev-wacom.c @@ -33,12 +33,13 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "desc.h" +#include "qom/object.h" =20 /* Interface requests */ #define WACOM_GET_REPORT 0x2101 #define WACOM_SET_REPORT 0x2109 =20 -typedef struct USBWacomState { +struct USBWacomState { USBDevice dev; USBEndpoint *intr; QEMUPutMouseEntry *eh_entry; @@ -51,7 +52,8 @@ typedef struct USBWacomState { } mode; uint8_t idle; int changed; -} USBWacomState; +}; +typedef struct USBWacomState USBWacomState; =20 #define TYPE_USB_WACOM "usb-wacom-tablet" #define USB_WACOM(obj) OBJECT_CHECK(USBWacomState, (obj), TYPE_USB_WACOM) diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index a7fb1666af..82fe967196 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -29,11 +29,13 @@ #include "hw/qdev-properties.h" #include "trace.h" #include "hcd-ohci.h" +#include "qom/object.h" =20 #define TYPE_PCI_OHCI "pci-ohci" +typedef struct OHCIPCIState OHCIPCIState; #define PCI_OHCI(obj) OBJECT_CHECK(OHCIPCIState, (obj), TYPE_PCI_OHCI) =20 -typedef struct { +struct OHCIPCIState { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -42,7 +44,7 @@ typedef struct { char *masterbus; uint32_t num_ports; uint32_t firstport; -} OHCIPCIState; +}; =20 /** * A typical PCI OHCI will additionally set PERR in its configspace to diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 37f7beb3fa..31ec5f4702 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -39,6 +39,7 @@ #include "trace.h" #include "qemu/main-loop.h" #include "qemu/module.h" +#include "qom/object.h" =20 #define FRAME_TIMER_FREQ 1000 =20 diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 08604f787f..30779c8ff4 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -34,6 +34,7 @@ */ =20 #include "qemu/osdep.h" +#include "qom/object.h" #ifndef CONFIG_WIN32 #include #endif @@ -60,10 +61,10 @@ /* -----------------------------------------------------------------------= - */ =20 #define TYPE_USB_HOST_DEVICE "usb-host" +typedef struct USBHostDevice USBHostDevice; #define USB_HOST_DEVICE(obj) \ OBJECT_CHECK(USBHostDevice, (obj), TYPE_USB_HOST_DEVICE) =20 -typedef struct USBHostDevice USBHostDevice; typedef struct USBHostRequest USBHostRequest; typedef struct USBHostIsoXfer USBHostIsoXfer; typedef struct USBHostIsoRing USBHostIsoRing; diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 417a60a2e6..344fdc3d66 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -45,6 +45,7 @@ #include "hw/usb.h" #include "migration/qemu-file-types.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 /* ERROR is defined below. Remove any previous definition. */ #undef ERROR diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index 27eb28d3e4..a15ee515d7 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -28,11 +28,13 @@ #include "hw/hw.h" #include "hw/irq.h" #include "hw/sysbus.h" +#include "qom/object.h" =20 #define TYPE_TUSB6010 "tusb6010" +typedef struct TUSBState TUSBState; #define TUSB(obj) OBJECT_CHECK(TUSBState, (obj), TYPE_TUSB6010) =20 -typedef struct TUSBState { +struct TUSBState { SysBusDevice parent_obj; =20 MemoryRegion iomem[2]; @@ -68,7 +70,7 @@ typedef struct TUSBState { uint32_t pullup[2]; uint32_t control_config; uint32_t otg_timer_val; -} TUSBState; +}; =20 #define TUSB_DEVCLOCK 60000000 /* 60 MHz */ =20 diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index cec6fe1599..eb74e57b23 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -28,13 +28,15 @@ #include "hw/qdev-properties.h" #include "hw/s390x/ap-bridge.h" #include "exec/address-spaces.h" +#include "qom/object.h" =20 #define VFIO_AP_DEVICE_TYPE "vfio-ap" =20 -typedef struct VFIOAPDevice { +struct VFIOAPDevice { APDevice apdev; VFIODevice vdev; -} VFIOAPDevice; +}; +typedef struct VFIOAPDevice VFIOAPDevice; =20 #define VFIO_AP_DEVICE(obj) \ OBJECT_CHECK(VFIOAPDevice, (obj), VFIO_AP_DEVICE_TYPE) diff --git a/hw/virtio/vhost-scsi-pci.c b/hw/virtio/vhost-scsi-pci.c index a6bb0dc60d..b30a04d7cd 100644 --- a/hw/virtio/vhost-scsi-pci.c +++ b/hw/virtio/vhost-scsi-pci.c @@ -22,6 +22,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "virtio-pci.h" +#include "qom/object.h" =20 typedef struct VHostSCSIPCI VHostSCSIPCI; =20 diff --git a/hw/virtio/vhost-user-blk-pci.c b/hw/virtio/vhost-user-blk-pci.c index a62a71e067..51d0858281 100644 --- a/hw/virtio/vhost-user-blk-pci.c +++ b/hw/virtio/vhost-user-blk-pci.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "virtio-pci.h" +#include "qom/object.h" =20 typedef struct VHostUserBlkPCI VHostUserBlkPCI; =20 diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c index e11c889d82..6b01561c2f 100644 --- a/hw/virtio/vhost-user-fs-pci.c +++ b/hw/virtio/vhost-user-fs-pci.c @@ -15,6 +15,7 @@ #include "hw/qdev-properties.h" #include "hw/virtio/vhost-user-fs.h" #include "virtio-pci.h" +#include "qom/object.h" =20 struct VHostUserFSPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/vhost-user-input-pci.c b/hw/virtio/vhost-user-input-= pci.c index 0a50015599..b072fb576a 100644 --- a/hw/virtio/vhost-user-input-pci.c +++ b/hw/virtio/vhost-user-input-pci.c @@ -10,6 +10,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "virtio-pci.h" +#include "qom/object.h" =20 typedef struct VHostUserInputPCI VHostUserInputPCI; =20 diff --git a/hw/virtio/vhost-user-scsi-pci.c b/hw/virtio/vhost-user-scsi-pc= i.c index 25e97ca54e..773104e351 100644 --- a/hw/virtio/vhost-user-scsi-pci.c +++ b/hw/virtio/vhost-user-scsi-pci.c @@ -31,6 +31,7 @@ #include "hw/loader.h" #include "sysemu/kvm.h" #include "virtio-pci.h" +#include "qom/object.h" =20 typedef struct VHostUserSCSIPCI VHostUserSCSIPCI; =20 diff --git a/hw/virtio/vhost-user-vsock-pci.c b/hw/virtio/vhost-user-vsock-= pci.c index f4cf95873d..65bfc91d2d 100644 --- a/hw/virtio/vhost-user-vsock-pci.c +++ b/hw/virtio/vhost-user-vsock-pci.c @@ -13,6 +13,7 @@ #include "virtio-pci.h" #include "hw/qdev-properties.h" #include "hw/virtio/vhost-user-vsock.h" +#include "qom/object.h" =20 typedef struct VHostUserVSockPCI VHostUserVSockPCI; =20 diff --git a/hw/virtio/vhost-vsock-pci.c b/hw/virtio/vhost-vsock-pci.c index a815278e69..49fcddcb5a 100644 --- a/hw/virtio/vhost-vsock-pci.c +++ b/hw/virtio/vhost-vsock-pci.c @@ -17,6 +17,7 @@ #include "hw/qdev-properties.h" #include "hw/virtio/vhost-vsock.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VHostVSockPCI VHostVSockPCI; =20 diff --git a/hw/virtio/virtio-9p-pci.c b/hw/virtio/virtio-9p-pci.c index cbcb062faa..8ea357b868 100644 --- a/hw/virtio/virtio-9p-pci.c +++ b/hw/virtio/virtio-9p-pci.c @@ -19,19 +19,21 @@ #include "hw/9pfs/virtio-9p.h" #include "hw/qdev-properties.h" #include "qemu/module.h" +#include "qom/object.h" =20 /* * virtio-9p-pci: This extends VirtioPCIProxy. */ =20 #define TYPE_VIRTIO_9P_PCI "virtio-9p-pci-base" +typedef struct V9fsPCIState V9fsPCIState; #define VIRTIO_9P_PCI(obj) \ OBJECT_CHECK(V9fsPCIState, (obj), TYPE_VIRTIO_9P_PCI) =20 -typedef struct V9fsPCIState { +struct V9fsPCIState { VirtIOPCIProxy parent_obj; V9fsVirtioState vdev; -} V9fsPCIState; +}; =20 static void virtio_9p_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) { diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c index 5adc4e5819..35378c7309 100644 --- a/hw/virtio/virtio-balloon-pci.c +++ b/hw/virtio/virtio-balloon-pci.c @@ -19,6 +19,7 @@ #include "hw/virtio/virtio-balloon.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIOBalloonPCI VirtIOBalloonPCI; =20 diff --git a/hw/virtio/virtio-blk-pci.c b/hw/virtio/virtio-blk-pci.c index 37c6e0aeb4..a2aa614ef4 100644 --- a/hw/virtio/virtio-blk-pci.c +++ b/hw/virtio/virtio-blk-pci.c @@ -22,6 +22,7 @@ #include "virtio-pci.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIOBlkPCI VirtIOBlkPCI; =20 diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c index 198f86e08c..518a87a36e 100644 --- a/hw/virtio/virtio-crypto-pci.c +++ b/hw/virtio/virtio-crypto-pci.c @@ -21,6 +21,7 @@ #include "hw/virtio/virtio-crypto.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIOCryptoPCI VirtIOCryptoPCI; =20 diff --git a/hw/virtio/virtio-input-host-pci.c b/hw/virtio/virtio-input-hos= t-pci.c index a82eb5d914..4d8479c92e 100644 --- a/hw/virtio/virtio-input-host-pci.c +++ b/hw/virtio/virtio-input-host-pci.c @@ -11,6 +11,7 @@ #include "virtio-pci.h" #include "hw/virtio/virtio-input.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIOInputHostPCI VirtIOInputHostPCI; =20 diff --git a/hw/virtio/virtio-input-pci.c b/hw/virtio/virtio-input-pci.c index 74651a42ea..429dd4d7ab 100644 --- a/hw/virtio/virtio-input-pci.c +++ b/hw/virtio/virtio-input-pci.c @@ -12,6 +12,7 @@ #include "hw/qdev-properties.h" #include "hw/virtio/virtio-input.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIOInputPCI VirtIOInputPCI; typedef struct VirtIOInputHIDPCI VirtIOInputHIDPCI; diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index ba62d60a0a..17451f5a78 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -16,6 +16,7 @@ #include "hw/qdev-properties.h" #include "qapi/error.h" #include "hw/boards.h" +#include "qom/object.h" =20 typedef struct VirtIOIOMMUPCI VirtIOIOMMUPCI; =20 diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index 489b5dbad6..498fc02d8f 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -22,6 +22,7 @@ #include "virtio-pci.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIONetPCI VirtIONetPCI; =20 diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c index 8afbb4c209..8f953dff83 100644 --- a/hw/virtio/virtio-rng-pci.c +++ b/hw/virtio/virtio-rng-pci.c @@ -15,6 +15,7 @@ #include "hw/virtio/virtio-rng.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qom/object.h" =20 typedef struct VirtIORngPCI VirtIORngPCI; =20 diff --git a/hw/virtio/virtio-scsi-pci.c b/hw/virtio/virtio-scsi-pci.c index fa4b3bfb50..7a7ffa43f8 100644 --- a/hw/virtio/virtio-scsi-pci.c +++ b/hw/virtio/virtio-scsi-pci.c @@ -19,6 +19,7 @@ #include "hw/virtio/virtio-scsi.h" #include "qemu/module.h" #include "virtio-pci.h" +#include "qom/object.h" =20 typedef struct VirtIOSCSIPCI VirtIOSCSIPCI; =20 diff --git a/hw/virtio/virtio-serial-pci.c b/hw/virtio/virtio-serial-pci.c index 95d25d54da..1bd769e88d 100644 --- a/hw/virtio/virtio-serial-pci.c +++ b/hw/virtio/virtio-serial-pci.c @@ -21,6 +21,7 @@ #include "hw/virtio/virtio-serial.h" #include "qemu/module.h" #include "virtio-pci.h" +#include "qom/object.h" =20 typedef struct VirtIOSerialPCI VirtIOSerialPCI; =20 diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index 370cf92e85..eaa2b39ab8 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -26,6 +26,7 @@ #include "sysemu/watchdog.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 /*#define I6300ESB_DEBUG 1*/ =20 diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c index 985944a84a..1a7a8f695f 100644 --- a/hw/watchdog/wdt_ib700.c +++ b/hw/watchdog/wdt_ib700.c @@ -25,6 +25,7 @@ #include "sysemu/watchdog.h" #include "hw/isa/isa.h" #include "migration/vmstate.h" +#include "qom/object.h" =20 /*#define IB700_DEBUG 1*/ =20 @@ -36,15 +37,16 @@ #endif =20 #define TYPE_IB700 "ib700" +typedef struct IB700state IB700State; #define IB700(obj) OBJECT_CHECK(IB700State, (obj), TYPE_IB700) =20 -typedef struct IB700state { +struct IB700state { ISADevice parent_obj; =20 QEMUTimer *timer; =20 PortioList port_list; -} IB700State; +}; =20 /* This is the timer. We use a global here because the watchdog * code ensures there is only one watchdog (it is located at a fixed, diff --git a/migration/rdma.c b/migration/rdma.c index bea6532813..0a90f0d420 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -35,6 +35,7 @@ #include #include #include "trace.h" +#include "qom/object.h" =20 /* * Print and error on both the Monitor and the Log file. @@ -397,10 +398,10 @@ typedef struct RDMAContext { } RDMAContext; =20 #define TYPE_QIO_CHANNEL_RDMA "qio-channel-rdma" +typedef struct QIOChannelRDMA QIOChannelRDMA; #define QIO_CHANNEL_RDMA(obj) \ OBJECT_CHECK(QIOChannelRDMA, (obj), TYPE_QIO_CHANNEL_RDMA) =20 -typedef struct QIOChannelRDMA QIOChannelRDMA; =20 =20 struct QIOChannelRDMA { diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c index b7ef63ec0e..0082aa6c3e 100644 --- a/net/can/can_socketcan.c +++ b/net/can/can_socketcan.c @@ -40,17 +40,19 @@ #include #include #include +#include "qom/object.h" =20 #ifndef DEBUG_CAN #define DEBUG_CAN 0 #endif /*DEBUG_CAN*/ =20 #define TYPE_CAN_HOST_SOCKETCAN "can-host-socketcan" +typedef struct CanHostSocketCAN CanHostSocketCAN; #define CAN_HOST_SOCKETCAN(obj) \ OBJECT_CHECK(CanHostSocketCAN, (obj), TYPE_CAN_HOST_SOCKETCAN) =20 #define CAN_READ_BUF_LEN 5 -typedef struct CanHostSocketCAN { +struct CanHostSocketCAN { CanHostState parent; char *ifname; =20 @@ -63,7 +65,7 @@ typedef struct CanHostSocketCAN { int bufptr; =20 int fd; -} CanHostSocketCAN; +}; =20 /* Check that QEMU and Linux kernel flags encoding and structure matches */ QEMU_BUILD_BUG_ON(QEMU_CAN_EFF_FLAG !=3D CAN_EFF_FLAG); diff --git a/net/colo-compare.c b/net/colo-compare.c index 2c20de1537..be3ca5f8c5 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -36,6 +36,7 @@ #include "qemu/coroutine.h" =20 #define TYPE_COLO_COMPARE "colo-compare" +typedef struct CompareState CompareState; #define COLO_COMPARE(obj) \ OBJECT_CHECK(CompareState, (obj), TYPE_COLO_COMPARE) =20 @@ -100,7 +101,7 @@ typedef struct SendEntry { uint8_t *buf; } SendEntry; =20 -typedef struct CompareState { +struct CompareState { Object parent; =20 char *pri_indev; @@ -136,7 +137,7 @@ typedef struct CompareState { enum colo_event event; =20 QTAILQ_ENTRY(CompareState) next; -} CompareState; +}; =20 typedef struct CompareClass { ObjectClass parent_class; diff --git a/net/dump.c b/net/dump.c index 11a737a4bc..454672d73d 100644 --- a/net/dump.c +++ b/net/dump.c @@ -33,6 +33,7 @@ #include "qemu/timer.h" #include "qapi/visitor.h" #include "net/filter.h" +#include "qom/object.h" =20 typedef struct DumpState { int64_t start_ts; @@ -139,6 +140,7 @@ static int net_dump_state_init(DumpState *s, const char= *filename, =20 #define TYPE_FILTER_DUMP "filter-dump" =20 +typedef struct NetFilterDumpState NetFilterDumpState; #define FILTER_DUMP(obj) \ OBJECT_CHECK(NetFilterDumpState, (obj), TYPE_FILTER_DUMP) =20 @@ -148,7 +150,6 @@ struct NetFilterDumpState { char *filename; uint32_t maxlen; }; -typedef struct NetFilterDumpState NetFilterDumpState; =20 static ssize_t filter_dump_receive_iov(NetFilterState *nf, NetClientState = *sndr, unsigned flags, const struct iovec = *iov, diff --git a/net/filter-buffer.c b/net/filter-buffer.c index dfa211794b..78f7f0b36b 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -18,16 +18,17 @@ =20 #define TYPE_FILTER_BUFFER "filter-buffer" =20 +typedef struct FilterBufferState FilterBufferState; #define FILTER_BUFFER(obj) \ OBJECT_CHECK(FilterBufferState, (obj), TYPE_FILTER_BUFFER) =20 -typedef struct FilterBufferState { +struct FilterBufferState { NetFilterState parent_obj; =20 NetQueue *incoming_queue; uint32_t interval; QEMUTimer release_timer; -} FilterBufferState; +}; =20 static void filter_buffer_flush(NetFilterState *nf) { diff --git a/net/filter-mirror.c b/net/filter-mirror.c index e9379ce248..3fd3b90d1d 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -21,17 +21,18 @@ #include "qemu/iov.h" #include "qemu/sockets.h" =20 +#define TYPE_FILTER_MIRROR "filter-mirror" +typedef struct MirrorState MirrorState; #define FILTER_MIRROR(obj) \ OBJECT_CHECK(MirrorState, (obj), TYPE_FILTER_MIRROR) =20 +#define TYPE_FILTER_REDIRECTOR "filter-redirector" #define FILTER_REDIRECTOR(obj) \ OBJECT_CHECK(MirrorState, (obj), TYPE_FILTER_REDIRECTOR) =20 -#define TYPE_FILTER_MIRROR "filter-mirror" -#define TYPE_FILTER_REDIRECTOR "filter-redirector" #define REDIRECTOR_MAX_LEN NET_BUFSIZE =20 -typedef struct MirrorState { +struct MirrorState { NetFilterState parent_obj; char *indev; char *outdev; @@ -39,7 +40,7 @@ typedef struct MirrorState { CharBackend chr_out; SocketReadState rs; bool vnet_hdr; -} MirrorState; +}; =20 static int filter_send(MirrorState *s, const struct iovec *iov, diff --git a/net/filter-replay.c b/net/filter-replay.c index 9dda193928..a0b99aaf86 100644 --- a/net/filter-replay.c +++ b/net/filter-replay.c @@ -19,9 +19,11 @@ #include "qapi/visitor.h" #include "net/filter.h" #include "sysemu/replay.h" +#include "qom/object.h" =20 #define TYPE_FILTER_REPLAY "filter-replay" =20 +typedef struct NetFilterReplayState NetFilterReplayState; #define FILTER_REPLAY(obj) \ OBJECT_CHECK(NetFilterReplayState, (obj), TYPE_FILTER_REPLAY) =20 @@ -29,7 +31,6 @@ struct NetFilterReplayState { NetFilterState nfs; ReplayNetState *rns; }; -typedef struct NetFilterReplayState NetFilterReplayState; =20 static ssize_t filter_replay_receive_iov(NetFilterState *nf, NetClientState *sndr, diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index 1aaad101b6..c28d959942 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -23,21 +23,22 @@ #include "migration/colo.h" #include "util.h" =20 +#define TYPE_FILTER_REWRITER "filter-rewriter" +typedef struct RewriterState RewriterState; #define FILTER_COLO_REWRITER(obj) \ OBJECT_CHECK(RewriterState, (obj), TYPE_FILTER_REWRITER) =20 -#define TYPE_FILTER_REWRITER "filter-rewriter" #define FAILOVER_MODE_ON true #define FAILOVER_MODE_OFF false =20 -typedef struct RewriterState { +struct RewriterState { NetFilterState parent_obj; NetQueue *incoming_queue; /* hashtable to save connection */ GHashTable *connection_track_table; bool vnet_hdr; bool failover_mode; -} RewriterState; +}; =20 static void filter_rewriter_failover_mode(RewriterState *s) { diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c index 5acccfb4e3..59ba4b70ae 100644 --- a/scsi/pr-manager-helper.c +++ b/scsi/pr-manager-helper.c @@ -21,16 +21,18 @@ #include "qemu/module.h" =20 #include +#include "qom/object.h" =20 #define PR_MAX_RECONNECT_ATTEMPTS 5 =20 #define TYPE_PR_MANAGER_HELPER "pr-manager-helper" =20 +typedef struct PRManagerHelper PRManagerHelper; #define PR_MANAGER_HELPER(obj) \ OBJECT_CHECK(PRManagerHelper, (obj), \ TYPE_PR_MANAGER_HELPER) =20 -typedef struct PRManagerHelper { +struct PRManagerHelper { /* */ PRManager parent; =20 @@ -38,7 +40,7 @@ typedef struct PRManagerHelper { =20 QemuMutex lock; QIOChannel *ioc; -} PRManagerHelper; +}; =20 static void pr_manager_send_status_changed_event(PRManagerHelper *pr_mgr) { diff --git a/target/i386/sev.c b/target/i386/sev.c index de4818da6d..d452e73c18 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -28,12 +28,13 @@ #include "sysemu/runstate.h" #include "trace.h" #include "migration/blocker.h" +#include "qom/object.h" =20 #define TYPE_SEV_GUEST "sev-guest" +typedef struct SevGuestState SevGuestState; #define SEV_GUEST(obj) \ OBJECT_CHECK(SevGuestState, (obj), TYPE_SEV_GUEST) =20 -typedef struct SevGuestState SevGuestState; =20 /** * SevGuestState: diff --git a/tests/check-qom-interface.c b/tests/check-qom-interface.c index 2177f0dce5..bfa9ad5d19 100644 --- a/tests/check-qom-interface.c +++ b/tests/check-qom-interface.c @@ -16,6 +16,7 @@ =20 =20 #define TYPE_TEST_IF "test-interface" +typedef struct TestIfClass TestIfClass; #define TEST_IF_CLASS(klass) \ OBJECT_CLASS_CHECK(TestIfClass, (klass), TYPE_TEST_IF) #define TEST_IF_GET_CLASS(obj) \ @@ -25,11 +26,11 @@ =20 typedef struct TestIf TestIf; =20 -typedef struct TestIfClass { +struct TestIfClass { InterfaceClass parent_class; =20 uint32_t test; -} TestIfClass; +}; =20 static const TypeInfo test_if_info =3D { .name =3D TYPE_TEST_IF, diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index 1e6b0f33ff..c3e210a9ef 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -31,6 +31,7 @@ =20 =20 #define TYPE_STATIC_PROPS "static_prop_type" +typedef struct MyType MyType; #define STATIC_TYPE(obj) \ OBJECT_CHECK(MyType, (obj), TYPE_STATIC_PROPS) =20 @@ -38,12 +39,12 @@ =20 #define PROP_DEFAULT 100 =20 -typedef struct MyType { +struct MyType { DeviceState parent_obj; =20 uint32_t prop1; uint32_t prop2; -} MyType; +}; =20 static Property static_props[] =3D { DEFINE_PROP_UINT32("prop1", MyType, prop1, PROP_DEFAULT), diff --git a/ui/console.c b/ui/console.c index 0579be792f..37972cb5e0 100644 --- a/ui/console.c +++ b/ui/console.c @@ -34,6 +34,7 @@ #include "trace.h" #include "exec/memory.h" #include "io/channel-file.h" +#include "qom/object.h" =20 #define DEFAULT_BACKSCROLL 512 #define CONSOLE_CURSOR_PERIOD 500 @@ -1082,10 +1083,11 @@ void console_select(unsigned int index) } } =20 -typedef struct VCChardev { +struct VCChardev { Chardev parent; QemuConsole *console; -} VCChardev; +}; +typedef struct VCChardev VCChardev; =20 #define TYPE_CHARDEV_VC "chardev-vc" #define VC_CHARDEV(obj) OBJECT_CHECK(VCChardev, (obj), TYPE_CHARDEV_VC) diff --git a/ui/gtk.c b/ui/gtk.c index b0cc08ad6d..558c63dc22 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -171,11 +171,12 @@ struct GtkDisplayState { DisplayOptions *opts; }; =20 -typedef struct VCChardev { +struct VCChardev { Chardev parent; VirtualConsole *console; bool echo; -} VCChardev; +}; +typedef struct VCChardev VCChardev; =20 #define TYPE_CHARDEV_VC "chardev-vc" #define VC_CHARDEV(obj) OBJECT_CHECK(VCChardev, (obj), TYPE_CHARDEV_VC) diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 1cdf0c5f82..477f6cd70e 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -13,12 +13,15 @@ #include "qom/object_interfaces.h" #include "io/channel-socket.h" #include "ui/input.h" +#include "qom/object.h" #include "ui/vnc_keysym.h" /* use name2keysym from VNC as we use X11 value= s */ #include "qemu/cutils.h" #include "qapi/qmp/qerror.h" #include "input-barrier.h" =20 #define TYPE_INPUT_BARRIER "input-barrier" +typedef struct InputBarrier InputBarrier; +typedef struct InputBarrierClass InputBarrierClass; #define INPUT_BARRIER(obj) \ OBJECT_CHECK(InputBarrier, (obj), TYPE_INPUT_BARRIER) #define INPUT_BARRIER_GET_CLASS(obj) \ @@ -26,8 +29,6 @@ #define INPUT_BARRIER_CLASS(klass) \ OBJECT_CLASS_CHECK(InputBarrierClass, (klass), TYPE_INPUT_BARRIER) =20 -typedef struct InputBarrier InputBarrier; -typedef struct InputBarrierClass InputBarrierClass; =20 #define MAX_HELLO_LENGTH 1024 =20 diff --git a/ui/input-linux.c b/ui/input-linux.c index 4925ce1af1..1b35c044e6 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -17,6 +17,7 @@ =20 #include #include "standard-headers/linux/input.h" +#include "qom/object.h" =20 static bool linux_is_button(unsigned int lnx) { @@ -30,6 +31,8 @@ static bool linux_is_button(unsigned int lnx) } =20 #define TYPE_INPUT_LINUX "input-linux" +typedef struct InputLinux InputLinux; +typedef struct InputLinuxClass InputLinuxClass; #define INPUT_LINUX(obj) \ OBJECT_CHECK(InputLinux, (obj), TYPE_INPUT_LINUX) #define INPUT_LINUX_GET_CLASS(obj) \ @@ -37,8 +40,6 @@ static bool linux_is_button(unsigned int lnx) #define INPUT_LINUX_CLASS(klass) \ OBJECT_CLASS_CHECK(InputLinuxClass, (klass), TYPE_INPUT_LINUX) =20 -typedef struct InputLinux InputLinux; -typedef struct InputLinuxClass InputLinuxClass; =20 struct InputLinux { Object parent; diff --git a/ui/spice-app.c b/ui/spice-app.c index 40fb2ef573..d68a35c3b1 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -35,14 +35,16 @@ #include "io/channel-command.h" #include "chardev/spice.h" #include "sysemu/sysemu.h" +#include "qom/object.h" =20 static const char *tmp_dir; static char *app_dir; static char *sock_path; =20 -typedef struct VCChardev { +struct VCChardev { SpiceChardev parent; -} VCChardev; +}; +typedef struct VCChardev VCChardev; =20 #define TYPE_CHARDEV_VC "chardev-vc" #define VC_CHARDEV(obj) OBJECT_CHECK(VCChardev, (obj), TYPE_CHARDEV_VC) --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166741; cv=none; d=zohomail.com; s=zohoarc; b=b0SdVFuC23FbmGw3OR3t00QPwDGZtuln9Bq9kfGUoHbGMzpirxSvds2/mxEQHCnCZbGzBATvuodUGgXzFBlHzE1KW03Fj64ib1hkKGNK/KYlZ671cnwARkmVIutZmIfe37GW+YDI4LvnQbLGLHGi8mGqhwDLSEDPoi7SfPXB95k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166741; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iemKwfNaT5kF3cXl06OAJZmw4z4aWY5w1AoLJJMezmo=; b=hKlMWWkyWMuGqBIjyu+bxkCPi913DHZ7aUiY3CZvmNh5SEpYgmuFdJik6+sy3IU2pKaD7YI1k3CvUZXcjYoGgmy+ImOOgBZhi+UmXkOKv6CuQNYTp9BzMpDx3vax+gkSSTpjyLTjXJ45tg2xWDW/rIW6sUUqzDKkRaBs/wnJLeU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166741796799.1922613063731; Thu, 3 Sep 2020 13:59:01 -0700 (PDT) Received: from localhost ([::1]:60828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwJw-0001GM-HI for importer@patchew.org; Thu, 03 Sep 2020 16:59:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwET-0000u6-Lt for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEN-0006aT-Q3 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-soV0MqWLOL2whvsSztm1Rg-1; Thu, 03 Sep 2020 16:53:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E55981F03F; Thu, 3 Sep 2020 20:53:06 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B565811AD; Thu, 3 Sep 2020 20:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iemKwfNaT5kF3cXl06OAJZmw4z4aWY5w1AoLJJMezmo=; b=ONbQWFbBEgyrXLZssLXVZvf/CNuEAheWgHNOmJN3X3iOnX/fSy1NuxOLZP5PKyQ6lnU6w0 dAlFa8Sglc0gqxmAaCLNaW+X1ohMddsDFsKtc4c+RreWm5e5oF6QuWDyjlX1MHRa2Ia0Ph RjdPzzLdKn1QvqEGyu1NwicHLpVBDj0= X-MC-Unique: soV0MqWLOL2whvsSztm1Rg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 09/27] Use DECLARE_*CHECKER* macros Date: Thu, 3 Sep 2020 16:52:29 -0400 Message-Id: <20200903205247.1667472-10-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.004 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=3DTypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Juan Quintela Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- chardev/chardev-internal.h | 3 +- hw/9pfs/virtio-9p.h | 4 +- hw/audio/intel-hda.h | 11 ++-- hw/avr/atmega.h | 3 +- hw/display/ati_int.h | 3 +- hw/display/qxl.h | 3 +- hw/display/virtio-vga.h | 8 +-- hw/i386/amd_iommu.h | 4 +- hw/misc/tmp105.h | 3 +- hw/net/fsl_etsec/etsec.h | 4 +- hw/net/rocker/rocker.h | 4 +- hw/net/tulip.h | 3 +- hw/net/vmxnet3_defs.h | 3 +- hw/ppc/e500-ccsr.h | 3 +- hw/ppc/e500.h | 8 +-- hw/ppc/mac.h | 8 +-- hw/rdma/vmw/pvrdma.h | 3 +- hw/s390x/ccw-device.h | 7 +-- hw/s390x/ipl.h | 3 +- hw/s390x/s390-pci-bus.h | 16 +++--- hw/s390x/virtio-ccw.h | 68 +++++++++++------------- hw/scsi/mptsas.h | 4 +- hw/usb/ccid.h | 8 +-- hw/usb/hcd-dwc2.h | 8 +-- hw/usb/hcd-ehci.h | 15 +++--- hw/usb/hcd-ohci.h | 3 +- hw/usb/hcd-xhci.h | 4 +- hw/vfio/pci.h | 3 +- hw/virtio/virtio-mem-pci.h | 4 +- hw/virtio/virtio-pci.h | 16 ++---- hw/virtio/virtio-pmem-pci.h | 4 +- hw/xen/xen_pt.h | 4 +- include/authz/base.h | 11 +--- include/authz/list.h | 11 +--- include/authz/listfile.h | 11 +--- include/authz/pamacct.h | 11 +--- include/authz/simple.h | 11 +--- include/block/throttle-groups.h | 3 +- include/chardev/char-fd.h | 3 +- include/chardev/char-win.h | 3 +- include/chardev/char.h | 7 +-- include/chardev/spice.h | 3 +- include/crypto/secret.h | 4 +- include/crypto/secret_common.h | 10 +--- include/crypto/secret_keyring.h | 11 +--- include/crypto/tls-cipher-suites.h | 4 +- include/crypto/tlscreds.h | 4 +- include/crypto/tlscredsanon.h | 4 +- include/crypto/tlscredspsk.h | 4 +- include/crypto/tlscredsx509.h | 4 +- include/exec/memory.h | 14 ++--- include/hw/acpi/acpi_dev_interface.h | 8 +-- include/hw/acpi/generic_event_device.h | 4 +- include/hw/acpi/vmgenid.h | 3 +- include/hw/adc/stm32f2xx_adc.h | 4 +- include/hw/arm/allwinner-a10.h | 3 +- include/hw/arm/allwinner-h3.h | 3 +- include/hw/arm/armsse.h | 7 +-- include/hw/arm/armv7m.h | 6 ++- include/hw/arm/aspeed.h | 8 +-- include/hw/arm/aspeed_soc.h | 7 +-- include/hw/arm/bcm2835_peripherals.h | 4 +- include/hw/arm/bcm2836.h | 7 +-- include/hw/arm/digic.h | 3 +- include/hw/arm/exynos4210.h | 4 +- include/hw/arm/fsl-imx25.h | 3 +- include/hw/arm/fsl-imx31.h | 3 +- include/hw/arm/fsl-imx6.h | 3 +- include/hw/arm/fsl-imx6ul.h | 3 +- include/hw/arm/fsl-imx7.h | 3 +- include/hw/arm/linux-boot-if.h | 6 +-- include/hw/arm/msf2-soc.h | 3 +- include/hw/arm/nrf51_soc.h | 4 +- include/hw/arm/omap.h | 15 +++--- include/hw/arm/pxa.h | 14 ++--- include/hw/arm/smmu-common.h | 7 +-- include/hw/arm/smmuv3.h | 7 +-- include/hw/arm/stm32f205_soc.h | 4 +- include/hw/arm/stm32f405_soc.h | 4 +- include/hw/arm/virt.h | 8 +-- include/hw/arm/xlnx-versal.h | 3 +- include/hw/arm/xlnx-zynqmp.h | 4 +- include/hw/block/flash.h | 8 +-- include/hw/block/swim.h | 9 ++-- include/hw/boards.h | 8 +-- include/hw/char/avr_usart.h | 4 +- include/hw/char/bcm2835_aux.h | 3 +- include/hw/char/cadence_uart.h | 4 +- include/hw/char/cmsdk-apb-uart.h | 4 +- include/hw/char/digic-uart.h | 4 +- include/hw/char/escc.h | 3 +- include/hw/char/ibex_uart.h | 4 +- include/hw/char/imx_serial.h | 3 +- include/hw/char/nrf51_uart.h | 3 +- include/hw/char/pl011.h | 3 +- include/hw/char/renesas_sci.h | 3 +- include/hw/char/serial.h | 9 ++-- include/hw/char/stm32f2xx_usart.h | 4 +- include/hw/clock.h | 3 +- include/hw/core/cpu.h | 4 +- include/hw/core/generic-loader.h | 4 +- include/hw/core/split-irq.h | 3 +- include/hw/cpu/a15mpcore.h | 4 +- include/hw/cpu/a9mpcore.h | 4 +- include/hw/cpu/arm11mpcore.h | 4 +- include/hw/cpu/cluster.h | 4 +- include/hw/cpu/core.h | 4 +- include/hw/display/bcm2835_fb.h | 3 +- include/hw/display/dpcd.h | 3 +- include/hw/display/i2c-ddc.h | 3 +- include/hw/display/macfb.h | 12 ++--- include/hw/display/xlnx_dp.h | 3 +- include/hw/dma/bcm2835_dma.h | 4 +- include/hw/dma/i8257.h | 4 +- include/hw/dma/pl080.h | 3 +- include/hw/dma/xlnx-zdma.h | 4 +- include/hw/dma/xlnx-zynq-devcfg.h | 4 +- include/hw/dma/xlnx_dpdma.h | 3 +- include/hw/fw-path-provider.h | 6 +-- include/hw/gpio/aspeed_gpio.h | 7 +-- include/hw/gpio/bcm2835_gpio.h | 4 +- include/hw/gpio/imx_gpio.h | 3 +- include/hw/gpio/nrf51_gpio.h | 3 +- include/hw/hotplug.h | 6 +-- include/hw/hyperv/vmbus-bridge.h | 3 +- include/hw/hyperv/vmbus.h | 11 ++-- include/hw/i2c/arm_sbcon_i2c.h | 4 +- include/hw/i2c/aspeed_i2c.h | 8 +-- include/hw/i2c/i2c.h | 11 ++-- include/hw/i2c/imx_i2c.h | 3 +- include/hw/i2c/microbit_i2c.h | 4 +- include/hw/i2c/ppc4xx_i2c.h | 3 +- include/hw/i2c/smbus_slave.h | 8 +-- include/hw/i386/apic_internal.h | 8 +-- include/hw/i386/ich9.h | 4 +- include/hw/i386/intel_iommu.h | 4 +- include/hw/i386/ioapic_internal.h | 8 +-- include/hw/i386/microvm.h | 8 +-- include/hw/i386/pc.h | 8 +-- include/hw/i386/x86-iommu.h | 8 +-- include/hw/i386/x86.h | 8 +-- include/hw/ide/ahci.h | 11 ++-- include/hw/ide/internal.h | 11 ++-- include/hw/ide/pci.h | 3 +- include/hw/input/adb.h | 10 ++-- include/hw/input/i8042.h | 3 +- include/hw/intc/allwinner-a10-pic.h | 3 +- include/hw/intc/arm_gic_common.h | 8 +-- include/hw/intc/arm_gicv3_common.h | 8 +-- include/hw/intc/arm_gicv3_its_common.h | 8 +-- include/hw/intc/armv7m_nvic.h | 4 +- include/hw/intc/aspeed_vic.h | 3 +- include/hw/intc/bcm2835_ic.h | 3 +- include/hw/intc/bcm2836_control.h | 4 +- include/hw/intc/heathrow_pic.h | 3 +- include/hw/intc/ibex_plic.h | 4 +- include/hw/intc/imx_avic.h | 3 +- include/hw/intc/imx_gpcv2.h | 3 +- include/hw/intc/intc.h | 6 +-- include/hw/intc/mips_gic.h | 3 +- include/hw/intc/realview_gic.h | 4 +- include/hw/intc/rx_icu.h | 3 +- include/hw/intc/xlnx-pmu-iomod-intc.h | 4 +- include/hw/intc/xlnx-zynqmp-ipi.h | 4 +- include/hw/ipack/ipack.h | 11 ++-- include/hw/ipmi/ipmi.h | 18 +++---- include/hw/isa/i8259_internal.h | 8 +-- include/hw/isa/isa.h | 17 +++--- include/hw/isa/pc87312.h | 3 +- include/hw/isa/superio.h | 8 +-- include/hw/m68k/mcf_fec.h | 3 +- include/hw/mem/memory-device.h | 6 +-- include/hw/mem/nvdimm.h | 6 +-- include/hw/mem/pc-dimm.h | 8 +-- include/hw/mips/cps.h | 3 +- include/hw/misc/a9scu.h | 3 +- include/hw/misc/allwinner-cpucfg.h | 4 +- include/hw/misc/allwinner-h3-ccu.h | 4 +- include/hw/misc/allwinner-h3-dramc.h | 4 +- include/hw/misc/allwinner-h3-sysctrl.h | 4 +- include/hw/misc/allwinner-sid.h | 4 +- include/hw/misc/arm11scu.h | 3 +- include/hw/misc/armsse-cpuid.h | 3 +- include/hw/misc/armsse-mhu.h | 3 +- include/hw/misc/aspeed_scu.h | 7 +-- include/hw/misc/aspeed_sdmc.h | 7 +-- include/hw/misc/aspeed_xdma.h | 3 +- include/hw/misc/auxbus.h | 10 ++-- include/hw/misc/avr_power.h | 3 +- include/hw/misc/bcm2835_mbox.h | 4 +- include/hw/misc/bcm2835_mphi.h | 4 +- include/hw/misc/bcm2835_property.h | 4 +- include/hw/misc/bcm2835_rng.h | 4 +- include/hw/misc/bcm2835_thermal.h | 4 +- include/hw/misc/grlib_ahb_apb_pnp.h | 8 +-- include/hw/misc/imx25_ccm.h | 3 +- include/hw/misc/imx31_ccm.h | 3 +- include/hw/misc/imx6_ccm.h | 3 +- include/hw/misc/imx6_src.h | 3 +- include/hw/misc/imx6ul_ccm.h | 3 +- include/hw/misc/imx7_ccm.h | 6 ++- include/hw/misc/imx7_gpr.h | 3 +- include/hw/misc/imx7_snvs.h | 3 +- include/hw/misc/imx_ccm.h | 8 +-- include/hw/misc/imx_rngc.h | 3 +- include/hw/misc/iotkit-secctl.h | 3 +- include/hw/misc/iotkit-sysctl.h | 4 +- include/hw/misc/iotkit-sysinfo.h | 4 +- include/hw/misc/mac_via.h | 11 ++-- include/hw/misc/macio/cuda.h | 7 +-- include/hw/misc/macio/gpio.h | 3 +- include/hw/misc/macio/macio.h | 17 +++--- include/hw/misc/macio/pmu.h | 7 +-- include/hw/misc/max111x.h | 4 +- include/hw/misc/mips_cmgcr.h | 3 +- include/hw/misc/mips_cpc.h | 3 +- include/hw/misc/mips_itu.h | 3 +- include/hw/misc/mos6522.h | 7 +-- include/hw/misc/mps2-fpgaio.h | 3 +- include/hw/misc/mps2-scc.h | 3 +- include/hw/misc/msf2-sysreg.h | 3 +- include/hw/misc/nrf51_rng.h | 3 +- include/hw/misc/pca9552.h | 3 +- include/hw/misc/stm32f2xx_syscfg.h | 4 +- include/hw/misc/stm32f4xx_exti.h | 4 +- include/hw/misc/stm32f4xx_syscfg.h | 4 +- include/hw/misc/tz-mpc.h | 3 +- include/hw/misc/tz-msc.h | 3 +- include/hw/misc/tz-ppc.h | 3 +- include/hw/misc/unimp.h | 4 +- include/hw/misc/vmcoreinfo.h | 3 +- include/hw/misc/zynq-xadc.h | 4 +- include/hw/net/allwinner-sun8i-emac.h | 4 +- include/hw/net/allwinner_emac.h | 3 +- include/hw/net/cadence_gem.h | 3 +- include/hw/net/ftgmac100.h | 6 ++- include/hw/net/imx_fec.h | 3 +- include/hw/net/lance.h | 4 +- include/hw/net/lasi_82596.h | 4 +- include/hw/net/msf2-emac.h | 4 +- include/hw/nmi.h | 6 +-- include/hw/nubus/mac-nubus-bridge.h | 4 +- include/hw/nubus/nubus.h | 7 +-- include/hw/nvram/fw_cfg.h | 15 +++--- include/hw/nvram/nrf51_nvm.h | 3 +- include/hw/or-irq.h | 3 +- include/hw/pci-bridge/simba.h | 4 +- include/hw/pci-host/designware.h | 8 +-- include/hw/pci-host/gpex.h | 8 +-- include/hw/pci-host/i440fx.h | 4 +- include/hw/pci-host/pnv_phb3.h | 9 ++-- include/hw/pci-host/pnv_phb4.h | 15 +++--- include/hw/pci-host/q35.h | 8 +-- include/hw/pci-host/sabre.h | 8 +-- include/hw/pci-host/spapr.h | 4 +- include/hw/pci-host/uninorth.h | 20 +++---- include/hw/pci-host/xilinx-pcie.h | 8 +-- include/hw/pci/pci.h | 13 ++--- include/hw/pci/pci_bridge.h | 3 +- include/hw/pci/pci_host.h | 8 +-- include/hw/pci/pcie_host.h | 4 +- include/hw/pci/pcie_port.h | 12 ++--- include/hw/pcmcia.h | 8 +-- include/hw/platform-bus.h | 4 +- include/hw/ppc/mac_dbdma.h | 3 +- include/hw/ppc/openpic.h | 3 +- include/hw/ppc/pnv.h | 44 +++++++-------- include/hw/ppc/pnv_core.h | 12 ++--- include/hw/ppc/pnv_homer.h | 13 +++-- include/hw/ppc/pnv_lpc.h | 17 +++--- include/hw/ppc/pnv_occ.h | 13 +++-- include/hw/ppc/pnv_pnor.h | 3 +- include/hw/ppc/pnv_psi.h | 16 +++--- include/hw/ppc/pnv_xive.h | 7 +-- include/hw/ppc/pnv_xscom.h | 5 +- include/hw/ppc/spapr.h | 20 +++---- include/hw/ppc/spapr_cpu_core.h | 8 +-- include/hw/ppc/spapr_drc.h | 67 ++++++----------------- include/hw/ppc/spapr_irq.h | 6 +-- include/hw/ppc/spapr_tpm_proxy.h | 4 +- include/hw/ppc/spapr_vio.h | 11 ++-- include/hw/ppc/spapr_xive.h | 7 +-- include/hw/ppc/xics.h | 23 +++----- include/hw/ppc/xive.h | 36 +++++-------- include/hw/qdev-core.h | 10 ++-- include/hw/rdma/rdma.h | 6 +-- include/hw/register.h | 3 +- include/hw/resettable.h | 6 +-- include/hw/riscv/opentitan.h | 4 +- include/hw/riscv/riscv_hart.h | 4 +- include/hw/riscv/sifive_clint.h | 4 +- include/hw/riscv/sifive_e.h | 8 +-- include/hw/riscv/sifive_e_prci.h | 4 +- include/hw/riscv/sifive_gpio.h | 3 +- include/hw/riscv/sifive_plic.h | 4 +- include/hw/riscv/sifive_test.h | 4 +- include/hw/riscv/sifive_u.h | 8 +-- include/hw/riscv/sifive_u_otp.h | 4 +- include/hw/riscv/sifive_u_prci.h | 4 +- include/hw/riscv/sifive_uart.h | 4 +- include/hw/riscv/spike.h | 4 +- include/hw/riscv/virt.h | 4 +- include/hw/rtc/allwinner-rtc.h | 8 +-- include/hw/rtc/aspeed_rtc.h | 3 +- include/hw/rtc/goldfish_rtc.h | 4 +- include/hw/rtc/m48t59.h | 6 +-- include/hw/rtc/mc146818rtc.h | 3 +- include/hw/rtc/pl031.h | 3 +- include/hw/rtc/xlnx-zynqmp-rtc.h | 4 +- include/hw/rx/rx62n.h | 3 +- include/hw/s390x/3270-ccw.h | 8 +-- include/hw/s390x/ap-device.h | 4 +- include/hw/s390x/css-bridge.h | 8 +-- include/hw/s390x/event-facility.h | 18 ++----- include/hw/s390x/s390-ccw.h | 8 +-- include/hw/s390x/s390-virtio-ccw.h | 6 +-- include/hw/s390x/s390_flic.h | 16 +++--- include/hw/s390x/sclp.h | 5 +- include/hw/s390x/storage-attributes.h | 16 +++--- include/hw/s390x/storage-keys.h | 12 ++--- include/hw/s390x/tod.h | 7 +-- include/hw/s390x/vfio-ccw.h | 4 +- include/hw/scsi/esp.h | 3 +- include/hw/scsi/scsi.h | 11 ++-- include/hw/sd/allwinner-sdhost.h | 8 +-- include/hw/sd/aspeed_sdhci.h | 4 +- include/hw/sd/bcm2835_sdhost.h | 4 +- include/hw/sd/sd.h | 12 ++--- include/hw/sd/sdhci.h | 7 +-- include/hw/southbridge/piix.h | 4 +- include/hw/sparc/sparc32_dma.h | 16 +++--- include/hw/sparc/sun4m_iommu.h | 3 +- include/hw/sparc/sun4u_iommu.h | 3 +- include/hw/ssi/aspeed_smc.h | 7 +-- include/hw/ssi/imx_spi.h | 3 +- include/hw/ssi/mss-spi.h | 3 +- include/hw/ssi/pl022.h | 3 +- include/hw/ssi/ssi.h | 8 +-- include/hw/ssi/stm32f2xx_spi.h | 4 +- include/hw/ssi/xilinx_spips.h | 20 +++---- include/hw/stream.h | 6 +-- include/hw/sysbus.h | 11 ++-- include/hw/timer/a9gtimer.h | 3 +- include/hw/timer/allwinner-a10-pit.h | 3 +- include/hw/timer/arm_mptimer.h | 4 +- include/hw/timer/armv7m_systick.h | 3 +- include/hw/timer/aspeed_timer.h | 8 +-- include/hw/timer/avr_timer16.h | 4 +- include/hw/timer/bcm2835_systmr.h | 4 +- include/hw/timer/cmsdk-apb-dualtimer.h | 4 +- include/hw/timer/cmsdk-apb-timer.h | 4 +- include/hw/timer/digic-timer.h | 3 +- include/hw/timer/i8254.h | 8 +-- include/hw/timer/imx_epit.h | 3 +- include/hw/timer/imx_gpt.h | 3 +- include/hw/timer/mss-timer.h | 4 +- include/hw/timer/nrf51_timer.h | 3 +- include/hw/timer/renesas_cmt.h | 3 +- include/hw/timer/renesas_tmr.h | 3 +- include/hw/timer/stm32f2xx_timer.h | 4 +- include/hw/usb.h | 11 ++-- include/hw/usb/chipidea.h | 3 +- include/hw/usb/imx-usb-phy.h | 3 +- include/hw/vfio/vfio-amd-xgbe.h | 10 +--- include/hw/vfio/vfio-calxeda-xgmac.h | 10 +--- include/hw/vfio/vfio-platform.h | 8 +-- include/hw/virtio/vhost-scsi-common.h | 4 +- include/hw/virtio/vhost-scsi.h | 4 +- include/hw/virtio/vhost-user-blk.h | 4 +- include/hw/virtio/vhost-user-fs.h | 4 +- include/hw/virtio/vhost-user-scsi.h | 4 +- include/hw/virtio/vhost-user-vsock.h | 4 +- include/hw/virtio/vhost-vsock-common.h | 4 +- include/hw/virtio/vhost-vsock.h | 4 +- include/hw/virtio/virtio-balloon.h | 4 +- include/hw/virtio/virtio-blk.h | 4 +- include/hw/virtio/virtio-bus.h | 7 +-- include/hw/virtio/virtio-crypto.h | 4 +- include/hw/virtio/virtio-gpu-pci.h | 4 +- include/hw/virtio/virtio-gpu.h | 16 +++--- include/hw/virtio/virtio-input.h | 20 +++---- include/hw/virtio/virtio-iommu.h | 4 +- include/hw/virtio/virtio-mem.h | 8 +-- include/hw/virtio/virtio-mmio.h | 4 +- include/hw/virtio/virtio-net.h | 4 +- include/hw/virtio/virtio-pmem.h | 8 +-- include/hw/virtio/virtio-rng.h | 4 +- include/hw/virtio/virtio-scsi.h | 8 +-- include/hw/virtio/virtio-serial.h | 16 +++--- include/hw/virtio/virtio.h | 8 +-- include/hw/vmstate-if.h | 6 +-- include/hw/watchdog/cmsdk-apb-watchdog.h | 4 +- include/hw/watchdog/wdt_aspeed.h | 8 +-- include/hw/watchdog/wdt_diag288.h | 8 +-- include/hw/watchdog/wdt_imx2.h | 3 +- include/hw/xen/xen-block.h | 16 +++--- include/hw/xen/xen-bus.h | 16 ++---- include/hw/xen/xen-legacy-backend.h | 4 +- include/io/channel-buffer.h | 4 +- include/io/channel-command.h | 4 +- include/io/channel-file.h | 4 +- include/io/channel-socket.h | 4 +- include/io/channel-tls.h | 4 +- include/io/channel-websock.h | 4 +- include/io/channel.h | 8 +-- include/io/dns-resolver.h | 8 +-- include/io/net-listener.h | 8 +-- include/net/can_emu.h | 4 +- include/net/can_host.h | 8 +-- include/net/filter.h | 8 +-- include/qom/object_interfaces.h | 8 +-- include/scsi/pr-manager.h | 8 +-- include/sysemu/accel.h | 8 +-- include/sysemu/cryptodev.h | 11 +--- include/sysemu/hostmem.h | 8 +-- include/sysemu/hvf.h | 4 +- include/sysemu/iothread.h | 4 +- include/sysemu/kvm.h | 4 +- include/sysemu/rng-random.h | 3 +- include/sysemu/rng.h | 8 +-- include/sysemu/tpm.h | 6 +-- include/sysemu/tpm_backend.h | 8 +-- include/sysemu/vhost-user-backend.h | 8 +-- include/ui/console.h | 8 +-- migration/migration.h | 8 +-- target/alpha/cpu-qom.h | 8 +-- target/arm/cpu-qom.h | 14 ++--- target/arm/idau.h | 6 +-- target/avr/cpu-qom.h | 8 +-- target/cris/cpu-qom.h | 8 +-- target/hppa/cpu-qom.h | 8 +-- target/i386/cpu-qom.h | 8 +-- target/lm32/cpu-qom.h | 8 +-- target/m68k/cpu-qom.h | 8 +-- target/microblaze/cpu-qom.h | 8 +-- target/mips/cpu-qom.h | 8 +-- target/moxie/cpu.h | 8 +-- target/nios2/cpu.h | 8 +-- target/openrisc/cpu.h | 8 +-- target/ppc/cpu-qom.h | 8 +-- target/ppc/cpu.h | 10 +--- target/riscv/cpu.h | 8 +-- target/rx/cpu-qom.h | 8 +-- target/s390x/cpu-qom.h | 8 +-- target/sh4/cpu-qom.h | 8 +-- target/sparc/cpu-qom.h | 8 +-- target/tilegx/cpu.h | 8 +-- target/tricore/cpu-qom.h | 8 +-- target/unicore32/cpu-qom.h | 8 +-- target/xtensa/cpu-qom.h | 8 +-- accel/tcg/tcg-all.c | 4 +- backends/cryptodev-builtin.c | 5 +- backends/cryptodev-vhost-user.c | 5 +- backends/dbus-vmstate.c | 8 +-- backends/hostmem-file.c | 4 +- backends/hostmem-memfd.c | 4 +- backends/rng-builtin.c | 3 +- backends/rng-egd.c | 3 +- backends/tpm/tpm_emulator.c | 4 +- backends/tpm/tpm_passthrough.c | 4 +- chardev/baum.c | 3 +- chardev/char-parallel.c | 6 +-- chardev/char-pty.c | 3 +- chardev/char-ringbuf.c | 4 +- chardev/char-socket.c | 4 +- chardev/char-udp.c | 3 +- chardev/char-win-stdio.c | 4 +- chardev/msmouse.c | 4 +- chardev/testdev.c | 4 +- chardev/wctablet.c | 4 +- hw/acpi/piix4.c | 4 +- hw/alpha/typhoon.c | 4 +- hw/arm/collie.c | 4 +- hw/arm/highbank.c | 4 +- hw/arm/integratorcp.c | 12 ++--- hw/arm/microbit.c | 4 +- hw/arm/mps2-tz.c | 8 +-- hw/arm/mps2.c | 8 +-- hw/arm/musca.c | 8 +-- hw/arm/musicpal.c | 32 +++++------ hw/arm/palm.c | 4 +- hw/arm/pxa2xx.c | 12 ++--- hw/arm/pxa2xx_gpio.c | 4 +- hw/arm/pxa2xx_pic.c | 4 +- hw/arm/raspi.c | 8 +-- hw/arm/sbsa-ref.c | 4 +- hw/arm/spitz.c | 25 +++++---- hw/arm/stellaris.c | 12 ++--- hw/arm/strongarm.c | 24 ++++----- hw/arm/tosa.c | 7 +-- hw/arm/versatilepb.c | 4 +- hw/arm/vexpress.c | 8 +-- hw/arm/xilinx_zynq.c | 4 +- hw/arm/xlnx-versal-virt.c | 4 +- hw/arm/xlnx-zcu102.c | 4 +- hw/arm/z2.c | 6 ++- hw/audio/ac97.c | 4 +- hw/audio/adlib.c | 3 +- hw/audio/cs4231.c | 4 +- hw/audio/cs4231a.c | 3 +- hw/audio/es1370.c | 4 +- hw/audio/gus.c | 3 +- hw/audio/hda-codec.c | 3 +- hw/audio/intel-hda.c | 4 +- hw/audio/marvell_88w8618.c | 4 +- hw/audio/milkymist-ac97.c | 4 +- hw/audio/pcspk.c | 3 +- hw/audio/pl041.c | 3 +- hw/audio/sb16.c | 3 +- hw/audio/wm8750.c | 3 +- hw/avr/arduino.c | 8 +-- hw/avr/atmega.c | 6 +-- hw/block/fdc.c | 13 +++-- hw/block/m25p80.c | 8 +-- hw/block/nand.c | 4 +- hw/block/onenand.c | 3 +- hw/char/debugcon.c | 4 +- hw/char/etraxfs_ser.c | 4 +- hw/char/exynos4210_uart.c | 4 +- hw/char/grlib_apbuart.c | 4 +- hw/char/ipoctal232.c | 4 +- hw/char/lm32_juart.c | 3 +- hw/char/lm32_uart.c | 3 +- hw/char/mcf_uart.c | 3 +- hw/char/milkymist-uart.c | 4 +- hw/char/parallel.c | 4 +- hw/char/sclpconsole-lm.c | 4 +- hw/char/sclpconsole.c | 4 +- hw/char/serial-isa.c | 3 +- hw/char/serial-pci.c | 3 +- hw/char/spapr_vty.c | 4 +- hw/char/terminal3270.c | 4 +- hw/char/virtio-console.c | 4 +- hw/char/xilinx_uartlite.c | 4 +- hw/core/irq.c | 3 +- hw/cpu/realview_mpcore.c | 4 +- hw/display/ads7846.c | 3 +- hw/display/artist.c | 3 +- hw/display/bochs-display.c | 4 +- hw/display/cg3.c | 3 +- hw/display/cirrus_vga.c | 4 +- hw/display/cirrus_vga_isa.c | 4 +- hw/display/exynos4210_fimd.c | 4 +- hw/display/g364fb.c | 3 +- hw/display/jazz_led.c | 3 +- hw/display/milkymist-tmu2.c | 4 +- hw/display/milkymist-vgafb.c | 4 +- hw/display/next-fb.c | 3 +- hw/display/pl110.c | 3 +- hw/display/ramfb-standalone.c | 3 +- hw/display/sii9022.c | 3 +- hw/display/sm501.c | 7 +-- hw/display/ssd0303.c | 3 +- hw/display/ssd0323.c | 3 +- hw/display/tcx.c | 3 +- hw/display/vga-isa.c | 3 +- hw/display/vga-pci.c | 3 +- hw/display/vhost-user-gpu-pci.c | 4 +- hw/display/vhost-user-vga.c | 4 +- hw/display/virtio-gpu-pci.c | 4 +- hw/display/virtio-vga.c | 4 +- hw/display/vmware_vga.c | 4 +- hw/dma/i82374.c | 3 +- hw/dma/pl330.c | 3 +- hw/dma/puv3_dma.c | 3 +- hw/dma/pxa2xx_dma.c | 3 +- hw/dma/rc4030.c | 4 +- hw/dma/xilinx_axidma.c | 14 +++-- hw/gpio/gpio_key.c | 3 +- hw/gpio/max7310.c | 3 +- hw/gpio/mpc8xxx.c | 3 +- hw/gpio/pl061.c | 3 +- hw/gpio/puv3_gpio.c | 3 +- hw/gpio/zaurus.c | 3 +- hw/hppa/dino.c | 4 +- hw/hppa/lasi.c | 4 +- hw/hyperv/hyperv.c | 3 +- hw/hyperv/hyperv_testdev.c | 4 +- hw/i2c/bitbang_i2c.c | 3 +- hw/i2c/exynos4210_i2c.c | 4 +- hw/i2c/mpc_i2c.c | 4 +- hw/i2c/smbus_eeprom.c | 4 +- hw/i2c/smbus_ich9.c | 4 +- hw/i2c/versatile_i2c.c | 4 +- hw/i386/kvm/clock.c | 3 +- hw/i386/kvm/i8254.c | 7 +-- hw/i386/kvm/i8259.c | 6 +-- hw/i386/kvmvapic.c | 3 +- hw/i386/port92.c | 3 +- hw/i386/vmmouse.c | 3 +- hw/i386/vmport.c | 3 +- hw/i386/xen/xen_platform.c | 4 +- hw/i386/xen/xen_pvdevice.c | 4 +- hw/ide/isa.c | 3 +- hw/ide/microdrive.c | 3 +- hw/ide/mmio.c | 3 +- hw/ide/sii3112.c | 2 +- hw/input/adb-kbd.c | 7 +-- hw/input/adb-mouse.c | 7 +-- hw/input/lm832x.c | 3 +- hw/input/milkymist-softusb.c | 4 +- hw/input/pl050.c | 3 +- hw/intc/arm_gicv2m.c | 3 +- hw/intc/etraxfs_pic.c | 4 +- hw/intc/exynos4210_combiner.c | 4 +- hw/intc/exynos4210_gic.c | 8 +-- hw/intc/grlib_irqmp.c | 3 +- hw/intc/i8259.c | 4 +- hw/intc/lm32_pic.c | 3 +- hw/intc/loongson_liointc.c | 4 +- hw/intc/nios2_iic.c | 4 +- hw/intc/ompic.c | 3 +- hw/intc/openpic_kvm.c | 4 +- hw/intc/pl190.c | 3 +- hw/intc/puv3_intc.c | 3 +- hw/intc/s390_flic_kvm.c | 6 +-- hw/intc/slavio_intctl.c | 4 +- hw/intc/xilinx_intc.c | 3 +- hw/ipack/tpci200.c | 4 +- hw/ipmi/ipmi_bmc_extern.c | 4 +- hw/ipmi/isa_ipmi_bt.c | 4 +- hw/ipmi/isa_ipmi_kcs.c | 4 +- hw/ipmi/pci_ipmi_bt.c | 4 +- hw/ipmi/pci_ipmi_kcs.c | 4 +- hw/ipmi/smbus_ipmi.c | 3 +- hw/isa/i82378.c | 4 +- hw/isa/piix4.c | 4 +- hw/isa/vt82c686.c | 16 +++--- hw/m68k/mcf_intc.c | 3 +- hw/m68k/next-cube.c | 3 +- hw/m68k/next-kbd.c | 3 +- hw/microblaze/xlnx-zynqmp-pmu.c | 4 +- hw/mips/boston.c | 3 +- hw/mips/gt64xxx_pci.c | 4 +- hw/mips/malta.c | 3 +- hw/misc/applesmc.c | 3 +- hw/misc/arm_integrator_debug.c | 4 +- hw/misc/arm_l2x0.c | 3 +- hw/misc/arm_sysctl.c | 4 +- hw/misc/debugexit.c | 4 +- hw/misc/eccmemctl.c | 3 +- hw/misc/edu.c | 3 +- hw/misc/empty_slot.c | 3 +- hw/misc/exynos4210_clk.c | 4 +- hw/misc/exynos4210_pmu.c | 4 +- hw/misc/exynos4210_rng.c | 4 +- hw/misc/ivshmem.c | 16 +++--- hw/misc/milkymist-hpdmc.c | 4 +- hw/misc/milkymist-pfpu.c | 4 +- hw/misc/mst_fpga.c | 4 +- hw/misc/pc-testdev.c | 4 +- hw/misc/pca9552.c | 6 +-- hw/misc/pci-testdev.c | 4 +- hw/misc/puv3_pm.c | 3 +- hw/misc/pvpanic.c | 4 +- hw/misc/sga.c | 3 +- hw/misc/slavio_misc.c | 6 ++- hw/misc/tmp421.c | 7 +-- hw/misc/zynq_slcr.c | 3 +- hw/net/can/can_kvaser_pci.c | 4 +- hw/net/can/can_mioe3680_pci.c | 4 +- hw/net/can/can_pcm3680_pci.c | 4 +- hw/net/dp8393x.c | 3 +- hw/net/e1000.c | 8 +-- hw/net/e1000e.c | 3 +- hw/net/etraxfs_eth.c | 4 +- hw/net/lan9118.c | 3 +- hw/net/milkymist-minimac2.c | 4 +- hw/net/mipsnet.c | 3 +- hw/net/ne2000-isa.c | 3 +- hw/net/opencores_eth.c | 3 +- hw/net/pcnet-pci.c | 4 +- hw/net/rtl8139.c | 4 +- hw/net/smc91c111.c | 3 +- hw/net/spapr_llan.c | 4 +- hw/net/stellaris_enet.c | 4 +- hw/net/sungem.c | 3 +- hw/net/sunhme.c | 3 +- hw/net/vmxnet3.c | 6 +-- hw/net/xgmac.c | 3 +- hw/net/xilinx_axienet.c | 14 +++-- hw/net/xilinx_ethlite.c | 4 +- hw/nvram/ds1225y.c | 3 +- hw/nvram/eeprom_at24c.c | 3 +- hw/nvram/spapr_nvram.c | 4 +- hw/pci-bridge/dec.c | 3 +- hw/pci-bridge/gen_pcie_root_port.c | 4 +- hw/pci-bridge/pci_bridge_dev.c | 4 +- hw/pci-bridge/pci_expander_bridge.c | 12 +++-- hw/pci-bridge/pcie_pci_bridge.c | 4 +- hw/pci-host/bonito.c | 8 +-- hw/pci-host/grackle.c | 4 +- hw/pci-host/i440fx.c | 4 +- hw/pci-host/pnv_phb3.c | 4 +- hw/pci-host/pnv_phb4.c | 4 +- hw/pci-host/ppce500.c | 8 +-- hw/pci-host/prep.c | 8 +-- hw/pci-host/versatile.c | 8 +-- hw/ppc/mpc8544_guts.c | 3 +- hw/ppc/ppc440_pcix.c | 4 +- hw/ppc/ppc440_uc.c | 4 +- hw/ppc/ppc4xx_pci.c | 4 +- hw/ppc/ppce500_spin.c | 3 +- hw/ppc/prep_systemio.c | 4 +- hw/ppc/rs6000_mc.c | 4 +- hw/ppc/spapr_rng.c | 4 +- hw/rtc/ds1338.c | 3 +- hw/rtc/exynos4210_rtc.c | 4 +- hw/rtc/m41t80.c | 3 +- hw/rtc/m48t59-isa.c | 8 +-- hw/rtc/m48t59.c | 8 +-- hw/rtc/sun4v-rtc.c | 3 +- hw/rtc/twl92230.c | 3 +- hw/rx/rx-gdbsim.c | 8 +-- hw/rx/rx62n.c | 6 +-- hw/scsi/esp-pci.c | 8 +-- hw/scsi/lsi53c895a.c | 4 +- hw/scsi/megasas.c | 8 +-- hw/scsi/scsi-disk.c | 8 +-- hw/scsi/spapr_vscsi.c | 4 +- hw/scsi/vmw_pvscsi.c | 7 +-- hw/sd/milkymist-memcard.c | 4 +- hw/sd/pl181.c | 3 +- hw/sd/ssi-sd.c | 3 +- hw/sh4/sh_pci.c | 4 +- hw/sparc/sun4m.c | 13 +++-- hw/sparc64/sun4u.c | 12 +++-- hw/ssi/ssi.c | 3 +- hw/ssi/xilinx_spi.c | 3 +- hw/timer/altera_timer.c | 4 +- hw/timer/arm_timer.c | 7 +-- hw/timer/cadence_ttc.c | 4 +- hw/timer/etraxfs_timer.c | 4 +- hw/timer/exynos4210_mct.c | 4 +- hw/timer/exynos4210_pwm.c | 4 +- hw/timer/grlib_gptimer.c | 4 +- hw/timer/hpet.c | 3 +- hw/timer/i8254.c | 4 +- hw/timer/lm32_timer.c | 3 +- hw/timer/milkymist-sysctl.c | 4 +- hw/timer/puv3_ost.c | 3 +- hw/timer/pxa2xx_timer.c | 4 +- hw/timer/slavio_timer.c | 4 +- hw/timer/xilinx_timer.c | 4 +- hw/tpm/tpm_crb.c | 3 +- hw/tpm/tpm_spapr.c | 4 +- hw/tpm/tpm_tis_isa.c | 3 +- hw/tpm/tpm_tis_sysbus.c | 3 +- hw/usb/ccid-card-emulated.c | 4 +- hw/usb/ccid-card-passthru.c | 4 +- hw/usb/dev-audio.c | 3 +- hw/usb/dev-hid.c | 3 +- hw/usb/dev-hub.c | 3 +- hw/usb/dev-mtp.c | 3 +- hw/usb/dev-network.c | 3 +- hw/usb/dev-serial.c | 3 +- hw/usb/dev-smartcard-reader.c | 6 ++- hw/usb/dev-storage.c | 3 +- hw/usb/dev-uas.c | 3 +- hw/usb/dev-wacom.c | 3 +- hw/usb/hcd-ohci-pci.c | 3 +- hw/usb/hcd-uhci.c | 3 +- hw/usb/host-libusb.c | 4 +- hw/usb/redirect.c | 3 +- hw/usb/tusb6010.c | 3 +- hw/vfio/ap.c | 4 +- hw/virtio/vhost-scsi-pci.c | 4 +- hw/virtio/vhost-user-blk-pci.c | 4 +- hw/virtio/vhost-user-fs-pci.c | 4 +- hw/virtio/vhost-user-input-pci.c | 4 +- hw/virtio/vhost-user-scsi-pci.c | 4 +- hw/virtio/vhost-user-vsock-pci.c | 4 +- hw/virtio/vhost-vsock-pci.c | 4 +- hw/virtio/virtio-9p-pci.c | 4 +- hw/virtio/virtio-balloon-pci.c | 4 +- hw/virtio/virtio-blk-pci.c | 4 +- hw/virtio/virtio-crypto-pci.c | 4 +- hw/virtio/virtio-input-host-pci.c | 4 +- hw/virtio/virtio-input-pci.c | 8 +-- hw/virtio/virtio-iommu-pci.c | 4 +- hw/virtio/virtio-net-pci.c | 4 +- hw/virtio/virtio-rng-pci.c | 4 +- hw/virtio/virtio-scsi-pci.c | 4 +- hw/virtio/virtio-serial-pci.c | 4 +- hw/watchdog/wdt_i6300esb.c | 4 +- hw/watchdog/wdt_ib700.c | 3 +- iothread.c | 6 +-- migration/rdma.c | 4 +- net/can/can_socketcan.c | 4 +- net/colo-compare.c | 4 +- net/dump.c | 4 +- net/filter-buffer.c | 4 +- net/filter-mirror.c | 8 +-- net/filter-replay.c | 4 +- net/filter-rewriter.c | 4 +- scsi/pr-manager-helper.c | 5 +- target/i386/sev.c | 4 +- tests/check-qom-interface.c | 6 +-- tests/check-qom-proplist.c | 16 +++--- tests/test-qdev-global-props.c | 8 +-- ui/console.c | 3 +- ui/gtk.c | 3 +- ui/input-barrier.c | 8 +-- ui/input-linux.c | 8 +-- ui/spice-app.c | 3 +- 805 files changed, 2035 insertions(+), 2514 deletions(-) diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h index 2926a326e0..aba0240759 100644 --- a/chardev/chardev-internal.h +++ b/chardev/chardev-internal.h @@ -54,7 +54,8 @@ struct MuxChardev { }; typedef struct MuxChardev MuxChardev; =20 -#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX) +DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV, + TYPE_CHARDEV_MUX) #define CHARDEV_IS_MUX(chr) \ object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX) =20 diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index 6dd945ecda..ff70c5a971 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -16,7 +16,7 @@ struct V9fsVirtioState { typedef struct V9fsVirtioState V9fsVirtioState; =20 #define TYPE_VIRTIO_9P "virtio-9p-device" -#define VIRTIO_9P(obj) \ - OBJECT_CHECK(V9fsVirtioState, (obj), TYPE_VIRTIO_9P) +DECLARE_INSTANCE_CHECKER(V9fsVirtioState, VIRTIO_9P, + TYPE_VIRTIO_9P) =20 #endif diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index 44a2897fff..813a7a357d 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -10,16 +10,13 @@ #define TYPE_HDA_CODEC_DEVICE "hda-codec" typedef struct HDACodecDevice HDACodecDevice; typedef struct HDACodecDeviceClass HDACodecDeviceClass; -#define HDA_CODEC_DEVICE(obj) \ - OBJECT_CHECK(HDACodecDevice, (obj), TYPE_HDA_CODEC_DEVICE) -#define HDA_CODEC_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(HDACodecDeviceClass, (klass), TYPE_HDA_CODEC_DEVIC= E) -#define HDA_CODEC_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(HDACodecDeviceClass, (obj), TYPE_HDA_CODEC_DEVICE) +DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass, + HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE) =20 #define TYPE_HDA_BUS "HDA" typedef struct HDACodecBus HDACodecBus; -#define HDA_BUS(obj) OBJECT_CHECK(HDACodecBus, (obj), TYPE_HDA_BUS) +DECLARE_INSTANCE_CHECKER(HDACodecBus, HDA_BUS, + TYPE_HDA_BUS) =20 =20 typedef void (*hda_codec_response_func)(HDACodecDevice *dev, diff --git a/hw/avr/atmega.h b/hw/avr/atmega.h index 2c46ecb904..a99ee15c7e 100644 --- a/hw/avr/atmega.h +++ b/hw/avr/atmega.h @@ -24,7 +24,8 @@ #define TYPE_ATMEGA2560_MCU "ATmega2560" =20 typedef struct AtmegaMcuState AtmegaMcuState; -#define ATMEGA_MCU(obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MC= U) +DECLARE_INSTANCE_CHECKER(AtmegaMcuState, ATMEGA_MCU, + TYPE_ATMEGA_MCU) =20 #define POWER_MAX 2 #define USART_MAX 4 diff --git a/hw/display/ati_int.h b/hw/display/ati_int.h index 2a8a3306da..714005447d 100644 --- a/hw/display/ati_int.h +++ b/hw/display/ati_int.h @@ -31,7 +31,8 @@ =20 #define TYPE_ATI_VGA "ati-vga" typedef struct ATIVGAState ATIVGAState; -#define ATI_VGA(obj) OBJECT_CHECK(ATIVGAState, (obj), TYPE_ATI_VGA) +DECLARE_INSTANCE_CHECKER(ATIVGAState, ATI_VGA, + TYPE_ATI_VGA) =20 typedef struct ATIVGARegs { uint32_t mm_index; diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 4ecb6b2934..714cd01b63 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -131,7 +131,8 @@ struct PCIQXLDevice { typedef struct PCIQXLDevice PCIQXLDevice; =20 #define TYPE_PCI_QXL "pci-qxl" -#define PCI_QXL(obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL) +DECLARE_INSTANCE_CHECKER(PCIQXLDevice, PCI_QXL, + TYPE_PCI_QXL) =20 #define PANIC_ON(x) if ((x)) { \ printf("%s: PANIC %s failed\n", __func__, #x); \ diff --git a/hw/display/virtio-vga.h b/hw/display/virtio-vga.h index 2d3b765bf9..19f8af7356 100644 --- a/hw/display/virtio-vga.h +++ b/hw/display/virtio-vga.h @@ -11,12 +11,8 @@ #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base" typedef struct VirtIOVGABase VirtIOVGABase; typedef struct VirtIOVGABaseClass VirtIOVGABaseClass; -#define VIRTIO_VGA_BASE(obj) \ - OBJECT_CHECK(VirtIOVGABase, (obj), TYPE_VIRTIO_VGA_BASE) -#define VIRTIO_VGA_BASE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtIOVGABaseClass, obj, TYPE_VIRTIO_VGA_BASE) -#define VIRTIO_VGA_BASE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtIOVGABaseClass, klass, TYPE_VIRTIO_VGA_BASE) +DECLARE_OBJ_CHECKERS(VirtIOVGABase, VirtIOVGABaseClass, + VIRTIO_VGA_BASE, TYPE_VIRTIO_VGA_BASE) =20 struct VirtIOVGABase { VirtIOPCIProxy parent_obj; diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 85860c36dd..fa5feb183c 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -298,8 +298,8 @@ struct irte_ga { =20 #define TYPE_AMD_IOMMU_DEVICE "amd-iommu" typedef struct AMDVIState AMDVIState; -#define AMD_IOMMU_DEVICE(obj)\ - OBJECT_CHECK(AMDVIState, (obj), TYPE_AMD_IOMMU_DEVICE) +DECLARE_INSTANCE_CHECKER(AMDVIState, AMD_IOMMU_DEVICE, + TYPE_AMD_IOMMU_DEVICE) =20 #define TYPE_AMD_IOMMU_PCI "AMDVI-PCI" =20 diff --git a/hw/misc/tmp105.h b/hw/misc/tmp105.h index 634bb4a0d6..7ee8a496ff 100644 --- a/hw/misc/tmp105.h +++ b/hw/misc/tmp105.h @@ -20,7 +20,8 @@ =20 #define TYPE_TMP105 "tmp105" typedef struct TMP105State TMP105State; -#define TMP105(obj) OBJECT_CHECK(TMP105State, (obj), TYPE_TMP105) +DECLARE_INSTANCE_CHECKER(TMP105State, TMP105, + TYPE_TMP105) =20 /** * TMP105State: diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h index 132a87b1ba..0c929d9afd 100644 --- a/hw/net/fsl_etsec/etsec.h +++ b/hw/net/fsl_etsec/etsec.h @@ -150,8 +150,8 @@ struct eTSEC { typedef struct eTSEC eTSEC; =20 #define TYPE_ETSEC_COMMON "eTSEC" -#define ETSEC_COMMON(obj) \ - OBJECT_CHECK(eTSEC, (obj), TYPE_ETSEC_COMMON) +DECLARE_INSTANCE_CHECKER(eTSEC, ETSEC_COMMON, + TYPE_ETSEC_COMMON) =20 #define eTSEC_TRANSMIT 1 #define eTSEC_RECEIVE 2 diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h index 0dd49d5f41..941c932265 100644 --- a/hw/net/rocker/rocker.h +++ b/hw/net/rocker/rocker.h @@ -73,8 +73,8 @@ typedef struct desc_ring DescRing; =20 #define TYPE_ROCKER "rocker" typedef struct rocker Rocker; -#define ROCKER(obj) \ - OBJECT_CHECK(Rocker, (obj), TYPE_ROCKER) +DECLARE_INSTANCE_CHECKER(Rocker, ROCKER, + TYPE_ROCKER) =20 Rocker *rocker_find(const char *name); uint32_t rocker_fp_ports(Rocker *r); diff --git a/hw/net/tulip.h b/hw/net/tulip.h index 5fe4aee87d..87e3ab79bc 100644 --- a/hw/net/tulip.h +++ b/hw/net/tulip.h @@ -7,7 +7,8 @@ =20 #define TYPE_TULIP "tulip" typedef struct TULIPState TULIPState; -#define TULIP(obj) OBJECT_CHECK(TULIPState, (obj), TYPE_TULIP) +DECLARE_INSTANCE_CHECKER(TULIPState, TULIP, + TYPE_TULIP) =20 #define CSR(_x) ((_x) << 3) =20 diff --git a/hw/net/vmxnet3_defs.h b/hw/net/vmxnet3_defs.h index 1df1e4c3a6..71440509ca 100644 --- a/hw/net/vmxnet3_defs.h +++ b/hw/net/vmxnet3_defs.h @@ -23,7 +23,8 @@ =20 #define TYPE_VMXNET3 "vmxnet3" typedef struct VMXNET3State VMXNET3State; -#define VMXNET3(obj) OBJECT_CHECK(VMXNET3State, (obj), TYPE_VMXNET3) +DECLARE_INSTANCE_CHECKER(VMXNET3State, VMXNET3, + TYPE_VMXNET3) =20 /* Device state and helper functions */ #define VMXNET3_RX_RINGS_PER_QUEUE (2) diff --git a/hw/ppc/e500-ccsr.h b/hw/ppc/e500-ccsr.h index f7fd73fc0d..de4b9d2bc3 100644 --- a/hw/ppc/e500-ccsr.h +++ b/hw/ppc/e500-ccsr.h @@ -14,6 +14,7 @@ struct PPCE500CCSRState { typedef struct PPCE500CCSRState PPCE500CCSRState; =20 #define TYPE_CCSR "e500-ccsr" -#define CCSR(obj) OBJECT_CHECK(PPCE500CCSRState, (obj), TYPE_CCSR) +DECLARE_INSTANCE_CHECKER(PPCE500CCSRState, CCSR, + TYPE_CCSR) =20 #endif /* E500_CCSR_H */ diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 5773460d5e..63870751ff 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -46,11 +46,7 @@ void ppce500_init(MachineState *machine); hwaddr booke206_page_size_to_tlb(uint64_t size); =20 #define TYPE_PPCE500_MACHINE "ppce500-base-machine" -#define PPCE500_MACHINE(obj) \ - OBJECT_CHECK(PPCE500MachineState, (obj), TYPE_PPCE500_MACHINE) -#define PPCE500_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PPCE500MachineClass, obj, TYPE_PPCE500_MACHINE) -#define PPCE500_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PPCE500MachineClass, klass, TYPE_PPCE500_MACHINE) +DECLARE_OBJ_CHECKERS(PPCE500MachineState, PPCE500MachineClass, + PPCE500_MACHINE, TYPE_PPCE500_MACHINE) =20 #endif diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index f4ef3f32b0..2b6425f600 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -73,8 +73,8 @@ /* Core99 machine */ #define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99") typedef struct Core99MachineState Core99MachineState; -#define CORE99_MACHINE(obj) OBJECT_CHECK(Core99MachineState, (obj), \ - TYPE_CORE99_MACHINE) +DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE, + TYPE_CORE99_MACHINE) =20 #define CORE99_VIA_CONFIG_CUDA 0x0 #define CORE99_VIA_CONFIG_PMU 0x1 @@ -93,8 +93,8 @@ struct Core99MachineState { /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" typedef struct MacIONVRAMState MacIONVRAMState; -#define MACIO_NVRAM(obj) \ - OBJECT_CHECK(MacIONVRAMState, (obj), TYPE_MACIO_NVRAM) +DECLARE_INSTANCE_CHECKER(MacIONVRAMState, MACIO_NVRAM, + TYPE_MACIO_NVRAM) =20 struct MacIONVRAMState { /*< private >*/ diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h index db9d9e2c73..1d36a76f1e 100644 --- a/hw/rdma/vmw/pvrdma.h +++ b/hw/rdma/vmw/pvrdma.h @@ -101,7 +101,8 @@ struct PVRDMADev { PVRDMADevStats stats; }; typedef struct PVRDMADev PVRDMADev; -#define PVRDMA_DEV(dev) OBJECT_CHECK(PVRDMADev, (dev), PVRDMA_HW_NAME) +DECLARE_INSTANCE_CHECKER(PVRDMADev, PVRDMA_DEV, + PVRDMA_HW_NAME) =20 static inline int get_reg_val(PVRDMADev *dev, hwaddr addr, uint32_t *val) { diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 867547b4eb..cf7d492084 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -47,10 +47,7 @@ static inline CcwDevice *to_ccw_dev_fast(DeviceState *d) =20 #define TYPE_CCW_DEVICE "ccw-device" =20 -#define CCW_DEVICE(obj) OBJECT_CHECK(CcwDevice, (obj), TYPE_CCW_DEVICE) -#define CCW_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(CCWDeviceClass, (obj), TYPE_CCW_DEVICE) -#define CCW_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(CCWDeviceClass, (klass), TYPE_CCW_DEVICE) +DECLARE_OBJ_CHECKERS(CcwDevice, CCWDeviceClass, + CCW_DEVICE, TYPE_CCW_DEVICE) =20 #endif diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 282b22cc4f..9e6061a043 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -154,7 +154,8 @@ typedef struct QemuIplParameters QemuIplParameters; =20 #define TYPE_S390_IPL "s390-ipl" typedef struct S390IPLState S390IPLState; -#define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL) +DECLARE_INSTANCE_CHECKER(S390IPLState, S390_IPL, + TYPE_S390_IPL) =20 struct S390IPLState { /*< private >*/ diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index 06f046e73a..045805980f 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -38,17 +38,17 @@ #define UID_CHECKING_ENABLED 0x01 =20 typedef struct S390pciState S390pciState; -#define S390_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(S390pciState, (obj), TYPE_S390_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(S390pciState, S390_PCI_HOST_BRIDGE, + TYPE_S390_PCI_HOST_BRIDGE) typedef struct S390PCIBus S390PCIBus; -#define S390_PCI_BUS(obj) \ - OBJECT_CHECK(S390PCIBus, (obj), TYPE_S390_PCI_BUS) +DECLARE_INSTANCE_CHECKER(S390PCIBus, S390_PCI_BUS, + TYPE_S390_PCI_BUS) typedef struct S390PCIBusDevice S390PCIBusDevice; -#define S390_PCI_DEVICE(obj) \ - OBJECT_CHECK(S390PCIBusDevice, (obj), TYPE_S390_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(S390PCIBusDevice, S390_PCI_DEVICE, + TYPE_S390_PCI_DEVICE) typedef struct S390PCIIOMMU S390PCIIOMMU; -#define S390_PCI_IOMMU(obj) \ - OBJECT_CHECK(S390PCIIOMMU, (obj), TYPE_S390_PCI_IOMMU) +DECLARE_INSTANCE_CHECKER(S390PCIIOMMU, S390_PCI_IOMMU, + TYPE_S390_PCI_IOMMU) =20 #define HP_EVENT_TO_CONFIGURED 0x0301 #define HP_EVENT_RESERVED_TO_STANDBY 0x0302 diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index c046c816c9..cea259685d 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -56,23 +56,15 @@ #define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device" typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass; typedef struct VirtioCcwDevice VirtioCcwDevice; -#define VIRTIO_CCW_DEVICE(obj) \ - OBJECT_CHECK(VirtioCcwDevice, (obj), TYPE_VIRTIO_CCW_DEVICE) -#define VIRTIO_CCW_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtIOCCWDeviceClass, (klass), TYPE_VIRTIO_CCW_DEV= ICE) -#define VIRTIO_CCW_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtIOCCWDeviceClass, (obj), TYPE_VIRTIO_CCW_DEVICE) +DECLARE_OBJ_CHECKERS(VirtioCcwDevice, VirtIOCCWDeviceClass, + VIRTIO_CCW_DEVICE, TYPE_VIRTIO_CCW_DEVICE) =20 typedef struct VirtioBusState VirtioCcwBusState; typedef struct VirtioBusClass VirtioCcwBusClass; =20 #define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus" -#define VIRTIO_CCW_BUS(obj) \ - OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS) -#define VIRTIO_CCW_BUS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtioCcwBusClass, (obj), TYPE_VIRTIO_CCW_BUS) -#define VIRTIO_CCW_BUS_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS) +DECLARE_OBJ_CHECKERS(VirtioCcwBusState, VirtioCcwBusClass, + VIRTIO_CCW_BUS, TYPE_VIRTIO_CCW_BUS) =20 =20 struct VirtIOCCWDeviceClass { @@ -114,8 +106,8 @@ static inline int virtio_ccw_rev_max(VirtioCcwDevice *d= ev) =20 #define TYPE_VIRTIO_SCSI_CCW "virtio-scsi-ccw" typedef struct VirtIOSCSICcw VirtIOSCSICcw; -#define VIRTIO_SCSI_CCW(obj) \ - OBJECT_CHECK(VirtIOSCSICcw, (obj), TYPE_VIRTIO_SCSI_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOSCSICcw, VIRTIO_SCSI_CCW, + TYPE_VIRTIO_SCSI_CCW) =20 struct VirtIOSCSICcw { VirtioCcwDevice parent_obj; @@ -127,8 +119,8 @@ struct VirtIOSCSICcw { =20 #define TYPE_VHOST_SCSI_CCW "vhost-scsi-ccw" typedef struct VHostSCSICcw VHostSCSICcw; -#define VHOST_SCSI_CCW(obj) \ - OBJECT_CHECK(VHostSCSICcw, (obj), TYPE_VHOST_SCSI_CCW) +DECLARE_INSTANCE_CHECKER(VHostSCSICcw, VHOST_SCSI_CCW, + TYPE_VHOST_SCSI_CCW) =20 struct VHostSCSICcw { VirtioCcwDevice parent_obj; @@ -140,8 +132,8 @@ struct VHostSCSICcw { =20 #define TYPE_VIRTIO_BLK_CCW "virtio-blk-ccw" typedef struct VirtIOBlkCcw VirtIOBlkCcw; -#define VIRTIO_BLK_CCW(obj) \ - OBJECT_CHECK(VirtIOBlkCcw, (obj), TYPE_VIRTIO_BLK_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOBlkCcw, VIRTIO_BLK_CCW, + TYPE_VIRTIO_BLK_CCW) =20 struct VirtIOBlkCcw { VirtioCcwDevice parent_obj; @@ -152,8 +144,8 @@ struct VirtIOBlkCcw { =20 #define TYPE_VIRTIO_BALLOON_CCW "virtio-balloon-ccw" typedef struct VirtIOBalloonCcw VirtIOBalloonCcw; -#define VIRTIO_BALLOON_CCW(obj) \ - OBJECT_CHECK(VirtIOBalloonCcw, (obj), TYPE_VIRTIO_BALLOON_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOBalloonCcw, VIRTIO_BALLOON_CCW, + TYPE_VIRTIO_BALLOON_CCW) =20 struct VirtIOBalloonCcw { VirtioCcwDevice parent_obj; @@ -164,8 +156,8 @@ struct VirtIOBalloonCcw { =20 #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw" typedef struct VirtioSerialCcw VirtioSerialCcw; -#define VIRTIO_SERIAL_CCW(obj) \ - OBJECT_CHECK(VirtioSerialCcw, (obj), TYPE_VIRTIO_SERIAL_CCW) +DECLARE_INSTANCE_CHECKER(VirtioSerialCcw, VIRTIO_SERIAL_CCW, + TYPE_VIRTIO_SERIAL_CCW) =20 struct VirtioSerialCcw { VirtioCcwDevice parent_obj; @@ -176,8 +168,8 @@ struct VirtioSerialCcw { =20 #define TYPE_VIRTIO_NET_CCW "virtio-net-ccw" typedef struct VirtIONetCcw VirtIONetCcw; -#define VIRTIO_NET_CCW(obj) \ - OBJECT_CHECK(VirtIONetCcw, (obj), TYPE_VIRTIO_NET_CCW) +DECLARE_INSTANCE_CHECKER(VirtIONetCcw, VIRTIO_NET_CCW, + TYPE_VIRTIO_NET_CCW) =20 struct VirtIONetCcw { VirtioCcwDevice parent_obj; @@ -188,8 +180,8 @@ struct VirtIONetCcw { =20 #define TYPE_VIRTIO_RNG_CCW "virtio-rng-ccw" typedef struct VirtIORNGCcw VirtIORNGCcw; -#define VIRTIO_RNG_CCW(obj) \ - OBJECT_CHECK(VirtIORNGCcw, (obj), TYPE_VIRTIO_RNG_CCW) +DECLARE_INSTANCE_CHECKER(VirtIORNGCcw, VIRTIO_RNG_CCW, + TYPE_VIRTIO_RNG_CCW) =20 struct VirtIORNGCcw { VirtioCcwDevice parent_obj; @@ -200,8 +192,8 @@ struct VirtIORNGCcw { =20 #define TYPE_VIRTIO_CRYPTO_CCW "virtio-crypto-ccw" typedef struct VirtIOCryptoCcw VirtIOCryptoCcw; -#define VIRTIO_CRYPTO_CCW(obj) \ - OBJECT_CHECK(VirtIOCryptoCcw, (obj), TYPE_VIRTIO_CRYPTO_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOCryptoCcw, VIRTIO_CRYPTO_CCW, + TYPE_VIRTIO_CRYPTO_CCW) =20 struct VirtIOCryptoCcw { VirtioCcwDevice parent_obj; @@ -215,8 +207,8 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch); =20 #define TYPE_VIRTIO_9P_CCW "virtio-9p-ccw" typedef struct V9fsCCWState V9fsCCWState; -#define VIRTIO_9P_CCW(obj) \ - OBJECT_CHECK(V9fsCCWState, (obj), TYPE_VIRTIO_9P_CCW) +DECLARE_INSTANCE_CHECKER(V9fsCCWState, VIRTIO_9P_CCW, + TYPE_VIRTIO_9P_CCW) =20 struct V9fsCCWState { VirtioCcwDevice parent_obj; @@ -228,8 +220,8 @@ struct V9fsCCWState { #ifdef CONFIG_VHOST_VSOCK #define TYPE_VHOST_VSOCK_CCW "vhost-vsock-ccw" typedef struct VHostVSockCCWState VHostVSockCCWState; -#define VHOST_VSOCK_CCW(obj) \ - OBJECT_CHECK(VHostVSockCCWState, (obj), TYPE_VHOST_VSOCK_CCW) +DECLARE_INSTANCE_CHECKER(VHostVSockCCWState, VHOST_VSOCK_CCW, + TYPE_VHOST_VSOCK_CCW) =20 struct VHostVSockCCWState { VirtioCcwDevice parent_obj; @@ -240,8 +232,8 @@ struct VHostVSockCCWState { =20 #define TYPE_VIRTIO_GPU_CCW "virtio-gpu-ccw" typedef struct VirtIOGPUCcw VirtIOGPUCcw; -#define VIRTIO_GPU_CCW(obj) \ - OBJECT_CHECK(VirtIOGPUCcw, (obj), TYPE_VIRTIO_GPU_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOGPUCcw, VIRTIO_GPU_CCW, + TYPE_VIRTIO_GPU_CCW) =20 struct VirtIOGPUCcw { VirtioCcwDevice parent_obj; @@ -250,8 +242,8 @@ struct VirtIOGPUCcw { =20 #define TYPE_VIRTIO_INPUT_CCW "virtio-input-ccw" typedef struct VirtIOInputCcw VirtIOInputCcw; -#define VIRTIO_INPUT_CCW(obj) \ - OBJECT_CHECK(VirtIOInputCcw, (obj), TYPE_VIRTIO_INPUT_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOInputCcw, VIRTIO_INPUT_CCW, + TYPE_VIRTIO_INPUT_CCW) =20 struct VirtIOInputCcw { VirtioCcwDevice parent_obj; @@ -263,8 +255,8 @@ struct VirtIOInputCcw { #define TYPE_VIRTIO_MOUSE_CCW "virtio-mouse-ccw" #define TYPE_VIRTIO_TABLET_CCW "virtio-tablet-ccw" typedef struct VirtIOInputHIDCcw VirtIOInputHIDCcw; -#define VIRTIO_INPUT_HID_CCW(obj) \ - OBJECT_CHECK(VirtIOInputHIDCcw, (obj), TYPE_VIRTIO_INPUT_HID_CCW) +DECLARE_INSTANCE_CHECKER(VirtIOInputHIDCcw, VIRTIO_INPUT_HID_CCW, + TYPE_VIRTIO_INPUT_HID_CCW) =20 struct VirtIOInputHIDCcw { VirtioCcwDevice parent_obj; diff --git a/hw/scsi/mptsas.h b/hw/scsi/mptsas.h index 2e76bda79e..b85ac1a5fc 100644 --- a/hw/scsi/mptsas.h +++ b/hw/scsi/mptsas.h @@ -16,8 +16,8 @@ typedef struct MPTSASRequest MPTSASRequest; =20 #define TYPE_MPTSAS1068 "mptsas1068" typedef struct MPTSASState MPTSASState; -#define MPT_SAS(obj) \ - OBJECT_CHECK(MPTSASState, (obj), TYPE_MPTSAS1068) +DECLARE_INSTANCE_CHECKER(MPTSASState, MPT_SAS, + TYPE_MPTSAS1068) =20 enum { DOORBELL_NONE, diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h index b992d2ccf8..ef2bb3462d 100644 --- a/hw/usb/ccid.h +++ b/hw/usb/ccid.h @@ -18,12 +18,8 @@ typedef struct CCIDCardInfo CCIDCardInfo; =20 #define TYPE_CCID_CARD "ccid-card" typedef struct CCIDCardClass CCIDCardClass; -#define CCID_CARD(obj) \ - OBJECT_CHECK(CCIDCardState, (obj), TYPE_CCID_CARD) -#define CCID_CARD_CLASS(klass) \ - OBJECT_CLASS_CHECK(CCIDCardClass, (klass), TYPE_CCID_CARD) -#define CCID_CARD_GET_CLASS(obj) \ - OBJECT_GET_CLASS(CCIDCardClass, (obj), TYPE_CCID_CARD) +DECLARE_OBJ_CHECKERS(CCIDCardState, CCIDCardClass, + CCID_CARD, TYPE_CCID_CARD) =20 /* * callbacks to be used by the CCID device (hw/usb-ccid.c) to call diff --git a/hw/usb/hcd-dwc2.h b/hw/usb/hcd-dwc2.h index 71b40f0d8a..919e3e43b1 100644 --- a/hw/usb/hcd-dwc2.h +++ b/hw/usb/hcd-dwc2.h @@ -181,11 +181,7 @@ struct DWC2Class { }; =20 #define TYPE_DWC2_USB "dwc2-usb" -#define DWC2_USB(obj) \ - OBJECT_CHECK(DWC2State, (obj), TYPE_DWC2_USB) -#define DWC2_USB_CLASS(klass) \ - OBJECT_CLASS_CHECK(DWC2Class, (klass), TYPE_DWC2_USB) -#define DWC2_USB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(DWC2Class, (obj), TYPE_DWC2_USB) +DECLARE_OBJ_CHECKERS(DWC2State, DWC2Class, + DWC2_USB, TYPE_DWC2_USB) =20 #endif diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index c12c9bae46..1301ce0be7 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -330,7 +330,8 @@ void ehci_reset(void *opaque); =20 #define TYPE_PCI_EHCI "pci-ehci-usb" typedef struct EHCIPCIState EHCIPCIState; -#define PCI_EHCI(obj) OBJECT_CHECK(EHCIPCIState, (obj), TYPE_PCI_EHCI) +DECLARE_INSTANCE_CHECKER(EHCIPCIState, PCI_EHCI, + TYPE_PCI_EHCI) =20 struct EHCIPCIState { /*< private >*/ @@ -351,12 +352,8 @@ struct EHCIPCIState { =20 typedef struct EHCISysBusState EHCISysBusState; typedef struct SysBusEHCIClass SysBusEHCIClass; -#define SYS_BUS_EHCI(obj) \ - OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI) -#define SYS_BUS_EHCI_CLASS(class) \ - OBJECT_CLASS_CHECK(SysBusEHCIClass, (class), TYPE_SYS_BUS_EHCI) -#define SYS_BUS_EHCI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SysBusEHCIClass, (obj), TYPE_SYS_BUS_EHCI) +DECLARE_OBJ_CHECKERS(EHCISysBusState, SysBusEHCIClass, + SYS_BUS_EHCI, TYPE_SYS_BUS_EHCI) =20 struct EHCISysBusState { /*< private >*/ @@ -378,8 +375,8 @@ struct SysBusEHCIClass { }; =20 typedef struct FUSBH200EHCIState FUSBH200EHCIState; -#define FUSBH200_EHCI(obj) \ - OBJECT_CHECK(FUSBH200EHCIState, (obj), TYPE_FUSBH200_EHCI) +DECLARE_INSTANCE_CHECKER(FUSBH200EHCIState, FUSBH200_EHCI, + TYPE_FUSBH200_EHCI) =20 struct FUSBH200EHCIState { /*< private >*/ diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 3e9053fb26..6e28e97839 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -94,7 +94,8 @@ typedef struct OHCIState { =20 #define TYPE_SYSBUS_OHCI "sysbus-ohci" typedef struct OHCISysBusState OHCISysBusState; -#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_= OHCI) +DECLARE_INSTANCE_CHECKER(OHCISysBusState, SYSBUS_OHCI, + TYPE_SYSBUS_OHCI) =20 struct OHCISysBusState { /*< private >*/ diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 867388a061..2110c0399e 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -28,8 +28,8 @@ #define TYPE_QEMU_XHCI "qemu-xhci" =20 typedef struct XHCIState XHCIState; -#define XHCI(obj) \ - OBJECT_CHECK(XHCIState, (obj), TYPE_XHCI) +DECLARE_INSTANCE_CHECKER(XHCIState, XHCI, + TYPE_XHCI) =20 #define MAXPORTS_2 15 #define MAXPORTS_3 15 diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 8c1f94118a..846d60e56c 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -116,7 +116,8 @@ typedef struct VFIOMSIXInfo { =20 #define TYPE_VFIO_PCI "vfio-pci" typedef struct VFIOPCIDevice VFIOPCIDevice; -#define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI) +DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, PCI_VFIO, + TYPE_VFIO_PCI) =20 struct VFIOPCIDevice { PCIDevice pdev; diff --git a/hw/virtio/virtio-mem-pci.h b/hw/virtio/virtio-mem-pci.h index 65b86beac7..e636e1a48d 100644 --- a/hw/virtio/virtio-mem-pci.h +++ b/hw/virtio/virtio-mem-pci.h @@ -23,8 +23,8 @@ typedef struct VirtIOMEMPCI VirtIOMEMPCI; * virtio-mem-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_MEM_PCI "virtio-mem-pci-base" -#define VIRTIO_MEM_PCI(obj) \ - OBJECT_CHECK(VirtIOMEMPCI, (obj), TYPE_VIRTIO_MEM_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOMEMPCI, VIRTIO_MEM_PCI, + TYPE_VIRTIO_MEM_PCI) =20 struct VirtIOMEMPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index d59ac97430..47b6bb4e26 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -27,12 +27,8 @@ typedef struct VirtioBusState VirtioPCIBusState; typedef struct VirtioBusClass VirtioPCIBusClass; =20 #define TYPE_VIRTIO_PCI_BUS "virtio-pci-bus" -#define VIRTIO_PCI_BUS(obj) \ - OBJECT_CHECK(VirtioPCIBusState, (obj), TYPE_VIRTIO_PCI_BUS) -#define VIRTIO_PCI_BUS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtioPCIBusClass, obj, TYPE_VIRTIO_PCI_BUS) -#define VIRTIO_PCI_BUS_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtioPCIBusClass, klass, TYPE_VIRTIO_PCI_BUS) +DECLARE_OBJ_CHECKERS(VirtioPCIBusState, VirtioPCIBusClass, + VIRTIO_PCI_BUS, TYPE_VIRTIO_PCI_BUS) =20 enum { VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT, @@ -96,12 +92,8 @@ typedef struct { */ #define TYPE_VIRTIO_PCI "virtio-pci" typedef struct VirtioPCIClass VirtioPCIClass; -#define VIRTIO_PCI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtioPCIClass, obj, TYPE_VIRTIO_PCI) -#define VIRTIO_PCI_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtioPCIClass, klass, TYPE_VIRTIO_PCI) -#define VIRTIO_PCI(obj) \ - OBJECT_CHECK(VirtIOPCIProxy, (obj), TYPE_VIRTIO_PCI) +DECLARE_OBJ_CHECKERS(VirtIOPCIProxy, VirtioPCIClass, + VIRTIO_PCI, TYPE_VIRTIO_PCI) =20 struct VirtioPCIClass { PCIDeviceClass parent_class; diff --git a/hw/virtio/virtio-pmem-pci.h b/hw/virtio/virtio-pmem-pci.h index 5ac8099637..63cfe727f7 100644 --- a/hw/virtio/virtio-pmem-pci.h +++ b/hw/virtio/virtio-pmem-pci.h @@ -24,8 +24,8 @@ typedef struct VirtIOPMEMPCI VirtIOPMEMPCI; * virtio-pmem-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_PMEM_PCI "virtio-pmem-pci-base" -#define VIRTIO_PMEM_PCI(obj) \ - OBJECT_CHECK(VirtIOPMEMPCI, (obj), TYPE_VIRTIO_PMEM_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOPMEMPCI, VIRTIO_PMEM_PCI, + TYPE_VIRTIO_PMEM_PCI) =20 struct VirtIOPMEMPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index c367c7da27..f46971eac6 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -40,8 +40,8 @@ typedef struct XenPTReg XenPTReg; typedef struct XenPCIPassthroughState XenPCIPassthroughState; =20 #define TYPE_XEN_PT_DEVICE "xen-pci-passthrough" -#define XEN_PT_DEVICE(obj) \ - OBJECT_CHECK(XenPCIPassthroughState, (obj), TYPE_XEN_PT_DEVICE) +DECLARE_INSTANCE_CHECKER(XenPCIPassthroughState, XEN_PT_DEVICE, + TYPE_XEN_PT_DEVICE) =20 uint32_t igd_read_opregion(XenPCIPassthroughState *s); void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val); diff --git a/include/authz/base.h b/include/authz/base.h index c01946b4ce..8d8cf9fa5a 100644 --- a/include/authz/base.h +++ b/include/authz/base.h @@ -29,15 +29,8 @@ =20 typedef struct QAuthZ QAuthZ; typedef struct QAuthZClass QAuthZClass; -#define QAUTHZ_CLASS(klass) \ - OBJECT_CLASS_CHECK(QAuthZClass, (klass), \ - TYPE_QAUTHZ) -#define QAUTHZ_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QAuthZClass, (obj), \ - TYPE_QAUTHZ) -#define QAUTHZ(obj) \ - OBJECT_CHECK(QAuthZ, (obj), \ - TYPE_QAUTHZ) +DECLARE_OBJ_CHECKERS(QAuthZ, QAuthZClass, + QAUTHZ, TYPE_QAUTHZ) =20 =20 /** diff --git a/include/authz/list.h b/include/authz/list.h index 5d5e8e803f..93d16876bc 100644 --- a/include/authz/list.h +++ b/include/authz/list.h @@ -29,15 +29,8 @@ =20 typedef struct QAuthZList QAuthZList; typedef struct QAuthZListClass QAuthZListClass; -#define QAUTHZ_LIST_CLASS(klass) \ - OBJECT_CLASS_CHECK(QAuthZListClass, (klass), \ - TYPE_QAUTHZ_LIST) -#define QAUTHZ_LIST_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QAuthZListClass, (obj), \ - TYPE_QAUTHZ_LIST) -#define QAUTHZ_LIST(obj) \ - OBJECT_CHECK(QAuthZList, (obj), \ - TYPE_QAUTHZ_LIST) +DECLARE_OBJ_CHECKERS(QAuthZList, QAuthZListClass, + QAUTHZ_LIST, TYPE_QAUTHZ_LIST) =20 =20 =20 diff --git a/include/authz/listfile.h b/include/authz/listfile.h index 11169ac882..2e4a629b6d 100644 --- a/include/authz/listfile.h +++ b/include/authz/listfile.h @@ -29,15 +29,8 @@ =20 typedef struct QAuthZListFile QAuthZListFile; typedef struct QAuthZListFileClass QAuthZListFileClass; -#define QAUTHZ_LIST_FILE_CLASS(klass) \ - OBJECT_CLASS_CHECK(QAuthZListFileClass, (klass), \ - TYPE_QAUTHZ_LIST_FILE) -#define QAUTHZ_LIST_FILE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QAuthZListFileClass, (obj), \ - TYPE_QAUTHZ_LIST_FILE) -#define QAUTHZ_LIST_FILE(obj) \ - OBJECT_CHECK(QAuthZListFile, (obj), \ - TYPE_QAUTHZ_LIST_FILE) +DECLARE_OBJ_CHECKERS(QAuthZListFile, QAuthZListFileClass, + QAUTHZ_LIST_FILE, TYPE_QAUTHZ_LIST_FILE) =20 =20 =20 diff --git a/include/authz/pamacct.h b/include/authz/pamacct.h index a14cf33fb4..98454ddc25 100644 --- a/include/authz/pamacct.h +++ b/include/authz/pamacct.h @@ -29,15 +29,8 @@ =20 typedef struct QAuthZPAM QAuthZPAM; typedef struct QAuthZPAMClass QAuthZPAMClass; -#define QAUTHZ_PAM_CLASS(klass) \ - OBJECT_CLASS_CHECK(QAuthZPAMClass, (klass), \ - TYPE_QAUTHZ_PAM) -#define QAUTHZ_PAM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QAuthZPAMClass, (obj), \ - TYPE_QAUTHZ_PAM) -#define QAUTHZ_PAM(obj) \ - OBJECT_CHECK(QAuthZPAM, (obj), \ - TYPE_QAUTHZ_PAM) +DECLARE_OBJ_CHECKERS(QAuthZPAM, QAuthZPAMClass, + QAUTHZ_PAM, TYPE_QAUTHZ_PAM) =20 =20 =20 diff --git a/include/authz/simple.h b/include/authz/simple.h index df8c1bf39c..7a896fb94b 100644 --- a/include/authz/simple.h +++ b/include/authz/simple.h @@ -28,15 +28,8 @@ =20 typedef struct QAuthZSimple QAuthZSimple; typedef struct QAuthZSimpleClass QAuthZSimpleClass; -#define QAUTHZ_SIMPLE_CLASS(klass) \ - OBJECT_CLASS_CHECK(QAuthZSimpleClass, (klass), \ - TYPE_QAUTHZ_SIMPLE) -#define QAUTHZ_SIMPLE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QAuthZSimpleClass, (obj), \ - TYPE_QAUTHZ_SIMPLE) -#define QAUTHZ_SIMPLE(obj) \ - OBJECT_CHECK(QAuthZSimple, (obj), \ - TYPE_QAUTHZ_SIMPLE) +DECLARE_OBJ_CHECKERS(QAuthZSimple, QAuthZSimpleClass, + QAUTHZ_SIMPLE, TYPE_QAUTHZ_SIMPLE) =20 =20 =20 diff --git a/include/block/throttle-groups.h b/include/block/throttle-group= s.h index 7c6f572cf9..20b308f619 100644 --- a/include/block/throttle-groups.h +++ b/include/block/throttle-groups.h @@ -61,7 +61,8 @@ typedef struct ThrottleGroupMember { =20 #define TYPE_THROTTLE_GROUP "throttle-group" typedef struct ThrottleGroup ThrottleGroup; -#define THROTTLE_GROUP(obj) OBJECT_CHECK(ThrottleGroup, (obj), TYPE_THROTT= LE_GROUP) +DECLARE_INSTANCE_CHECKER(ThrottleGroup, THROTTLE_GROUP, + TYPE_THROTTLE_GROUP) =20 const char *throttle_group_get_name(ThrottleGroupMember *tgm); =20 diff --git a/include/chardev/char-fd.h b/include/chardev/char-fd.h index 1442dcaa62..9de0e440de 100644 --- a/include/chardev/char-fd.h +++ b/include/chardev/char-fd.h @@ -38,7 +38,8 @@ typedef struct FDChardev FDChardev; =20 #define TYPE_CHARDEV_FD "chardev-fd" =20 -#define FD_CHARDEV(obj) OBJECT_CHECK(FDChardev, (obj), TYPE_CHARDEV_FD) +DECLARE_INSTANCE_CHECKER(FDChardev, FD_CHARDEV, + TYPE_CHARDEV_FD) =20 void qemu_chr_open_fd(Chardev *chr, int fd_in, int fd_out); int qmp_chardev_open_file_source(char *src, int flags, Error **errp); diff --git a/include/chardev/char-win.h b/include/chardev/char-win.h index f1632330f1..485521469c 100644 --- a/include/chardev/char-win.h +++ b/include/chardev/char-win.h @@ -44,7 +44,8 @@ typedef struct WinChardev WinChardev; #define NRECVBUF 2048 =20 #define TYPE_CHARDEV_WIN "chardev-win" -#define WIN_CHARDEV(obj) OBJECT_CHECK(WinChardev, (obj), TYPE_CHARDEV_WIN) +DECLARE_INSTANCE_CHECKER(WinChardev, WIN_CHARDEV, + TYPE_CHARDEV_WIN) =20 void win_chr_set_file(Chardev *chr, HANDLE file, bool keep_open); int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp); diff --git a/include/chardev/char.h b/include/chardev/char.h index d91d851b33..5874de57ea 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -227,11 +227,8 @@ int qemu_chr_wait_connected(Chardev *chr, Error **errp= ); =20 #define TYPE_CHARDEV "chardev" typedef struct ChardevClass ChardevClass; -#define CHARDEV(obj) OBJECT_CHECK(Chardev, (obj), TYPE_CHARDEV) -#define CHARDEV_CLASS(klass) \ - OBJECT_CLASS_CHECK(ChardevClass, (klass), TYPE_CHARDEV) -#define CHARDEV_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ChardevClass, (obj), TYPE_CHARDEV) +DECLARE_OBJ_CHECKERS(Chardev, ChardevClass, + CHARDEV, TYPE_CHARDEV) =20 #define TYPE_CHARDEV_NULL "chardev-null" #define TYPE_CHARDEV_MUX "chardev-mux" diff --git a/include/chardev/spice.h b/include/chardev/spice.h index 5bccc47392..99f26aedde 100644 --- a/include/chardev/spice.h +++ b/include/chardev/spice.h @@ -21,7 +21,8 @@ typedef struct SpiceChardev SpiceChardev; #define TYPE_CHARDEV_SPICEVMC "chardev-spicevmc" #define TYPE_CHARDEV_SPICEPORT "chardev-spiceport" =20 -#define SPICE_CHARDEV(obj) OBJECT_CHECK(SpiceChardev, (obj), TYPE_CHARDEV_= SPICE) +DECLARE_INSTANCE_CHECKER(SpiceChardev, SPICE_CHARDEV, + TYPE_CHARDEV_SPICE) =20 void qemu_chr_open_spice_port(Chardev *chr, ChardevBackend *backend, bool *be_opened, Error **errp); diff --git a/include/crypto/secret.h b/include/crypto/secret.h index 8c03971e75..5d20ae6d2f 100644 --- a/include/crypto/secret.h +++ b/include/crypto/secret.h @@ -27,8 +27,8 @@ =20 #define TYPE_QCRYPTO_SECRET "secret" typedef struct QCryptoSecret QCryptoSecret; -#define QCRYPTO_SECRET(obj) \ - OBJECT_CHECK(QCryptoSecret, (obj), TYPE_QCRYPTO_SECRET) +DECLARE_INSTANCE_CHECKER(QCryptoSecret, QCRYPTO_SECRET, + TYPE_QCRYPTO_SECRET) =20 typedef struct QCryptoSecretClass QCryptoSecretClass; =20 diff --git a/include/crypto/secret_common.h b/include/crypto/secret_common.h index db282a3872..dd3310ea5f 100644 --- a/include/crypto/secret_common.h +++ b/include/crypto/secret_common.h @@ -27,14 +27,8 @@ #define TYPE_QCRYPTO_SECRET_COMMON "secret_common" typedef struct QCryptoSecretCommon QCryptoSecretCommon; typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass; -#define QCRYPTO_SECRET_COMMON(obj) \ - OBJECT_CHECK(QCryptoSecretCommon, (obj), TYPE_QCRYPTO_SECRET_COMMON) -#define QCRYPTO_SECRET_COMMON_CLASS(class) \ - OBJECT_CLASS_CHECK(QCryptoSecretCommonClass, \ - (class), TYPE_QCRYPTO_SECRET_COMMON) -#define QCRYPTO_SECRET_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QCryptoSecretCommonClass, \ - (obj), TYPE_QCRYPTO_SECRET_COMMON) +DECLARE_OBJ_CHECKERS(QCryptoSecretCommon, QCryptoSecretCommonClass, + QCRYPTO_SECRET_COMMON, TYPE_QCRYPTO_SECRET_COMMON) =20 =20 struct QCryptoSecretCommon { diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyrin= g.h index 8b3b8ee67d..9875f4cbf3 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -28,15 +28,8 @@ #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" typedef struct QCryptoSecretKeyring QCryptoSecretKeyring; typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass; -#define QCRYPTO_SECRET_KEYRING(obj) \ - OBJECT_CHECK(QCryptoSecretKeyring, (obj), \ - TYPE_QCRYPTO_SECRET_KEYRING) -#define QCRYPTO_SECRET_KEYRING_CLASS(class) \ - OBJECT_CLASS_CHECK(QCryptoSecretKeyringClass, \ - (class), TYPE_QCRYPTO_SECRET_KEYRING) -#define QCRYPTO_SECRET_KEYRING_GET_CLASS(class) \ - OBJECT_GET_CLASS(QCryptoSecretKeyringClass, \ - (class), TYPE_QCRYPTO_SECRET_KEYRING) +DECLARE_OBJ_CHECKERS(QCryptoSecretKeyring, QCryptoSecretKeyringClass, + QCRYPTO_SECRET_KEYRING, TYPE_QCRYPTO_SECRET_KEYRING) =20 =20 struct QCryptoSecretKeyring { diff --git a/include/crypto/tls-cipher-suites.h b/include/crypto/tls-cipher= -suites.h index 23f031953f..bb9ee53e03 100644 --- a/include/crypto/tls-cipher-suites.h +++ b/include/crypto/tls-cipher-suites.h @@ -16,8 +16,8 @@ =20 #define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites" typedef struct QCryptoTLSCipherSuites QCryptoTLSCipherSuites; -#define QCRYPTO_TLS_CIPHER_SUITES(obj) \ - OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SU= ITES) +DECLARE_INSTANCE_CHECKER(QCryptoTLSCipherSuites, QCRYPTO_TLS_CIPHER_SUITES, + TYPE_QCRYPTO_TLS_CIPHER_SUITES) =20 struct QCryptoTLSCipherSuites { /* */ diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h index 9f065a4def..079e376047 100644 --- a/include/crypto/tlscreds.h +++ b/include/crypto/tlscreds.h @@ -30,8 +30,8 @@ =20 #define TYPE_QCRYPTO_TLS_CREDS "tls-creds" typedef struct QCryptoTLSCreds QCryptoTLSCreds; -#define QCRYPTO_TLS_CREDS(obj) \ - OBJECT_CHECK(QCryptoTLSCreds, (obj), TYPE_QCRYPTO_TLS_CREDS) +DECLARE_INSTANCE_CHECKER(QCryptoTLSCreds, QCRYPTO_TLS_CREDS, + TYPE_QCRYPTO_TLS_CREDS) =20 typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass; =20 diff --git a/include/crypto/tlscredsanon.h b/include/crypto/tlscredsanon.h index 034ebd3fd9..3f464a3809 100644 --- a/include/crypto/tlscredsanon.h +++ b/include/crypto/tlscredsanon.h @@ -26,8 +26,8 @@ =20 #define TYPE_QCRYPTO_TLS_CREDS_ANON "tls-creds-anon" typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon; -#define QCRYPTO_TLS_CREDS_ANON(obj) \ - OBJECT_CHECK(QCryptoTLSCredsAnon, (obj), TYPE_QCRYPTO_TLS_CREDS_ANON) +DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsAnon, QCRYPTO_TLS_CREDS_ANON, + TYPE_QCRYPTO_TLS_CREDS_ANON) =20 =20 typedef struct QCryptoTLSCredsAnonClass QCryptoTLSCredsAnonClass; diff --git a/include/crypto/tlscredspsk.h b/include/crypto/tlscredspsk.h index 6e361366eb..d7e6bdb5ed 100644 --- a/include/crypto/tlscredspsk.h +++ b/include/crypto/tlscredspsk.h @@ -26,8 +26,8 @@ =20 #define TYPE_QCRYPTO_TLS_CREDS_PSK "tls-creds-psk" typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK; -#define QCRYPTO_TLS_CREDS_PSK(obj) \ - OBJECT_CHECK(QCryptoTLSCredsPSK, (obj), TYPE_QCRYPTO_TLS_CREDS_PSK) +DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsPSK, QCRYPTO_TLS_CREDS_PSK, + TYPE_QCRYPTO_TLS_CREDS_PSK) =20 typedef struct QCryptoTLSCredsPSKClass QCryptoTLSCredsPSKClass; =20 diff --git a/include/crypto/tlscredsx509.h b/include/crypto/tlscredsx509.h index e4d44ea22d..c6d89b7881 100644 --- a/include/crypto/tlscredsx509.h +++ b/include/crypto/tlscredsx509.h @@ -26,8 +26,8 @@ =20 #define TYPE_QCRYPTO_TLS_CREDS_X509 "tls-creds-x509" typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509; -#define QCRYPTO_TLS_CREDS_X509(obj) \ - OBJECT_CHECK(QCryptoTLSCredsX509, (obj), TYPE_QCRYPTO_TLS_CREDS_X509) +DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsX509, QCRYPTO_TLS_CREDS_X509, + TYPE_QCRYPTO_TLS_CREDS_X509) =20 typedef struct QCryptoTLSCredsX509Class QCryptoTLSCredsX509Class; =20 diff --git a/include/exec/memory.h b/include/exec/memory.h index 752b905e14..dc908738c6 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -34,19 +34,13 @@ #define MAX_PHYS_ADDR (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) = - 1) =20 #define TYPE_MEMORY_REGION "qemu:memory-region" -#define MEMORY_REGION(obj) \ - OBJECT_CHECK(MemoryRegion, (obj), TYPE_MEMORY_REGION) +DECLARE_INSTANCE_CHECKER(MemoryRegion, MEMORY_REGION, + TYPE_MEMORY_REGION) =20 #define TYPE_IOMMU_MEMORY_REGION "qemu:iommu-memory-region" typedef struct IOMMUMemoryRegionClass IOMMUMemoryRegionClass; -#define IOMMU_MEMORY_REGION(obj) \ - OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_IOMMU_MEMORY_REGION) -#define IOMMU_MEMORY_REGION_CLASS(klass) \ - OBJECT_CLASS_CHECK(IOMMUMemoryRegionClass, (klass), \ - TYPE_IOMMU_MEMORY_REGION) -#define IOMMU_MEMORY_REGION_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IOMMUMemoryRegionClass, (obj), \ - TYPE_IOMMU_MEMORY_REGION) +DECLARE_OBJ_CHECKERS(IOMMUMemoryRegion, IOMMUMemoryRegionClass, + IOMMU_MEMORY_REGION, TYPE_IOMMU_MEMORY_REGION) =20 extern bool global_dirty_log; =20 diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index 4ef44d6fe8..9adf1e4706 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -19,12 +19,8 @@ typedef enum { #define TYPE_ACPI_DEVICE_IF "acpi-device-interface" =20 typedef struct AcpiDeviceIfClass AcpiDeviceIfClass; -#define ACPI_DEVICE_IF_CLASS(klass) \ - OBJECT_CLASS_CHECK(AcpiDeviceIfClass, (klass), \ - TYPE_ACPI_DEVICE_IF) -#define ACPI_DEVICE_IF_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AcpiDeviceIfClass, (obj), \ - TYPE_ACPI_DEVICE_IF) +DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF, + TYPE_ACPI_DEVICE_IF) #define ACPI_DEVICE_IF(obj) \ INTERFACE_CHECK(AcpiDeviceIf, (obj), \ TYPE_ACPI_DEVICE_IF) diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/gener= ic_event_device.h index 2208f0b939..1be05a3c0f 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -68,8 +68,8 @@ =20 #define TYPE_ACPI_GED "acpi-ged" typedef struct AcpiGedState AcpiGedState; -#define ACPI_GED(obj) \ - OBJECT_CHECK(AcpiGedState, (obj), TYPE_ACPI_GED) +DECLARE_INSTANCE_CHECKER(AcpiGedState, ACPI_GED, + TYPE_ACPI_GED) =20 #define ACPI_GED_EVT_SEL_OFFSET 0x0 #define ACPI_GED_EVT_SEL_LEN 0x4 diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index 0286fc0f09..86cd1da605 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -17,7 +17,8 @@ */ =20 typedef struct VmGenIdState VmGenIdState; -#define VMGENID(obj) OBJECT_CHECK(VmGenIdState, (obj), VMGENID_DEVICE) +DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID, + VMGENID_DEVICE) =20 struct VmGenIdState { DeviceClass parent_obj; diff --git a/include/hw/adc/stm32f2xx_adc.h b/include/hw/adc/stm32f2xx_adc.h index 60d4b65570..6a4f8e955b 100644 --- a/include/hw/adc/stm32f2xx_adc.h +++ b/include/hw/adc/stm32f2xx_adc.h @@ -60,8 +60,8 @@ =20 #define TYPE_STM32F2XX_ADC "stm32f2xx-adc" typedef struct STM32F2XXADCState STM32F2XXADCState; -#define STM32F2XX_ADC(obj) \ - OBJECT_CHECK(STM32F2XXADCState, (obj), TYPE_STM32F2XX_ADC) +DECLARE_INSTANCE_CHECKER(STM32F2XXADCState, STM32F2XX_ADC, + TYPE_STM32F2XX_ADC) =20 struct STM32F2XXADCState { /* */ diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index 631454f1c7..d13b6cf50f 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -23,7 +23,8 @@ =20 #define TYPE_AW_A10 "allwinner-a10" typedef struct AwA10State AwA10State; -#define AW_A10(obj) OBJECT_CHECK(AwA10State, (obj), TYPE_AW_A10) +DECLARE_INSTANCE_CHECKER(AwA10State, AW_A10, + TYPE_AW_A10) =20 struct AwA10State { /*< private >*/ diff --git a/include/hw/arm/allwinner-h3.h b/include/hw/arm/allwinner-h3.h index 5fda95066f..a93e019521 100644 --- a/include/hw/arm/allwinner-h3.h +++ b/include/hw/arm/allwinner-h3.h @@ -107,7 +107,8 @@ enum { =20 /** Convert input object to Allwinner H3 state object */ typedef struct AwH3State AwH3State; -#define AW_H3(obj) OBJECT_CHECK(AwH3State, (obj), TYPE_AW_H3) +DECLARE_INSTANCE_CHECKER(AwH3State, AW_H3, + TYPE_AW_H3) =20 /** @} */ =20 diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index e5788e9d3c..452cbb5793 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -110,7 +110,8 @@ #define TYPE_ARM_SSE "arm-sse" typedef struct ARMSSE ARMSSE; typedef struct ARMSSEClass ARMSSEClass; -#define ARM_SSE(obj) OBJECT_CHECK(ARMSSE, (obj), TYPE_ARM_SSE) +DECLARE_OBJ_CHECKERS(ARMSSE, ARMSSEClass, + ARM_SSE, TYPE_ARM_SSE) =20 /* * These type names are for specific IoTKit subsystems; other than @@ -227,9 +228,5 @@ struct ARMSSEClass { const ARMSSEInfo *info; }; =20 -#define ARM_SSE_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMSSEClass, (klass), TYPE_ARM_SSE) -#define ARM_SSE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMSSEClass, (obj), TYPE_ARM_SSE) =20 #endif diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h index c820d32ad5..dcb891d9cc 100644 --- a/include/hw/arm/armv7m.h +++ b/include/hw/arm/armv7m.h @@ -17,7 +17,8 @@ =20 #define TYPE_BITBAND "ARM,bitband-memory" typedef struct BitBandState BitBandState; -#define BITBAND(obj) OBJECT_CHECK(BitBandState, (obj), TYPE_BITBAND) +DECLARE_INSTANCE_CHECKER(BitBandState, BITBAND, + TYPE_BITBAND) =20 struct BitBandState { /*< private >*/ @@ -32,7 +33,8 @@ struct BitBandState { =20 #define TYPE_ARMV7M "armv7m" typedef struct ARMv7MState ARMv7MState; -#define ARMV7M(obj) OBJECT_CHECK(ARMv7MState, (obj), TYPE_ARMV7M) +DECLARE_INSTANCE_CHECKER(ARMv7MState, ARMV7M, + TYPE_ARMV7M) =20 #define ARMV7M_NUM_BITBANDS 2 =20 diff --git a/include/hw/arm/aspeed.h b/include/hw/arm/aspeed.h index 4e5ec37acb..c9747b15fc 100644 --- a/include/hw/arm/aspeed.h +++ b/include/hw/arm/aspeed.h @@ -16,18 +16,14 @@ typedef struct AspeedMachineState AspeedMachineState; =20 #define TYPE_ASPEED_MACHINE MACHINE_TYPE_NAME("aspeed") typedef struct AspeedMachineClass AspeedMachineClass; -#define ASPEED_MACHINE(obj) \ - OBJECT_CHECK(AspeedMachineState, (obj), TYPE_ASPEED_MACHINE) +DECLARE_OBJ_CHECKERS(AspeedMachineState, AspeedMachineClass, + ASPEED_MACHINE, TYPE_ASPEED_MACHINE) =20 #define ASPEED_MAC0_ON (1 << 0) #define ASPEED_MAC1_ON (1 << 1) #define ASPEED_MAC2_ON (1 << 2) #define ASPEED_MAC3_ON (1 << 3) =20 -#define ASPEED_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedMachineClass, (klass), TYPE_ASPEED_MACHINE) -#define ASPEED_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE) =20 struct AspeedMachineClass { MachineClass parent_obj; diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 31679ee42e..05c7d53df3 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -66,7 +66,8 @@ typedef struct AspeedSoCState AspeedSoCState; =20 #define TYPE_ASPEED_SOC "aspeed-soc" typedef struct AspeedSoCClass AspeedSoCClass; -#define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SO= C) +DECLARE_OBJ_CHECKERS(AspeedSoCState, AspeedSoCClass, + ASPEED_SOC, TYPE_ASPEED_SOC) =20 struct AspeedSoCClass { DeviceClass parent_class; @@ -84,10 +85,6 @@ struct AspeedSoCClass { uint32_t num_cpus; }; =20 -#define ASPEED_SOC_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC) -#define ASPEED_SOC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC) =20 enum { ASPEED_DEV_IOMEM, diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_= peripherals.h index 67f5a5f8f5..b4d3ae121a 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -33,8 +33,8 @@ =20 #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals" typedef struct BCM2835PeripheralState BCM2835PeripheralState; -#define BCM2835_PERIPHERALS(obj) \ - OBJECT_CHECK(BCM2835PeripheralState, (obj), TYPE_BCM2835_PERIPHERALS) +DECLARE_INSTANCE_CHECKER(BCM2835PeripheralState, BCM2835_PERIPHERALS, + TYPE_BCM2835_PERIPHERALS) =20 struct BCM2835PeripheralState { /*< private >*/ diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index cf22dc96a0..181d9563d0 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -20,7 +20,8 @@ #define TYPE_BCM283X "bcm283x" typedef struct BCM283XClass BCM283XClass; typedef struct BCM283XState BCM283XState; -#define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X) +DECLARE_OBJ_CHECKERS(BCM283XState, BCM283XClass, + BCM283X, TYPE_BCM283X) =20 #define BCM283X_NCPUS 4 =20 @@ -52,9 +53,5 @@ struct BCM283XClass { const BCM283XInfo *info; }; =20 -#define BCM283X_CLASS(klass) \ - OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) -#define BCM283X_GET_CLASS(obj) \ - OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) =20 #endif /* BCM2836_H */ diff --git a/include/hw/arm/digic.h b/include/hw/arm/digic.h index f77833f6e3..f3ba398914 100644 --- a/include/hw/arm/digic.h +++ b/include/hw/arm/digic.h @@ -26,7 +26,8 @@ #define TYPE_DIGIC "digic" =20 typedef struct DigicState DigicState; -#define DIGIC(obj) OBJECT_CHECK(DigicState, (obj), TYPE_DIGIC) +DECLARE_INSTANCE_CHECKER(DigicState, DIGIC, + TYPE_DIGIC) =20 #define DIGIC4_NB_TIMERS 3 =20 diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index 114c594cd2..c2de1dc102 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -106,8 +106,8 @@ struct Exynos4210State { typedef struct Exynos4210State Exynos4210State; =20 #define TYPE_EXYNOS4210_SOC "exynos4210" -#define EXYNOS4210_SOC(obj) \ - OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) +DECLARE_INSTANCE_CHECKER(Exynos4210State, EXYNOS4210_SOC, + TYPE_EXYNOS4210_SOC) =20 void exynos4210_write_secondary(ARMCPU *cpu, const struct arm_boot_info *info); diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 8b4c974f09..e239505724 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -36,7 +36,8 @@ =20 #define TYPE_FSL_IMX25 "fsl,imx25" typedef struct FslIMX25State FslIMX25State; -#define FSL_IMX25(obj) OBJECT_CHECK(FslIMX25State, (obj), TYPE_FSL_IMX25) +DECLARE_INSTANCE_CHECKER(FslIMX25State, FSL_IMX25, + TYPE_FSL_IMX25) =20 #define FSL_IMX25_NUM_UARTS 5 #define FSL_IMX25_NUM_GPTS 4 diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h index 12368f2c8f..64b4ca07b7 100644 --- a/include/hw/arm/fsl-imx31.h +++ b/include/hw/arm/fsl-imx31.h @@ -32,7 +32,8 @@ =20 #define TYPE_FSL_IMX31 "fsl,imx31" typedef struct FslIMX31State FslIMX31State; -#define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31) +DECLARE_INSTANCE_CHECKER(FslIMX31State, FSL_IMX31, + TYPE_FSL_IMX31) =20 #define FSL_IMX31_NUM_UARTS 2 #define FSL_IMX31_NUM_EPITS 2 diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h index e66ea1e917..602b9aff36 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -38,7 +38,8 @@ =20 #define TYPE_FSL_IMX6 "fsl,imx6" typedef struct FslIMX6State FslIMX6State; -#define FSL_IMX6(obj) OBJECT_CHECK(FslIMX6State, (obj), TYPE_FSL_IMX6) +DECLARE_INSTANCE_CHECKER(FslIMX6State, FSL_IMX6, + TYPE_FSL_IMX6) =20 #define FSL_IMX6_NUM_CPUS 4 #define FSL_IMX6_NUM_UARTS 5 diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index e95c4820c6..e4862fdb2c 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -42,7 +42,8 @@ =20 #define TYPE_FSL_IMX6UL "fsl,imx6ul" typedef struct FslIMX6ULState FslIMX6ULState; -#define FSL_IMX6UL(obj) OBJECT_CHECK(FslIMX6ULState, (obj), TYPE_FSL_IMX6U= L) +DECLARE_INSTANCE_CHECKER(FslIMX6ULState, FSL_IMX6UL, + TYPE_FSL_IMX6UL) =20 enum FslIMX6ULConfiguration { FSL_IMX6UL_NUM_CPUS =3D 1, diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 8095e5544b..434d1d0641 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -43,7 +43,8 @@ =20 #define TYPE_FSL_IMX7 "fsl,imx7" typedef struct FslIMX7State FslIMX7State; -#define FSL_IMX7(obj) OBJECT_CHECK(FslIMX7State, (obj), TYPE_FSL_IMX7) +DECLARE_INSTANCE_CHECKER(FslIMX7State, FSL_IMX7, + TYPE_FSL_IMX7) =20 enum FslIMX7Configuration { FSL_IMX7_NUM_CPUS =3D 2, diff --git a/include/hw/arm/linux-boot-if.h b/include/hw/arm/linux-boot-if.h index 6d9e13fd36..c85f33b2c5 100644 --- a/include/hw/arm/linux-boot-if.h +++ b/include/hw/arm/linux-boot-if.h @@ -10,10 +10,8 @@ =20 #define TYPE_ARM_LINUX_BOOT_IF "arm-linux-boot-if" typedef struct ARMLinuxBootIfClass ARMLinuxBootIfClass; -#define ARM_LINUX_BOOT_IF_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMLinuxBootIfClass, (klass), TYPE_ARM_LINUX_BOOT_I= F) -#define ARM_LINUX_BOOT_IF_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMLinuxBootIfClass, (obj), TYPE_ARM_LINUX_BOOT_IF) +DECLARE_CLASS_CHECKERS(ARMLinuxBootIfClass, ARM_LINUX_BOOT_IF, + TYPE_ARM_LINUX_BOOT_IF) #define ARM_LINUX_BOOT_IF(obj) \ INTERFACE_CHECK(ARMLinuxBootIf, (obj), TYPE_ARM_LINUX_BOOT_IF) =20 diff --git a/include/hw/arm/msf2-soc.h b/include/hw/arm/msf2-soc.h index b4bc5ef96a..9b93d0d64e 100644 --- a/include/hw/arm/msf2-soc.h +++ b/include/hw/arm/msf2-soc.h @@ -34,7 +34,8 @@ =20 #define TYPE_MSF2_SOC "msf2-soc" typedef struct MSF2State MSF2State; -#define MSF2_SOC(obj) OBJECT_CHECK(MSF2State, (obj), TYPE_MSF2_SOC) +DECLARE_INSTANCE_CHECKER(MSF2State, MSF2_SOC, + TYPE_MSF2_SOC) =20 #define MSF2_NUM_SPIS 2 #define MSF2_NUM_UARTS 2 diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h index 727ac1ae04..b69492b29d 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -21,8 +21,8 @@ =20 #define TYPE_NRF51_SOC "nrf51-soc" typedef struct NRF51State NRF51State; -#define NRF51_SOC(obj) \ - OBJECT_CHECK(NRF51State, (obj), TYPE_NRF51_SOC) +DECLARE_INSTANCE_CHECKER(NRF51State, NRF51_SOC, + TYPE_NRF51_SOC) =20 #define NRF51_NUM_TIMERS 3 =20 diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 0d365edeec..0dbf1712f4 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -71,8 +71,8 @@ void omap_clk_reparent(omap_clk clk, omap_clk parent); /* omap_intc.c */ #define TYPE_OMAP_INTC "common-omap-intc" typedef struct omap_intr_handler_s omap_intr_handler; -#define OMAP_INTC(obj) \ - OBJECT_CHECK(omap_intr_handler, (obj), TYPE_OMAP_INTC) +DECLARE_INSTANCE_CHECKER(omap_intr_handler, OMAP_INTC, + TYPE_OMAP_INTC) =20 =20 /* @@ -95,7 +95,8 @@ void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk= clk); /* omap_i2c.c */ #define TYPE_OMAP_I2C "omap_i2c" typedef struct OMAPI2CState OMAPI2CState; -#define OMAP_I2C(obj) OBJECT_CHECK(OMAPI2CState, (obj), TYPE_OMAP_I2C) +DECLARE_INSTANCE_CHECKER(OMAPI2CState, OMAP_I2C, + TYPE_OMAP_I2C) =20 =20 /* TODO: clock framework (see above) */ @@ -104,12 +105,12 @@ void omap_i2c_set_fclk(OMAPI2CState *i2c, omap_clk cl= k); =20 /* omap_gpio.c */ #define TYPE_OMAP1_GPIO "omap-gpio" -#define OMAP1_GPIO(obj) \ - OBJECT_CHECK(struct omap_gpif_s, (obj), TYPE_OMAP1_GPIO) +DECLARE_INSTANCE_CHECKER(struct omap_gpif_s, OMAP1_GPIO, + TYPE_OMAP1_GPIO) =20 #define TYPE_OMAP2_GPIO "omap2-gpio" -#define OMAP2_GPIO(obj) \ - OBJECT_CHECK(struct omap2_gpif_s, (obj), TYPE_OMAP2_GPIO) +DECLARE_INSTANCE_CHECKER(struct omap2_gpif_s, OMAP2_GPIO, + TYPE_OMAP2_GPIO) =20 typedef struct omap_gpif_s omap_gpif; typedef struct omap2_gpif_s omap2_gpif; diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index b2f9a41468..9046876134 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -89,7 +89,8 @@ void pxa2xx_lcd_vsync_notifier(PXA2xxLCDState *s, qemu_ir= q handler); /* pxa2xx_mmci.c */ #define TYPE_PXA2XX_MMCI "pxa2xx-mmci" typedef struct PXA2xxMMCIState PXA2xxMMCIState; -#define PXA2XX_MMCI(obj) OBJECT_CHECK(PXA2xxMMCIState, (obj), TYPE_PXA2XX_= MMCI) +DECLARE_INSTANCE_CHECKER(PXA2xxMMCIState, PXA2XX_MMCI, + TYPE_PXA2XX_MMCI) =20 PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, hwaddr base, @@ -100,8 +101,8 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq = readonly, /* pxa2xx_pcmcia.c */ #define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia" typedef struct PXA2xxPCMCIAState PXA2xxPCMCIAState; -#define PXA2XX_PCMCIA(obj) \ - OBJECT_CHECK(PXA2xxPCMCIAState, obj, TYPE_PXA2XX_PCMCIA) +DECLARE_INSTANCE_CHECKER(PXA2xxPCMCIAState, PXA2XX_PCMCIA, + TYPE_PXA2XX_PCMCIA) =20 PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base); @@ -129,12 +130,13 @@ I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s); =20 #define TYPE_PXA2XX_I2C "pxa2xx_i2c" typedef struct PXA2xxI2SState PXA2xxI2SState; -#define PXA2XX_I2C(obj) \ - OBJECT_CHECK(PXA2xxI2CState, (obj), TYPE_PXA2XX_I2C) +DECLARE_INSTANCE_CHECKER(PXA2xxI2CState, PXA2XX_I2C, + TYPE_PXA2XX_I2C) =20 #define TYPE_PXA2XX_FIR "pxa2xx-fir" typedef struct PXA2xxFIrState PXA2xxFIrState; -#define PXA2XX_FIR(obj) OBJECT_CHECK(PXA2xxFIrState, (obj), TYPE_PXA2XX_FI= R) +DECLARE_INSTANCE_CHECKER(PXA2xxFIrState, PXA2XX_FIR, + TYPE_PXA2XX_FIR) =20 typedef struct { ARMCPU *cpu; diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index b6b51a1cb1..54d0872fd8 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -132,11 +132,8 @@ struct SMMUBaseClass { typedef struct SMMUBaseClass SMMUBaseClass; =20 #define TYPE_ARM_SMMU "arm-smmu" -#define ARM_SMMU(obj) OBJECT_CHECK(SMMUState, (obj), TYPE_ARM_SMMU) -#define ARM_SMMU_CLASS(klass) \ - OBJECT_CLASS_CHECK(SMMUBaseClass, (klass), TYPE_ARM_SMMU) -#define ARM_SMMU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SMMUBaseClass, (obj), TYPE_ARM_SMMU) +DECLARE_OBJ_CHECKERS(SMMUState, SMMUBaseClass, + ARM_SMMU, TYPE_ARM_SMMU) =20 /* Return the SMMUPciBus handle associated to a PCI bus number */ SMMUPciBus *smmu_find_smmu_pcibus(SMMUState *s, uint8_t bus_num); diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h index 698b89d234..2a3f6dd197 100644 --- a/include/hw/arm/smmuv3.h +++ b/include/hw/arm/smmuv3.h @@ -83,10 +83,7 @@ struct SMMUv3Class { typedef struct SMMUv3Class SMMUv3Class; =20 #define TYPE_ARM_SMMUV3 "arm-smmuv3" -#define ARM_SMMUV3(obj) OBJECT_CHECK(SMMUv3State, (obj), TYPE_ARM_SMMUV3) -#define ARM_SMMUV3_CLASS(klass) \ - OBJECT_CLASS_CHECK(SMMUv3Class, (klass), TYPE_ARM_SMMUV3) -#define ARM_SMMUV3_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SMMUv3Class, (obj), TYPE_ARM_SMMUV3) +DECLARE_OBJ_CHECKERS(SMMUv3State, SMMUv3Class, + ARM_SMMUV3, TYPE_ARM_SMMUV3) =20 #endif diff --git a/include/hw/arm/stm32f205_soc.h b/include/hw/arm/stm32f205_soc.h index 6d86937e07..9c2f4818a6 100644 --- a/include/hw/arm/stm32f205_soc.h +++ b/include/hw/arm/stm32f205_soc.h @@ -36,8 +36,8 @@ =20 #define TYPE_STM32F205_SOC "stm32f205-soc" typedef struct STM32F205State STM32F205State; -#define STM32F205_SOC(obj) \ - OBJECT_CHECK(STM32F205State, (obj), TYPE_STM32F205_SOC) +DECLARE_INSTANCE_CHECKER(STM32F205State, STM32F205_SOC, + TYPE_STM32F205_SOC) =20 #define STM_NUM_USARTS 6 #define STM_NUM_TIMERS 4 diff --git a/include/hw/arm/stm32f405_soc.h b/include/hw/arm/stm32f405_soc.h index 8f44fb2046..f1a22763f4 100644 --- a/include/hw/arm/stm32f405_soc.h +++ b/include/hw/arm/stm32f405_soc.h @@ -37,8 +37,8 @@ =20 #define TYPE_STM32F405_SOC "stm32f405-soc" typedef struct STM32F405State STM32F405State; -#define STM32F405_SOC(obj) \ - OBJECT_CHECK(STM32F405State, (obj), TYPE_STM32F405_SOC) +DECLARE_INSTANCE_CHECKER(STM32F405State, STM32F405_SOC, + TYPE_STM32F405_SOC) =20 #define STM_NUM_USARTS 7 #define STM_NUM_TIMERS 4 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 49ad860943..392b0bd571 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -170,12 +170,8 @@ typedef struct VirtMachineState VirtMachineState; #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) =20 #define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") -#define VIRT_MACHINE(obj) \ - OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE) -#define VIRT_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_VIRT_MACHINE) -#define VIRT_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE) +DECLARE_OBJ_CHECKERS(VirtMachineState, VirtMachineClass, + VIRT_MACHINE, TYPE_VIRT_MACHINE) =20 void virt_acpi_setup(VirtMachineState *vms); bool virt_is_acpi_enabled(VirtMachineState *vms); diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index a960619ec9..eaa9023fd6 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -24,7 +24,8 @@ =20 #define TYPE_XLNX_VERSAL "xlnx-versal" typedef struct Versal Versal; -#define XLNX_VERSAL(obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL) +DECLARE_INSTANCE_CHECKER(Versal, XLNX_VERSAL, + TYPE_XLNX_VERSAL) =20 #define XLNX_VERSAL_NR_ACPUS 2 #define XLNX_VERSAL_NR_UARTS 2 diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 6a24216abf..4cc97b4610 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -36,8 +36,8 @@ =20 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" typedef struct XlnxZynqMPState XlnxZynqMPState; -#define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ - TYPE_XLNX_ZYNQMP) +DECLARE_INSTANCE_CHECKER(XlnxZynqMPState, XLNX_ZYNQMP, + TYPE_XLNX_ZYNQMP) =20 #define XLNX_ZYNQMP_NUM_APU_CPUS 4 #define XLNX_ZYNQMP_NUM_RPU_CPUS 2 diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index 9b2fa7e92c..3e26303705 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -10,8 +10,8 @@ =20 #define TYPE_PFLASH_CFI01 "cfi.pflash01" typedef struct PFlashCFI01 PFlashCFI01; -#define PFLASH_CFI01(obj) \ - OBJECT_CHECK(PFlashCFI01, (obj), TYPE_PFLASH_CFI01) +DECLARE_INSTANCE_CHECKER(PFlashCFI01, PFLASH_CFI01, + TYPE_PFLASH_CFI01) =20 =20 PFlashCFI01 *pflash_cfi01_register(hwaddr base, @@ -31,8 +31,8 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveInf= o *dinfo); =20 #define TYPE_PFLASH_CFI02 "cfi.pflash02" typedef struct PFlashCFI02 PFlashCFI02; -#define PFLASH_CFI02(obj) \ - OBJECT_CHECK(PFlashCFI02, (obj), TYPE_PFLASH_CFI02) +DECLARE_INSTANCE_CHECKER(PFlashCFI02, PFLASH_CFI02, + TYPE_PFLASH_CFI02) =20 =20 PFlashCFI02 *pflash_cfi02_register(hwaddr base, diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h index f013d634f7..8287da7c30 100644 --- a/include/hw/block/swim.h +++ b/include/hw/block/swim.h @@ -22,7 +22,8 @@ typedef struct SWIMBus SWIMBus; typedef struct SWIMCtrl SWIMCtrl; =20 #define TYPE_SWIM_DRIVE "swim-drive" -#define SWIM_DRIVE(obj) OBJECT_CHECK(SWIMDrive, (obj), TYPE_SWIM_DRIVE) +DECLARE_INSTANCE_CHECKER(SWIMDrive, SWIM_DRIVE, + TYPE_SWIM_DRIVE) =20 struct SWIMDrive { DeviceState qdev; @@ -31,7 +32,8 @@ struct SWIMDrive { }; =20 #define TYPE_SWIM_BUS "swim-bus" -#define SWIM_BUS(obj) OBJECT_CHECK(SWIMBus, (obj), TYPE_SWIM_BUS) +DECLARE_INSTANCE_CHECKER(SWIMBus, SWIM_BUS, + TYPE_SWIM_BUS) =20 struct SWIMBus { BusState bus; @@ -69,7 +71,8 @@ struct SWIMCtrl { =20 #define TYPE_SWIM "swim" typedef struct Swim Swim; -#define SWIM(obj) OBJECT_CHECK(Swim, (obj), TYPE_SWIM) +DECLARE_INSTANCE_CHECKER(Swim, SWIM, + TYPE_SWIM) =20 struct Swim { SysBusDevice parent_obj; diff --git a/include/hw/boards.h b/include/hw/boards.h index bc5b82ad20..795910d01b 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -21,12 +21,8 @@ =20 #define TYPE_MACHINE "machine" #undef MACHINE /* BSD defines it and QEMU does not use it */ -#define MACHINE(obj) \ - OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE) -#define MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE) -#define MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE) +DECLARE_OBJ_CHECKERS(MachineState, MachineClass, + MACHINE, TYPE_MACHINE) =20 extern MachineState *current_machine; =20 diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h index 67ad345edd..5202f152b0 100644 --- a/include/hw/char/avr_usart.h +++ b/include/hw/char/avr_usart.h @@ -59,8 +59,8 @@ =20 #define TYPE_AVR_USART "avr-usart" typedef struct AVRUsartState AVRUsartState; -#define AVR_USART(obj) \ - OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART) +DECLARE_INSTANCE_CHECKER(AVRUsartState, AVR_USART, + TYPE_AVR_USART) =20 struct AVRUsartState { /* */ diff --git a/include/hw/char/bcm2835_aux.h b/include/hw/char/bcm2835_aux.h index 2647becc52..a08795c47f 100644 --- a/include/hw/char/bcm2835_aux.h +++ b/include/hw/char/bcm2835_aux.h @@ -15,7 +15,8 @@ =20 #define TYPE_BCM2835_AUX "bcm2835-aux" typedef struct BCM2835AuxState BCM2835AuxState; -#define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835= _AUX) +DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX, + TYPE_BCM2835_AUX) =20 #define BCM2835_AUX_RX_FIFO_LEN 8 =20 diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h index 3d02d6ef1a..1734f53541 100644 --- a/include/hw/char/cadence_uart.h +++ b/include/hw/char/cadence_uart.h @@ -33,8 +33,8 @@ =20 #define TYPE_CADENCE_UART "cadence_uart" typedef struct CadenceUARTState CadenceUARTState; -#define CADENCE_UART(obj) OBJECT_CHECK(CadenceUARTState, (obj), \ - TYPE_CADENCE_UART) +DECLARE_INSTANCE_CHECKER(CadenceUARTState, CADENCE_UART, + TYPE_CADENCE_UART) =20 struct CadenceUARTState { /*< private >*/ diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-u= art.h index 32c0df9df3..2c3869aa16 100644 --- a/include/hw/char/cmsdk-apb-uart.h +++ b/include/hw/char/cmsdk-apb-uart.h @@ -19,8 +19,8 @@ =20 #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" typedef struct CMSDKAPBUART CMSDKAPBUART; -#define CMSDK_APB_UART(obj) OBJECT_CHECK(CMSDKAPBUART, (obj), \ - TYPE_CMSDK_APB_UART) +DECLARE_INSTANCE_CHECKER(CMSDKAPBUART, CMSDK_APB_UART, + TYPE_CMSDK_APB_UART) =20 struct CMSDKAPBUART { /*< private >*/ diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h index 7c6ec2a5c5..01d406833d 100644 --- a/include/hw/char/digic-uart.h +++ b/include/hw/char/digic-uart.h @@ -24,8 +24,8 @@ =20 #define TYPE_DIGIC_UART "digic-uart" typedef struct DigicUartState DigicUartState; -#define DIGIC_UART(obj) \ - OBJECT_CHECK(DigicUartState, (obj), TYPE_DIGIC_UART) +DECLARE_INSTANCE_CHECKER(DigicUartState, DIGIC_UART, + TYPE_DIGIC_UART) =20 enum { R_TX =3D 0x00, diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h index 5de2a39e77..5eaec507da 100644 --- a/include/hw/char/escc.h +++ b/include/hw/char/escc.h @@ -12,7 +12,8 @@ #define ESCC_SIZE 4 =20 typedef struct ESCCState ESCCState; -#define ESCC(obj) OBJECT_CHECK(ESCCState, (obj), TYPE_ESCC) +DECLARE_INSTANCE_CHECKER(ESCCState, ESCC, + TYPE_ESCC) =20 typedef enum { escc_chn_a, escc_chn_b, diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h index ec9fcde8f0..36eb75fc4c 100644 --- a/include/hw/char/ibex_uart.h +++ b/include/hw/char/ibex_uart.h @@ -71,8 +71,8 @@ REG32(TIMEOUT_CTRL, 0x2c) =20 #define TYPE_IBEX_UART "ibex-uart" typedef struct IbexUartState IbexUartState; -#define IBEX_UART(obj) \ - OBJECT_CHECK(IbexUartState, (obj), TYPE_IBEX_UART) +DECLARE_INSTANCE_CHECKER(IbexUartState, IBEX_UART, + TYPE_IBEX_UART) =20 struct IbexUartState { /* */ diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h index bfaf8ec695..200f1ec33a 100644 --- a/include/hw/char/imx_serial.h +++ b/include/hw/char/imx_serial.h @@ -24,7 +24,8 @@ =20 #define TYPE_IMX_SERIAL "imx.serial" typedef struct IMXSerialState IMXSerialState; -#define IMX_SERIAL(obj) OBJECT_CHECK(IMXSerialState, (obj), TYPE_IMX_SERIA= L) +DECLARE_INSTANCE_CHECKER(IMXSerialState, IMX_SERIAL, + TYPE_IMX_SERIAL) =20 #define URXD_CHARRDY (1<<15) /* character read is valid */ #define URXD_ERR (1<<14) /* Character has error */ diff --git a/include/hw/char/nrf51_uart.h b/include/hw/char/nrf51_uart.h index 20560ba6dc..0cf3c4e328 100644 --- a/include/hw/char/nrf51_uart.h +++ b/include/hw/char/nrf51_uart.h @@ -21,7 +21,8 @@ =20 #define TYPE_NRF51_UART "nrf51_soc.uart" typedef struct NRF51UARTState NRF51UARTState; -#define NRF51_UART(obj) OBJECT_CHECK(NRF51UARTState, (obj), TYPE_NRF51_UAR= T) +DECLARE_INSTANCE_CHECKER(NRF51UARTState, NRF51_UART, + TYPE_NRF51_UART) =20 REG32(UART_STARTRX, 0x000) REG32(UART_STOPRX, 0x004) diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h index ddbd8ad45b..80de4ecde6 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -23,7 +23,8 @@ =20 #define TYPE_PL011 "pl011" typedef struct PL011State PL011State; -#define PL011(obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011) +DECLARE_INSTANCE_CHECKER(PL011State, PL011, + TYPE_PL011) =20 /* This shares the same struct (and cast macro) as the base pl011 device */ #define TYPE_PL011_LUMINARY "pl011_luminary" diff --git a/include/hw/char/renesas_sci.h b/include/hw/char/renesas_sci.h index 5a5ebfd28c..a4764e3eee 100644 --- a/include/hw/char/renesas_sci.h +++ b/include/hw/char/renesas_sci.h @@ -15,7 +15,8 @@ =20 #define TYPE_RENESAS_SCI "renesas-sci" typedef struct RSCIState RSCIState; -#define RSCI(obj) OBJECT_CHECK(RSCIState, (obj), TYPE_RENESAS_SCI) +DECLARE_INSTANCE_CHECKER(RSCIState, RSCI, + TYPE_RENESAS_SCI) =20 enum { ERI =3D 0, diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index dbeef43676..264f529a7f 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -104,13 +104,16 @@ extern const MemoryRegionOps serial_io_ops; void serial_set_frequency(SerialState *s, uint32_t frequency); =20 #define TYPE_SERIAL "serial" -#define SERIAL(s) OBJECT_CHECK(SerialState, (s), TYPE_SERIAL) +DECLARE_INSTANCE_CHECKER(SerialState, SERIAL, + TYPE_SERIAL) =20 #define TYPE_SERIAL_MM "serial-mm" -#define SERIAL_MM(s) OBJECT_CHECK(SerialMM, (s), TYPE_SERIAL_MM) +DECLARE_INSTANCE_CHECKER(SerialMM, SERIAL_MM, + TYPE_SERIAL_MM) =20 #define TYPE_SERIAL_IO "serial-io" -#define SERIAL_IO(s) OBJECT_CHECK(SerialIO, (s), TYPE_SERIAL_IO) +DECLARE_INSTANCE_CHECKER(SerialIO, SERIAL_IO, + TYPE_SERIAL_IO) =20 SerialMM *serial_mm_init(MemoryRegion *address_space, hwaddr base, int regshift, diff --git a/include/hw/char/stm32f2xx_usart.h b/include/hw/char/stm32f2xx_= usart.h index c44faca751..1670c076d4 100644 --- a/include/hw/char/stm32f2xx_usart.h +++ b/include/hw/char/stm32f2xx_usart.h @@ -55,8 +55,8 @@ =20 #define TYPE_STM32F2XX_USART "stm32f2xx-usart" typedef struct STM32F2XXUsartState STM32F2XXUsartState; -#define STM32F2XX_USART(obj) \ - OBJECT_CHECK(STM32F2XXUsartState, (obj), TYPE_STM32F2XX_USART) +DECLARE_INSTANCE_CHECKER(STM32F2XXUsartState, STM32F2XX_USART, + TYPE_STM32F2XX_USART) =20 struct STM32F2XXUsartState { /* */ diff --git a/include/hw/clock.h b/include/hw/clock.h index 65cf363dd5..b524509b47 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -19,7 +19,8 @@ =20 #define TYPE_CLOCK "clock" typedef struct Clock Clock; -#define CLOCK(obj) OBJECT_CHECK(Clock, (obj), TYPE_CLOCK) +DECLARE_INSTANCE_CHECKER(Clock, CLOCK, + TYPE_CLOCK) =20 typedef void ClockCallback(void *opaque); =20 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5f319b9d22..59ff021228 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -63,8 +63,8 @@ typedef uint64_t vaddr; #define CPU(obj) ((CPUState *)(obj)) =20 typedef struct CPUClass CPUClass; -#define CPU_CLASS(class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU) -#define CPU_GET_CLASS(obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU) +DECLARE_CLASS_CHECKERS(CPUClass, CPU, + TYPE_CPU) =20 typedef enum MMUAccessType { MMU_DATA_LOAD =3D 0, diff --git a/include/hw/core/generic-loader.h b/include/hw/core/generic-loa= der.h index f435af1884..8e86532df6 100644 --- a/include/hw/core/generic-loader.h +++ b/include/hw/core/generic-loader.h @@ -43,7 +43,7 @@ struct GenericLoaderState { typedef struct GenericLoaderState GenericLoaderState; =20 #define TYPE_GENERIC_LOADER "loader" -#define GENERIC_LOADER(obj) OBJECT_CHECK(GenericLoaderState, (obj), \ - TYPE_GENERIC_LOADER) +DECLARE_INSTANCE_CHECKER(GenericLoaderState, GENERIC_LOADER, + TYPE_GENERIC_LOADER) =20 #endif diff --git a/include/hw/core/split-irq.h b/include/hw/core/split-irq.h index 872a39aa4f..76d42b29aa 100644 --- a/include/hw/core/split-irq.h +++ b/include/hw/core/split-irq.h @@ -44,7 +44,8 @@ =20 typedef struct SplitIRQ SplitIRQ; =20 -#define SPLIT_IRQ(obj) OBJECT_CHECK(SplitIRQ, (obj), TYPE_SPLIT_IRQ) +DECLARE_INSTANCE_CHECKER(SplitIRQ, SPLIT_IRQ, + TYPE_SPLIT_IRQ) =20 struct SplitIRQ { DeviceState parent_obj; diff --git a/include/hw/cpu/a15mpcore.h b/include/hw/cpu/a15mpcore.h index 01415728d0..58d8ac7415 100644 --- a/include/hw/cpu/a15mpcore.h +++ b/include/hw/cpu/a15mpcore.h @@ -28,8 +28,8 @@ =20 #define TYPE_A15MPCORE_PRIV "a15mpcore_priv" typedef struct A15MPPrivState A15MPPrivState; -#define A15MPCORE_PRIV(obj) \ - OBJECT_CHECK(A15MPPrivState, (obj), TYPE_A15MPCORE_PRIV) +DECLARE_INSTANCE_CHECKER(A15MPPrivState, A15MPCORE_PRIV, + TYPE_A15MPCORE_PRIV) =20 struct A15MPPrivState { /*< private >*/ diff --git a/include/hw/cpu/a9mpcore.h b/include/hw/cpu/a9mpcore.h index 1a3b32cc4c..37e5cfce08 100644 --- a/include/hw/cpu/a9mpcore.h +++ b/include/hw/cpu/a9mpcore.h @@ -19,8 +19,8 @@ =20 #define TYPE_A9MPCORE_PRIV "a9mpcore_priv" typedef struct A9MPPrivState A9MPPrivState; -#define A9MPCORE_PRIV(obj) \ - OBJECT_CHECK(A9MPPrivState, (obj), TYPE_A9MPCORE_PRIV) +DECLARE_INSTANCE_CHECKER(A9MPPrivState, A9MPCORE_PRIV, + TYPE_A9MPCORE_PRIV) =20 struct A9MPPrivState { /*< private >*/ diff --git a/include/hw/cpu/arm11mpcore.h b/include/hw/cpu/arm11mpcore.h index 5a5575b86d..411d7e6659 100644 --- a/include/hw/cpu/arm11mpcore.h +++ b/include/hw/cpu/arm11mpcore.h @@ -18,8 +18,8 @@ =20 #define TYPE_ARM11MPCORE_PRIV "arm11mpcore_priv" typedef struct ARM11MPCorePriveState ARM11MPCorePriveState; -#define ARM11MPCORE_PRIV(obj) \ - OBJECT_CHECK(ARM11MPCorePriveState, (obj), TYPE_ARM11MPCORE_PRIV) +DECLARE_INSTANCE_CHECKER(ARM11MPCorePriveState, ARM11MPCORE_PRIV, + TYPE_ARM11MPCORE_PRIV) =20 struct ARM11MPCorePriveState { SysBusDevice parent_obj; diff --git a/include/hw/cpu/cluster.h b/include/hw/cpu/cluster.h index faacf9757e..1c807c5902 100644 --- a/include/hw/cpu/cluster.h +++ b/include/hw/cpu/cluster.h @@ -56,8 +56,8 @@ =20 #define TYPE_CPU_CLUSTER "cpu-cluster" typedef struct CPUClusterState CPUClusterState; -#define CPU_CLUSTER(obj) \ - OBJECT_CHECK(CPUClusterState, (obj), TYPE_CPU_CLUSTER) +DECLARE_INSTANCE_CHECKER(CPUClusterState, CPU_CLUSTER, + TYPE_CPU_CLUSTER) =20 /* * This limit is imposed by TCG, which puts the cluster ID into an diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h index 850191527e..61ea3481f8 100644 --- a/include/hw/cpu/core.h +++ b/include/hw/cpu/core.h @@ -15,8 +15,8 @@ #define TYPE_CPU_CORE "cpu-core" =20 typedef struct CPUCore CPUCore; -#define CPU_CORE(obj) \ - OBJECT_CHECK(CPUCore, (obj), TYPE_CPU_CORE) +DECLARE_INSTANCE_CHECKER(CPUCore, CPU_CORE, + TYPE_CPU_CORE) =20 struct CPUCore { /*< private >*/ diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_f= b.h index 5fc4d74a06..226d77a264 100644 --- a/include/hw/display/bcm2835_fb.h +++ b/include/hw/display/bcm2835_fb.h @@ -18,7 +18,8 @@ =20 #define TYPE_BCM2835_FB "bcm2835-fb" typedef struct BCM2835FBState BCM2835FBState; -#define BCM2835_FB(obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_F= B) +DECLARE_INSTANCE_CHECKER(BCM2835FBState, BCM2835_FB, + TYPE_BCM2835_FB) =20 /* * Configuration information about the fb which the guest can program diff --git a/include/hw/display/dpcd.h b/include/hw/display/dpcd.h index 6b96a463a7..09304dd1f6 100644 --- a/include/hw/display/dpcd.h +++ b/include/hw/display/dpcd.h @@ -29,7 +29,8 @@ typedef struct DPCDState DPCDState; =20 #define TYPE_DPCD "dpcd" -#define DPCD(obj) OBJECT_CHECK(DPCDState, (obj), TYPE_DPCD) +DECLARE_INSTANCE_CHECKER(DPCDState, DPCD, + TYPE_DPCD) =20 /* DCPD Revision. */ #define DPCD_REVISION 0x00 diff --git a/include/hw/display/i2c-ddc.h b/include/hw/display/i2c-ddc.h index 8ab50641aa..fbabfea5a9 100644 --- a/include/hw/display/i2c-ddc.h +++ b/include/hw/display/i2c-ddc.h @@ -37,6 +37,7 @@ struct I2CDDCState { typedef struct I2CDDCState I2CDDCState; =20 #define TYPE_I2CDDC "i2c-ddc" -#define I2CDDC(obj) OBJECT_CHECK(I2CDDCState, (obj), TYPE_I2CDDC) +DECLARE_INSTANCE_CHECKER(I2CDDCState, I2CDDC, + TYPE_I2CDDC) =20 #endif /* I2C_DDC_H */ diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index d330ee9823..0960480b75 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -33,8 +33,8 @@ typedef struct MacfbState { =20 #define TYPE_MACFB "sysbus-macfb" typedef struct MacfbSysBusState MacfbSysBusState; -#define MACFB(obj) \ - OBJECT_CHECK(MacfbSysBusState, (obj), TYPE_MACFB) +DECLARE_INSTANCE_CHECKER(MacfbSysBusState, MACFB, + TYPE_MACFB) =20 struct MacfbSysBusState { SysBusDevice busdev; @@ -45,10 +45,8 @@ struct MacfbSysBusState { #define TYPE_NUBUS_MACFB "nubus-macfb" typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass; typedef struct MacfbNubusState MacfbNubusState; -#define NUBUS_MACFB_CLASS(class) \ - OBJECT_CLASS_CHECK(MacfbNubusDeviceClass, (class), TYPE_NUBUS_MACFB) -#define NUBUS_MACFB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MacfbNubusDeviceClass, (obj), TYPE_NUBUS_MACFB) +DECLARE_OBJ_CHECKERS(MacfbNubusState, MacfbNubusDeviceClass, + NUBUS_MACFB, TYPE_NUBUS_MACFB) =20 struct MacfbNubusDeviceClass { DeviceClass parent_class; @@ -56,8 +54,6 @@ struct MacfbNubusDeviceClass { DeviceRealize parent_realize; }; =20 -#define NUBUS_MACFB(obj) \ - OBJECT_CHECK(MacfbNubusState, (obj), TYPE_NUBUS_MACFB) =20 struct MacfbNubusState { NubusDevice busdev; diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index f76bde2e77..3b7d9e5a2a 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -106,6 +106,7 @@ struct XlnxDPState { typedef struct XlnxDPState XlnxDPState; =20 #define TYPE_XLNX_DP "xlnx.v-dp" -#define XLNX_DP(obj) OBJECT_CHECK(XlnxDPState, (obj), TYPE_XLNX_DP) +DECLARE_INSTANCE_CHECKER(XlnxDPState, XLNX_DP, + TYPE_XLNX_DP) =20 #endif diff --git a/include/hw/dma/bcm2835_dma.h b/include/hw/dma/bcm2835_dma.h index 31f335ec5b..b94dae779a 100644 --- a/include/hw/dma/bcm2835_dma.h +++ b/include/hw/dma/bcm2835_dma.h @@ -27,8 +27,8 @@ typedef struct { =20 #define TYPE_BCM2835_DMA "bcm2835-dma" typedef struct BCM2835DMAState BCM2835DMAState; -#define BCM2835_DMA(obj) \ - OBJECT_CHECK(BCM2835DMAState, (obj), TYPE_BCM2835_DMA) +DECLARE_INSTANCE_CHECKER(BCM2835DMAState, BCM2835_DMA, + TYPE_BCM2835_DMA) =20 #define BCM2835_DMA_NCHANS 16 =20 diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 46eef1f581..362ce7b8dc 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -7,8 +7,8 @@ =20 #define TYPE_I8257 "i8257" typedef struct I8257State I8257State; -#define I8257(obj) \ - OBJECT_CHECK(I8257State, (obj), TYPE_I8257) +DECLARE_INSTANCE_CHECKER(I8257State, I8257, + TYPE_I8257) =20 typedef struct I8257Regs { int now[2]; diff --git a/include/hw/dma/pl080.h b/include/hw/dma/pl080.h index 55a645b055..e9669bf5ae 100644 --- a/include/hw/dma/pl080.h +++ b/include/hw/dma/pl080.h @@ -44,7 +44,8 @@ typedef struct { #define TYPE_PL080 "pl080" #define TYPE_PL081 "pl081" typedef struct PL080State PL080State; -#define PL080(obj) OBJECT_CHECK(PL080State, (obj), TYPE_PL080) +DECLARE_INSTANCE_CHECKER(PL080State, PL080, + TYPE_PL080) =20 struct PL080State { SysBusDevice parent_obj; diff --git a/include/hw/dma/xlnx-zdma.h b/include/hw/dma/xlnx-zdma.h index 8be9ee5cc2..f638abe568 100644 --- a/include/hw/dma/xlnx-zdma.h +++ b/include/hw/dma/xlnx-zdma.h @@ -80,7 +80,7 @@ typedef struct XlnxZDMA XlnxZDMA; =20 #define TYPE_XLNX_ZDMA "xlnx.zdma" =20 -#define XLNX_ZDMA(obj) \ - OBJECT_CHECK(XlnxZDMA, (obj), TYPE_XLNX_ZDMA) +DECLARE_INSTANCE_CHECKER(XlnxZDMA, XLNX_ZDMA, + TYPE_XLNX_ZDMA) =20 #endif /* XLNX_ZDMA_H */ diff --git a/include/hw/dma/xlnx-zynq-devcfg.h b/include/hw/dma/xlnx-zynq-d= evcfg.h index 52ba61b653..e16b08f9c5 100644 --- a/include/hw/dma/xlnx-zynq-devcfg.h +++ b/include/hw/dma/xlnx-zynq-devcfg.h @@ -34,8 +34,8 @@ #define TYPE_XLNX_ZYNQ_DEVCFG "xlnx.ps7-dev-cfg" =20 typedef struct XlnxZynqDevcfg XlnxZynqDevcfg; -#define XLNX_ZYNQ_DEVCFG(obj) \ - OBJECT_CHECK(XlnxZynqDevcfg, (obj), TYPE_XLNX_ZYNQ_DEVCFG) +DECLARE_INSTANCE_CHECKER(XlnxZynqDevcfg, XLNX_ZYNQ_DEVCFG, + TYPE_XLNX_ZYNQ_DEVCFG) =20 #define XLNX_ZYNQ_DEVCFG_R_MAX (0x100 / 4) =20 diff --git a/include/hw/dma/xlnx_dpdma.h b/include/hw/dma/xlnx_dpdma.h index 50952dd7ce..94b01cad0a 100644 --- a/include/hw/dma/xlnx_dpdma.h +++ b/include/hw/dma/xlnx_dpdma.h @@ -46,7 +46,8 @@ struct XlnxDPDMAState { typedef struct XlnxDPDMAState XlnxDPDMAState; =20 #define TYPE_XLNX_DPDMA "xlnx.dpdma" -#define XLNX_DPDMA(obj) OBJECT_CHECK(XlnxDPDMAState, (obj), TYPE_XLNX_DPDM= A) +DECLARE_INSTANCE_CHECKER(XlnxDPDMAState, XLNX_DPDMA, + TYPE_XLNX_DPDMA) =20 /* * xlnx_dpdma_start_operation: Start the operation on the specified channe= l. The diff --git a/include/hw/fw-path-provider.h b/include/hw/fw-path-provider.h index 1231cca63b..8e1d45651c 100644 --- a/include/hw/fw-path-provider.h +++ b/include/hw/fw-path-provider.h @@ -23,10 +23,8 @@ #define TYPE_FW_PATH_PROVIDER "fw-path-provider" =20 typedef struct FWPathProviderClass FWPathProviderClass; -#define FW_PATH_PROVIDER_CLASS(klass) \ - OBJECT_CLASS_CHECK(FWPathProviderClass, (klass), TYPE_FW_PATH_PROVIDE= R) -#define FW_PATH_PROVIDER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(FWPathProviderClass, (obj), TYPE_FW_PATH_PROVIDER) +DECLARE_CLASS_CHECKERS(FWPathProviderClass, FW_PATH_PROVIDER, + TYPE_FW_PATH_PROVIDER) #define FW_PATH_PROVIDER(obj) \ INTERFACE_CHECK(FWPathProvider, (obj), TYPE_FW_PATH_PROVIDER) =20 diff --git a/include/hw/gpio/aspeed_gpio.h b/include/hw/gpio/aspeed_gpio.h index 4dc0bc3f3d..2582e6e0dc 100644 --- a/include/hw/gpio/aspeed_gpio.h +++ b/include/hw/gpio/aspeed_gpio.h @@ -16,11 +16,8 @@ #define TYPE_ASPEED_GPIO "aspeed.gpio" typedef struct AspeedGPIOClass AspeedGPIOClass; typedef struct AspeedGPIOState AspeedGPIOState; -#define ASPEED_GPIO(obj) OBJECT_CHECK(AspeedGPIOState, (obj), TYPE_ASPEED_= GPIO) -#define ASPEED_GPIO_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedGPIOClass, (klass), TYPE_ASPEED_GPIO) -#define ASPEED_GPIO_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedGPIOClass, (obj), TYPE_ASPEED_GPIO) +DECLARE_OBJ_CHECKERS(AspeedGPIOState, AspeedGPIOClass, + ASPEED_GPIO, TYPE_ASPEED_GPIO) =20 #define ASPEED_GPIO_MAX_NR_SETS 8 #define ASPEED_REGS_PER_BANK 14 diff --git a/include/hw/gpio/bcm2835_gpio.h b/include/hw/gpio/bcm2835_gpio.h index d8268f1461..e06e08a0fe 100644 --- a/include/hw/gpio/bcm2835_gpio.h +++ b/include/hw/gpio/bcm2835_gpio.h @@ -36,7 +36,7 @@ struct BCM2835GpioState { typedef struct BCM2835GpioState BCM2835GpioState; =20 #define TYPE_BCM2835_GPIO "bcm2835_gpio" -#define BCM2835_GPIO(obj) \ - OBJECT_CHECK(BCM2835GpioState, (obj), TYPE_BCM2835_GPIO) +DECLARE_INSTANCE_CHECKER(BCM2835GpioState, BCM2835_GPIO, + TYPE_BCM2835_GPIO) =20 #endif diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h index b7dc689f73..a72b272ace 100644 --- a/include/hw/gpio/imx_gpio.h +++ b/include/hw/gpio/imx_gpio.h @@ -25,7 +25,8 @@ =20 #define TYPE_IMX_GPIO "imx.gpio" typedef struct IMXGPIOState IMXGPIOState; -#define IMX_GPIO(obj) OBJECT_CHECK(IMXGPIOState, (obj), TYPE_IMX_GPIO) +DECLARE_INSTANCE_CHECKER(IMXGPIOState, IMX_GPIO, + TYPE_IMX_GPIO) =20 #define IMX_GPIO_MEM_SIZE 0x20 =20 diff --git a/include/hw/gpio/nrf51_gpio.h b/include/hw/gpio/nrf51_gpio.h index 0c37dd74c0..55d7d24a52 100644 --- a/include/hw/gpio/nrf51_gpio.h +++ b/include/hw/gpio/nrf51_gpio.h @@ -30,7 +30,8 @@ #include "qom/object.h" #define TYPE_NRF51_GPIO "nrf51_soc.gpio" typedef struct NRF51GPIOState NRF51GPIOState; -#define NRF51_GPIO(obj) OBJECT_CHECK(NRF51GPIOState, (obj), TYPE_NRF51_GPI= O) +DECLARE_INSTANCE_CHECKER(NRF51GPIOState, NRF51_GPIO, + TYPE_NRF51_GPIO) =20 #define NRF51_GPIO_PINS 32 =20 diff --git a/include/hw/hotplug.h b/include/hw/hotplug.h index 6536bb01a3..e15f59c8b3 100644 --- a/include/hw/hotplug.h +++ b/include/hw/hotplug.h @@ -17,10 +17,8 @@ #define TYPE_HOTPLUG_HANDLER "hotplug-handler" =20 typedef struct HotplugHandlerClass HotplugHandlerClass; -#define HOTPLUG_HANDLER_CLASS(klass) \ - OBJECT_CLASS_CHECK(HotplugHandlerClass, (klass), TYPE_HOTPLUG_HANDLER) -#define HOTPLUG_HANDLER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(HotplugHandlerClass, (obj), TYPE_HOTPLUG_HANDLER) +DECLARE_CLASS_CHECKERS(HotplugHandlerClass, HOTPLUG_HANDLER, + TYPE_HOTPLUG_HANDLER) #define HOTPLUG_HANDLER(obj) \ INTERFACE_CHECK(HotplugHandler, (obj), TYPE_HOTPLUG_HANDLER) =20 diff --git a/include/hw/hyperv/vmbus-bridge.h b/include/hw/hyperv/vmbus-bri= dge.h index d090d46651..1324873775 100644 --- a/include/hw/hyperv/vmbus-bridge.h +++ b/include/hw/hyperv/vmbus-bridge.h @@ -25,7 +25,8 @@ struct VMBusBridge { }; typedef struct VMBusBridge VMBusBridge; =20 -#define VMBUS_BRIDGE(obj) OBJECT_CHECK(VMBusBridge, (obj), TYPE_VMBUS_BRID= GE) +DECLARE_INSTANCE_CHECKER(VMBusBridge, VMBUS_BRIDGE, + TYPE_VMBUS_BRIDGE) =20 static inline VMBusBridge *vmbus_bridge_find(void) { diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h index 282399b8ce..0fe3d3b47c 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -22,16 +22,13 @@ =20 typedef struct VMBusDevice VMBusDevice; typedef struct VMBusDeviceClass VMBusDeviceClass; -#define VMBUS_DEVICE(obj) \ - OBJECT_CHECK(VMBusDevice, (obj), TYPE_VMBUS_DEVICE) -#define VMBUS_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VMBusDeviceClass, (klass), TYPE_VMBUS_DEVICE) -#define VMBUS_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VMBusDeviceClass, (obj), TYPE_VMBUS_DEVICE) +DECLARE_OBJ_CHECKERS(VMBusDevice, VMBusDeviceClass, + VMBUS_DEVICE, TYPE_VMBUS_DEVICE) =20 #define TYPE_VMBUS "vmbus" typedef struct VMBus VMBus; -#define VMBUS(obj) OBJECT_CHECK(VMBus, (obj), TYPE_VMBUS) +DECLARE_INSTANCE_CHECKER(VMBus, VMBUS, + TYPE_VMBUS) =20 /* * Object wrapping a GPADL -- GPA Descriptor List -- an array of guest phy= sical diff --git a/include/hw/i2c/arm_sbcon_i2c.h b/include/hw/i2c/arm_sbcon_i2c.h index ca54867964..ad96781e7a 100644 --- a/include/hw/i2c/arm_sbcon_i2c.h +++ b/include/hw/i2c/arm_sbcon_i2c.h @@ -20,8 +20,8 @@ #define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C =20 typedef struct ArmSbconI2CState ArmSbconI2CState; -#define ARM_SBCON_I2C(obj) \ - OBJECT_CHECK(ArmSbconI2CState, (obj), TYPE_ARM_SBCON_I2C) +DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, ARM_SBCON_I2C, + TYPE_ARM_SBCON_I2C) =20 struct ArmSbconI2CState { /*< private >*/ diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index 2c0198e314..695e1c0928 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -31,8 +31,8 @@ #define TYPE_ASPEED_2600_I2C TYPE_ASPEED_I2C "-ast2600" typedef struct AspeedI2CClass AspeedI2CClass; typedef struct AspeedI2CState AspeedI2CState; -#define ASPEED_I2C(obj) \ - OBJECT_CHECK(AspeedI2CState, (obj), TYPE_ASPEED_I2C) +DECLARE_OBJ_CHECKERS(AspeedI2CState, AspeedI2CClass, + ASPEED_I2C, TYPE_ASPEED_I2C) =20 #define ASPEED_I2C_NR_BUSSES 16 #define ASPEED_I2C_MAX_POOL_SIZE 0x800 @@ -75,10 +75,6 @@ struct AspeedI2CState { AddressSpace dram_as; }; =20 -#define ASPEED_I2C_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedI2CClass, (klass), TYPE_ASPEED_I2C) -#define ASPEED_I2C_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedI2CClass, (obj), TYPE_ASPEED_I2C) =20 struct AspeedI2CClass { SysBusDeviceClass parent_class; diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index a22f861451..2074f7c971 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -20,12 +20,8 @@ typedef struct I2CSlave I2CSlave; =20 #define TYPE_I2C_SLAVE "i2c-slave" typedef struct I2CSlaveClass I2CSlaveClass; -#define I2C_SLAVE(obj) \ - OBJECT_CHECK(I2CSlave, (obj), TYPE_I2C_SLAVE) -#define I2C_SLAVE_CLASS(klass) \ - OBJECT_CLASS_CHECK(I2CSlaveClass, (klass), TYPE_I2C_SLAVE) -#define I2C_SLAVE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(I2CSlaveClass, (obj), TYPE_I2C_SLAVE) +DECLARE_OBJ_CHECKERS(I2CSlave, I2CSlaveClass, + I2C_SLAVE, TYPE_I2C_SLAVE) =20 struct I2CSlaveClass { DeviceClass parent_class; @@ -55,7 +51,8 @@ struct I2CSlave { }; =20 #define TYPE_I2C_BUS "i2c-bus" -#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) +DECLARE_INSTANCE_CHECKER(I2CBus, I2C_BUS, + TYPE_I2C_BUS) =20 typedef struct I2CNode I2CNode; =20 diff --git a/include/hw/i2c/imx_i2c.h b/include/hw/i2c/imx_i2c.h index 285a8f40a4..e7f09104cf 100644 --- a/include/hw/i2c/imx_i2c.h +++ b/include/hw/i2c/imx_i2c.h @@ -26,7 +26,8 @@ =20 #define TYPE_IMX_I2C "imx.i2c" typedef struct IMXI2CState IMXI2CState; -#define IMX_I2C(obj) OBJECT_CHECK(IMXI2CState, (obj), TYPE_IMX_I2C) +DECLARE_INSTANCE_CHECKER(IMXI2CState, IMX_I2C, + TYPE_IMX_I2C) =20 #define IMX_I2C_MEM_SIZE 0x14 =20 diff --git a/include/hw/i2c/microbit_i2c.h b/include/hw/i2c/microbit_i2c.h index 76ffaff47a..69d70287d7 100644 --- a/include/hw/i2c/microbit_i2c.h +++ b/include/hw/i2c/microbit_i2c.h @@ -28,8 +28,8 @@ =20 #define TYPE_MICROBIT_I2C "microbit.i2c" typedef struct MicrobitI2CState MicrobitI2CState; -#define MICROBIT_I2C(obj) \ - OBJECT_CHECK(MicrobitI2CState, (obj), TYPE_MICROBIT_I2C) +DECLARE_INSTANCE_CHECKER(MicrobitI2CState, MICROBIT_I2C, + TYPE_MICROBIT_I2C) =20 #define MICROBIT_I2C_NREGS (NRF51_PERIPHERAL_SIZE / sizeof(uint32_t)) =20 diff --git a/include/hw/i2c/ppc4xx_i2c.h b/include/hw/i2c/ppc4xx_i2c.h index 3698e054b1..7cbcdaf12f 100644 --- a/include/hw/i2c/ppc4xx_i2c.h +++ b/include/hw/i2c/ppc4xx_i2c.h @@ -33,7 +33,8 @@ =20 #define TYPE_PPC4xx_I2C "ppc4xx-i2c" typedef struct PPC4xxI2CState PPC4xxI2CState; -#define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2= C) +DECLARE_INSTANCE_CHECKER(PPC4xxI2CState, PPC4xx_I2C, + TYPE_PPC4xx_I2C) =20 struct PPC4xxI2CState { /*< private >*/ diff --git a/include/hw/i2c/smbus_slave.h b/include/hw/i2c/smbus_slave.h index 17f2cd2d8d..8d16e4bcd9 100644 --- a/include/hw/i2c/smbus_slave.h +++ b/include/hw/i2c/smbus_slave.h @@ -31,12 +31,8 @@ #define TYPE_SMBUS_DEVICE "smbus-device" typedef struct SMBusDevice SMBusDevice; typedef struct SMBusDeviceClass SMBusDeviceClass; -#define SMBUS_DEVICE(obj) \ - OBJECT_CHECK(SMBusDevice, (obj), TYPE_SMBUS_DEVICE) -#define SMBUS_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SMBusDeviceClass, (klass), TYPE_SMBUS_DEVICE) -#define SMBUS_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SMBusDeviceClass, (obj), TYPE_SMBUS_DEVICE) +DECLARE_OBJ_CHECKERS(SMBusDevice, SMBusDeviceClass, + SMBUS_DEVICE, TYPE_SMBUS_DEVICE) =20 =20 struct SMBusDeviceClass { diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_interna= l.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; =20 #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) =20 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); =20 #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) =20 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 @@ =20 #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) =20 #define TYPE_INTEL_IOMMU_MEMORY_REGION "intel-iommu-iommu-memory-region" =20 diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_int= ernal.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; =20 #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) =20 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; =20 #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) =20 #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; =20 #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) =20 /* ioapic.c */ =20 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) =20 #define X86_IOMMU_SID_INVALID (0xffff) =20 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" =20 #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) =20 void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86m= s); =20 diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index 110269f152..4cf6813d80 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -54,15 +54,16 @@ typedef struct AHCIState { typedef struct AHCIPCIState AHCIPCIState; =20 #define TYPE_ICH9_AHCI "ich9-ahci" -#define ICH_AHCI(obj) \ - OBJECT_CHECK(AHCIPCIState, (obj), TYPE_ICH9_AHCI) +DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH_AHCI, + TYPE_ICH9_AHCI) =20 int32_t ahci_get_num_ports(PCIDevice *dev); void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); =20 #define TYPE_SYSBUS_AHCI "sysbus-ahci" typedef struct SysbusAHCIState SysbusAHCIState; -#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_= AHCI) +DECLARE_INSTANCE_CHECKER(SysbusAHCIState, SYSBUS_AHCI, + TYPE_SYSBUS_AHCI) =20 struct SysbusAHCIState { /*< private >*/ @@ -75,8 +76,8 @@ struct SysbusAHCIState { =20 #define TYPE_ALLWINNER_AHCI "allwinner-ahci" typedef struct AllwinnerAHCIState AllwinnerAHCIState; -#define ALLWINNER_AHCI(obj) \ - OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI) +DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState, ALLWINNER_AHCI, + TYPE_ALLWINNER_AHCI) =20 #define ALLWINNER_AHCI_MMIO_OFF 0x80 #define ALLWINNER_AHCI_MMIO_SIZE 0x80 diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 74ea1e324c..eb9eb4e0ae 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -26,7 +26,8 @@ typedef struct IDEDMA IDEDMA; typedef struct IDEDMAOps IDEDMAOps; =20 #define TYPE_IDE_BUS "IDE" -#define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS) +DECLARE_INSTANCE_CHECKER(IDEBus, IDE_BUS, + TYPE_IDE_BUS) =20 #define MAX_IDE_DEVS 2 =20 @@ -488,12 +489,8 @@ struct IDEBus { =20 #define TYPE_IDE_DEVICE "ide-device" typedef struct IDEDeviceClass IDEDeviceClass; -#define IDE_DEVICE(obj) \ - OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE) -#define IDE_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(IDEDeviceClass, (klass), TYPE_IDE_DEVICE) -#define IDE_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE) +DECLARE_OBJ_CHECKERS(IDEDevice, IDEDeviceClass, + IDE_DEVICE, TYPE_IDE_DEVICE) =20 struct IDEDeviceClass { DeviceClass parent_class; diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index 7ed1fa101d..b8d7270ec8 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -41,7 +41,8 @@ typedef struct BMDMAState { =20 #define TYPE_PCI_IDE "pci-ide" typedef struct PCIIDEState PCIIDEState; -#define PCI_IDE(obj) OBJECT_CHECK(PCIIDEState, (obj), TYPE_PCI_IDE) +DECLARE_INSTANCE_CHECKER(PCIIDEState, PCI_IDE, + TYPE_PCI_IDE) =20 struct PCIIDEState { /*< private >*/ diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h index ad89a21176..285f70db55 100644 --- a/include/hw/input/adb.h +++ b/include/hw/input/adb.h @@ -44,7 +44,8 @@ typedef bool ADBDeviceHasData(ADBDevice *d); =20 #define TYPE_ADB_DEVICE "adb-device" typedef struct ADBDeviceClass ADBDeviceClass; -#define ADB_DEVICE(obj) OBJECT_CHECK(ADBDevice, (obj), TYPE_ADB_DEVICE) +DECLARE_OBJ_CHECKERS(ADBDevice, ADBDeviceClass, + ADB_DEVICE, TYPE_ADB_DEVICE) =20 struct ADBDevice { /*< private >*/ @@ -55,10 +56,6 @@ struct ADBDevice { int handler; }; =20 -#define ADB_DEVICE_CLASS(cls) \ - OBJECT_CLASS_CHECK(ADBDeviceClass, (cls), TYPE_ADB_DEVICE) -#define ADB_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ADBDeviceClass, (obj), TYPE_ADB_DEVICE) =20 struct ADBDeviceClass { /*< private >*/ @@ -70,7 +67,8 @@ struct ADBDeviceClass { }; =20 #define TYPE_ADB_BUS "apple-desktop-bus" -#define ADB_BUS(obj) OBJECT_CHECK(ADBBusState, (obj), TYPE_ADB_BUS) +DECLARE_INSTANCE_CHECKER(ADBBusState, ADB_BUS, + TYPE_ADB_BUS) =20 #define ADB_STATUS_BUSTIMEOUT 0x1 #define ADB_STATUS_POLLREPLY 0x2 diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index d4bf584699..f8a3bf88ac 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -13,7 +13,8 @@ =20 #define TYPE_I8042 "i8042" typedef struct ISAKBDState ISAKBDState; -#define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042) +DECLARE_INSTANCE_CHECKER(ISAKBDState, I8042, + TYPE_I8042) =20 #define I8042_A20_LINE "a20" =20 diff --git a/include/hw/intc/allwinner-a10-pic.h b/include/hw/intc/allwinne= r-a10-pic.h index 692d2a88d0..4d7199480a 100644 --- a/include/hw/intc/allwinner-a10-pic.h +++ b/include/hw/intc/allwinner-a10-pic.h @@ -6,7 +6,8 @@ =20 #define TYPE_AW_A10_PIC "allwinner-a10-pic" typedef struct AwA10PICState AwA10PICState; -#define AW_A10_PIC(obj) OBJECT_CHECK(AwA10PICState, (obj), TYPE_AW_A10_PIC) +DECLARE_INSTANCE_CHECKER(AwA10PICState, AW_A10_PIC, + TYPE_AW_A10_PIC) =20 #define AW_A10_PIC_VECTOR 0 #define AW_A10_PIC_BASE_ADDR 4 diff --git a/include/hw/intc/arm_gic_common.h b/include/hw/intc/arm_gic_com= mon.h index 2cbde9b7a9..7080375008 100644 --- a/include/hw/intc/arm_gic_common.h +++ b/include/hw/intc/arm_gic_common.h @@ -149,12 +149,8 @@ typedef struct GICState GICState; =20 #define TYPE_ARM_GIC_COMMON "arm_gic_common" typedef struct ARMGICCommonClass ARMGICCommonClass; -#define ARM_GIC_COMMON(obj) \ - OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC_COMMON) -#define ARM_GIC_COMMON_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMGICCommonClass, (klass), TYPE_ARM_GIC_COMMON) -#define ARM_GIC_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMGICCommonClass, (obj), TYPE_ARM_GIC_COMMON) +DECLARE_OBJ_CHECKERS(GICState, ARMGICCommonClass, + ARM_GIC_COMMON, TYPE_ARM_GIC_COMMON) =20 struct ARMGICCommonClass { /*< private >*/ diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3= _common.h index 86fb060320..0331b0ffdb 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -281,12 +281,8 @@ GICV3_BITMAP_ACCESSORS(edge_trigger) =20 #define TYPE_ARM_GICV3_COMMON "arm-gicv3-common" typedef struct ARMGICv3CommonClass ARMGICv3CommonClass; -#define ARM_GICV3_COMMON(obj) \ - OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3_COMMON) -#define ARM_GICV3_COMMON_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMGICv3CommonClass, (klass), TYPE_ARM_GICV3_COMMO= N) -#define ARM_GICV3_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMGICv3CommonClass, (obj), TYPE_ARM_GICV3_COMMON) +DECLARE_OBJ_CHECKERS(GICv3State, ARMGICv3CommonClass, + ARM_GICV3_COMMON, TYPE_ARM_GICV3_COMMON) =20 struct ARMGICv3CommonClass { /*< private >*/ diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_g= icv3_its_common.h index 03a0fa335b..5a0952b404 100644 --- a/include/hw/intc/arm_gicv3_its_common.h +++ b/include/hw/intc/arm_gicv3_its_common.h @@ -66,12 +66,8 @@ void gicv3_its_init_mmio(GICv3ITSState *s, const MemoryR= egionOps *ops); =20 #define TYPE_ARM_GICV3_ITS_COMMON "arm-gicv3-its-common" typedef struct GICv3ITSCommonClass GICv3ITSCommonClass; -#define ARM_GICV3_ITS_COMMON(obj) \ - OBJECT_CHECK(GICv3ITSState, (obj), TYPE_ARM_GICV3_ITS_COMMON) -#define ARM_GICV3_ITS_COMMON_CLASS(klass) \ - OBJECT_CLASS_CHECK(GICv3ITSCommonClass, (klass), TYPE_ARM_GICV3_ITS_C= OMMON) -#define ARM_GICV3_ITS_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(GICv3ITSCommonClass, (obj), TYPE_ARM_GICV3_ITS_COMMO= N) +DECLARE_OBJ_CHECKERS(GICv3ITSState, GICv3ITSCommonClass, + ARM_GICV3_ITS_COMMON, TYPE_ARM_GICV3_ITS_COMMON) =20 struct GICv3ITSCommonClass { /*< private >*/ diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h index 63098822fa..bb087b23c3 100644 --- a/include/hw/intc/armv7m_nvic.h +++ b/include/hw/intc/armv7m_nvic.h @@ -18,8 +18,8 @@ #define TYPE_NVIC "armv7m_nvic" =20 typedef struct NVICState NVICState; -#define NVIC(obj) \ - OBJECT_CHECK(NVICState, (obj), TYPE_NVIC) +DECLARE_INSTANCE_CHECKER(NVICState, NVIC, + TYPE_NVIC) =20 /* Highest permitted number of exceptions (architectural limit) */ #define NVIC_MAX_VECTORS 512 diff --git a/include/hw/intc/aspeed_vic.h b/include/hw/intc/aspeed_vic.h index f8844b3327..8f2e67db5a 100644 --- a/include/hw/intc/aspeed_vic.h +++ b/include/hw/intc/aspeed_vic.h @@ -18,7 +18,8 @@ =20 #define TYPE_ASPEED_VIC "aspeed.vic" typedef struct AspeedVICState AspeedVICState; -#define ASPEED_VIC(obj) OBJECT_CHECK(AspeedVICState, (obj), TYPE_ASPEED_VI= C) +DECLARE_INSTANCE_CHECKER(AspeedVICState, ASPEED_VIC, + TYPE_ASPEED_VIC) =20 #define ASPEED_VIC_NR_IRQS 51 =20 diff --git a/include/hw/intc/bcm2835_ic.h b/include/hw/intc/bcm2835_ic.h index 4a9f093025..fd4a767845 100644 --- a/include/hw/intc/bcm2835_ic.h +++ b/include/hw/intc/bcm2835_ic.h @@ -13,7 +13,8 @@ =20 #define TYPE_BCM2835_IC "bcm2835-ic" typedef struct BCM2835ICState BCM2835ICState; -#define BCM2835_IC(obj) OBJECT_CHECK(BCM2835ICState, (obj), TYPE_BCM2835_I= C) +DECLARE_INSTANCE_CHECKER(BCM2835ICState, BCM2835_IC, + TYPE_BCM2835_IC) =20 #define BCM2835_IC_GPU_IRQ "gpu-irq" #define BCM2835_IC_ARM_IRQ "arm-irq" diff --git a/include/hw/intc/bcm2836_control.h b/include/hw/intc/bcm2836_co= ntrol.h index 7d8a51fc72..f23292776e 100644 --- a/include/hw/intc/bcm2836_control.h +++ b/include/hw/intc/bcm2836_control.h @@ -25,8 +25,8 @@ =20 #define TYPE_BCM2836_CONTROL "bcm2836-control" typedef struct BCM2836ControlState BCM2836ControlState; -#define BCM2836_CONTROL(obj) \ - OBJECT_CHECK(BCM2836ControlState, (obj), TYPE_BCM2836_CONTROL) +DECLARE_INSTANCE_CHECKER(BCM2836ControlState, BCM2836_CONTROL, + TYPE_BCM2836_CONTROL) =20 struct BCM2836ControlState { /*< private >*/ diff --git a/include/hw/intc/heathrow_pic.h b/include/hw/intc/heathrow_pic.h index bd9fc115a8..f8c9bc20ab 100644 --- a/include/hw/intc/heathrow_pic.h +++ b/include/hw/intc/heathrow_pic.h @@ -31,7 +31,8 @@ =20 #define TYPE_HEATHROW "heathrow" typedef struct HeathrowState HeathrowState; -#define HEATHROW(obj) OBJECT_CHECK(HeathrowState, (obj), TYPE_HEATHROW) +DECLARE_INSTANCE_CHECKER(HeathrowState, HEATHROW, + TYPE_HEATHROW) =20 typedef struct HeathrowPICState { uint32_t events; diff --git a/include/hw/intc/ibex_plic.h b/include/hw/intc/ibex_plic.h index 0125b36267..8da6b03805 100644 --- a/include/hw/intc/ibex_plic.h +++ b/include/hw/intc/ibex_plic.h @@ -24,8 +24,8 @@ =20 #define TYPE_IBEX_PLIC "ibex-plic" typedef struct IbexPlicState IbexPlicState; -#define IBEX_PLIC(obj) \ - OBJECT_CHECK(IbexPlicState, (obj), TYPE_IBEX_PLIC) +DECLARE_INSTANCE_CHECKER(IbexPlicState, IBEX_PLIC, + TYPE_IBEX_PLIC) =20 struct IbexPlicState { /*< private >*/ diff --git a/include/hw/intc/imx_avic.h b/include/hw/intc/imx_avic.h index 124f29f763..621742533c 100644 --- a/include/hw/intc/imx_avic.h +++ b/include/hw/intc/imx_avic.h @@ -22,7 +22,8 @@ =20 #define TYPE_IMX_AVIC "imx.avic" typedef struct IMXAVICState IMXAVICState; -#define IMX_AVIC(obj) OBJECT_CHECK(IMXAVICState, (obj), TYPE_IMX_AVIC) +DECLARE_INSTANCE_CHECKER(IMXAVICState, IMX_AVIC, + TYPE_IMX_AVIC) =20 #define IMX_AVIC_NUM_IRQS 64 =20 diff --git a/include/hw/intc/imx_gpcv2.h b/include/hw/intc/imx_gpcv2.h index 66befda3fd..2d8075e527 100644 --- a/include/hw/intc/imx_gpcv2.h +++ b/include/hw/intc/imx_gpcv2.h @@ -19,6 +19,7 @@ struct IMXGPCv2State { typedef struct IMXGPCv2State IMXGPCv2State; =20 #define TYPE_IMX_GPCV2 "imx-gpcv2" -#define IMX_GPCV2(obj) OBJECT_CHECK(IMXGPCv2State, (obj), TYPE_IMX_GPCV2) +DECLARE_INSTANCE_CHECKER(IMXGPCv2State, IMX_GPCV2, + TYPE_IMX_GPCV2) =20 #endif /* IMX_GPCV2_H */ diff --git a/include/hw/intc/intc.h b/include/hw/intc/intc.h index b51c0ac0f4..7018f608ca 100644 --- a/include/hw/intc/intc.h +++ b/include/hw/intc/intc.h @@ -6,12 +6,8 @@ #define TYPE_INTERRUPT_STATS_PROVIDER "intctrl" =20 typedef struct InterruptStatsProviderClass InterruptStatsProviderClass; -#define INTERRUPT_STATS_PROVIDER_CLASS(klass) \ - OBJECT_CLASS_CHECK(InterruptStatsProviderClass, (klass), \ +DECLARE_CLASS_CHECKERS(InterruptStatsProviderClass, INTERRUPT_STATS_PROVID= ER, TYPE_INTERRUPT_STATS_PROVIDER) -#define INTERRUPT_STATS_PROVIDER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(InterruptStatsProviderClass, (obj), \ - TYPE_INTERRUPT_STATS_PROVIDER) #define INTERRUPT_STATS_PROVIDER(obj) \ INTERFACE_CHECK(InterruptStatsProvider, (obj), \ TYPE_INTERRUPT_STATS_PROVIDER) diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index 5670421e62..65aa3a9a5e 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -172,7 +172,8 @@ =20 #define TYPE_MIPS_GIC "mips-gic" typedef struct MIPSGICState MIPSGICState; -#define MIPS_GIC(obj) OBJECT_CHECK(MIPSGICState, (obj), TYPE_MIPS_GIC) +DECLARE_INSTANCE_CHECKER(MIPSGICState, MIPS_GIC, + TYPE_MIPS_GIC) =20 /* Support up to 32 VPs and 256 IRQs */ #define GIC_MAX_VPS 32 diff --git a/include/hw/intc/realview_gic.h b/include/hw/intc/realview_gic.h index e633992b9c..a93ace87c8 100644 --- a/include/hw/intc/realview_gic.h +++ b/include/hw/intc/realview_gic.h @@ -16,8 +16,8 @@ =20 #define TYPE_REALVIEW_GIC "realview_gic" typedef struct RealViewGICState RealViewGICState; -#define REALVIEW_GIC(obj) \ - OBJECT_CHECK(RealViewGICState, (obj), TYPE_REALVIEW_GIC) +DECLARE_INSTANCE_CHECKER(RealViewGICState, REALVIEW_GIC, + TYPE_REALVIEW_GIC) =20 struct RealViewGICState { SysBusDevice parent_obj; diff --git a/include/hw/intc/rx_icu.h b/include/hw/intc/rx_icu.h index 5660cb4e7f..ec02df35e3 100644 --- a/include/hw/intc/rx_icu.h +++ b/include/hw/intc/rx_icu.h @@ -72,6 +72,7 @@ struct RXICUState { typedef struct RXICUState RXICUState; =20 #define TYPE_RX_ICU "rx-icu" -#define RX_ICU(obj) OBJECT_CHECK(RXICUState, (obj), TYPE_RX_ICU) +DECLARE_INSTANCE_CHECKER(RXICUState, RX_ICU, + TYPE_RX_ICU) =20 #endif /* RX_ICU_H */ diff --git a/include/hw/intc/xlnx-pmu-iomod-intc.h b/include/hw/intc/xlnx-p= mu-iomod-intc.h index fce35ac941..7a560e97af 100644 --- a/include/hw/intc/xlnx-pmu-iomod-intc.h +++ b/include/hw/intc/xlnx-pmu-iomod-intc.h @@ -32,8 +32,8 @@ #define TYPE_XLNX_PMU_IO_INTC "xlnx.pmu_io_intc" =20 typedef struct XlnxPMUIOIntc XlnxPMUIOIntc; -#define XLNX_PMU_IO_INTC(obj) \ - OBJECT_CHECK(XlnxPMUIOIntc, (obj), TYPE_XLNX_PMU_IO_INTC) +DECLARE_INSTANCE_CHECKER(XlnxPMUIOIntc, XLNX_PMU_IO_INTC, + TYPE_XLNX_PMU_IO_INTC) =20 /* This is R_PIT3_CONTROL + 1 */ #define XLNXPMUIOINTC_R_MAX (0x78 + 1) diff --git a/include/hw/intc/xlnx-zynqmp-ipi.h b/include/hw/intc/xlnx-zynqm= p-ipi.h index 9044ca5afe..29c48db307 100644 --- a/include/hw/intc/xlnx-zynqmp-ipi.h +++ b/include/hw/intc/xlnx-zynqmp-ipi.h @@ -32,8 +32,8 @@ #define TYPE_XLNX_ZYNQMP_IPI "xlnx.zynqmp_ipi" =20 typedef struct XlnxZynqMPIPI XlnxZynqMPIPI; -#define XLNX_ZYNQMP_IPI(obj) \ - OBJECT_CHECK(XlnxZynqMPIPI, (obj), TYPE_XLNX_ZYNQMP_IPI) +DECLARE_INSTANCE_CHECKER(XlnxZynqMPIPI, XLNX_ZYNQMP_IPI, + TYPE_XLNX_ZYNQMP_IPI) =20 /* This is R_IPI_IDR + 1 */ #define R_XLNX_ZYNQMP_IPI_MAX ((0x1c / 4) + 1) diff --git a/include/hw/ipack/ipack.h b/include/hw/ipack/ipack.h index ac6105ff8b..a2304c1b3e 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -17,7 +17,8 @@ typedef struct IPackBus IPackBus; =20 #define TYPE_IPACK_BUS "IndustryPack" -#define IPACK_BUS(obj) OBJECT_CHECK(IPackBus, (obj), TYPE_IPACK_BUS) +DECLARE_INSTANCE_CHECKER(IPackBus, IPACK_BUS, + TYPE_IPACK_BUS) =20 struct IPackBus { /*< private >*/ @@ -33,12 +34,8 @@ typedef struct IPackDevice IPackDevice; typedef struct IPackDeviceClass IPackDeviceClass; =20 #define TYPE_IPACK_DEVICE "ipack-device" -#define IPACK_DEVICE(obj) \ - OBJECT_CHECK(IPackDevice, (obj), TYPE_IPACK_DEVICE) -#define IPACK_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(IPackDeviceClass, (klass), TYPE_IPACK_DEVICE) -#define IPACK_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IPackDeviceClass, (obj), TYPE_IPACK_DEVICE) +DECLARE_OBJ_CHECKERS(IPackDevice, IPackDeviceClass, + IPACK_DEVICE, TYPE_IPACK_DEVICE) =20 struct IPackDeviceClass { /*< private >*/ diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index 742c400533..d2ed0a9fc4 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -111,10 +111,8 @@ uint32_t ipmi_next_uuid(void); #define IPMI_INTERFACE(obj) \ INTERFACE_CHECK(IPMIInterface, (obj), TYPE_IPMI_INTERFACE) typedef struct IPMIInterfaceClass IPMIInterfaceClass; -#define IPMI_INTERFACE_CLASS(class) \ - OBJECT_CLASS_CHECK(IPMIInterfaceClass, (class), TYPE_IPMI_INTERFACE) -#define IPMI_INTERFACE_GET_CLASS(class) \ - OBJECT_GET_CLASS(IPMIInterfaceClass, (class), TYPE_IPMI_INTERFACE) +DECLARE_CLASS_CHECKERS(IPMIInterfaceClass, IPMI_INTERFACE, + TYPE_IPMI_INTERFACE) =20 typedef struct IPMIInterface IPMIInterface; =20 @@ -179,12 +177,8 @@ struct IPMIInterfaceClass { #define TYPE_IPMI_BMC "ipmi-bmc" typedef struct IPMIBmc IPMIBmc; typedef struct IPMIBmcClass IPMIBmcClass; -#define IPMI_BMC(obj) \ - OBJECT_CHECK(IPMIBmc, (obj), TYPE_IPMI_BMC) -#define IPMI_BMC_CLASS(obj_class) \ - OBJECT_CLASS_CHECK(IPMIBmcClass, (obj_class), TYPE_IPMI_BMC) -#define IPMI_BMC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IPMIBmcClass, (obj), TYPE_IPMI_BMC) +DECLARE_OBJ_CHECKERS(IPMIBmc, IPMIBmcClass, + IPMI_BMC, TYPE_IPMI_BMC) =20 struct IPMIBmc { DeviceState parent; @@ -272,8 +266,8 @@ void ipmi_bmc_gen_event(IPMIBmc *b, uint8_t *evt, bool = log); =20 #define TYPE_IPMI_BMC_SIMULATOR "ipmi-bmc-sim" typedef struct IPMIBmcSim IPMIBmcSim; -#define IPMI_BMC_SIMULATOR(obj) OBJECT_CHECK(IPMIBmcSim, (obj), \ - TYPE_IPMI_BMC_SIMULATOR) +DECLARE_INSTANCE_CHECKER(IPMIBmcSim, IPMI_BMC_SIMULATOR, + TYPE_IPMI_BMC_SIMULATOR) =20 =20 typedef struct RspBuffer { diff --git a/include/hw/isa/i8259_internal.h b/include/hw/isa/i8259_interna= l.h index 69170df6f8..cd050bb9f2 100644 --- a/include/hw/isa/i8259_internal.h +++ b/include/hw/isa/i8259_internal.h @@ -34,12 +34,8 @@ typedef struct PICCommonState PICCommonState; =20 #define TYPE_PIC_COMMON "pic-common" typedef struct PICCommonClass PICCommonClass; -#define PIC_COMMON(obj) \ - OBJECT_CHECK(PICCommonState, (obj), TYPE_PIC_COMMON) -#define PIC_COMMON_CLASS(klass) \ - OBJECT_CLASS_CHECK(PICCommonClass, (klass), TYPE_PIC_COMMON) -#define PIC_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PICCommonClass, (obj), TYPE_PIC_COMMON) +DECLARE_OBJ_CHECKERS(PICCommonState, PICCommonClass, + PIC_COMMON, TYPE_PIC_COMMON) =20 struct PICCommonClass { ISADeviceClass parent_class; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index c7f27d5aa9..ddb6a2d168 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -12,15 +12,12 @@ =20 #define TYPE_ISA_DEVICE "isa-device" typedef struct ISADeviceClass ISADeviceClass; -#define ISA_DEVICE(obj) \ - OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE) -#define ISA_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(ISADeviceClass, (klass), TYPE_ISA_DEVICE) -#define ISA_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ISADeviceClass, (obj), TYPE_ISA_DEVICE) +DECLARE_OBJ_CHECKERS(ISADevice, ISADeviceClass, + ISA_DEVICE, TYPE_ISA_DEVICE) =20 #define TYPE_ISA_BUS "ISA" -#define ISA_BUS(obj) OBJECT_CHECK(ISABus, (obj), TYPE_ISA_BUS) +DECLARE_INSTANCE_CHECKER(ISABus, ISA_BUS, + TYPE_ISA_BUS) =20 #define TYPE_APPLE_SMC "isa-applesmc" #define APPLESMC_MAX_DATA_LENGTH 32 @@ -39,10 +36,8 @@ static inline uint16_t applesmc_port(void) #define TYPE_ISADMA "isa-dma" =20 typedef struct IsaDmaClass IsaDmaClass; -#define ISADMA_CLASS(klass) \ - OBJECT_CLASS_CHECK(IsaDmaClass, (klass), TYPE_ISADMA) -#define ISADMA_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IsaDmaClass, (obj), TYPE_ISADMA) +DECLARE_CLASS_CHECKERS(IsaDmaClass, ISADMA, + TYPE_ISADMA) #define ISADMA(obj) \ INTERFACE_CHECK(IsaDma, (obj), TYPE_ISADMA) =20 diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index c8e98ea029..a65168a157 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -31,7 +31,8 @@ =20 #define TYPE_PC87312_SUPERIO "pc87312" typedef struct PC87312State PC87312State; -#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERI= O) +DECLARE_INSTANCE_CHECKER(PC87312State, PC87312, + TYPE_PC87312_SUPERIO) =20 struct PC87312State { /*< private >*/ diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index c782c8b64e..b9f5c19155 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -17,12 +17,8 @@ #define TYPE_ISA_SUPERIO "isa-superio" typedef struct ISASuperIOClass ISASuperIOClass; typedef struct ISASuperIODevice ISASuperIODevice; -#define ISA_SUPERIO(obj) \ - OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO) -#define ISA_SUPERIO_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ISASuperIOClass, (obj), TYPE_ISA_SUPERIO) -#define ISA_SUPERIO_CLASS(klass) \ - OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO) +DECLARE_OBJ_CHECKERS(ISASuperIODevice, ISASuperIOClass, + ISA_SUPERIO, TYPE_ISA_SUPERIO) =20 #define SUPERIO_MAX_SERIAL_PORTS 4 =20 diff --git a/include/hw/m68k/mcf_fec.h b/include/hw/m68k/mcf_fec.h index c8ece3cb4b..840c5bbf53 100644 --- a/include/hw/m68k/mcf_fec.h +++ b/include/hw/m68k/mcf_fec.h @@ -13,7 +13,8 @@ =20 #define TYPE_MCF_FEC_NET "mcf-fec" typedef struct mcf_fec_state mcf_fec_state; -#define MCF_FEC_NET(obj) OBJECT_CHECK(mcf_fec_state, (obj), TYPE_MCF_FEC_N= ET) +DECLARE_INSTANCE_CHECKER(mcf_fec_state, MCF_FEC_NET, + TYPE_MCF_FEC_NET) =20 #define FEC_NUM_IRQ 13 =20 diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h index d19bca5942..cde52e83c9 100644 --- a/include/hw/mem/memory-device.h +++ b/include/hw/mem/memory-device.h @@ -20,10 +20,8 @@ #define TYPE_MEMORY_DEVICE "memory-device" =20 typedef struct MemoryDeviceClass MemoryDeviceClass; -#define MEMORY_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(MemoryDeviceClass, (klass), TYPE_MEMORY_DEVICE) -#define MEMORY_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MemoryDeviceClass, (obj), TYPE_MEMORY_DEVICE) +DECLARE_CLASS_CHECKERS(MemoryDeviceClass, MEMORY_DEVICE, + TYPE_MEMORY_DEVICE) #define MEMORY_DEVICE(obj) \ INTERFACE_CHECK(MemoryDeviceState, (obj), TYPE_MEMORY_DEVICE) =20 diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index 4b4a4b5b17..19e3d3092d 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -48,10 +48,8 @@ #define TYPE_NVDIMM "nvdimm" typedef struct NVDIMMClass NVDIMMClass; typedef struct NVDIMMDevice NVDIMMDevice; -#define NVDIMM(obj) OBJECT_CHECK(NVDIMMDevice, (obj), TYPE_NVDIMM) -#define NVDIMM_CLASS(oc) OBJECT_CLASS_CHECK(NVDIMMClass, (oc), TYPE_NVDIMM) -#define NVDIMM_GET_CLASS(obj) OBJECT_GET_CLASS(NVDIMMClass, (obj), \ - TYPE_NVDIMM) +DECLARE_OBJ_CHECKERS(NVDIMMDevice, NVDIMMClass, + NVDIMM, TYPE_NVDIMM) =20 #define NVDIMM_LABEL_SIZE_PROP "label-size" #define NVDIMM_UUID_PROP "uuid" diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 41d4ff39ba..86e3010243 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -23,12 +23,8 @@ #define TYPE_PC_DIMM "pc-dimm" typedef struct PCDIMMDevice PCDIMMDevice; typedef struct PCDIMMDeviceClass PCDIMMDeviceClass; -#define PC_DIMM(obj) \ - OBJECT_CHECK(PCDIMMDevice, (obj), TYPE_PC_DIMM) -#define PC_DIMM_CLASS(oc) \ - OBJECT_CLASS_CHECK(PCDIMMDeviceClass, (oc), TYPE_PC_DIMM) -#define PC_DIMM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCDIMMDeviceClass, (obj), TYPE_PC_DIMM) +DECLARE_OBJ_CHECKERS(PCDIMMDevice, PCDIMMDeviceClass, + PC_DIMM, TYPE_PC_DIMM) =20 #define PC_DIMM_ADDR_PROP "addr" #define PC_DIMM_SLOT_PROP "slot" diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h index ab79a66b1d..849e640570 100644 --- a/include/hw/mips/cps.h +++ b/include/hw/mips/cps.h @@ -30,7 +30,8 @@ =20 #define TYPE_MIPS_CPS "mips-cps" typedef struct MIPSCPSState MIPSCPSState; -#define MIPS_CPS(obj) OBJECT_CHECK(MIPSCPSState, (obj), TYPE_MIPS_CPS) +DECLARE_INSTANCE_CHECKER(MIPSCPSState, MIPS_CPS, + TYPE_MIPS_CPS) =20 struct MIPSCPSState { SysBusDevice parent_obj; diff --git a/include/hw/misc/a9scu.h b/include/hw/misc/a9scu.h index c5481f4dbb..fd1b92e923 100644 --- a/include/hw/misc/a9scu.h +++ b/include/hw/misc/a9scu.h @@ -28,6 +28,7 @@ struct A9SCUState { typedef struct A9SCUState A9SCUState; =20 #define TYPE_A9_SCU "a9-scu" -#define A9_SCU(obj) OBJECT_CHECK(A9SCUState, (obj), TYPE_A9_SCU) +DECLARE_INSTANCE_CHECKER(A9SCUState, A9_SCU, + TYPE_A9_SCU) =20 #endif diff --git a/include/hw/misc/allwinner-cpucfg.h b/include/hw/misc/allwinner= -cpucfg.h index f5420b11d5..058514de15 100644 --- a/include/hw/misc/allwinner-cpucfg.h +++ b/include/hw/misc/allwinner-cpucfg.h @@ -30,8 +30,8 @@ =20 #define TYPE_AW_CPUCFG "allwinner-cpucfg" typedef struct AwCpuCfgState AwCpuCfgState; -#define AW_CPUCFG(obj) \ - OBJECT_CHECK(AwCpuCfgState, (obj), TYPE_AW_CPUCFG) +DECLARE_INSTANCE_CHECKER(AwCpuCfgState, AW_CPUCFG, + TYPE_AW_CPUCFG) =20 /** @} */ =20 diff --git a/include/hw/misc/allwinner-h3-ccu.h b/include/hw/misc/allwinner= -h3-ccu.h index 60f0c56cd9..05f5c7bd8e 100644 --- a/include/hw/misc/allwinner-h3-ccu.h +++ b/include/hw/misc/allwinner-h3-ccu.h @@ -43,8 +43,8 @@ =20 #define TYPE_AW_H3_CCU "allwinner-h3-ccu" typedef struct AwH3ClockCtlState AwH3ClockCtlState; -#define AW_H3_CCU(obj) \ - OBJECT_CHECK(AwH3ClockCtlState, (obj), TYPE_AW_H3_CCU) +DECLARE_INSTANCE_CHECKER(AwH3ClockCtlState, AW_H3_CCU, + TYPE_AW_H3_CCU) =20 /** @} */ =20 diff --git a/include/hw/misc/allwinner-h3-dramc.h b/include/hw/misc/allwinn= er-h3-dramc.h index 0538e598b0..60a13a6958 100644 --- a/include/hw/misc/allwinner-h3-dramc.h +++ b/include/hw/misc/allwinner-h3-dramc.h @@ -59,8 +59,8 @@ =20 #define TYPE_AW_H3_DRAMC "allwinner-h3-dramc" typedef struct AwH3DramCtlState AwH3DramCtlState; -#define AW_H3_DRAMC(obj) \ - OBJECT_CHECK(AwH3DramCtlState, (obj), TYPE_AW_H3_DRAMC) +DECLARE_INSTANCE_CHECKER(AwH3DramCtlState, AW_H3_DRAMC, + TYPE_AW_H3_DRAMC) =20 /** @} */ =20 diff --git a/include/hw/misc/allwinner-h3-sysctrl.h b/include/hw/misc/allwi= nner-h3-sysctrl.h index 7360698f8f..50baa8eb07 100644 --- a/include/hw/misc/allwinner-h3-sysctrl.h +++ b/include/hw/misc/allwinner-h3-sysctrl.h @@ -44,8 +44,8 @@ =20 #define TYPE_AW_H3_SYSCTRL "allwinner-h3-sysctrl" typedef struct AwH3SysCtrlState AwH3SysCtrlState; -#define AW_H3_SYSCTRL(obj) \ - OBJECT_CHECK(AwH3SysCtrlState, (obj), TYPE_AW_H3_SYSCTRL) +DECLARE_INSTANCE_CHECKER(AwH3SysCtrlState, AW_H3_SYSCTRL, + TYPE_AW_H3_SYSCTRL) =20 /** @} */ =20 diff --git a/include/hw/misc/allwinner-sid.h b/include/hw/misc/allwinner-si= d.h index 70cd7cc7c0..b8e83bb7ce 100644 --- a/include/hw/misc/allwinner-sid.h +++ b/include/hw/misc/allwinner-sid.h @@ -31,8 +31,8 @@ =20 #define TYPE_AW_SID "allwinner-sid" typedef struct AwSidState AwSidState; -#define AW_SID(obj) \ - OBJECT_CHECK(AwSidState, (obj), TYPE_AW_SID) +DECLARE_INSTANCE_CHECKER(AwSidState, AW_SID, + TYPE_AW_SID) =20 /** @} */ =20 diff --git a/include/hw/misc/arm11scu.h b/include/hw/misc/arm11scu.h index 7e2e6d2b44..71b4bc9a22 100644 --- a/include/hw/misc/arm11scu.h +++ b/include/hw/misc/arm11scu.h @@ -16,7 +16,8 @@ =20 #define TYPE_ARM11_SCU "arm11-scu" typedef struct ARM11SCUState ARM11SCUState; -#define ARM11_SCU(obj) OBJECT_CHECK(ARM11SCUState, (obj), TYPE_ARM11_SCU) +DECLARE_INSTANCE_CHECKER(ARM11SCUState, ARM11_SCU, + TYPE_ARM11_SCU) =20 struct ARM11SCUState { /*< private >*/ diff --git a/include/hw/misc/armsse-cpuid.h b/include/hw/misc/armsse-cpuid.h index 290a52cf10..80691c7180 100644 --- a/include/hw/misc/armsse-cpuid.h +++ b/include/hw/misc/armsse-cpuid.h @@ -27,7 +27,8 @@ =20 #define TYPE_ARMSSE_CPUID "armsse-cpuid" typedef struct ARMSSECPUID ARMSSECPUID; -#define ARMSSE_CPUID(obj) OBJECT_CHECK(ARMSSECPUID, (obj), TYPE_ARMSSE_CPU= ID) +DECLARE_INSTANCE_CHECKER(ARMSSECPUID, ARMSSE_CPUID, + TYPE_ARMSSE_CPUID) =20 struct ARMSSECPUID { /*< private >*/ diff --git a/include/hw/misc/armsse-mhu.h b/include/hw/misc/armsse-mhu.h index d1ae4a463a..310643a022 100644 --- a/include/hw/misc/armsse-mhu.h +++ b/include/hw/misc/armsse-mhu.h @@ -28,7 +28,8 @@ =20 #define TYPE_ARMSSE_MHU "armsse-mhu" typedef struct ARMSSEMHU ARMSSEMHU; -#define ARMSSE_MHU(obj) OBJECT_CHECK(ARMSSEMHU, (obj), TYPE_ARMSSE_MHU) +DECLARE_INSTANCE_CHECKER(ARMSSEMHU, ARMSSE_MHU, + TYPE_ARMSSE_MHU) =20 struct ARMSSEMHU { /*< private >*/ diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h index feebb1baf6..8d3b14acd4 100644 --- a/include/hw/misc/aspeed_scu.h +++ b/include/hw/misc/aspeed_scu.h @@ -17,7 +17,8 @@ #define TYPE_ASPEED_SCU "aspeed.scu" typedef struct AspeedSCUClass AspeedSCUClass; typedef struct AspeedSCUState AspeedSCUState; -#define ASPEED_SCU(obj) OBJECT_CHECK(AspeedSCUState, (obj), TYPE_ASPEED_SC= U) +DECLARE_OBJ_CHECKERS(AspeedSCUState, AspeedSCUClass, + ASPEED_SCU, TYPE_ASPEED_SCU) #define TYPE_ASPEED_2400_SCU TYPE_ASPEED_SCU "-ast2400" #define TYPE_ASPEED_2500_SCU TYPE_ASPEED_SCU "-ast2500" #define TYPE_ASPEED_2600_SCU TYPE_ASPEED_SCU "-ast2600" @@ -50,10 +51,6 @@ struct AspeedSCUState { =20 extern bool is_supported_silicon_rev(uint32_t silicon_rev); =20 -#define ASPEED_SCU_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedSCUClass, (klass), TYPE_ASPEED_SCU) -#define ASPEED_SCU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedSCUClass, (obj), TYPE_ASPEED_SCU) =20 struct AspeedSCUClass { SysBusDeviceClass parent_class; diff --git a/include/hw/misc/aspeed_sdmc.h b/include/hw/misc/aspeed_sdmc.h index 3d98817715..3375afc89b 100644 --- a/include/hw/misc/aspeed_sdmc.h +++ b/include/hw/misc/aspeed_sdmc.h @@ -15,7 +15,8 @@ #define TYPE_ASPEED_SDMC "aspeed.sdmc" typedef struct AspeedSDMCClass AspeedSDMCClass; typedef struct AspeedSDMCState AspeedSDMCState; -#define ASPEED_SDMC(obj) OBJECT_CHECK(AspeedSDMCState, (obj), TYPE_ASPEED_= SDMC) +DECLARE_OBJ_CHECKERS(AspeedSDMCState, AspeedSDMCClass, + ASPEED_SDMC, TYPE_ASPEED_SDMC) #define TYPE_ASPEED_2400_SDMC TYPE_ASPEED_SDMC "-ast2400" #define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500" #define TYPE_ASPEED_2600_SDMC TYPE_ASPEED_SDMC "-ast2600" @@ -45,10 +46,6 @@ struct AspeedSDMCState { uint64_t max_ram_size; }; =20 -#define ASPEED_SDMC_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedSDMCClass, (klass), TYPE_ASPEED_SDMC) -#define ASPEED_SDMC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedSDMCClass, (obj), TYPE_ASPEED_SDMC) =20 struct AspeedSDMCClass { SysBusDeviceClass parent_class; diff --git a/include/hw/misc/aspeed_xdma.h b/include/hw/misc/aspeed_xdma.h index e5177e2c02..0e62c04520 100644 --- a/include/hw/misc/aspeed_xdma.h +++ b/include/hw/misc/aspeed_xdma.h @@ -14,7 +14,8 @@ =20 #define TYPE_ASPEED_XDMA "aspeed.xdma" typedef struct AspeedXDMAState AspeedXDMAState; -#define ASPEED_XDMA(obj) OBJECT_CHECK(AspeedXDMAState, (obj), TYPE_ASPEED_= XDMA) +DECLARE_INSTANCE_CHECKER(AspeedXDMAState, ASPEED_XDMA, + TYPE_ASPEED_XDMA) =20 #define ASPEED_XDMA_NUM_REGS (ASPEED_XDMA_REG_SIZE / sizeof(uint32_t)) #define ASPEED_XDMA_REG_SIZE 0x7C diff --git a/include/hw/misc/auxbus.h b/include/hw/misc/auxbus.h index f24f2fd789..f910d94118 100644 --- a/include/hw/misc/auxbus.h +++ b/include/hw/misc/auxbus.h @@ -36,7 +36,8 @@ typedef enum AUXReply AUXReply; =20 #define TYPE_AUXTOI2C "aux-to-i2c-bridge" typedef struct AUXTOI2CState AUXTOI2CState; -#define AUXTOI2C(obj) OBJECT_CHECK(AUXTOI2CState, (obj), TYPE_AUXTOI2C) +DECLARE_INSTANCE_CHECKER(AUXTOI2CState, AUXTOI2C, + TYPE_AUXTOI2C) =20 enum AUXCommand { WRITE_I2C =3D 0, @@ -57,7 +58,8 @@ enum AUXReply { }; =20 #define TYPE_AUX_BUS "aux-bus" -#define AUX_BUS(obj) OBJECT_CHECK(AUXBus, (obj), TYPE_AUX_BUS) +DECLARE_INSTANCE_CHECKER(AUXBus, AUX_BUS, + TYPE_AUX_BUS) =20 struct AUXBus { /* < private > */ @@ -76,8 +78,8 @@ struct AUXBus { }; =20 #define TYPE_AUX_SLAVE "aux-slave" -#define AUX_SLAVE(obj) \ - OBJECT_CHECK(AUXSlave, (obj), TYPE_AUX_SLAVE) +DECLARE_INSTANCE_CHECKER(AUXSlave, AUX_SLAVE, + TYPE_AUX_SLAVE) =20 struct AUXSlave { /* < private > */ diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h index c230a2655c..938ab3e21b 100644 --- a/include/hw/misc/avr_power.h +++ b/include/hw/misc/avr_power.h @@ -32,7 +32,8 @@ =20 #define TYPE_AVR_MASK "avr-power" typedef struct AVRMaskState AVRMaskState; -#define AVR_MASK(obj) OBJECT_CHECK(AVRMaskState, (obj), TYPE_AVR_MASK) +DECLARE_INSTANCE_CHECKER(AVRMaskState, AVR_MASK, + TYPE_AVR_MASK) =20 struct AVRMaskState { /* */ diff --git a/include/hw/misc/bcm2835_mbox.h b/include/hw/misc/bcm2835_mbox.h index 3ec6a2f0e8..d8c8017f4e 100644 --- a/include/hw/misc/bcm2835_mbox.h +++ b/include/hw/misc/bcm2835_mbox.h @@ -14,8 +14,8 @@ =20 #define TYPE_BCM2835_MBOX "bcm2835-mbox" typedef struct BCM2835MboxState BCM2835MboxState; -#define BCM2835_MBOX(obj) \ - OBJECT_CHECK(BCM2835MboxState, (obj), TYPE_BCM2835_MBOX) +DECLARE_INSTANCE_CHECKER(BCM2835MboxState, BCM2835_MBOX, + TYPE_BCM2835_MBOX) =20 typedef struct { uint32_t reg[MBOX_SIZE]; diff --git a/include/hw/misc/bcm2835_mphi.h b/include/hw/misc/bcm2835_mphi.h index ce1c273cfb..249511182e 100644 --- a/include/hw/misc/bcm2835_mphi.h +++ b/include/hw/misc/bcm2835_mphi.h @@ -39,7 +39,7 @@ struct BCM2835MphiState { =20 #define TYPE_BCM2835_MPHI "bcm2835-mphi" =20 -#define BCM2835_MPHI(obj) \ - OBJECT_CHECK(BCM2835MphiState, (obj), TYPE_BCM2835_MPHI) +DECLARE_INSTANCE_CHECKER(BCM2835MphiState, BCM2835_MPHI, + TYPE_BCM2835_MPHI) =20 #endif diff --git a/include/hw/misc/bcm2835_property.h b/include/hw/misc/bcm2835_p= roperty.h index 28bf2b49b6..5c827a1900 100644 --- a/include/hw/misc/bcm2835_property.h +++ b/include/hw/misc/bcm2835_property.h @@ -15,8 +15,8 @@ =20 #define TYPE_BCM2835_PROPERTY "bcm2835-property" typedef struct BCM2835PropertyState BCM2835PropertyState; -#define BCM2835_PROPERTY(obj) \ - OBJECT_CHECK(BCM2835PropertyState, (obj), TYPE_BCM2835_PROPERTY) +DECLARE_INSTANCE_CHECKER(BCM2835PropertyState, BCM2835_PROPERTY, + TYPE_BCM2835_PROPERTY) =20 struct BCM2835PropertyState { /*< private >*/ diff --git a/include/hw/misc/bcm2835_rng.h b/include/hw/misc/bcm2835_rng.h index 0921d9b3f1..fec76eef8e 100644 --- a/include/hw/misc/bcm2835_rng.h +++ b/include/hw/misc/bcm2835_rng.h @@ -15,8 +15,8 @@ =20 #define TYPE_BCM2835_RNG "bcm2835-rng" typedef struct BCM2835RngState BCM2835RngState; -#define BCM2835_RNG(obj) \ - OBJECT_CHECK(BCM2835RngState, (obj), TYPE_BCM2835_RNG) +DECLARE_INSTANCE_CHECKER(BCM2835RngState, BCM2835_RNG, + TYPE_BCM2835_RNG) =20 struct BCM2835RngState { SysBusDevice busdev; diff --git a/include/hw/misc/bcm2835_thermal.h b/include/hw/misc/bcm2835_th= ermal.h index 2b937527eb..5b827c970e 100644 --- a/include/hw/misc/bcm2835_thermal.h +++ b/include/hw/misc/bcm2835_thermal.h @@ -15,8 +15,8 @@ #define TYPE_BCM2835_THERMAL "bcm2835-thermal" =20 typedef struct Bcm2835ThermalState Bcm2835ThermalState; -#define BCM2835_THERMAL(obj) \ - OBJECT_CHECK(Bcm2835ThermalState, (obj), TYPE_BCM2835_THERMAL) +DECLARE_INSTANCE_CHECKER(Bcm2835ThermalState, BCM2835_THERMAL, + TYPE_BCM2835_THERMAL) =20 struct Bcm2835ThermalState { /*< private >*/ diff --git a/include/hw/misc/grlib_ahb_apb_pnp.h b/include/hw/misc/grlib_ah= b_apb_pnp.h index 427606fd6b..34b18e3193 100644 --- a/include/hw/misc/grlib_ahb_apb_pnp.h +++ b/include/hw/misc/grlib_ahb_apb_pnp.h @@ -27,13 +27,13 @@ =20 #define TYPE_GRLIB_AHB_PNP "grlib,ahbpnp" typedef struct AHBPnp AHBPnp; -#define GRLIB_AHB_PNP(obj) \ - OBJECT_CHECK(AHBPnp, (obj), TYPE_GRLIB_AHB_PNP) +DECLARE_INSTANCE_CHECKER(AHBPnp, GRLIB_AHB_PNP, + TYPE_GRLIB_AHB_PNP) =20 #define TYPE_GRLIB_APB_PNP "grlib,apbpnp" typedef struct APBPnp APBPnp; -#define GRLIB_APB_PNP(obj) \ - OBJECT_CHECK(APBPnp, (obj), TYPE_GRLIB_APB_PNP) +DECLARE_INSTANCE_CHECKER(APBPnp, GRLIB_APB_PNP, + TYPE_GRLIB_APB_PNP) =20 void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask, uint8_t vendor, uint16_t device, int slave, diff --git a/include/hw/misc/imx25_ccm.h b/include/hw/misc/imx25_ccm.h index 8a7a9b675f..55c5db8815 100644 --- a/include/hw/misc/imx25_ccm.h +++ b/include/hw/misc/imx25_ccm.h @@ -65,7 +65,8 @@ =20 #define TYPE_IMX25_CCM "imx25.ccm" typedef struct IMX25CCMState IMX25CCMState; -#define IMX25_CCM(obj) OBJECT_CHECK(IMX25CCMState, (obj), TYPE_IMX25_CCM) +DECLARE_INSTANCE_CHECKER(IMX25CCMState, IMX25_CCM, + TYPE_IMX25_CCM) =20 struct IMX25CCMState { /* */ diff --git a/include/hw/misc/imx31_ccm.h b/include/hw/misc/imx31_ccm.h index a56ee992af..25e280e976 100644 --- a/include/hw/misc/imx31_ccm.h +++ b/include/hw/misc/imx31_ccm.h @@ -74,7 +74,8 @@ =20 #define TYPE_IMX31_CCM "imx31.ccm" typedef struct IMX31CCMState IMX31CCMState; -#define IMX31_CCM(obj) OBJECT_CHECK(IMX31CCMState, (obj), TYPE_IMX31_CCM) +DECLARE_INSTANCE_CHECKER(IMX31CCMState, IMX31_CCM, + TYPE_IMX31_CCM) =20 struct IMX31CCMState { /* */ diff --git a/include/hw/misc/imx6_ccm.h b/include/hw/misc/imx6_ccm.h index affa13087e..85f32417d6 100644 --- a/include/hw/misc/imx6_ccm.h +++ b/include/hw/misc/imx6_ccm.h @@ -180,7 +180,8 @@ =20 #define TYPE_IMX6_CCM "imx6.ccm" typedef struct IMX6CCMState IMX6CCMState; -#define IMX6_CCM(obj) OBJECT_CHECK(IMX6CCMState, (obj), TYPE_IMX6_CCM) +DECLARE_INSTANCE_CHECKER(IMX6CCMState, IMX6_CCM, + TYPE_IMX6_CCM) =20 struct IMX6CCMState { /* */ diff --git a/include/hw/misc/imx6_src.h b/include/hw/misc/imx6_src.h index f1d70ec177..15b51757ba 100644 --- a/include/hw/misc/imx6_src.h +++ b/include/hw/misc/imx6_src.h @@ -59,7 +59,8 @@ =20 #define TYPE_IMX6_SRC "imx6.src" typedef struct IMX6SRCState IMX6SRCState; -#define IMX6_SRC(obj) OBJECT_CHECK(IMX6SRCState, (obj), TYPE_IMX6_SRC) +DECLARE_INSTANCE_CHECKER(IMX6SRCState, IMX6_SRC, + TYPE_IMX6_SRC) =20 struct IMX6SRCState { /* */ diff --git a/include/hw/misc/imx6ul_ccm.h b/include/hw/misc/imx6ul_ccm.h index 2304c6e738..d614de0edd 100644 --- a/include/hw/misc/imx6ul_ccm.h +++ b/include/hw/misc/imx6ul_ccm.h @@ -209,7 +209,8 @@ =20 #define TYPE_IMX6UL_CCM "imx6ul.ccm" typedef struct IMX6ULCCMState IMX6ULCCMState; -#define IMX6UL_CCM(obj) OBJECT_CHECK(IMX6ULCCMState, (obj), TYPE_IMX6UL_CC= M) +DECLARE_INSTANCE_CHECKER(IMX6ULCCMState, IMX6UL_CCM, + TYPE_IMX6UL_CCM) =20 struct IMX6ULCCMState { /* */ diff --git a/include/hw/misc/imx7_ccm.h b/include/hw/misc/imx7_ccm.h index 9e9e58a5c2..e2757622d0 100644 --- a/include/hw/misc/imx7_ccm.h +++ b/include/hw/misc/imx7_ccm.h @@ -106,7 +106,8 @@ enum IMX7PMURegisters { =20 #define TYPE_IMX7_CCM "imx7.ccm" typedef struct IMX7CCMState IMX7CCMState; -#define IMX7_CCM(obj) OBJECT_CHECK(IMX7CCMState, (obj), TYPE_IMX7_CCM) +DECLARE_INSTANCE_CHECKER(IMX7CCMState, IMX7_CCM, + TYPE_IMX7_CCM) =20 struct IMX7CCMState { /* */ @@ -121,7 +122,8 @@ struct IMX7CCMState { =20 #define TYPE_IMX7_ANALOG "imx7.analog" typedef struct IMX7AnalogState IMX7AnalogState; -#define IMX7_ANALOG(obj) OBJECT_CHECK(IMX7AnalogState, (obj), TYPE_IMX7_AN= ALOG) +DECLARE_INSTANCE_CHECKER(IMX7AnalogState, IMX7_ANALOG, + TYPE_IMX7_ANALOG) =20 struct IMX7AnalogState { /* */ diff --git a/include/hw/misc/imx7_gpr.h b/include/hw/misc/imx7_gpr.h index 83384ec0cc..f80b3ed28c 100644 --- a/include/hw/misc/imx7_gpr.h +++ b/include/hw/misc/imx7_gpr.h @@ -18,7 +18,8 @@ =20 #define TYPE_IMX7_GPR "imx7.gpr" typedef struct IMX7GPRState IMX7GPRState; -#define IMX7_GPR(obj) OBJECT_CHECK(IMX7GPRState, (obj), TYPE_IMX7_GPR) +DECLARE_INSTANCE_CHECKER(IMX7GPRState, IMX7_GPR, + TYPE_IMX7_GPR) =20 struct IMX7GPRState { /* */ diff --git a/include/hw/misc/imx7_snvs.h b/include/hw/misc/imx7_snvs.h index f8659acb7d..ea5395c107 100644 --- a/include/hw/misc/imx7_snvs.h +++ b/include/hw/misc/imx7_snvs.h @@ -25,7 +25,8 @@ enum IMX7SNVSRegisters { =20 #define TYPE_IMX7_SNVS "imx7.snvs" typedef struct IMX7SNVSState IMX7SNVSState; -#define IMX7_SNVS(obj) OBJECT_CHECK(IMX7SNVSState, (obj), TYPE_IMX7_SNVS) +DECLARE_INSTANCE_CHECKER(IMX7SNVSState, IMX7_SNVS, + TYPE_IMX7_SNVS) =20 struct IMX7SNVSState { /* */ diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h index 174248e5df..e9d82a2a50 100644 --- a/include/hw/misc/imx_ccm.h +++ b/include/hw/misc/imx_ccm.h @@ -30,12 +30,8 @@ #define TYPE_IMX_CCM "imx.ccm" typedef struct IMXCCMClass IMXCCMClass; typedef struct IMXCCMState IMXCCMState; -#define IMX_CCM(obj) \ - OBJECT_CHECK(IMXCCMState, (obj), TYPE_IMX_CCM) -#define IMX_CCM_CLASS(klass) \ - OBJECT_CLASS_CHECK(IMXCCMClass, (klass), TYPE_IMX_CCM) -#define IMX_CCM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IMXCCMClass, (obj), TYPE_IMX_CCM) +DECLARE_OBJ_CHECKERS(IMXCCMState, IMXCCMClass, + IMX_CCM, TYPE_IMX_CCM) =20 struct IMXCCMState { /* */ diff --git a/include/hw/misc/imx_rngc.h b/include/hw/misc/imx_rngc.h index cd7ba8f91e..f7b569cac5 100644 --- a/include/hw/misc/imx_rngc.h +++ b/include/hw/misc/imx_rngc.h @@ -15,7 +15,8 @@ =20 #define TYPE_IMX_RNGC "imx.rngc" typedef struct IMXRNGCState IMXRNGCState; -#define IMX_RNGC(obj) OBJECT_CHECK(IMXRNGCState, (obj), TYPE_IMX_RNGC) +DECLARE_INSTANCE_CHECKER(IMXRNGCState, IMX_RNGC, + TYPE_IMX_RNGC) =20 struct IMXRNGCState { /*< private >*/ diff --git a/include/hw/misc/iotkit-secctl.h b/include/hw/misc/iotkit-secct= l.h index 3d54d8f3de..d062ed43e7 100644 --- a/include/hw/misc/iotkit-secctl.h +++ b/include/hw/misc/iotkit-secctl.h @@ -60,7 +60,8 @@ =20 #define TYPE_IOTKIT_SECCTL "iotkit-secctl" typedef struct IoTKitSecCtl IoTKitSecCtl; -#define IOTKIT_SECCTL(obj) OBJECT_CHECK(IoTKitSecCtl, (obj), TYPE_IOTKIT_S= ECCTL) +DECLARE_INSTANCE_CHECKER(IoTKitSecCtl, IOTKIT_SECCTL, + TYPE_IOTKIT_SECCTL) =20 #define IOTS_APB_PPC0_NUM_PORTS 3 #define IOTS_APB_PPC1_NUM_PORTS 1 diff --git a/include/hw/misc/iotkit-sysctl.h b/include/hw/misc/iotkit-sysct= l.h index 27fe6346e6..22ceb5d76d 100644 --- a/include/hw/misc/iotkit-sysctl.h +++ b/include/hw/misc/iotkit-sysctl.h @@ -32,8 +32,8 @@ =20 #define TYPE_IOTKIT_SYSCTL "iotkit-sysctl" typedef struct IoTKitSysCtl IoTKitSysCtl; -#define IOTKIT_SYSCTL(obj) OBJECT_CHECK(IoTKitSysCtl, (obj), \ - TYPE_IOTKIT_SYSCTL) +DECLARE_INSTANCE_CHECKER(IoTKitSysCtl, IOTKIT_SYSCTL, + TYPE_IOTKIT_SYSCTL) =20 struct IoTKitSysCtl { /*< private >*/ diff --git a/include/hw/misc/iotkit-sysinfo.h b/include/hw/misc/iotkit-sysi= nfo.h index e0e610c75c..23ae43e549 100644 --- a/include/hw/misc/iotkit-sysinfo.h +++ b/include/hw/misc/iotkit-sysinfo.h @@ -27,8 +27,8 @@ =20 #define TYPE_IOTKIT_SYSINFO "iotkit-sysinfo" typedef struct IoTKitSysInfo IoTKitSysInfo; -#define IOTKIT_SYSINFO(obj) OBJECT_CHECK(IoTKitSysInfo, (obj), \ - TYPE_IOTKIT_SYSINFO) +DECLARE_INSTANCE_CHECKER(IoTKitSysInfo, IOTKIT_SYSINFO, + TYPE_IOTKIT_SYSINFO) =20 struct IoTKitSysInfo { /*< private >*/ diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h index a59750634f..862cbba3ab 100644 --- a/include/hw/misc/mac_via.h +++ b/include/hw/misc/mac_via.h @@ -33,8 +33,8 @@ =20 #define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1" typedef struct MOS6522Q800VIA1State MOS6522Q800VIA1State; -#define MOS6522_Q800_VIA1(obj) OBJECT_CHECK(MOS6522Q800VIA1State, (obj), \ - TYPE_MOS6522_Q800_VIA1) +DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA1State, MOS6522_Q800_VIA1, + TYPE_MOS6522_Q800_VIA1) =20 struct MOS6522Q800VIA1State { /*< private >*/ @@ -69,8 +69,8 @@ struct MOS6522Q800VIA1State { =20 #define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2" typedef struct MOS6522Q800VIA2State MOS6522Q800VIA2State; -#define MOS6522_Q800_VIA2(obj) OBJECT_CHECK(MOS6522Q800VIA2State, (obj), \ - TYPE_MOS6522_Q800_VIA2) +DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA2State, MOS6522_Q800_VIA2, + TYPE_MOS6522_Q800_VIA2) =20 struct MOS6522Q800VIA2State { /*< private >*/ @@ -80,7 +80,8 @@ struct MOS6522Q800VIA2State { =20 #define TYPE_MAC_VIA "mac_via" typedef struct MacVIAState MacVIAState; -#define MAC_VIA(obj) OBJECT_CHECK(MacVIAState, (obj), TYPE_MAC_VIA) +DECLARE_INSTANCE_CHECKER(MacVIAState, MAC_VIA, + TYPE_MAC_VIA) =20 struct MacVIAState { SysBusDevice busdev; diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h index f2b0069262..e738b6376f 100644 --- a/include/hw/misc/macio/cuda.h +++ b/include/hw/misc/macio/cuda.h @@ -66,13 +66,14 @@ struct MOS6522CUDAState { typedef struct MOS6522CUDAState MOS6522CUDAState; =20 #define TYPE_MOS6522_CUDA "mos6522-cuda" -#define MOS6522_CUDA(obj) OBJECT_CHECK(MOS6522CUDAState, (obj), \ - TYPE_MOS6522_CUDA) +DECLARE_INSTANCE_CHECKER(MOS6522CUDAState, MOS6522_CUDA, + TYPE_MOS6522_CUDA) =20 /* Cuda */ #define TYPE_CUDA "cuda" typedef struct CUDAState CUDAState; -#define CUDA(obj) OBJECT_CHECK(CUDAState, (obj), TYPE_CUDA) +DECLARE_INSTANCE_CHECKER(CUDAState, CUDA, + TYPE_CUDA) =20 struct CUDAState { /*< private >*/ diff --git a/include/hw/misc/macio/gpio.h b/include/hw/misc/macio/gpio.h index 2234873250..1d0c8434ae 100644 --- a/include/hw/misc/macio/gpio.h +++ b/include/hw/misc/macio/gpio.h @@ -32,7 +32,8 @@ =20 #define TYPE_MACIO_GPIO "macio-gpio" typedef struct MacIOGPIOState MacIOGPIOState; -#define MACIO_GPIO(obj) OBJECT_CHECK(MacIOGPIOState, (obj), TYPE_MACIO_GPI= O) +DECLARE_INSTANCE_CHECKER(MacIOGPIOState, MACIO_GPIO, + TYPE_MACIO_GPIO) =20 struct MacIOGPIOState { /*< private >*/ diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 81c28eeef7..02dbf37630 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -41,7 +41,8 @@ /* MacIO virtual bus */ #define TYPE_MACIO_BUS "macio-bus" typedef struct MacIOBusState MacIOBusState; -#define MACIO_BUS(obj) OBJECT_CHECK(MacIOBusState, (obj), TYPE_MACIO_BUS) +DECLARE_INSTANCE_CHECKER(MacIOBusState, MACIO_BUS, + TYPE_MACIO_BUS) =20 struct MacIOBusState { /*< private >*/ @@ -51,7 +52,8 @@ struct MacIOBusState { /* MacIO IDE */ #define TYPE_MACIO_IDE "macio-ide" typedef struct MACIOIDEState MACIOIDEState; -#define MACIO_IDE(obj) OBJECT_CHECK(MACIOIDEState, (obj), TYPE_MACIO_IDE) +DECLARE_INSTANCE_CHECKER(MACIOIDEState, MACIO_IDE, + TYPE_MACIO_IDE) =20 struct MACIOIDEState { /*< private >*/ @@ -78,7 +80,8 @@ void macio_ide_register_dma(MACIOIDEState *ide); =20 #define TYPE_MACIO "macio" typedef struct MacIOState MacIOState; -#define MACIO(obj) OBJECT_CHECK(MacIOState, (obj), TYPE_MACIO) +DECLARE_INSTANCE_CHECKER(MacIOState, MACIO, + TYPE_MACIO) =20 struct MacIOState { /*< private >*/ @@ -96,8 +99,8 @@ struct MacIOState { =20 #define TYPE_OLDWORLD_MACIO "macio-oldworld" typedef struct OldWorldMacIOState OldWorldMacIOState; -#define OLDWORLD_MACIO(obj) \ - OBJECT_CHECK(OldWorldMacIOState, (obj), TYPE_OLDWORLD_MACIO) +DECLARE_INSTANCE_CHECKER(OldWorldMacIOState, OLDWORLD_MACIO, + TYPE_OLDWORLD_MACIO) =20 struct OldWorldMacIOState { /*< private >*/ @@ -112,8 +115,8 @@ struct OldWorldMacIOState { =20 #define TYPE_NEWWORLD_MACIO "macio-newworld" typedef struct NewWorldMacIOState NewWorldMacIOState; -#define NEWWORLD_MACIO(obj) \ - OBJECT_CHECK(NewWorldMacIOState, (obj), TYPE_NEWWORLD_MACIO) +DECLARE_INSTANCE_CHECKER(NewWorldMacIOState, NEWWORLD_MACIO, + TYPE_NEWWORLD_MACIO) =20 struct NewWorldMacIOState { /*< private >*/ diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h index b3982f6f32..0d1a5c1406 100644 --- a/include/hw/misc/macio/pmu.h +++ b/include/hw/misc/macio/pmu.h @@ -181,8 +181,8 @@ struct MOS6522PMUState { typedef struct MOS6522PMUState MOS6522PMUState; =20 #define TYPE_MOS6522_PMU "mos6522-pmu" -#define MOS6522_PMU(obj) OBJECT_CHECK(MOS6522PMUState, (obj), \ - TYPE_MOS6522_PMU) +DECLARE_INSTANCE_CHECKER(MOS6522PMUState, MOS6522_PMU, + TYPE_MOS6522_PMU) /** * PMUState: * @last_b: last value of B register @@ -234,6 +234,7 @@ struct PMUState { typedef struct PMUState PMUState; =20 #define TYPE_VIA_PMU "via-pmu" -#define VIA_PMU(obj) OBJECT_CHECK(PMUState, (obj), TYPE_VIA_PMU) +DECLARE_INSTANCE_CHECKER(PMUState, VIA_PMU, + TYPE_VIA_PMU) =20 #endif /* PMU_H */ diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h index e903a1af9c..6350a3f7c0 100644 --- a/include/hw/misc/max111x.h +++ b/include/hw/misc/max111x.h @@ -49,8 +49,8 @@ typedef struct MAX111xState MAX111xState; =20 #define TYPE_MAX_111X "max111x" =20 -#define MAX_111X(obj) \ - OBJECT_CHECK(MAX111xState, (obj), TYPE_MAX_111X) +DECLARE_INSTANCE_CHECKER(MAX111xState, MAX_111X, + TYPE_MAX_111X) =20 #define TYPE_MAX_1110 "max1110" #define TYPE_MAX_1111 "max1111" diff --git a/include/hw/misc/mips_cmgcr.h b/include/hw/misc/mips_cmgcr.h index a334be8edd..923df4f112 100644 --- a/include/hw/misc/mips_cmgcr.h +++ b/include/hw/misc/mips_cmgcr.h @@ -15,7 +15,8 @@ =20 #define TYPE_MIPS_GCR "mips-gcr" typedef struct MIPSGCRState MIPSGCRState; -#define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR) +DECLARE_INSTANCE_CHECKER(MIPSGCRState, MIPS_GCR, + TYPE_MIPS_GCR) =20 #define GCR_BASE_ADDR 0x1fbf8000ULL #define GCR_ADDRSPACE_SZ 0x8000 diff --git a/include/hw/misc/mips_cpc.h b/include/hw/misc/mips_cpc.h index b0131e4a54..7dc188e8a2 100644 --- a/include/hw/misc/mips_cpc.h +++ b/include/hw/misc/mips_cpc.h @@ -36,7 +36,8 @@ =20 #define TYPE_MIPS_CPC "mips-cpc" typedef struct MIPSCPCState MIPSCPCState; -#define MIPS_CPC(obj) OBJECT_CHECK(MIPSCPCState, (obj), TYPE_MIPS_CPC) +DECLARE_INSTANCE_CHECKER(MIPSCPCState, MIPS_CPC, + TYPE_MIPS_CPC) =20 struct MIPSCPCState { SysBusDevice parent_obj; diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index 9ddb04708a..7c19f61fbb 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -25,7 +25,8 @@ =20 #define TYPE_MIPS_ITU "mips-itu" typedef struct MIPSITUState MIPSITUState; -#define MIPS_ITU(obj) OBJECT_CHECK(MIPSITUState, (obj), TYPE_MIPS_ITU) +DECLARE_INSTANCE_CHECKER(MIPSITUState, MIPS_ITU, + TYPE_MIPS_ITU) =20 #define ITC_CELL_DEPTH_SHIFT 2 #define ITC_CELL_DEPTH (1u << ITC_CELL_DEPTH_SHIFT) diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index b099814879..f73271ba67 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -126,7 +126,8 @@ typedef struct MOS6522State MOS6522State; =20 #define TYPE_MOS6522 "mos6522" typedef struct MOS6522DeviceClass MOS6522DeviceClass; -#define MOS6522(obj) OBJECT_CHECK(MOS6522State, (obj), TYPE_MOS6522) +DECLARE_OBJ_CHECKERS(MOS6522State, MOS6522DeviceClass, + MOS6522, TYPE_MOS6522) =20 struct MOS6522DeviceClass { DeviceClass parent_class; @@ -143,10 +144,6 @@ struct MOS6522DeviceClass { uint64_t (*get_timer2_load_time)(MOS6522State *dev, MOS6522Timer *ti); }; =20 -#define MOS6522_CLASS(cls) \ - OBJECT_CLASS_CHECK(MOS6522DeviceClass, (cls), TYPE_MOS6522) -#define MOS6522_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MOS6522DeviceClass, (obj), TYPE_MOS6522) =20 extern const VMStateDescription vmstate_mos6522; =20 diff --git a/include/hw/misc/mps2-fpgaio.h b/include/hw/misc/mps2-fpgaio.h index e844041bb0..991f5b731e 100644 --- a/include/hw/misc/mps2-fpgaio.h +++ b/include/hw/misc/mps2-fpgaio.h @@ -26,7 +26,8 @@ =20 #define TYPE_MPS2_FPGAIO "mps2-fpgaio" typedef struct MPS2FPGAIO MPS2FPGAIO; -#define MPS2_FPGAIO(obj) OBJECT_CHECK(MPS2FPGAIO, (obj), TYPE_MPS2_FPGAIO) +DECLARE_INSTANCE_CHECKER(MPS2FPGAIO, MPS2_FPGAIO, + TYPE_MPS2_FPGAIO) =20 struct MPS2FPGAIO { /*< private >*/ diff --git a/include/hw/misc/mps2-scc.h b/include/hw/misc/mps2-scc.h index 10393c4e3a..445e268b1f 100644 --- a/include/hw/misc/mps2-scc.h +++ b/include/hw/misc/mps2-scc.h @@ -17,7 +17,8 @@ =20 #define TYPE_MPS2_SCC "mps2-scc" typedef struct MPS2SCC MPS2SCC; -#define MPS2_SCC(obj) OBJECT_CHECK(MPS2SCC, (obj), TYPE_MPS2_SCC) +DECLARE_INSTANCE_CHECKER(MPS2SCC, MPS2_SCC, + TYPE_MPS2_SCC) =20 #define NUM_OSCCLK 3 =20 diff --git a/include/hw/misc/msf2-sysreg.h b/include/hw/misc/msf2-sysreg.h index 6b5d03608a..625932354a 100644 --- a/include/hw/misc/msf2-sysreg.h +++ b/include/hw/misc/msf2-sysreg.h @@ -63,7 +63,8 @@ enum { =20 #define TYPE_MSF2_SYSREG "msf2-sysreg" typedef struct MSF2SysregState MSF2SysregState; -#define MSF2_SYSREG(obj) OBJECT_CHECK(MSF2SysregState, (obj), TYPE_MSF2_S= YSREG) +DECLARE_INSTANCE_CHECKER(MSF2SysregState, MSF2_SYSREG, + TYPE_MSF2_SYSREG) =20 struct MSF2SysregState { SysBusDevice parent_obj; diff --git a/include/hw/misc/nrf51_rng.h b/include/hw/misc/nrf51_rng.h index 247f167100..7f2263a906 100644 --- a/include/hw/misc/nrf51_rng.h +++ b/include/hw/misc/nrf51_rng.h @@ -39,7 +39,8 @@ #include "qom/object.h" #define TYPE_NRF51_RNG "nrf51_soc.rng" typedef struct NRF51RNGState NRF51RNGState; -#define NRF51_RNG(obj) OBJECT_CHECK(NRF51RNGState, (obj), TYPE_NRF51_RNG) +DECLARE_INSTANCE_CHECKER(NRF51RNGState, NRF51_RNG, + TYPE_NRF51_RNG) =20 #define NRF51_RNG_SIZE 0x1000 =20 diff --git a/include/hw/misc/pca9552.h b/include/hw/misc/pca9552.h index ebf8425903..b6f4e264fe 100644 --- a/include/hw/misc/pca9552.h +++ b/include/hw/misc/pca9552.h @@ -15,7 +15,8 @@ #define TYPE_PCA9552 "pca9552" #define TYPE_PCA955X "pca955x" typedef struct PCA955xState PCA955xState; -#define PCA955X(obj) OBJECT_CHECK(PCA955xState, (obj), TYPE_PCA955X) +DECLARE_INSTANCE_CHECKER(PCA955xState, PCA955X, + TYPE_PCA955X) =20 #define PCA955X_NR_REGS 10 #define PCA955X_PIN_COUNT_MAX 16 diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx= _syscfg.h index ff7c976d66..82ccd7cc24 100644 --- a/include/hw/misc/stm32f2xx_syscfg.h +++ b/include/hw/misc/stm32f2xx_syscfg.h @@ -38,8 +38,8 @@ =20 #define TYPE_STM32F2XX_SYSCFG "stm32f2xx-syscfg" typedef struct STM32F2XXSyscfgState STM32F2XXSyscfgState; -#define STM32F2XX_SYSCFG(obj) \ - OBJECT_CHECK(STM32F2XXSyscfgState, (obj), TYPE_STM32F2XX_SYSCFG) +DECLARE_INSTANCE_CHECKER(STM32F2XXSyscfgState, STM32F2XX_SYSCFG, + TYPE_STM32F2XX_SYSCFG) =20 struct STM32F2XXSyscfgState { /* */ diff --git a/include/hw/misc/stm32f4xx_exti.h b/include/hw/misc/stm32f4xx_e= xti.h index 7132615785..4987c286ed 100644 --- a/include/hw/misc/stm32f4xx_exti.h +++ b/include/hw/misc/stm32f4xx_exti.h @@ -38,8 +38,8 @@ =20 #define TYPE_STM32F4XX_EXTI "stm32f4xx-exti" typedef struct STM32F4xxExtiState STM32F4xxExtiState; -#define STM32F4XX_EXTI(obj) \ - OBJECT_CHECK(STM32F4xxExtiState, (obj), TYPE_STM32F4XX_EXTI) +DECLARE_INSTANCE_CHECKER(STM32F4xxExtiState, STM32F4XX_EXTI, + TYPE_STM32F4XX_EXTI) =20 #define NUM_GPIO_EVENT_IN_LINES 16 #define NUM_INTERRUPT_OUT_LINES 16 diff --git a/include/hw/misc/stm32f4xx_syscfg.h b/include/hw/misc/stm32f4xx= _syscfg.h index 78130cb9c3..c3d89d4536 100644 --- a/include/hw/misc/stm32f4xx_syscfg.h +++ b/include/hw/misc/stm32f4xx_syscfg.h @@ -39,8 +39,8 @@ =20 #define TYPE_STM32F4XX_SYSCFG "stm32f4xx-syscfg" typedef struct STM32F4xxSyscfgState STM32F4xxSyscfgState; -#define STM32F4XX_SYSCFG(obj) \ - OBJECT_CHECK(STM32F4xxSyscfgState, (obj), TYPE_STM32F4XX_SYSCFG) +DECLARE_INSTANCE_CHECKER(STM32F4xxSyscfgState, STM32F4XX_SYSCFG, + TYPE_STM32F4XX_SYSCFG) =20 #define SYSCFG_NUM_EXTICR 4 =20 diff --git a/include/hw/misc/tz-mpc.h b/include/hw/misc/tz-mpc.h index 2d3eae0834..34e45fdb97 100644 --- a/include/hw/misc/tz-mpc.h +++ b/include/hw/misc/tz-mpc.h @@ -36,7 +36,8 @@ =20 #define TYPE_TZ_MPC "tz-mpc" typedef struct TZMPC TZMPC; -#define TZ_MPC(obj) OBJECT_CHECK(TZMPC, (obj), TYPE_TZ_MPC) +DECLARE_INSTANCE_CHECKER(TZMPC, TZ_MPC, + TYPE_TZ_MPC) =20 #define TZ_NUM_PORTS 16 =20 diff --git a/include/hw/misc/tz-msc.h b/include/hw/misc/tz-msc.h index 3f719833a9..7169f330ff 100644 --- a/include/hw/misc/tz-msc.h +++ b/include/hw/misc/tz-msc.h @@ -56,7 +56,8 @@ =20 #define TYPE_TZ_MSC "tz-msc" typedef struct TZMSC TZMSC; -#define TZ_MSC(obj) OBJECT_CHECK(TZMSC, (obj), TYPE_TZ_MSC) +DECLARE_INSTANCE_CHECKER(TZMSC, TZ_MSC, + TYPE_TZ_MSC) =20 struct TZMSC { /*< private >*/ diff --git a/include/hw/misc/tz-ppc.h b/include/hw/misc/tz-ppc.h index 4646005fa5..b5251b715e 100644 --- a/include/hw/misc/tz-ppc.h +++ b/include/hw/misc/tz-ppc.h @@ -70,7 +70,8 @@ =20 #define TYPE_TZ_PPC "tz-ppc" typedef struct TZPPC TZPPC; -#define TZ_PPC(obj) OBJECT_CHECK(TZPPC, (obj), TYPE_TZ_PPC) +DECLARE_INSTANCE_CHECKER(TZPPC, TZ_PPC, + TYPE_TZ_PPC) =20 #define TZ_NUM_PORTS 16 =20 diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index 6c04c8a923..7c724bab94 100644 --- a/include/hw/misc/unimp.h +++ b/include/hw/misc/unimp.h @@ -16,8 +16,8 @@ #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device" =20 typedef struct UnimplementedDeviceState UnimplementedDeviceState; -#define UNIMPLEMENTED_DEVICE(obj) \ - OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVIC= E) +DECLARE_INSTANCE_CHECKER(UnimplementedDeviceState, UNIMPLEMENTED_DEVICE, + TYPE_UNIMPLEMENTED_DEVICE) =20 struct UnimplementedDeviceState { SysBusDevice parent_obj; diff --git a/include/hw/misc/vmcoreinfo.h b/include/hw/misc/vmcoreinfo.h index cf0e51f863..ebada6617a 100644 --- a/include/hw/misc/vmcoreinfo.h +++ b/include/hw/misc/vmcoreinfo.h @@ -18,7 +18,8 @@ =20 #define VMCOREINFO_DEVICE "vmcoreinfo" typedef struct VMCoreInfoState VMCoreInfoState; -#define VMCOREINFO(obj) OBJECT_CHECK(VMCoreInfoState, (obj), VMCOREINFO_DE= VICE) +DECLARE_INSTANCE_CHECKER(VMCoreInfoState, VMCOREINFO, + VMCOREINFO_DEVICE) =20 typedef struct fw_cfg_vmcoreinfo FWCfgVMCoreInfo; =20 diff --git a/include/hw/misc/zynq-xadc.h b/include/hw/misc/zynq-xadc.h index 7e9767c74f..052f47954f 100644 --- a/include/hw/misc/zynq-xadc.h +++ b/include/hw/misc/zynq-xadc.h @@ -25,8 +25,8 @@ =20 #define TYPE_ZYNQ_XADC "xlnx,zynq-xadc" typedef struct ZynqXADCState ZynqXADCState; -#define ZYNQ_XADC(obj) \ - OBJECT_CHECK(ZynqXADCState, (obj), TYPE_ZYNQ_XADC) +DECLARE_INSTANCE_CHECKER(ZynqXADCState, ZYNQ_XADC, + TYPE_ZYNQ_XADC) =20 struct ZynqXADCState { /*< private >*/ diff --git a/include/hw/net/allwinner-sun8i-emac.h b/include/hw/net/allwinn= er-sun8i-emac.h index bd38588885..89e56b815b 100644 --- a/include/hw/net/allwinner-sun8i-emac.h +++ b/include/hw/net/allwinner-sun8i-emac.h @@ -31,8 +31,8 @@ =20 #define TYPE_AW_SUN8I_EMAC "allwinner-sun8i-emac" typedef struct AwSun8iEmacState AwSun8iEmacState; -#define AW_SUN8I_EMAC(obj) \ - OBJECT_CHECK(AwSun8iEmacState, (obj), TYPE_AW_SUN8I_EMAC) +DECLARE_INSTANCE_CHECKER(AwSun8iEmacState, AW_SUN8I_EMAC, + TYPE_AW_SUN8I_EMAC) =20 /** @} */ =20 diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_ema= c.h index e927082580..f5f5b67939 100644 --- a/include/hw/net/allwinner_emac.h +++ b/include/hw/net/allwinner_emac.h @@ -32,7 +32,8 @@ =20 #define TYPE_AW_EMAC "allwinner-emac" typedef struct AwEmacState AwEmacState; -#define AW_EMAC(obj) OBJECT_CHECK(AwEmacState, (obj), TYPE_AW_EMAC) +DECLARE_INSTANCE_CHECKER(AwEmacState, AW_EMAC, + TYPE_AW_EMAC) =20 /* * Allwinner EMAC register list diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index 04fd59a525..dff1083738 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -28,7 +28,8 @@ =20 #define TYPE_CADENCE_GEM "cadence_gem" typedef struct CadenceGEMState CadenceGEMState; -#define CADENCE_GEM(obj) OBJECT_CHECK(CadenceGEMState, (obj), TYPE_CADENCE= _GEM) +DECLARE_INSTANCE_CHECKER(CadenceGEMState, CADENCE_GEM, + TYPE_CADENCE_GEM) =20 #include "net/net.h" #include "hw/sysbus.h" diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index 6371bf60ab..c6b1c11fca 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -13,7 +13,8 @@ =20 #define TYPE_FTGMAC100 "ftgmac100" typedef struct FTGMAC100State FTGMAC100State; -#define FTGMAC100(obj) OBJECT_CHECK(FTGMAC100State, (obj), TYPE_FTGMAC100) +DECLARE_INSTANCE_CHECKER(FTGMAC100State, FTGMAC100, + TYPE_FTGMAC100) =20 #include "hw/sysbus.h" #include "net/net.h" @@ -70,7 +71,8 @@ struct FTGMAC100State { =20 #define TYPE_ASPEED_MII "aspeed-mmi" typedef struct AspeedMiiState AspeedMiiState; -#define ASPEED_MII(obj) OBJECT_CHECK(AspeedMiiState, (obj), TYPE_ASPEED_MI= I) +DECLARE_INSTANCE_CHECKER(AspeedMiiState, ASPEED_MII, + TYPE_ASPEED_MII) =20 /* * AST2600 MII controller diff --git a/include/hw/net/imx_fec.h b/include/hw/net/imx_fec.h index 4d6ac5e408..ffdbc304b6 100644 --- a/include/hw/net/imx_fec.h +++ b/include/hw/net/imx_fec.h @@ -27,7 +27,8 @@ =20 #define TYPE_IMX_FEC "imx.fec" typedef struct IMXFECState IMXFECState; -#define IMX_FEC(obj) OBJECT_CHECK(IMXFECState, (obj), TYPE_IMX_FEC) +DECLARE_INSTANCE_CHECKER(IMXFECState, IMX_FEC, + TYPE_IMX_FEC) =20 #define TYPE_IMX_ENET "imx.enet" =20 diff --git a/include/hw/net/lance.h b/include/hw/net/lance.h index fe459ffea7..f645d6af67 100644 --- a/include/hw/net/lance.h +++ b/include/hw/net/lance.h @@ -36,8 +36,8 @@ =20 #define TYPE_LANCE "lance" typedef struct SysBusPCNetState SysBusPCNetState; -#define SYSBUS_PCNET(obj) \ - OBJECT_CHECK(SysBusPCNetState, (obj), TYPE_LANCE) +DECLARE_INSTANCE_CHECKER(SysBusPCNetState, SYSBUS_PCNET, + TYPE_LANCE) =20 struct SysBusPCNetState { SysBusDevice parent_obj; diff --git a/include/hw/net/lasi_82596.h b/include/hw/net/lasi_82596.h index 141e0cc17a..7b62b04833 100644 --- a/include/hw/net/lasi_82596.h +++ b/include/hw/net/lasi_82596.h @@ -14,8 +14,8 @@ =20 #define TYPE_LASI_82596 "lasi_82596" typedef struct SysBusI82596State SysBusI82596State; -#define SYSBUS_I82596(obj) \ - OBJECT_CHECK(SysBusI82596State, (obj), TYPE_LASI_82596) +DECLARE_INSTANCE_CHECKER(SysBusI82596State, SYSBUS_I82596, + TYPE_LASI_82596) =20 struct SysBusI82596State { SysBusDevice parent_obj; diff --git a/include/hw/net/msf2-emac.h b/include/hw/net/msf2-emac.h index 6aef711007..68194d798c 100644 --- a/include/hw/net/msf2-emac.h +++ b/include/hw/net/msf2-emac.h @@ -30,8 +30,8 @@ =20 #define TYPE_MSS_EMAC "msf2-emac" typedef struct MSF2EmacState MSF2EmacState; -#define MSS_EMAC(obj) \ - OBJECT_CHECK(MSF2EmacState, (obj), TYPE_MSS_EMAC) +DECLARE_INSTANCE_CHECKER(MSF2EmacState, MSS_EMAC, + TYPE_MSS_EMAC) =20 #define R_MAX (0x1a0 / 4) #define PHY_MAX_REGS 32 diff --git a/include/hw/nmi.h b/include/hw/nmi.h index 47fc036e74..fff41bebc6 100644 --- a/include/hw/nmi.h +++ b/include/hw/nmi.h @@ -27,10 +27,8 @@ #define TYPE_NMI "nmi" =20 typedef struct NMIClass NMIClass; -#define NMI_CLASS(klass) \ - OBJECT_CLASS_CHECK(NMIClass, (klass), TYPE_NMI) -#define NMI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI) +DECLARE_CLASS_CHECKERS(NMIClass, NMI, + TYPE_NMI) #define NMI(obj) \ INTERFACE_CHECK(NMIState, (obj), TYPE_NMI) =20 diff --git a/include/hw/nubus/mac-nubus-bridge.h b/include/hw/nubus/mac-nub= us-bridge.h index 8407ad21f6..6856d7e095 100644 --- a/include/hw/nubus/mac-nubus-bridge.h +++ b/include/hw/nubus/mac-nubus-bridge.h @@ -14,8 +14,8 @@ =20 #define TYPE_MAC_NUBUS_BRIDGE "mac-nubus-bridge" typedef struct MacNubusState MacNubusState; -#define MAC_NUBUS_BRIDGE(obj) OBJECT_CHECK(MacNubusState, (obj), \ - TYPE_MAC_NUBUS_BRIDGE) +DECLARE_INSTANCE_CHECKER(MacNubusState, MAC_NUBUS_BRIDGE, + TYPE_MAC_NUBUS_BRIDGE) =20 struct MacNubusState { SysBusDevice sysbus_dev; diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index 226efb2ff7..9370f0d8f0 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -24,12 +24,13 @@ =20 #define TYPE_NUBUS_DEVICE "nubus-device" typedef struct NubusDevice NubusDevice; -#define NUBUS_DEVICE(obj) \ - OBJECT_CHECK(NubusDevice, (obj), TYPE_NUBUS_DEVICE) +DECLARE_INSTANCE_CHECKER(NubusDevice, NUBUS_DEVICE, + TYPE_NUBUS_DEVICE) =20 #define TYPE_NUBUS_BUS "nubus-bus" typedef struct NubusBus NubusBus; -#define NUBUS_BUS(obj) OBJECT_CHECK(NubusBus, (obj), TYPE_NUBUS_BUS) +DECLARE_INSTANCE_CHECKER(NubusBus, NUBUS_BUS, + TYPE_NUBUS_BUS) =20 #define TYPE_NUBUS_BRIDGE "nubus-bridge" =20 diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index 5e00fdc21e..f85393400c 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -12,17 +12,16 @@ #define TYPE_FW_CFG_MEM "fw_cfg_mem" #define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator" =20 -#define FW_CFG(obj) OBJECT_CHECK(FWCfgState, (obj), TYPE_FW_CFG) -#define FW_CFG_IO(obj) OBJECT_CHECK(FWCfgIoState, (obj), TYPE_FW_CFG_IO) -#define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM) +DECLARE_INSTANCE_CHECKER(FWCfgState, FW_CFG, + TYPE_FW_CFG) +DECLARE_INSTANCE_CHECKER(FWCfgIoState, FW_CFG_IO, + TYPE_FW_CFG_IO) +DECLARE_INSTANCE_CHECKER(FWCfgMemState, FW_CFG_MEM, + TYPE_FW_CFG_MEM) =20 typedef struct FWCfgDataGeneratorClass FWCfgDataGeneratorClass; -#define FW_CFG_DATA_GENERATOR_CLASS(class) \ - OBJECT_CLASS_CHECK(FWCfgDataGeneratorClass, (class), \ +DECLARE_CLASS_CHECKERS(FWCfgDataGeneratorClass, FW_CFG_DATA_GENERATOR, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE) -#define FW_CFG_DATA_GENERATOR_GET_CLASS(obj) \ - OBJECT_GET_CLASS(FWCfgDataGeneratorClass, (obj), \ - TYPE_FW_CFG_DATA_GENERATOR_INTERFACE) =20 struct FWCfgDataGeneratorClass { /*< private >*/ diff --git a/include/hw/nvram/nrf51_nvm.h b/include/hw/nvram/nrf51_nvm.h index 48871667f1..ab99b09206 100644 --- a/include/hw/nvram/nrf51_nvm.h +++ b/include/hw/nvram/nrf51_nvm.h @@ -26,7 +26,8 @@ #include "qom/object.h" #define TYPE_NRF51_NVM "nrf51_soc.nvm" typedef struct NRF51NVMState NRF51NVMState; -#define NRF51_NVM(obj) OBJECT_CHECK(NRF51NVMState, (obj), TYPE_NRF51_NVM) +DECLARE_INSTANCE_CHECKER(NRF51NVMState, NRF51_NVM, + TYPE_NRF51_NVM) =20 #define NRF51_UICR_FIXTURE_SIZE 64 =20 diff --git a/include/hw/or-irq.h b/include/hw/or-irq.h index 0038bfbe3d..f2f0a27381 100644 --- a/include/hw/or-irq.h +++ b/include/hw/or-irq.h @@ -37,7 +37,8 @@ =20 typedef struct OrIRQState qemu_or_irq; =20 -#define OR_IRQ(obj) OBJECT_CHECK(qemu_or_irq, (obj), TYPE_OR_IRQ) +DECLARE_INSTANCE_CHECKER(qemu_or_irq, OR_IRQ, + TYPE_OR_IRQ) =20 struct OrIRQState { DeviceState parent_obj; diff --git a/include/hw/pci-bridge/simba.h b/include/hw/pci-bridge/simba.h index 300379b94d..675aa5a990 100644 --- a/include/hw/pci-bridge/simba.h +++ b/include/hw/pci-bridge/simba.h @@ -38,7 +38,7 @@ struct SimbaPCIBridge { typedef struct SimbaPCIBridge SimbaPCIBridge; =20 #define TYPE_SIMBA_PCI_BRIDGE "pbm-bridge" -#define SIMBA_PCI_BRIDGE(obj) \ - OBJECT_CHECK(SimbaPCIBridge, (obj), TYPE_SIMBA_PCI_BRIDGE) +DECLARE_INSTANCE_CHECKER(SimbaPCIBridge, SIMBA_PCI_BRIDGE, + TYPE_SIMBA_PCI_BRIDGE) =20 #endif diff --git a/include/hw/pci-host/designware.h b/include/hw/pci-host/designw= are.h index 43ee5b3a12..551eec3107 100644 --- a/include/hw/pci-host/designware.h +++ b/include/hw/pci-host/designware.h @@ -30,13 +30,13 @@ =20 #define TYPE_DESIGNWARE_PCIE_HOST "designware-pcie-host" typedef struct DesignwarePCIEHost DesignwarePCIEHost; -#define DESIGNWARE_PCIE_HOST(obj) \ - OBJECT_CHECK(DesignwarePCIEHost, (obj), TYPE_DESIGNWARE_PCIE_HOST) +DECLARE_INSTANCE_CHECKER(DesignwarePCIEHost, DESIGNWARE_PCIE_HOST, + TYPE_DESIGNWARE_PCIE_HOST) =20 #define TYPE_DESIGNWARE_PCIE_ROOT "designware-pcie-root" typedef struct DesignwarePCIERoot DesignwarePCIERoot; -#define DESIGNWARE_PCIE_ROOT(obj) \ - OBJECT_CHECK(DesignwarePCIERoot, (obj), TYPE_DESIGNWARE_PCIE_ROOT) +DECLARE_INSTANCE_CHECKER(DesignwarePCIERoot, DESIGNWARE_PCIE_ROOT, + TYPE_DESIGNWARE_PCIE_ROOT) =20 struct DesignwarePCIERoot; =20 diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index d70e1c69dc..e8432eced8 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -27,13 +27,13 @@ =20 #define TYPE_GPEX_HOST "gpex-pcihost" typedef struct GPEXHost GPEXHost; -#define GPEX_HOST(obj) \ - OBJECT_CHECK(GPEXHost, (obj), TYPE_GPEX_HOST) +DECLARE_INSTANCE_CHECKER(GPEXHost, GPEX_HOST, + TYPE_GPEX_HOST) =20 #define TYPE_GPEX_ROOT_DEVICE "gpex-root" typedef struct GPEXRootState GPEXRootState; -#define MCH_PCI_DEVICE(obj) \ - OBJECT_CHECK(GPEXRootState, (obj), TYPE_GPEX_ROOT_DEVICE) +DECLARE_INSTANCE_CHECKER(GPEXRootState, MCH_PCI_DEVICE, + TYPE_GPEX_ROOT_DEVICE) =20 #define GPEX_NUM_IRQS 4 =20 diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index 74fe300bff..046c64576d 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -20,8 +20,8 @@ #define TYPE_I440FX_PCI_DEVICE "i440FX" =20 typedef struct PCII440FXState PCII440FXState; -#define I440FX_PCI_DEVICE(obj) \ - OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(PCII440FXState, I440FX_PCI_DEVICE, + TYPE_I440FX_PCI_DEVICE) =20 struct PCII440FXState { /*< private >*/ diff --git a/include/hw/pci-host/pnv_phb3.h b/include/hw/pci-host/pnv_phb3.h index 43f9e873ae..182f29d681 100644 --- a/include/hw/pci-host/pnv_phb3.h +++ b/include/hw/pci-host/pnv_phb3.h @@ -22,7 +22,8 @@ typedef struct PnvPHB3 PnvPHB3; */ #define TYPE_PHB3_MSI "phb3-msi" typedef struct Phb3MsiState Phb3MsiState; -#define PHB3_MSI(obj) OBJECT_CHECK(Phb3MsiState, (obj), TYPE_PHB3_MSI) +DECLARE_INSTANCE_CHECKER(Phb3MsiState, PHB3_MSI, + TYPE_PHB3_MSI) =20 #define PHB3_MAX_MSI 2048 =20 @@ -72,7 +73,8 @@ typedef struct PnvPhb3DMASpace { */ #define TYPE_PNV_PBCQ "pnv-pbcq" typedef struct PnvPBCQState PnvPBCQState; -#define PNV_PBCQ(obj) OBJECT_CHECK(PnvPBCQState, (obj), TYPE_PNV_PBCQ) +DECLARE_INSTANCE_CHECKER(PnvPBCQState, PNV_PBCQ, + TYPE_PNV_PBCQ) =20 struct PnvPBCQState { DeviceState parent; @@ -116,7 +118,8 @@ typedef struct PnvPHB3RootPort { * PHB3 PCIe Host Bridge for PowerNV machines (POWER8) */ #define TYPE_PNV_PHB3 "pnv-phb3" -#define PNV_PHB3(obj) OBJECT_CHECK(PnvPHB3, (obj), TYPE_PNV_PHB3) +DECLARE_INSTANCE_CHECKER(PnvPHB3, PNV_PHB3, + TYPE_PNV_PHB3) =20 #define PNV_PHB3_NUM_M64 16 #define PNV_PHB3_NUM_REGS (0x1000 >> 3) diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 450602cb72..15a4633178 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -58,7 +58,8 @@ typedef struct PnvPHB4RootPort { * PHB4 PCIe Host Bridge for PowerNV machines (POWER9) */ #define TYPE_PNV_PHB4 "pnv-phb4" -#define PNV_PHB4(obj) OBJECT_CHECK(PnvPHB4, (obj), TYPE_PNV_PHB4) +DECLARE_INSTANCE_CHECKER(PnvPHB4, PNV_PHB4, + TYPE_PNV_PHB4) =20 #define PNV_PHB4_MAX_LSIs 8 #define PNV_PHB4_MAX_INTs 4096 @@ -142,12 +143,12 @@ extern const MemoryRegionOps pnv_phb4_xscom_ops; */ #define TYPE_PNV_PHB4_PEC "pnv-phb4-pec" typedef struct PnvPhb4PecClass PnvPhb4PecClass; -#define PNV_PHB4_PEC(obj) \ - OBJECT_CHECK(PnvPhb4PecState, (obj), TYPE_PNV_PHB4_PEC) +DECLARE_OBJ_CHECKERS(PnvPhb4PecState, PnvPhb4PecClass, + PNV_PHB4_PEC, TYPE_PNV_PHB4_PEC) =20 #define TYPE_PNV_PHB4_PEC_STACK "pnv-phb4-pec-stack" -#define PNV_PHB4_PEC_STACK(obj) \ - OBJECT_CHECK(PnvPhb4PecStack, (obj), TYPE_PNV_PHB4_PEC_STACK) +DECLARE_INSTANCE_CHECKER(PnvPhb4PecStack, PNV_PHB4_PEC_STACK, + TYPE_PNV_PHB4_PEC_STACK) =20 /* Per-stack data */ struct PnvPhb4PecStack { @@ -211,10 +212,6 @@ struct PnvPhb4PecState { PnvPhb4PecStack stacks[PHB4_PEC_MAX_STACKS]; }; =20 -#define PNV_PHB4_PEC_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvPhb4PecClass, (klass), TYPE_PNV_PHB4_PEC) -#define PNV_PHB4_PEC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvPhb4PecClass, (obj), TYPE_PNV_PHB4_PEC) =20 struct PnvPhb4PecClass { DeviceClass parent_class; diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index 5db5a763d4..0f5a534f77 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -31,13 +31,13 @@ =20 #define TYPE_Q35_HOST_DEVICE "q35-pcihost" typedef struct Q35PCIHost Q35PCIHost; -#define Q35_HOST_DEVICE(obj) \ - OBJECT_CHECK(Q35PCIHost, (obj), TYPE_Q35_HOST_DEVICE) +DECLARE_INSTANCE_CHECKER(Q35PCIHost, Q35_HOST_DEVICE, + TYPE_Q35_HOST_DEVICE) =20 #define TYPE_MCH_PCI_DEVICE "mch" typedef struct MCHPCIState MCHPCIState; -#define MCH_PCI_DEVICE(obj) \ - OBJECT_CHECK(MCHPCIState, (obj), TYPE_MCH_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(MCHPCIState, MCH_PCI_DEVICE, + TYPE_MCH_PCI_DEVICE) =20 struct MCHPCIState { /*< private >*/ diff --git a/include/hw/pci-host/sabre.h b/include/hw/pci-host/sabre.h index 5fb508e9ce..597bf70d69 100644 --- a/include/hw/pci-host/sabre.h +++ b/include/hw/pci-host/sabre.h @@ -23,8 +23,8 @@ struct SabrePCIState { typedef struct SabrePCIState SabrePCIState; =20 #define TYPE_SABRE_PCI_DEVICE "sabre-pci" -#define SABRE_PCI_DEVICE(obj) \ - OBJECT_CHECK(SabrePCIState, (obj), TYPE_SABRE_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(SabrePCIState, SABRE_PCI_DEVICE, + TYPE_SABRE_PCI_DEVICE) =20 struct SabreState { PCIHostState parent_obj; @@ -51,7 +51,7 @@ struct SabreState { typedef struct SabreState SabreState; =20 #define TYPE_SABRE "sabre" -#define SABRE_DEVICE(obj) \ - OBJECT_CHECK(SabreState, (obj), TYPE_SABRE) +DECLARE_INSTANCE_CHECKER(SabreState, SABRE_DEVICE, + TYPE_SABRE) =20 #endif diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 783e8905df..0431ce1048 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -29,8 +29,8 @@ #define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" =20 typedef struct SpaprPhbState SpaprPhbState; -#define SPAPR_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(SpaprPhbState, (obj), TYPE_SPAPR_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(SpaprPhbState, SPAPR_PCI_HOST_BRIDGE, + TYPE_SPAPR_PCI_HOST_BRIDGE) =20 #define SPAPR_PCI_DMA_MAX_WINDOWS 2 =20 diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h index a1f3aaaecd..d10c598298 100644 --- a/include/hw/pci-host/uninorth.h +++ b/include/hw/pci-host/uninorth.h @@ -38,14 +38,14 @@ #define TYPE_U3_AGP_HOST_BRIDGE "u3-agp-pcihost" =20 typedef struct UNINHostState UNINHostState; -#define UNI_NORTH_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_PCI_HOST_BRIDGE) -#define UNI_NORTH_AGP_HOST_BRIDGE(obj) \ - OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_AGP_HOST_BRIDGE) -#define UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BR= IDGE) -#define U3_AGP_HOST_BRIDGE(obj) \ - OBJECT_CHECK(UNINHostState, (obj), TYPE_U3_AGP_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_PCI_HOST_BRIDGE, + TYPE_UNI_NORTH_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_AGP_HOST_BRIDGE, + TYPE_UNI_NORTH_AGP_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE, + TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(UNINHostState, U3_AGP_HOST_BRIDGE, + TYPE_U3_AGP_HOST_BRIDGE) =20 struct UNINHostState { PCIHostState parent_obj; @@ -66,7 +66,7 @@ struct UNINState { typedef struct UNINState UNINState; =20 #define TYPE_UNI_NORTH "uni-north" -#define UNI_NORTH(obj) \ - OBJECT_CHECK(UNINState, (obj), TYPE_UNI_NORTH) +DECLARE_INSTANCE_CHECKER(UNINState, UNI_NORTH, + TYPE_UNI_NORTH) =20 #endif /* UNINORTH_H */ diff --git a/include/hw/pci-host/xilinx-pcie.h b/include/hw/pci-host/xilinx= -pcie.h index 1cbd6d2f79..6058c8c9e2 100644 --- a/include/hw/pci-host/xilinx-pcie.h +++ b/include/hw/pci-host/xilinx-pcie.h @@ -28,13 +28,13 @@ =20 #define TYPE_XILINX_PCIE_HOST "xilinx-pcie-host" typedef struct XilinxPCIEHost XilinxPCIEHost; -#define XILINX_PCIE_HOST(obj) \ - OBJECT_CHECK(XilinxPCIEHost, (obj), TYPE_XILINX_PCIE_HOST) +DECLARE_INSTANCE_CHECKER(XilinxPCIEHost, XILINX_PCIE_HOST, + TYPE_XILINX_PCIE_HOST) =20 #define TYPE_XILINX_PCIE_ROOT "xilinx-pcie-root" typedef struct XilinxPCIERoot XilinxPCIERoot; -#define XILINX_PCIE_ROOT(obj) \ - OBJECT_CHECK(XilinxPCIERoot, (obj), TYPE_XILINX_PCIE_ROOT) +DECLARE_INSTANCE_CHECKER(XilinxPCIERoot, XILINX_PCIE_ROOT, + TYPE_XILINX_PCIE_ROOT) =20 struct XilinxPCIERoot { PCIBridge parent_obj; diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index be9e298dba..c13ae1f858 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -197,12 +197,8 @@ enum { =20 #define TYPE_PCI_DEVICE "pci-device" typedef struct PCIDeviceClass PCIDeviceClass; -#define PCI_DEVICE(obj) \ - OBJECT_CHECK(PCIDevice, (obj), TYPE_PCI_DEVICE) -#define PCI_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PCIDeviceClass, (klass), TYPE_PCI_DEVICE) -#define PCI_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE) +DECLARE_OBJ_CHECKERS(PCIDevice, PCIDeviceClass, + PCI_DEVICE, TYPE_PCI_DEVICE) =20 /* Implemented by devices that can be plugged on PCI Express buses */ #define INTERFACE_PCIE_DEVICE "pci-express-device" @@ -399,9 +395,8 @@ typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, = int pin); =20 #define TYPE_PCI_BUS "PCI" typedef struct PCIBusClass PCIBusClass; -#define PCI_BUS(obj) OBJECT_CHECK(PCIBus, (obj), TYPE_PCI_BUS) -#define PCI_BUS_CLASS(klass) OBJECT_CLASS_CHECK(PCIBusClass, (klass), TYPE= _PCI_BUS) -#define PCI_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(PCIBusClass, (obj), TYPE_P= CI_BUS) +DECLARE_OBJ_CHECKERS(PCIBus, PCIBusClass, + PCI_BUS, TYPE_PCI_BUS) #define TYPE_PCIE_BUS "PCIE" =20 bool pci_bus_is_express(PCIBus *bus); diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index b46d37faa8..7ab145955a 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -51,7 +51,8 @@ struct PCIBridgeWindows { }; =20 #define TYPE_PCI_BRIDGE "base-pci-bridge" -#define PCI_BRIDGE(obj) OBJECT_CHECK(PCIBridge, (obj), TYPE_PCI_BRIDGE) +DECLARE_INSTANCE_CHECKER(PCIBridge, PCI_BRIDGE, + TYPE_PCI_BRIDGE) =20 struct PCIBridge { /*< private >*/ diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index 51ea53908f..d1fc1c3604 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -33,12 +33,8 @@ =20 #define TYPE_PCI_HOST_BRIDGE "pci-host-bridge" typedef struct PCIHostBridgeClass PCIHostBridgeClass; -#define PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(PCIHostState, (obj), TYPE_PCI_HOST_BRIDGE) -#define PCI_HOST_BRIDGE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PCIHostBridgeClass, (klass), TYPE_PCI_HOST_BRIDGE) -#define PCI_HOST_BRIDGE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCIHostBridgeClass, (obj), TYPE_PCI_HOST_BRIDGE) +DECLARE_OBJ_CHECKERS(PCIHostState, PCIHostBridgeClass, + PCI_HOST_BRIDGE, TYPE_PCI_HOST_BRIDGE) =20 struct PCIHostState { SysBusDevice busdev; diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h index c7d2ae5bf4..f512646c0c 100644 --- a/include/hw/pci/pcie_host.h +++ b/include/hw/pci/pcie_host.h @@ -26,8 +26,8 @@ #include "qom/object.h" =20 #define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge" -#define PCIE_HOST_BRIDGE(obj) \ - OBJECT_CHECK(PCIExpressHost, (obj), TYPE_PCIE_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(PCIExpressHost, PCIE_HOST_BRIDGE, + TYPE_PCIE_HOST_BRIDGE) =20 #define PCIE_HOST_MCFG_BASE "MCFG" #define PCIE_HOST_MCFG_SIZE "mcfg_size" diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h index 765399159f..2463c07fa7 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -26,7 +26,8 @@ #include "qom/object.h" =20 #define TYPE_PCIE_PORT "pcie-port" -#define PCIE_PORT(obj) OBJECT_CHECK(PCIEPort, (obj), TYPE_PCIE_PORT) +DECLARE_INSTANCE_CHECKER(PCIEPort, PCIE_PORT, + TYPE_PCIE_PORT) =20 struct PCIEPort { /*< private >*/ @@ -40,7 +41,8 @@ struct PCIEPort { void pcie_port_init_reg(PCIDevice *d); =20 #define TYPE_PCIE_SLOT "pcie-slot" -#define PCIE_SLOT(obj) OBJECT_CHECK(PCIESlot, (obj), TYPE_PCIE_SLOT) +DECLARE_INSTANCE_CHECKER(PCIESlot, PCIE_SLOT, + TYPE_PCIE_SLOT) =20 struct PCIESlot { /*< private >*/ @@ -69,10 +71,8 @@ void pcie_chassis_del_slot(PCIESlot *s); =20 #define TYPE_PCIE_ROOT_PORT "pcie-root-port-base" typedef struct PCIERootPortClass PCIERootPortClass; -#define PCIE_ROOT_PORT_CLASS(klass) \ - OBJECT_CLASS_CHECK(PCIERootPortClass, (klass), TYPE_PCIE_ROOT_PORT) -#define PCIE_ROOT_PORT_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCIERootPortClass, (obj), TYPE_PCIE_ROOT_PORT) +DECLARE_CLASS_CHECKERS(PCIERootPortClass, PCIE_ROOT_PORT, + TYPE_PCIE_ROOT_PORT) =20 struct PCIERootPortClass { PCIDeviceClass parent_class; diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index 0f9e41db02..fb40ae7e09 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -14,12 +14,8 @@ typedef struct PCMCIASocket { #define TYPE_PCMCIA_CARD "pcmcia-card" typedef struct PCMCIACardClass PCMCIACardClass; typedef struct PCMCIACardState PCMCIACardState; -#define PCMCIA_CARD(obj) \ - OBJECT_CHECK(PCMCIACardState, (obj), TYPE_PCMCIA_CARD) -#define PCMCIA_CARD_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCMCIACardClass, obj, TYPE_PCMCIA_CARD) -#define PCMCIA_CARD_CLASS(cls) \ - OBJECT_CLASS_CHECK(PCMCIACardClass, cls, TYPE_PCMCIA_CARD) +DECLARE_OBJ_CHECKERS(PCMCIACardState, PCMCIACardClass, + PCMCIA_CARD, TYPE_PCMCIA_CARD) =20 struct PCMCIACardState { /*< private >*/ diff --git a/include/hw/platform-bus.h b/include/hw/platform-bus.h index cda1346a4f..0d035e1b71 100644 --- a/include/hw/platform-bus.h +++ b/include/hw/platform-bus.h @@ -28,8 +28,8 @@ typedef struct PlatformBusDevice PlatformBusDevice; =20 #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device" -#define PLATFORM_BUS_DEVICE(obj) \ - OBJECT_CHECK(PlatformBusDevice, (obj), TYPE_PLATFORM_BUS_DEVICE) +DECLARE_INSTANCE_CHECKER(PlatformBusDevice, PLATFORM_BUS_DEVICE, + TYPE_PLATFORM_BUS_DEVICE) =20 struct PlatformBusDevice { /*< private >*/ diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h index e1f42cdbd3..9166d5f758 100644 --- a/include/hw/ppc/mac_dbdma.h +++ b/include/hw/ppc/mac_dbdma.h @@ -178,6 +178,7 @@ void DBDMA_register_channel(void *dbdma, int nchan, qem= u_irq irq, void DBDMA_kick(DBDMAState *dbdma); =20 #define TYPE_MAC_DBDMA "mac-dbdma" -#define MAC_DBDMA(obj) OBJECT_CHECK(DBDMAState, (obj), TYPE_MAC_DBDMA) +DECLARE_INSTANCE_CHECKER(DBDMAState, MAC_DBDMA, + TYPE_MAC_DBDMA) =20 #endif diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h index 81a0b3b1ee..61908c7858 100644 --- a/include/hw/ppc/openpic.h +++ b/include/hw/ppc/openpic.h @@ -138,7 +138,8 @@ typedef struct IRQDest { =20 #define TYPE_OPENPIC "openpic" typedef struct OpenPICState OpenPICState; -#define OPENPIC(obj) OBJECT_CHECK(OpenPICState, (obj), TYPE_OPENPIC) +DECLARE_INSTANCE_CHECKER(OpenPICState, OPENPIC, + TYPE_OPENPIC) =20 struct OpenPICState { /*< private >*/ diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 64f9ee8867..f3bacb6a5c 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -37,11 +37,8 @@ #define TYPE_PNV_CHIP "pnv-chip" typedef struct PnvChip PnvChip; typedef struct PnvChipClass PnvChipClass; -#define PNV_CHIP(obj) OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP) -#define PNV_CHIP_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvChipClass, (klass), TYPE_PNV_CHIP) -#define PNV_CHIP_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvChipClass, (obj), TYPE_PNV_CHIP) +DECLARE_OBJ_CHECKERS(PnvChip, PnvChipClass, + PNV_CHIP, TYPE_PNV_CHIP) =20 struct PnvChip { /*< private >*/ @@ -68,7 +65,8 @@ struct PnvChip { =20 #define TYPE_PNV8_CHIP "pnv8-chip" typedef struct Pnv8Chip Pnv8Chip; -#define PNV8_CHIP(obj) OBJECT_CHECK(Pnv8Chip, (obj), TYPE_PNV8_CHIP) +DECLARE_INSTANCE_CHECKER(Pnv8Chip, PNV8_CHIP, + TYPE_PNV8_CHIP) =20 struct Pnv8Chip { /*< private >*/ @@ -90,7 +88,8 @@ struct Pnv8Chip { =20 #define TYPE_PNV9_CHIP "pnv9-chip" typedef struct Pnv9Chip Pnv9Chip; -#define PNV9_CHIP(obj) OBJECT_CHECK(Pnv9Chip, (obj), TYPE_PNV9_CHIP) +DECLARE_INSTANCE_CHECKER(Pnv9Chip, PNV9_CHIP, + TYPE_PNV9_CHIP) =20 struct Pnv9Chip { /*< private >*/ @@ -118,7 +117,8 @@ struct Pnv9Chip { =20 #define TYPE_PNV10_CHIP "pnv10-chip" typedef struct Pnv10Chip Pnv10Chip; -#define PNV10_CHIP(obj) OBJECT_CHECK(Pnv10Chip, (obj), TYPE_PNV10_CHIP) +DECLARE_INSTANCE_CHECKER(Pnv10Chip, PNV10_CHIP, + TYPE_PNV10_CHIP) =20 struct Pnv10Chip { /*< private >*/ @@ -156,24 +156,24 @@ struct PnvChipClass { #define PNV_CHIP_TYPE_NAME(cpu_model) cpu_model PNV_CHIP_TYPE_SUFFIX =20 #define TYPE_PNV_CHIP_POWER8E PNV_CHIP_TYPE_NAME("power8e_v2.1") -#define PNV_CHIP_POWER8E(obj) \ - OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP_POWER8E) +DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER8E, + TYPE_PNV_CHIP_POWER8E) =20 #define TYPE_PNV_CHIP_POWER8 PNV_CHIP_TYPE_NAME("power8_v2.0") -#define PNV_CHIP_POWER8(obj) \ - OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP_POWER8) +DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER8, + TYPE_PNV_CHIP_POWER8) =20 #define TYPE_PNV_CHIP_POWER8NVL PNV_CHIP_TYPE_NAME("power8nvl_v1.0") -#define PNV_CHIP_POWER8NVL(obj) \ - OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP_POWER8NVL) +DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER8NVL, + TYPE_PNV_CHIP_POWER8NVL) =20 #define TYPE_PNV_CHIP_POWER9 PNV_CHIP_TYPE_NAME("power9_v2.0") -#define PNV_CHIP_POWER9(obj) \ - OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP_POWER9) +DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER9, + TYPE_PNV_CHIP_POWER9) =20 #define TYPE_PNV_CHIP_POWER10 PNV_CHIP_TYPE_NAME("power10_v1.0") -#define PNV_CHIP_POWER10(obj) \ - OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP_POWER10) +DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER10, + TYPE_PNV_CHIP_POWER10) =20 /* * This generates a HW chip id depending on an index, as found on a @@ -199,12 +199,8 @@ PowerPCCPU *pnv_chip_find_cpu(PnvChip *chip, uint32_t = pir); #define TYPE_PNV_MACHINE MACHINE_TYPE_NAME("powernv") typedef struct PnvMachineClass PnvMachineClass; typedef struct PnvMachineState PnvMachineState; -#define PNV_MACHINE(obj) \ - OBJECT_CHECK(PnvMachineState, (obj), TYPE_PNV_MACHINE) -#define PNV_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvMachineClass, obj, TYPE_PNV_MACHINE) -#define PNV_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvMachineClass, klass, TYPE_PNV_MACHINE) +DECLARE_OBJ_CHECKERS(PnvMachineState, PnvMachineClass, + PNV_MACHINE, TYPE_PNV_MACHINE) =20 =20 struct PnvMachineClass { diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index 2d91a7d519..fd17a236e3 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -27,12 +27,8 @@ #define TYPE_PNV_CORE "powernv-cpu-core" typedef struct PnvCore PnvCore; typedef struct PnvCoreClass PnvCoreClass; -#define PNV_CORE(obj) \ - OBJECT_CHECK(PnvCore, (obj), TYPE_PNV_CORE) -#define PNV_CORE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvCoreClass, (klass), TYPE_PNV_CORE) -#define PNV_CORE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvCoreClass, (obj), TYPE_PNV_CORE) +DECLARE_OBJ_CHECKERS(PnvCore, PnvCoreClass, + PNV_CORE, TYPE_PNV_CORE) =20 typedef struct PnvChip PnvChip; =20 @@ -69,8 +65,8 @@ static inline PnvCPUState *pnv_cpu_state(PowerPCCPU *cpu) =20 #define TYPE_PNV_QUAD "powernv-cpu-quad" typedef struct PnvQuad PnvQuad; -#define PNV_QUAD(obj) \ - OBJECT_CHECK(PnvQuad, (obj), TYPE_PNV_QUAD) +DECLARE_INSTANCE_CHECKER(PnvQuad, PNV_QUAD, + TYPE_PNV_QUAD) =20 struct PnvQuad { DeviceState parent_obj; diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h index bedba94e18..7aadcab03c 100644 --- a/include/hw/ppc/pnv_homer.h +++ b/include/hw/ppc/pnv_homer.h @@ -26,11 +26,14 @@ #define TYPE_PNV_HOMER "pnv-homer" typedef struct PnvHomer PnvHomer; typedef struct PnvHomerClass PnvHomerClass; -#define PNV_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV_HOMER) +DECLARE_OBJ_CHECKERS(PnvHomer, PnvHomerClass, + PNV_HOMER, TYPE_PNV_HOMER) #define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8" -#define PNV8_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV8_HOMER) +DECLARE_INSTANCE_CHECKER(PnvHomer, PNV8_HOMER, + TYPE_PNV8_HOMER) #define TYPE_PNV9_HOMER TYPE_PNV_HOMER "-POWER9" -#define PNV9_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV9_HOMER) +DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER, + TYPE_PNV9_HOMER) =20 struct PnvHomer { DeviceState parent; @@ -40,10 +43,6 @@ struct PnvHomer { MemoryRegion regs; }; =20 -#define PNV_HOMER_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvHomerClass, (klass), TYPE_PNV_HOMER) -#define PNV_HOMER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvHomerClass, (obj), TYPE_PNV_HOMER) =20 struct PnvHomerClass { DeviceClass parent_class; diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h index 50d92517f2..cd3c13c2a8 100644 --- a/include/hw/ppc/pnv_lpc.h +++ b/include/hw/ppc/pnv_lpc.h @@ -26,16 +26,19 @@ #define TYPE_PNV_LPC "pnv-lpc" typedef struct PnvLpcClass PnvLpcClass; typedef struct PnvLpcController PnvLpcController; -#define PNV_LPC(obj) \ - OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV_LPC) +DECLARE_OBJ_CHECKERS(PnvLpcController, PnvLpcClass, + PNV_LPC, TYPE_PNV_LPC) #define TYPE_PNV8_LPC TYPE_PNV_LPC "-POWER8" -#define PNV8_LPC(obj) OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV8_LPC) +DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV8_LPC, + TYPE_PNV8_LPC) =20 #define TYPE_PNV9_LPC TYPE_PNV_LPC "-POWER9" -#define PNV9_LPC(obj) OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV9_LPC) +DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC, + TYPE_PNV9_LPC) =20 #define TYPE_PNV10_LPC TYPE_PNV_LPC "-POWER10" -#define PNV10_LPC(obj) OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV10_LP= C) +DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV10_LPC, + TYPE_PNV10_LPC) =20 struct PnvLpcController { DeviceState parent; @@ -84,10 +87,6 @@ struct PnvLpcController { PnvPsi *psi; }; =20 -#define PNV_LPC_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvLpcClass, (klass), TYPE_PNV_LPC) -#define PNV_LPC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvLpcClass, (obj), TYPE_PNV_LPC) =20 struct PnvLpcClass { DeviceClass parent_class; diff --git a/include/hw/ppc/pnv_occ.h b/include/hw/ppc/pnv_occ.h index 30a9faea78..4fcfb32417 100644 --- a/include/hw/ppc/pnv_occ.h +++ b/include/hw/ppc/pnv_occ.h @@ -26,11 +26,14 @@ #define TYPE_PNV_OCC "pnv-occ" typedef struct PnvOCC PnvOCC; typedef struct PnvOCCClass PnvOCCClass; -#define PNV_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV_OCC) +DECLARE_OBJ_CHECKERS(PnvOCC, PnvOCCClass, + PNV_OCC, TYPE_PNV_OCC) #define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8" -#define PNV8_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV8_OCC) +DECLARE_INSTANCE_CHECKER(PnvOCC, PNV8_OCC, + TYPE_PNV8_OCC) #define TYPE_PNV9_OCC TYPE_PNV_OCC "-POWER9" -#define PNV9_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV9_OCC) +DECLARE_INSTANCE_CHECKER(PnvOCC, PNV9_OCC, + TYPE_PNV9_OCC) =20 #define PNV_OCC_SENSOR_DATA_BLOCK_OFFSET 0x00580000 #define PNV_OCC_SENSOR_DATA_BLOCK_SIZE 0x00025800 @@ -47,10 +50,6 @@ struct PnvOCC { MemoryRegion sram_regs; }; =20 -#define PNV_OCC_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvOCCClass, (klass), TYPE_PNV_OCC) -#define PNV_OCC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvOCCClass, (obj), TYPE_PNV_OCC) =20 struct PnvOCCClass { DeviceClass parent_class; diff --git a/include/hw/ppc/pnv_pnor.h b/include/hw/ppc/pnv_pnor.h index 8b27bf111c..1ec4098bb9 100644 --- a/include/hw/ppc/pnv_pnor.h +++ b/include/hw/ppc/pnv_pnor.h @@ -17,7 +17,8 @@ =20 #define TYPE_PNV_PNOR "pnv-pnor" typedef struct PnvPnor PnvPnor; -#define PNV_PNOR(obj) OBJECT_CHECK(PnvPnor, (obj), TYPE_PNV_PNOR) +DECLARE_INSTANCE_CHECKER(PnvPnor, PNV_PNOR, + TYPE_PNV_PNOR) =20 struct PnvPnor { SysBusDevice parent_obj; diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index 060a7a110c..a33195df17 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -28,8 +28,8 @@ #define TYPE_PNV_PSI "pnv-psi" typedef struct PnvPsi PnvPsi; typedef struct PnvPsiClass PnvPsiClass; -#define PNV_PSI(obj) \ - OBJECT_CHECK(PnvPsi, (obj), TYPE_PNV_PSI) +DECLARE_OBJ_CHECKERS(PnvPsi, PnvPsiClass, + PNV_PSI, TYPE_PNV_PSI) =20 #define PSIHB_XSCOM_MAX 0x20 =20 @@ -54,8 +54,8 @@ struct PnvPsi { =20 #define TYPE_PNV8_PSI TYPE_PNV_PSI "-POWER8" typedef struct Pnv8Psi Pnv8Psi; -#define PNV8_PSI(obj) \ - OBJECT_CHECK(Pnv8Psi, (obj), TYPE_PNV8_PSI) +DECLARE_INSTANCE_CHECKER(Pnv8Psi, PNV8_PSI, + TYPE_PNV8_PSI) =20 struct Pnv8Psi { PnvPsi parent; @@ -65,8 +65,8 @@ struct Pnv8Psi { =20 #define TYPE_PNV9_PSI TYPE_PNV_PSI "-POWER9" typedef struct Pnv9Psi Pnv9Psi; -#define PNV9_PSI(obj) \ - OBJECT_CHECK(Pnv9Psi, (obj), TYPE_PNV9_PSI) +DECLARE_INSTANCE_CHECKER(Pnv9Psi, PNV9_PSI, + TYPE_PNV9_PSI) =20 struct Pnv9Psi { PnvPsi parent; @@ -76,10 +76,6 @@ struct Pnv9Psi { =20 #define TYPE_PNV10_PSI TYPE_PNV_PSI "-POWER10" =20 -#define PNV_PSI_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvPsiClass, (klass), TYPE_PNV_PSI) -#define PNV_PSI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvPsiClass, (obj), TYPE_PNV_PSI) =20 struct PnvPsiClass { SysBusDeviceClass parent_class; diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index 24c37de184..a014e2a726 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -18,11 +18,8 @@ struct PnvChip; #define TYPE_PNV_XIVE "pnv-xive" typedef struct PnvXive PnvXive; typedef struct PnvXiveClass PnvXiveClass; -#define PNV_XIVE(obj) OBJECT_CHECK(PnvXive, (obj), TYPE_PNV_XIVE) -#define PNV_XIVE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvXiveClass, (klass), TYPE_PNV_XIVE) -#define PNV_XIVE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvXiveClass, (obj), TYPE_PNV_XIVE) +DECLARE_OBJ_CHECKERS(PnvXive, PnvXiveClass, + PNV_XIVE, TYPE_PNV_XIVE) =20 #define XIVE_BLOCK_MAX 16 =20 diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index fb9b97f5be..7e3b189c07 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -28,11 +28,8 @@ typedef struct PnvXScomInterface PnvXScomInterface; #define PNV_XSCOM_INTERFACE(obj) \ INTERFACE_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE) typedef struct PnvXScomInterfaceClass PnvXScomInterfaceClass; -#define PNV_XSCOM_INTERFACE_CLASS(klass) \ - OBJECT_CLASS_CHECK(PnvXScomInterfaceClass, (klass), \ +DECLARE_CLASS_CHECKERS(PnvXScomInterfaceClass, PNV_XSCOM_INTERFACE, TYPE_PNV_XSCOM_INTERFACE) -#define PNV_XSCOM_INTERFACE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PnvXScomInterfaceClass, (obj), TYPE_PNV_XSCOM_INTERF= ACE) =20 struct PnvXScomInterfaceClass { InterfaceClass parent; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 69eafe913a..3b819d7209 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -29,8 +29,8 @@ typedef struct SpaprPendingHpt SpaprPendingHpt; #define TYPE_SPAPR_RTC "spapr-rtc" =20 typedef struct SpaprRtcState SpaprRtcState; -#define SPAPR_RTC(obj) \ - OBJECT_CHECK(SpaprRtcState, (obj), TYPE_SPAPR_RTC) +DECLARE_INSTANCE_CHECKER(SpaprRtcState, SPAPR_RTC, + TYPE_SPAPR_RTC) =20 struct SpaprRtcState { /*< private >*/ @@ -43,12 +43,8 @@ typedef struct SpaprMachineClass SpaprMachineClass; =20 #define TYPE_SPAPR_MACHINE "spapr-machine" typedef struct SpaprMachineState SpaprMachineState; -#define SPAPR_MACHINE(obj) \ - OBJECT_CHECK(SpaprMachineState, (obj), TYPE_SPAPR_MACHINE) -#define SPAPR_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprMachineClass, obj, TYPE_SPAPR_MACHINE) -#define SPAPR_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprMachineClass, klass, TYPE_SPAPR_MACHINE) +DECLARE_OBJ_CHECKERS(SpaprMachineState, SpaprMachineClass, + SPAPR_MACHINE, TYPE_SPAPR_MACHINE) =20 typedef enum { SPAPR_RESIZE_HPT_DEFAULT =3D 0, @@ -774,12 +770,12 @@ static inline void spapr_dt_irq(uint32_t *intspec, in= t irq, bool is_lsi) typedef struct SpaprTceTable SpaprTceTable; =20 #define TYPE_SPAPR_TCE_TABLE "spapr-tce-table" -#define SPAPR_TCE_TABLE(obj) \ - OBJECT_CHECK(SpaprTceTable, (obj), TYPE_SPAPR_TCE_TABLE) +DECLARE_INSTANCE_CHECKER(SpaprTceTable, SPAPR_TCE_TABLE, + TYPE_SPAPR_TCE_TABLE) =20 #define TYPE_SPAPR_IOMMU_MEMORY_REGION "spapr-iommu-memory-region" -#define SPAPR_IOMMU_MEMORY_REGION(obj) \ - OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_SPAPR_IOMMU_MEMORY_REG= ION) +DECLARE_INSTANCE_CHECKER(IOMMUMemoryRegion, SPAPR_IOMMU_MEMORY_REGION, + TYPE_SPAPR_IOMMU_MEMORY_REGION) =20 struct SpaprTceTable { DeviceState parent; diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_cor= e.h index adcf74dbc3..fba6a01050 100644 --- a/include/hw/ppc/spapr_cpu_core.h +++ b/include/hw/ppc/spapr_cpu_core.h @@ -18,12 +18,8 @@ #define TYPE_SPAPR_CPU_CORE "spapr-cpu-core" typedef struct SpaprCpuCore SpaprCpuCore; typedef struct SpaprCpuCoreClass SpaprCpuCoreClass; -#define SPAPR_CPU_CORE(obj) \ - OBJECT_CHECK(SpaprCpuCore, (obj), TYPE_SPAPR_CPU_CORE) -#define SPAPR_CPU_CORE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprCpuCoreClass, (klass), TYPE_SPAPR_CPU_CORE) -#define SPAPR_CPU_CORE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprCpuCoreClass, (obj), TYPE_SPAPR_CPU_CORE) +DECLARE_OBJ_CHECKERS(SpaprCpuCore, SpaprCpuCoreClass, + SPAPR_CPU_CORE, TYPE_SPAPR_CPU_CORE) =20 #define SPAPR_CPU_CORE_TYPE_NAME(model) model "-" TYPE_SPAPR_CPU_CORE =20 diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index ab799930bf..2236aea66a 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -22,72 +22,37 @@ #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector" typedef struct SpaprDrc SpaprDrc; typedef struct SpaprDrcClass SpaprDrcClass; -#define SPAPR_DR_CONNECTOR_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DR_CONNECTOR) -#define SPAPR_DR_CONNECTOR_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ - TYPE_SPAPR_DR_CONNECTOR) -#define SPAPR_DR_CONNECTOR(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DR_CONNECTOR) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DR_CONNECTOR, TYPE_SPAPR_DR_CONNECTOR) =20 #define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" typedef struct SpaprDrcPhysical SpaprDrcPhysical; -#define SPAPR_DRC_PHYSICAL_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHYSICAL) -#define SPAPR_DRC_PHYSICAL_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ - TYPE_SPAPR_DRC_PHYSICAL) -#define SPAPR_DRC_PHYSICAL(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \ - TYPE_SPAPR_DRC_PHYSICAL) +DECLARE_OBJ_CHECKERS(SpaprDrcPhysical, SpaprDrcClass, + SPAPR_DRC_PHYSICAL, TYPE_SPAPR_DRC_PHYSICAL) =20 #define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical" -#define SPAPR_DRC_LOGICAL_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LOGICAL) -#define SPAPR_DRC_LOGICAL_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ - TYPE_SPAPR_DRC_LOGICAL) -#define SPAPR_DRC_LOGICAL(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DRC_LOGICAL) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DRC_LOGICAL, TYPE_SPAPR_DRC_LOGICAL) =20 #define TYPE_SPAPR_DRC_CPU "spapr-drc-cpu" -#define SPAPR_DRC_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_CPU) -#define SPAPR_DRC_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_CPU) -#define SPAPR_DRC_CPU(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DRC_CPU) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DRC_CPU, TYPE_SPAPR_DRC_CPU) =20 #define TYPE_SPAPR_DRC_PCI "spapr-drc-pci" -#define SPAPR_DRC_PCI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PCI) -#define SPAPR_DRC_PCI_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PCI) -#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DRC_PCI) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DRC_PCI, TYPE_SPAPR_DRC_PCI) =20 #define TYPE_SPAPR_DRC_LMB "spapr-drc-lmb" -#define SPAPR_DRC_LMB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LMB) -#define SPAPR_DRC_LMB_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_LMB) -#define SPAPR_DRC_LMB(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DRC_LMB) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DRC_LMB, TYPE_SPAPR_DRC_LMB) =20 #define TYPE_SPAPR_DRC_PHB "spapr-drc-phb" -#define SPAPR_DRC_PHB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHB) -#define SPAPR_DRC_PHB_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PHB) -#define SPAPR_DRC_PHB(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DRC_PHB) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DRC_PHB, TYPE_SPAPR_DRC_PHB) =20 #define TYPE_SPAPR_DRC_PMEM "spapr-drc-pmem" -#define SPAPR_DRC_PMEM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PMEM) -#define SPAPR_DRC_PMEM_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PMEM) -#define SPAPR_DRC_PMEM(obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DRC_PMEM) +DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, + SPAPR_DRC_PMEM, TYPE_SPAPR_DRC_PMEM) /* * Various hotplug types managed by SpaprDrc * diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index 83addd0a0b..c22a72c9e2 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -37,10 +37,8 @@ typedef struct SpaprInterruptController SpaprInterruptCo= ntroller; #define SPAPR_INTC(obj) \ INTERFACE_CHECK(SpaprInterruptController, (obj), TYPE_SPAPR_INTC) typedef struct SpaprInterruptControllerClass SpaprInterruptControllerClass; -#define SPAPR_INTC_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprInterruptControllerClass, (klass), TYPE_SPAPR_= INTC) -#define SPAPR_INTC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprInterruptControllerClass, (obj), TYPE_SPAPR_INTC) +DECLARE_CLASS_CHECKERS(SpaprInterruptControllerClass, SPAPR_INTC, + TYPE_SPAPR_INTC) =20 struct SpaprInterruptControllerClass { InterfaceClass parent; diff --git a/include/hw/ppc/spapr_tpm_proxy.h b/include/hw/ppc/spapr_tpm_pr= oxy.h index 1e9890d978..300c81b1f0 100644 --- a/include/hw/ppc/spapr_tpm_proxy.h +++ b/include/hw/ppc/spapr_tpm_proxy.h @@ -18,8 +18,8 @@ =20 #define TYPE_SPAPR_TPM_PROXY "spapr-tpm-proxy" typedef struct SpaprTpmProxy SpaprTpmProxy; -#define SPAPR_TPM_PROXY(obj) OBJECT_CHECK(SpaprTpmProxy, (obj), \ - TYPE_SPAPR_TPM_PROXY) +DECLARE_INSTANCE_CHECKER(SpaprTpmProxy, SPAPR_TPM_PROXY, + TYPE_SPAPR_TPM_PROXY) =20 struct SpaprTpmProxy { /*< private >*/ diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index 9c9d14e63b..e289028634 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -30,16 +30,13 @@ #define TYPE_VIO_SPAPR_DEVICE "vio-spapr-device" typedef struct SpaprVioDevice SpaprVioDevice; typedef struct SpaprVioDeviceClass SpaprVioDeviceClass; -#define VIO_SPAPR_DEVICE(obj) \ - OBJECT_CHECK(SpaprVioDevice, (obj), TYPE_VIO_SPAPR_DEVICE) -#define VIO_SPAPR_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprVioDeviceClass, (klass), TYPE_VIO_SPAPR_DEVIC= E) -#define VIO_SPAPR_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprVioDeviceClass, (obj), TYPE_VIO_SPAPR_DEVICE) +DECLARE_OBJ_CHECKERS(SpaprVioDevice, SpaprVioDeviceClass, + VIO_SPAPR_DEVICE, TYPE_VIO_SPAPR_DEVICE) =20 #define TYPE_SPAPR_VIO_BUS "spapr-vio-bus" typedef struct SpaprVioBus SpaprVioBus; -#define SPAPR_VIO_BUS(obj) OBJECT_CHECK(SpaprVioBus, (obj), TYPE_SPAPR_VIO= _BUS) +DECLARE_INSTANCE_CHECKER(SpaprVioBus, SPAPR_VIO_BUS, + TYPE_SPAPR_VIO_BUS) =20 #define TYPE_SPAPR_VIO_BRIDGE "spapr-vio-bridge" =20 diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index 620abc6639..feb6630783 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -17,11 +17,8 @@ #define TYPE_SPAPR_XIVE "spapr-xive" typedef struct SpaprXive SpaprXive; typedef struct SpaprXiveClass SpaprXiveClass; -#define SPAPR_XIVE(obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE) -#define SPAPR_XIVE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpaprXiveClass, (klass), TYPE_SPAPR_XIVE) -#define SPAPR_XIVE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpaprXiveClass, (obj), TYPE_SPAPR_XIVE) +DECLARE_OBJ_CHECKERS(SpaprXive, SpaprXiveClass, + SPAPR_XIVE, TYPE_SPAPR_XIVE) =20 struct SpaprXive { XiveRouter parent; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index e5f48faba0..bcb584b90d 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -50,15 +50,13 @@ typedef struct ICSIRQState ICSIRQState; typedef struct XICSFabric XICSFabric; =20 #define TYPE_ICP "icp" -#define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP) +DECLARE_OBJ_CHECKERS(ICPState, ICPStateClass, + ICP, TYPE_ICP) =20 #define TYPE_PNV_ICP "pnv-icp" -#define PNV_ICP(obj) OBJECT_CHECK(PnvICPState, (obj), TYPE_PNV_ICP) +DECLARE_INSTANCE_CHECKER(PnvICPState, PNV_ICP, + TYPE_PNV_ICP) =20 -#define ICP_CLASS(klass) \ - OBJECT_CLASS_CHECK(ICPStateClass, (klass), TYPE_ICP) -#define ICP_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ICPStateClass, (obj), TYPE_ICP) =20 struct ICPStateClass { DeviceClass parent_class; @@ -91,12 +89,9 @@ struct PnvICPState { }; =20 #define TYPE_ICS "ics" -#define ICS(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS) +DECLARE_OBJ_CHECKERS(ICSState, ICSStateClass, + ICS, TYPE_ICS) =20 -#define ICS_CLASS(klass) \ - OBJECT_CLASS_CHECK(ICSStateClass, (klass), TYPE_ICS) -#define ICS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ICSStateClass, (obj), TYPE_ICS) =20 struct ICSStateClass { DeviceClass parent_class; @@ -147,10 +142,8 @@ struct ICSIRQState { #define XICS_FABRIC(obj) \ INTERFACE_CHECK(XICSFabric, (obj), TYPE_XICS_FABRIC) typedef struct XICSFabricClass XICSFabricClass; -#define XICS_FABRIC_CLASS(klass) \ - OBJECT_CLASS_CHECK(XICSFabricClass, (klass), TYPE_XICS_FABRIC) -#define XICS_FABRIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XICSFabricClass, (obj), TYPE_XICS_FABRIC) +DECLARE_CLASS_CHECKERS(XICSFabricClass, XICS_FABRIC, + TYPE_XICS_FABRIC) =20 struct XICSFabricClass { InterfaceClass parent; diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 8ef9af1969..48595ab641 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -155,10 +155,8 @@ typedef struct XiveNotifier XiveNotifier; #define XIVE_NOTIFIER(obj) \ INTERFACE_CHECK(XiveNotifier, (obj), TYPE_XIVE_NOTIFIER) typedef struct XiveNotifierClass XiveNotifierClass; -#define XIVE_NOTIFIER_CLASS(klass) \ - OBJECT_CLASS_CHECK(XiveNotifierClass, (klass), TYPE_XIVE_NOTIFIER) -#define XIVE_NOTIFIER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XiveNotifierClass, (obj), TYPE_XIVE_NOTIFIER) +DECLARE_CLASS_CHECKERS(XiveNotifierClass, XIVE_NOTIFIER, + TYPE_XIVE_NOTIFIER) =20 struct XiveNotifierClass { InterfaceClass parent; @@ -171,7 +169,8 @@ struct XiveNotifierClass { =20 #define TYPE_XIVE_SOURCE "xive-source" typedef struct XiveSource XiveSource; -#define XIVE_SOURCE(obj) OBJECT_CHECK(XiveSource, (obj), TYPE_XIVE_SOURCE) +DECLARE_INSTANCE_CHECKER(XiveSource, XIVE_SOURCE, + TYPE_XIVE_SOURCE) =20 /* * XIVE Interrupt Source characteristics, which define how the ESB are @@ -308,7 +307,8 @@ void xive_source_set_irq(void *opaque, int srcno, int v= al); =20 #define TYPE_XIVE_TCTX "xive-tctx" typedef struct XiveTCTX XiveTCTX; -#define XIVE_TCTX(obj) OBJECT_CHECK(XiveTCTX, (obj), TYPE_XIVE_TCTX) +DECLARE_INSTANCE_CHECKER(XiveTCTX, XIVE_TCTX, + TYPE_XIVE_TCTX) =20 /* * XIVE Thread interrupt Management register rings : @@ -349,12 +349,8 @@ typedef struct XiveRouter XiveRouter; =20 #define TYPE_XIVE_ROUTER "xive-router" typedef struct XiveRouterClass XiveRouterClass; -#define XIVE_ROUTER(obj) \ - OBJECT_CHECK(XiveRouter, (obj), TYPE_XIVE_ROUTER) -#define XIVE_ROUTER_CLASS(klass) \ - OBJECT_CLASS_CHECK(XiveRouterClass, (klass), TYPE_XIVE_ROUTER) -#define XIVE_ROUTER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XiveRouterClass, (obj), TYPE_XIVE_ROUTER) +DECLARE_OBJ_CHECKERS(XiveRouter, XiveRouterClass, + XIVE_ROUTER, TYPE_XIVE_ROUTER) =20 struct XiveRouterClass { SysBusDeviceClass parent; @@ -398,10 +394,8 @@ typedef struct XiveTCTXMatch { #define XIVE_PRESENTER(obj) \ INTERFACE_CHECK(XivePresenter, (obj), TYPE_XIVE_PRESENTER) typedef struct XivePresenterClass XivePresenterClass; -#define XIVE_PRESENTER_CLASS(klass) \ - OBJECT_CLASS_CHECK(XivePresenterClass, (klass), TYPE_XIVE_PRESENTER) -#define XIVE_PRESENTER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XivePresenterClass, (obj), TYPE_XIVE_PRESENTER) +DECLARE_CLASS_CHECKERS(XivePresenterClass, XIVE_PRESENTER, + TYPE_XIVE_PRESENTER) =20 struct XivePresenterClass { InterfaceClass parent; @@ -425,10 +419,8 @@ int xive_presenter_tctx_match(XivePresenter *xptr, Xiv= eTCTX *tctx, #define XIVE_FABRIC(obj) \ INTERFACE_CHECK(XiveFabric, (obj), TYPE_XIVE_FABRIC) typedef struct XiveFabricClass XiveFabricClass; -#define XIVE_FABRIC_CLASS(klass) \ - OBJECT_CLASS_CHECK(XiveFabricClass, (klass), TYPE_XIVE_FABRIC) -#define XIVE_FABRIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XiveFabricClass, (obj), TYPE_XIVE_FABRIC) +DECLARE_CLASS_CHECKERS(XiveFabricClass, XIVE_FABRIC, + TYPE_XIVE_FABRIC) =20 struct XiveFabricClass { InterfaceClass parent; @@ -444,8 +436,8 @@ struct XiveFabricClass { =20 #define TYPE_XIVE_END_SOURCE "xive-end-source" typedef struct XiveENDSource XiveENDSource; -#define XIVE_END_SOURCE(obj) \ - OBJECT_CHECK(XiveENDSource, (obj), TYPE_XIVE_END_SOURCE) +DECLARE_INSTANCE_CHECKER(XiveENDSource, XIVE_END_SOURCE, + TYPE_XIVE_END_SOURCE) =20 struct XiveENDSource { DeviceState parent; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 479377f37b..e025ba9653 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -13,9 +13,8 @@ enum { =20 #define TYPE_DEVICE "device" typedef struct DeviceClass DeviceClass; -#define DEVICE(obj) OBJECT_CHECK(DeviceState, (obj), TYPE_DEVICE) -#define DEVICE_CLASS(klass) OBJECT_CLASS_CHECK(DeviceClass, (klass), TYPE_= DEVICE) -#define DEVICE_GET_CLASS(obj) OBJECT_GET_CLASS(DeviceClass, (obj), TYPE_DE= VICE) +DECLARE_OBJ_CHECKERS(DeviceState, DeviceClass, + DEVICE, TYPE_DEVICE) =20 typedef enum DeviceCategory { DEVICE_CATEGORY_BRIDGE, @@ -204,9 +203,8 @@ struct DeviceListener { }; =20 #define TYPE_BUS "bus" -#define BUS(obj) OBJECT_CHECK(BusState, (obj), TYPE_BUS) -#define BUS_CLASS(klass) OBJECT_CLASS_CHECK(BusClass, (klass), TYPE_BUS) -#define BUS_GET_CLASS(obj) OBJECT_GET_CLASS(BusClass, (obj), TYPE_BUS) +DECLARE_OBJ_CHECKERS(BusState, BusClass, + BUS, TYPE_BUS) =20 struct BusClass { ObjectClass parent_class; diff --git a/include/hw/rdma/rdma.h b/include/hw/rdma/rdma.h index aef82e58db..e77e43a170 100644 --- a/include/hw/rdma/rdma.h +++ b/include/hw/rdma/rdma.h @@ -20,12 +20,8 @@ #define INTERFACE_RDMA_PROVIDER "rdma" =20 typedef struct RdmaProviderClass RdmaProviderClass; -#define RDMA_PROVIDER_CLASS(klass) \ - OBJECT_CLASS_CHECK(RdmaProviderClass, (klass), \ +DECLARE_CLASS_CHECKERS(RdmaProviderClass, RDMA_PROVIDER, INTERFACE_RDMA_PROVIDER) -#define RDMA_PROVIDER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RdmaProviderClass, (obj), \ - INTERFACE_RDMA_PROVIDER) #define RDMA_PROVIDER(obj) \ INTERFACE_CHECK(RdmaProvider, (obj), \ INTERFACE_RDMA_PROVIDER) diff --git a/include/hw/register.h b/include/hw/register.h index 29c669e901..03c8926d27 100644 --- a/include/hw/register.h +++ b/include/hw/register.h @@ -88,7 +88,8 @@ struct RegisterInfo { }; =20 #define TYPE_REGISTER "qemu,register" -#define REGISTER(obj) OBJECT_CHECK(RegisterInfo, (obj), TYPE_REGISTER) +DECLARE_INSTANCE_CHECKER(RegisterInfo, REGISTER, + TYPE_REGISTER) =20 /** * This structure is used to group all of the individual registers which a= re diff --git a/include/hw/resettable.h b/include/hw/resettable.h index bcd36bce06..bdcd1276b6 100644 --- a/include/hw/resettable.h +++ b/include/hw/resettable.h @@ -18,11 +18,9 @@ #define TYPE_RESETTABLE_INTERFACE "resettable" =20 typedef struct ResettableClass ResettableClass; -#define RESETTABLE_CLASS(class) \ - OBJECT_CLASS_CHECK(ResettableClass, (class), TYPE_RESETTABLE_INTERFACE) +DECLARE_CLASS_CHECKERS(ResettableClass, RESETTABLE, + TYPE_RESETTABLE_INTERFACE) =20 -#define RESETTABLE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ResettableClass, (obj), TYPE_RESETTABLE_INTERFACE) =20 typedef struct ResettableState ResettableState; =20 diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index b42599ff54..8c15b6325f 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -26,8 +26,8 @@ =20 #define TYPE_RISCV_IBEX_SOC "riscv.lowrisc.ibex.soc" typedef struct LowRISCIbexSoCState LowRISCIbexSoCState; -#define RISCV_IBEX_SOC(obj) \ - OBJECT_CHECK(LowRISCIbexSoCState, (obj), TYPE_RISCV_IBEX_SOC) +DECLARE_INSTANCE_CHECKER(LowRISCIbexSoCState, RISCV_IBEX_SOC, + TYPE_RISCV_IBEX_SOC) =20 struct LowRISCIbexSoCState { /*< private >*/ diff --git a/include/hw/riscv/riscv_hart.h b/include/hw/riscv/riscv_hart.h index 617b977214..9be1fd80ed 100644 --- a/include/hw/riscv/riscv_hart.h +++ b/include/hw/riscv/riscv_hart.h @@ -28,8 +28,8 @@ #define TYPE_RISCV_HART_ARRAY "riscv.hart_array" =20 typedef struct RISCVHartArrayState RISCVHartArrayState; -#define RISCV_HART_ARRAY(obj) \ - OBJECT_CHECK(RISCVHartArrayState, (obj), TYPE_RISCV_HART_ARRAY) +DECLARE_INSTANCE_CHECKER(RISCVHartArrayState, RISCV_HART_ARRAY, + TYPE_RISCV_HART_ARRAY) =20 struct RISCVHartArrayState { /*< private >*/ diff --git a/include/hw/riscv/sifive_clint.h b/include/hw/riscv/sifive_clin= t.h index eb51b43dd6..a4fc2fcea4 100644 --- a/include/hw/riscv/sifive_clint.h +++ b/include/hw/riscv/sifive_clint.h @@ -26,8 +26,8 @@ #define TYPE_SIFIVE_CLINT "riscv.sifive.clint" =20 typedef struct SiFiveCLINTState SiFiveCLINTState; -#define SIFIVE_CLINT(obj) \ - OBJECT_CHECK(SiFiveCLINTState, (obj), TYPE_SIFIVE_CLINT) +DECLARE_INSTANCE_CHECKER(SiFiveCLINTState, SIFIVE_CLINT, + TYPE_SIFIVE_CLINT) =20 struct SiFiveCLINTState { /*< private >*/ diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h index 9dddf91a02..7186c8eca2 100644 --- a/include/hw/riscv/sifive_e.h +++ b/include/hw/riscv/sifive_e.h @@ -26,8 +26,8 @@ =20 #define TYPE_RISCV_E_SOC "riscv.sifive.e.soc" typedef struct SiFiveESoCState SiFiveESoCState; -#define RISCV_E_SOC(obj) \ - OBJECT_CHECK(SiFiveESoCState, (obj), TYPE_RISCV_E_SOC) +DECLARE_INSTANCE_CHECKER(SiFiveESoCState, RISCV_E_SOC, + TYPE_RISCV_E_SOC) =20 struct SiFiveESoCState { /*< private >*/ @@ -52,8 +52,8 @@ struct SiFiveEState { typedef struct SiFiveEState SiFiveEState; =20 #define TYPE_RISCV_E_MACHINE MACHINE_TYPE_NAME("sifive_e") -#define RISCV_E_MACHINE(obj) \ - OBJECT_CHECK(SiFiveEState, (obj), TYPE_RISCV_E_MACHINE) +DECLARE_INSTANCE_CHECKER(SiFiveEState, RISCV_E_MACHINE, + TYPE_RISCV_E_MACHINE) =20 enum { SIFIVE_E_DEBUG, diff --git a/include/hw/riscv/sifive_e_prci.h b/include/hw/riscv/sifive_e_p= rci.h index de1e502eea..262ca16181 100644 --- a/include/hw/riscv/sifive_e_prci.h +++ b/include/hw/riscv/sifive_e_prci.h @@ -53,8 +53,8 @@ enum { #define TYPE_SIFIVE_E_PRCI "riscv.sifive.e.prci" =20 typedef struct SiFiveEPRCIState SiFiveEPRCIState; -#define SIFIVE_E_PRCI(obj) \ - OBJECT_CHECK(SiFiveEPRCIState, (obj), TYPE_SIFIVE_E_PRCI) +DECLARE_INSTANCE_CHECKER(SiFiveEPRCIState, SIFIVE_E_PRCI, + TYPE_SIFIVE_E_PRCI) =20 struct SiFiveEPRCIState { /*< private >*/ diff --git a/include/hw/riscv/sifive_gpio.h b/include/hw/riscv/sifive_gpio.h index af991fa44e..fc53785c9d 100644 --- a/include/hw/riscv/sifive_gpio.h +++ b/include/hw/riscv/sifive_gpio.h @@ -19,7 +19,8 @@ =20 #define TYPE_SIFIVE_GPIO "sifive_soc.gpio" typedef struct SIFIVEGPIOState SIFIVEGPIOState; -#define SIFIVE_GPIO(obj) OBJECT_CHECK(SIFIVEGPIOState, (obj), TYPE_SIFIVE_= GPIO) +DECLARE_INSTANCE_CHECKER(SIFIVEGPIOState, SIFIVE_GPIO, + TYPE_SIFIVE_GPIO) =20 #define SIFIVE_GPIO_PINS 32 =20 diff --git a/include/hw/riscv/sifive_plic.h b/include/hw/riscv/sifive_plic.h index aa6ae13c3a..b75b1f145d 100644 --- a/include/hw/riscv/sifive_plic.h +++ b/include/hw/riscv/sifive_plic.h @@ -27,8 +27,8 @@ #define TYPE_SIFIVE_PLIC "riscv.sifive.plic" =20 typedef struct SiFivePLICState SiFivePLICState; -#define SIFIVE_PLIC(obj) \ - OBJECT_CHECK(SiFivePLICState, (obj), TYPE_SIFIVE_PLIC) +DECLARE_INSTANCE_CHECKER(SiFivePLICState, SIFIVE_PLIC, + TYPE_SIFIVE_PLIC) =20 typedef enum PLICMode { PLICMode_U, diff --git a/include/hw/riscv/sifive_test.h b/include/hw/riscv/sifive_test.h index dc54b7af0c..88a38d00c5 100644 --- a/include/hw/riscv/sifive_test.h +++ b/include/hw/riscv/sifive_test.h @@ -25,8 +25,8 @@ #define TYPE_SIFIVE_TEST "riscv.sifive.test" =20 typedef struct SiFiveTestState SiFiveTestState; -#define SIFIVE_TEST(obj) \ - OBJECT_CHECK(SiFiveTestState, (obj), TYPE_SIFIVE_TEST) +DECLARE_INSTANCE_CHECKER(SiFiveTestState, SIFIVE_TEST, + TYPE_SIFIVE_TEST) =20 struct SiFiveTestState { /*< private >*/ diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index 30bd41d391..ce3af6f169 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -29,8 +29,8 @@ =20 #define TYPE_RISCV_U_SOC "riscv.sifive.u.soc" typedef struct SiFiveUSoCState SiFiveUSoCState; -#define RISCV_U_SOC(obj) \ - OBJECT_CHECK(SiFiveUSoCState, (obj), TYPE_RISCV_U_SOC) +DECLARE_INSTANCE_CHECKER(SiFiveUSoCState, RISCV_U_SOC, + TYPE_RISCV_U_SOC) =20 struct SiFiveUSoCState { /*< private >*/ @@ -52,8 +52,8 @@ struct SiFiveUSoCState { =20 #define TYPE_RISCV_U_MACHINE MACHINE_TYPE_NAME("sifive_u") typedef struct SiFiveUState SiFiveUState; -#define RISCV_U_MACHINE(obj) \ - OBJECT_CHECK(SiFiveUState, (obj), TYPE_RISCV_U_MACHINE) +DECLARE_INSTANCE_CHECKER(SiFiveUState, RISCV_U_MACHINE, + TYPE_RISCV_U_MACHINE) =20 struct SiFiveUState { /*< private >*/ diff --git a/include/hw/riscv/sifive_u_otp.h b/include/hw/riscv/sifive_u_ot= p.h index 4572534f50..82c9176c8f 100644 --- a/include/hw/riscv/sifive_u_otp.h +++ b/include/hw/riscv/sifive_u_otp.h @@ -51,8 +51,8 @@ #define TYPE_SIFIVE_U_OTP "riscv.sifive.u.otp" =20 typedef struct SiFiveUOTPState SiFiveUOTPState; -#define SIFIVE_U_OTP(obj) \ - OBJECT_CHECK(SiFiveUOTPState, (obj), TYPE_SIFIVE_U_OTP) +DECLARE_INSTANCE_CHECKER(SiFiveUOTPState, SIFIVE_U_OTP, + TYPE_SIFIVE_U_OTP) =20 struct SiFiveUOTPState { /*< private >*/ diff --git a/include/hw/riscv/sifive_u_prci.h b/include/hw/riscv/sifive_u_p= rci.h index 83eab43686..d9ebf40b7f 100644 --- a/include/hw/riscv/sifive_u_prci.h +++ b/include/hw/riscv/sifive_u_prci.h @@ -60,8 +60,8 @@ #define TYPE_SIFIVE_U_PRCI "riscv.sifive.u.prci" =20 typedef struct SiFiveUPRCIState SiFiveUPRCIState; -#define SIFIVE_U_PRCI(obj) \ - OBJECT_CHECK(SiFiveUPRCIState, (obj), TYPE_SIFIVE_U_PRCI) +DECLARE_INSTANCE_CHECKER(SiFiveUPRCIState, SIFIVE_U_PRCI, + TYPE_SIFIVE_U_PRCI) =20 struct SiFiveUPRCIState { /*< private >*/ diff --git a/include/hw/riscv/sifive_uart.h b/include/hw/riscv/sifive_uart.h index 2bb72ac80b..3e962be659 100644 --- a/include/hw/riscv/sifive_uart.h +++ b/include/hw/riscv/sifive_uart.h @@ -53,8 +53,8 @@ enum { #define TYPE_SIFIVE_UART "riscv.sifive.uart" =20 typedef struct SiFiveUARTState SiFiveUARTState; -#define SIFIVE_UART(obj) \ - OBJECT_CHECK(SiFiveUARTState, (obj), TYPE_SIFIVE_UART) +DECLARE_INSTANCE_CHECKER(SiFiveUARTState, SIFIVE_UART, + TYPE_SIFIVE_UART) =20 struct SiFiveUARTState { /*< private >*/ diff --git a/include/hw/riscv/spike.h b/include/hw/riscv/spike.h index 121396d07a..cddeca2e77 100644 --- a/include/hw/riscv/spike.h +++ b/include/hw/riscv/spike.h @@ -28,8 +28,8 @@ =20 #define TYPE_SPIKE_MACHINE MACHINE_TYPE_NAME("spike") typedef struct SpikeState SpikeState; -#define SPIKE_MACHINE(obj) \ - OBJECT_CHECK(SpikeState, (obj), TYPE_SPIKE_MACHINE) +DECLARE_INSTANCE_CHECKER(SpikeState, SPIKE_MACHINE, + TYPE_SPIKE_MACHINE) =20 struct SpikeState { /*< private >*/ diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 3069379c84..b4ed9a32eb 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -29,8 +29,8 @@ =20 #define TYPE_RISCV_VIRT_MACHINE MACHINE_TYPE_NAME("virt") typedef struct RISCVVirtState RISCVVirtState; -#define RISCV_VIRT_MACHINE(obj) \ - OBJECT_CHECK(RISCVVirtState, (obj), TYPE_RISCV_VIRT_MACHINE) +DECLARE_INSTANCE_CHECKER(RISCVVirtState, RISCV_VIRT_MACHINE, + TYPE_RISCV_VIRT_MACHINE) =20 struct RISCVVirtState { /*< private >*/ diff --git a/include/hw/rtc/allwinner-rtc.h b/include/hw/rtc/allwinner-rtc.h index 1126e05f23..5a6e9fff32 100644 --- a/include/hw/rtc/allwinner-rtc.h +++ b/include/hw/rtc/allwinner-rtc.h @@ -62,12 +62,8 @@ =20 typedef struct AwRtcClass AwRtcClass; typedef struct AwRtcState AwRtcState; -#define AW_RTC(obj) \ - OBJECT_CHECK(AwRtcState, (obj), TYPE_AW_RTC) -#define AW_RTC_CLASS(klass) \ - OBJECT_CLASS_CHECK(AwRtcClass, (klass), TYPE_AW_RTC) -#define AW_RTC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AwRtcClass, (obj), TYPE_AW_RTC) +DECLARE_OBJ_CHECKERS(AwRtcState, AwRtcClass, + AW_RTC, TYPE_AW_RTC) =20 /** @} */ =20 diff --git a/include/hw/rtc/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h index 295f4a7d30..d7691ab88f 100644 --- a/include/hw/rtc/aspeed_rtc.h +++ b/include/hw/rtc/aspeed_rtc.h @@ -24,6 +24,7 @@ struct AspeedRtcState { typedef struct AspeedRtcState AspeedRtcState; =20 #define TYPE_ASPEED_RTC "aspeed.rtc" -#define ASPEED_RTC(obj) OBJECT_CHECK(AspeedRtcState, (obj), TYPE_ASPEED_RT= C) +DECLARE_INSTANCE_CHECKER(AspeedRtcState, ASPEED_RTC, + TYPE_ASPEED_RTC) =20 #endif /* HW_RTC_ASPEED_RTC_H */ diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h index f31b0cbb89..b710c21c94 100644 --- a/include/hw/rtc/goldfish_rtc.h +++ b/include/hw/rtc/goldfish_rtc.h @@ -27,8 +27,8 @@ =20 #define TYPE_GOLDFISH_RTC "goldfish_rtc" typedef struct GoldfishRTCState GoldfishRTCState; -#define GOLDFISH_RTC(obj) \ - OBJECT_CHECK(GoldfishRTCState, (obj), TYPE_GOLDFISH_RTC) +DECLARE_INSTANCE_CHECKER(GoldfishRTCState, GOLDFISH_RTC, + TYPE_GOLDFISH_RTC) =20 struct GoldfishRTCState { SysBusDevice parent_obj; diff --git a/include/hw/rtc/m48t59.h b/include/hw/rtc/m48t59.h index 78aae2c072..04abedf3b2 100644 --- a/include/hw/rtc/m48t59.h +++ b/include/hw/rtc/m48t59.h @@ -32,10 +32,8 @@ #define TYPE_NVRAM "nvram" =20 typedef struct NvramClass NvramClass; -#define NVRAM_CLASS(klass) \ - OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM) -#define NVRAM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM) +DECLARE_CLASS_CHECKERS(NvramClass, NVRAM, + TYPE_NVRAM) #define NVRAM(obj) \ INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM) =20 diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 7b42d9c534..e58e006d0d 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -17,7 +17,8 @@ =20 #define TYPE_MC146818_RTC "mc146818rtc" typedef struct RTCState RTCState; -#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) +DECLARE_INSTANCE_CHECKER(RTCState, MC146818_RTC, + TYPE_MC146818_RTC) =20 struct RTCState { ISADevice parent_obj; diff --git a/include/hw/rtc/pl031.h b/include/hw/rtc/pl031.h index 3ddf48cc76..3897b424d4 100644 --- a/include/hw/rtc/pl031.h +++ b/include/hw/rtc/pl031.h @@ -20,7 +20,8 @@ =20 #define TYPE_PL031 "pl031" typedef struct PL031State PL031State; -#define PL031(obj) OBJECT_CHECK(PL031State, (obj), TYPE_PL031) +DECLARE_INSTANCE_CHECKER(PL031State, PL031, + TYPE_PL031) =20 struct PL031State { SysBusDevice parent_obj; diff --git a/include/hw/rtc/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-= rtc.h index 95c85d3bf1..209de85ae6 100644 --- a/include/hw/rtc/xlnx-zynqmp-rtc.h +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h @@ -34,8 +34,8 @@ #define TYPE_XLNX_ZYNQMP_RTC "xlnx-zynmp.rtc" =20 typedef struct XlnxZynqMPRTC XlnxZynqMPRTC; -#define XLNX_ZYNQMP_RTC(obj) \ - OBJECT_CHECK(XlnxZynqMPRTC, (obj), TYPE_XLNX_ZYNQMP_RTC) +DECLARE_INSTANCE_CHECKER(XlnxZynqMPRTC, XLNX_ZYNQMP_RTC, + TYPE_XLNX_ZYNQMP_RTC) =20 REG32(SET_TIME_WRITE, 0x0) REG32(SET_TIME_READ, 0x4) diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h index 4451a9e006..3ed80dba0d 100644 --- a/include/hw/rx/rx62n.h +++ b/include/hw/rx/rx62n.h @@ -34,7 +34,8 @@ =20 #define TYPE_RX62N_MCU "rx62n-mcu" typedef struct RX62NState RX62NState; -#define RX62N_MCU(obj) OBJECT_CHECK(RX62NState, (obj), TYPE_RX62N_MCU) +DECLARE_INSTANCE_CHECKER(RX62NState, RX62N_MCU, + TYPE_RX62N_MCU) =20 #define TYPE_R5F562N7_MCU "r5f562n7-mcu" #define TYPE_R5F562N8_MCU "r5f562n8-mcu" diff --git a/include/hw/s390x/3270-ccw.h b/include/hw/s390x/3270-ccw.h index ac254f95ed..9a11093192 100644 --- a/include/hw/s390x/3270-ccw.h +++ b/include/hw/s390x/3270-ccw.h @@ -33,12 +33,8 @@ =20 typedef struct EmulatedCcw3270Class EmulatedCcw3270Class; typedef struct EmulatedCcw3270Device EmulatedCcw3270Device; -#define EMULATED_CCW_3270(obj) \ - OBJECT_CHECK(EmulatedCcw3270Device, (obj), TYPE_EMULATED_CCW_3270) -#define EMULATED_CCW_3270_CLASS(klass) \ - OBJECT_CLASS_CHECK(EmulatedCcw3270Class, (klass), TYPE_EMULATED_CCW_3= 270) -#define EMULATED_CCW_3270_GET_CLASS(obj) \ - OBJECT_GET_CLASS(EmulatedCcw3270Class, (obj), TYPE_EMULATED_CCW_3270) +DECLARE_OBJ_CHECKERS(EmulatedCcw3270Device, EmulatedCcw3270Class, + EMULATED_CCW_3270, TYPE_EMULATED_CCW_3270) =20 struct EmulatedCcw3270Device { CcwDevice parent_obj; diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h index b3b3e98a67..fb250a20f3 100644 --- a/include/hw/s390x/ap-device.h +++ b/include/hw/s390x/ap-device.h @@ -21,7 +21,7 @@ struct APDevice { }; typedef struct APDevice APDevice; =20 -#define AP_DEVICE(obj) \ - OBJECT_CHECK(APDevice, (obj), AP_DEVICE_TYPE) +DECLARE_INSTANCE_CHECKER(APDevice, AP_DEVICE, + AP_DEVICE_TYPE) =20 #endif /* HW_S390X_AP_DEVICE_H */ diff --git a/include/hw/s390x/css-bridge.h b/include/hw/s390x/css-bridge.h index 05786b38de..9fd4484204 100644 --- a/include/hw/s390x/css-bridge.h +++ b/include/hw/s390x/css-bridge.h @@ -24,8 +24,8 @@ struct VirtualCssBridge { typedef struct VirtualCssBridge VirtualCssBridge; =20 #define TYPE_VIRTUAL_CSS_BRIDGE "virtual-css-bridge" -#define VIRTUAL_CSS_BRIDGE(obj) \ - OBJECT_CHECK(VirtualCssBridge, (obj), TYPE_VIRTUAL_CSS_BRIDGE) +DECLARE_INSTANCE_CHECKER(VirtualCssBridge, VIRTUAL_CSS_BRIDGE, + TYPE_VIRTUAL_CSS_BRIDGE) =20 /* virtual css bus type */ struct VirtualCssBus { @@ -34,8 +34,8 @@ struct VirtualCssBus { typedef struct VirtualCssBus VirtualCssBus; =20 #define TYPE_VIRTUAL_CSS_BUS "virtual-css-bus" -#define VIRTUAL_CSS_BUS(obj) \ - OBJECT_CHECK(VirtualCssBus, (obj), TYPE_VIRTUAL_CSS_BUS) +DECLARE_INSTANCE_CHECKER(VirtualCssBus, VIRTUAL_CSS_BUS, + TYPE_VIRTUAL_CSS_BUS) VirtualCssBus *virtual_css_bus_init(void); =20 #endif diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index dd1a6a44c0..eccf6e924b 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -44,12 +44,8 @@ #define TYPE_SCLP_EVENT "s390-sclp-event-type" typedef struct SCLPEvent SCLPEvent; typedef struct SCLPEventClass SCLPEventClass; -#define SCLP_EVENT(obj) \ - OBJECT_CHECK(SCLPEvent, (obj), TYPE_SCLP_EVENT) -#define SCLP_EVENT_CLASS(klass) \ - OBJECT_CLASS_CHECK(SCLPEventClass, (klass), TYPE_SCLP_EVENT) -#define SCLP_EVENT_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SCLPEventClass, (obj), TYPE_SCLP_EVENT) +DECLARE_OBJ_CHECKERS(SCLPEvent, SCLPEventClass, + SCLP_EVENT, TYPE_SCLP_EVENT) =20 #define TYPE_SCLP_CPU_HOTPLUG "sclp-cpu-hotplug" #define TYPE_SCLP_QUIESCE "sclpquiesce" @@ -200,14 +196,8 @@ struct SCLPEventClass { #define TYPE_SCLP_EVENT_FACILITY "s390-sclp-event-facility" typedef struct SCLPEventFacility SCLPEventFacility; typedef struct SCLPEventFacilityClass SCLPEventFacilityClass; -#define EVENT_FACILITY(obj) \ - OBJECT_CHECK(SCLPEventFacility, (obj), TYPE_SCLP_EVENT_FACILITY) -#define EVENT_FACILITY_CLASS(klass) \ - OBJECT_CLASS_CHECK(SCLPEventFacilityClass, (klass), \ - TYPE_SCLP_EVENT_FACILITY) -#define EVENT_FACILITY_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SCLPEventFacilityClass, (obj), \ - TYPE_SCLP_EVENT_FACILITY) +DECLARE_OBJ_CHECKERS(SCLPEventFacility, SCLPEventFacilityClass, + EVENT_FACILITY, TYPE_SCLP_EVENT_FACILITY) =20 struct SCLPEventFacilityClass { SysBusDeviceClass parent_class; diff --git a/include/hw/s390x/s390-ccw.h b/include/hw/s390x/s390-ccw.h index f0f96952f1..2c807ee3a1 100644 --- a/include/hw/s390x/s390-ccw.h +++ b/include/hw/s390x/s390-ccw.h @@ -19,12 +19,8 @@ #define TYPE_S390_CCW "s390-ccw" typedef struct S390CCWDevice S390CCWDevice; typedef struct S390CCWDeviceClass S390CCWDeviceClass; -#define S390_CCW_DEVICE(obj) \ - OBJECT_CHECK(S390CCWDevice, (obj), TYPE_S390_CCW) -#define S390_CCW_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(S390CCWDeviceClass, (klass), TYPE_S390_CCW) -#define S390_CCW_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(S390CCWDeviceClass, (obj), TYPE_S390_CCW) +DECLARE_OBJ_CHECKERS(S390CCWDevice, S390CCWDeviceClass, + S390_CCW_DEVICE, TYPE_S390_CCW) =20 struct S390CCWDevice { CcwDevice parent_obj; diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index f20c503b19..54d14da0a6 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -18,11 +18,9 @@ =20 typedef struct S390CcwMachineClass S390CcwMachineClass; typedef struct S390CcwMachineState S390CcwMachineState; -#define S390_CCW_MACHINE(obj) \ - OBJECT_CHECK(S390CcwMachineState, (obj), TYPE_S390_CCW_MACHINE) +DECLARE_OBJ_CHECKERS(S390CcwMachineState, S390CcwMachineClass, + S390_CCW_MACHINE, TYPE_S390_CCW_MACHINE) =20 -#define S390_CCW_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(S390CcwMachineClass, (klass), TYPE_S390_CCW_MACHINE) =20 struct S390CcwMachineState { /*< private >*/ diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index 2ae7cca85b..a6a123598d 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -41,8 +41,8 @@ extern const VMStateDescription vmstate_adapter_routes; #define TYPE_S390_FLIC_COMMON "s390-flic" typedef struct S390FLICState S390FLICState; typedef struct S390FLICStateClass S390FLICStateClass; -#define S390_FLIC_COMMON(obj) \ - OBJECT_CHECK(S390FLICState, (obj), TYPE_S390_FLIC_COMMON) +DECLARE_OBJ_CHECKERS(S390FLICState, S390FLICStateClass, + S390_FLIC_COMMON, TYPE_S390_FLIC_COMMON) =20 struct S390FLICState { SysBusDevice parent_obj; @@ -51,10 +51,6 @@ struct S390FLICState { bool ais_supported; }; =20 -#define S390_FLIC_COMMON_CLASS(klass) \ - OBJECT_CLASS_CHECK(S390FLICStateClass, (klass), TYPE_S390_FLIC_COMMON) -#define S390_FLIC_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(S390FLICStateClass, (obj), TYPE_S390_FLIC_COMMON) =20 struct S390FLICStateClass { DeviceClass parent_class; @@ -79,13 +75,13 @@ struct S390FLICStateClass { =20 #define TYPE_KVM_S390_FLIC "s390-flic-kvm" typedef struct KVMS390FLICState KVMS390FLICState; -#define KVM_S390_FLIC(obj) \ - OBJECT_CHECK(KVMS390FLICState, (obj), TYPE_KVM_S390_FLIC) +DECLARE_INSTANCE_CHECKER(KVMS390FLICState, KVM_S390_FLIC, + TYPE_KVM_S390_FLIC) =20 #define TYPE_QEMU_S390_FLIC "s390-flic-qemu" typedef struct QEMUS390FLICState QEMUS390FLICState; -#define QEMU_S390_FLIC(obj) \ - OBJECT_CHECK(QEMUS390FLICState, (obj), TYPE_QEMU_S390_FLIC) +DECLARE_INSTANCE_CHECKER(QEMUS390FLICState, QEMU_S390_FLIC, + TYPE_QEMU_S390_FLIC) =20 #define SIC_IRQ_MODE_ALL 0 #define SIC_IRQ_MODE_SINGLE 1 diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index 2a5bdc6dfe..5038a45612 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -184,9 +184,8 @@ typedef struct SCCB { #define TYPE_SCLP "sclp" typedef struct SCLPDevice SCLPDevice; typedef struct SCLPDeviceClass SCLPDeviceClass; -#define SCLP(obj) OBJECT_CHECK(SCLPDevice, (obj), TYPE_SCLP) -#define SCLP_CLASS(oc) OBJECT_CLASS_CHECK(SCLPDeviceClass, (oc), TYPE_SCLP) -#define SCLP_GET_CLASS(obj) OBJECT_GET_CLASS(SCLPDeviceClass, (obj), TYPE_= SCLP) +DECLARE_OBJ_CHECKERS(SCLPDevice, SCLPDeviceClass, + SCLP, TYPE_SCLP) =20 struct SCLPEventFacility; =20 diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/stora= ge-attributes.h index b5d9663f7c..efb28c48be 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -22,8 +22,8 @@ =20 typedef struct S390StAttribClass S390StAttribClass; typedef struct S390StAttribState S390StAttribState; -#define S390_STATTRIB(obj) \ - OBJECT_CHECK(S390StAttribState, (obj), TYPE_S390_STATTRIB) +DECLARE_OBJ_CHECKERS(S390StAttribState, S390StAttribClass, + S390_STATTRIB, TYPE_S390_STATTRIB) =20 struct S390StAttribState { DeviceState parent_obj; @@ -31,10 +31,6 @@ struct S390StAttribState { bool migration_enabled; }; =20 -#define S390_STATTRIB_CLASS(klass) \ - OBJECT_CLASS_CHECK(S390StAttribClass, (klass), TYPE_S390_STATTRIB) -#define S390_STATTRIB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(S390StAttribClass, (obj), TYPE_S390_STATTRIB) =20 struct S390StAttribClass { DeviceClass parent_class; @@ -52,16 +48,16 @@ struct S390StAttribClass { }; =20 typedef struct QEMUS390StAttribState QEMUS390StAttribState; -#define QEMU_S390_STATTRIB(obj) \ - OBJECT_CHECK(QEMUS390StAttribState, (obj), TYPE_QEMU_S390_STATTRIB) +DECLARE_INSTANCE_CHECKER(QEMUS390StAttribState, QEMU_S390_STATTRIB, + TYPE_QEMU_S390_STATTRIB) =20 struct QEMUS390StAttribState { S390StAttribState parent_obj; }; =20 typedef struct KVMS390StAttribState KVMS390StAttribState; -#define KVM_S390_STATTRIB(obj) \ - OBJECT_CHECK(KVMS390StAttribState, (obj), TYPE_KVM_S390_STATTRIB) +DECLARE_INSTANCE_CHECKER(KVMS390StAttribState, KVM_S390_STATTRIB, + TYPE_KVM_S390_STATTRIB) =20 struct KVMS390StAttribState { S390StAttribState parent_obj; diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-key= s.h index e94a201f71..40f042f54e 100644 --- a/include/hw/s390x/storage-keys.h +++ b/include/hw/s390x/storage-keys.h @@ -19,8 +19,8 @@ #define TYPE_S390_SKEYS "s390-skeys" typedef struct S390SKeysClass S390SKeysClass; typedef struct S390SKeysState S390SKeysState; -#define S390_SKEYS(obj) \ - OBJECT_CHECK(S390SKeysState, (obj), TYPE_S390_SKEYS) +DECLARE_OBJ_CHECKERS(S390SKeysState, S390SKeysClass, + S390_SKEYS, TYPE_S390_SKEYS) =20 struct S390SKeysState { DeviceState parent_obj; @@ -28,10 +28,6 @@ struct S390SKeysState { =20 }; =20 -#define S390_SKEYS_CLASS(klass) \ - OBJECT_CLASS_CHECK(S390SKeysClass, (klass), TYPE_S390_SKEYS) -#define S390_SKEYS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(S390SKeysClass, (obj), TYPE_S390_SKEYS) =20 struct S390SKeysClass { DeviceClass parent_class; @@ -45,8 +41,8 @@ struct S390SKeysClass { #define TYPE_KVM_S390_SKEYS "s390-skeys-kvm" #define TYPE_QEMU_S390_SKEYS "s390-skeys-qemu" typedef struct QEMUS390SKeysState QEMUS390SKeysState; -#define QEMU_S390_SKEYS(obj) \ - OBJECT_CHECK(QEMUS390SKeysState, (obj), TYPE_QEMU_S390_SKEYS) +DECLARE_INSTANCE_CHECKER(QEMUS390SKeysState, QEMU_S390_SKEYS, + TYPE_QEMU_S390_SKEYS) =20 struct QEMUS390SKeysState { S390SKeysState parent_obj; diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h index e240faf11c..c02498f65e 100644 --- a/include/hw/s390x/tod.h +++ b/include/hw/s390x/tod.h @@ -23,11 +23,8 @@ typedef struct S390TOD { #define TYPE_S390_TOD "s390-tod" typedef struct S390TODClass S390TODClass; typedef struct S390TODState S390TODState; -#define S390_TOD(obj) OBJECT_CHECK(S390TODState, (obj), TYPE_S390_TOD) -#define S390_TOD_CLASS(oc) OBJECT_CLASS_CHECK(S390TODClass, (oc), \ - TYPE_S390_TOD) -#define S390_TOD_GET_CLASS(obj) OBJECT_GET_CLASS(S390TODClass, (obj), \ - TYPE_S390_TOD) +DECLARE_OBJ_CHECKERS(S390TODState, S390TODClass, + S390_TOD, TYPE_S390_TOD) #define TYPE_KVM_S390_TOD TYPE_S390_TOD "-kvm" #define TYPE_QEMU_S390_TOD TYPE_S390_TOD "-qemu" =20 diff --git a/include/hw/s390x/vfio-ccw.h b/include/hw/s390x/vfio-ccw.h index 7bd4640ac3..9c9c8944ad 100644 --- a/include/hw/s390x/vfio-ccw.h +++ b/include/hw/s390x/vfio-ccw.h @@ -21,8 +21,8 @@ =20 #define TYPE_VFIO_CCW "vfio-ccw" typedef struct VFIOCCWDevice VFIOCCWDevice; -#define VFIO_CCW(obj) \ - OBJECT_CHECK(VFIOCCWDevice, (obj), TYPE_VFIO_CCW) +DECLARE_INSTANCE_CHECKER(VFIOCCWDevice, VFIO_CCW, + TYPE_VFIO_CCW) =20 #define TYPE_VFIO_CCW "vfio-ccw" =20 diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index d4a4e2930c..f281625dd5 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -67,7 +67,8 @@ struct ESPState { =20 #define TYPE_ESP "esp" typedef struct SysBusESPState SysBusESPState; -#define ESP_STATE(obj) OBJECT_CHECK(SysBusESPState, (obj), TYPE_ESP) +DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP_STATE, + TYPE_ESP) =20 struct SysBusESPState { /*< private >*/ diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index bad4dfb223..3818e3fa46 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -51,12 +51,8 @@ struct SCSIRequest { =20 #define TYPE_SCSI_DEVICE "scsi-device" typedef struct SCSIDeviceClass SCSIDeviceClass; -#define SCSI_DEVICE(obj) \ - OBJECT_CHECK(SCSIDevice, (obj), TYPE_SCSI_DEVICE) -#define SCSI_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SCSIDeviceClass, (klass), TYPE_SCSI_DEVICE) -#define SCSI_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SCSIDeviceClass, (obj), TYPE_SCSI_DEVICE) +DECLARE_OBJ_CHECKERS(SCSIDevice, SCSIDeviceClass, + SCSI_DEVICE, TYPE_SCSI_DEVICE) =20 struct SCSIDeviceClass { DeviceClass parent_class; @@ -138,7 +134,8 @@ struct SCSIBusInfo { }; =20 #define TYPE_SCSI_BUS "SCSI" -#define SCSI_BUS(obj) OBJECT_CHECK(SCSIBus, (obj), TYPE_SCSI_BUS) +DECLARE_INSTANCE_CHECKER(SCSIBus, SCSI_BUS, + TYPE_SCSI_BUS) =20 struct SCSIBus { BusState qbus; diff --git a/include/hw/sd/allwinner-sdhost.h b/include/hw/sd/allwinner-sdh= ost.h index b23de2c548..7bccc06d1c 100644 --- a/include/hw/sd/allwinner-sdhost.h +++ b/include/hw/sd/allwinner-sdhost.h @@ -47,12 +47,8 @@ =20 typedef struct AwSdHostClass AwSdHostClass; typedef struct AwSdHostState AwSdHostState; -#define AW_SDHOST(obj) \ - OBJECT_CHECK(AwSdHostState, (obj), TYPE_AW_SDHOST) -#define AW_SDHOST_CLASS(klass) \ - OBJECT_CLASS_CHECK(AwSdHostClass, (klass), TYPE_AW_SDHOST) -#define AW_SDHOST_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AwSdHostClass, (obj), TYPE_AW_SDHOST) +DECLARE_OBJ_CHECKERS(AwSdHostState, AwSdHostClass, + AW_SDHOST, TYPE_AW_SDHOST) =20 /** @} */ =20 diff --git a/include/hw/sd/aspeed_sdhci.h b/include/hw/sd/aspeed_sdhci.h index 527075476b..783ccc2956 100644 --- a/include/hw/sd/aspeed_sdhci.h +++ b/include/hw/sd/aspeed_sdhci.h @@ -14,8 +14,8 @@ =20 #define TYPE_ASPEED_SDHCI "aspeed.sdhci" typedef struct AspeedSDHCIState AspeedSDHCIState; -#define ASPEED_SDHCI(obj) OBJECT_CHECK(AspeedSDHCIState, (obj), \ - TYPE_ASPEED_SDHCI) +DECLARE_INSTANCE_CHECKER(AspeedSDHCIState, ASPEED_SDHCI, + TYPE_ASPEED_SDHCI) =20 #define ASPEED_SDHCI_CAPABILITIES 0x01E80080 #define ASPEED_SDHCI_NUM_SLOTS 2 diff --git a/include/hw/sd/bcm2835_sdhost.h b/include/hw/sd/bcm2835_sdhost.h index 233e74b002..751ba531d6 100644 --- a/include/hw/sd/bcm2835_sdhost.h +++ b/include/hw/sd/bcm2835_sdhost.h @@ -20,8 +20,8 @@ =20 #define TYPE_BCM2835_SDHOST "bcm2835-sdhost" typedef struct BCM2835SDHostState BCM2835SDHostState; -#define BCM2835_SDHOST(obj) \ - OBJECT_CHECK(BCM2835SDHostState, (obj), TYPE_BCM2835_SDHOST) +DECLARE_INSTANCE_CHECKER(BCM2835SDHostState, BCM2835_SDHOST, + TYPE_BCM2835_SDHOST) =20 #define BCM2835_SDHOST_FIFO_LEN 16 =20 diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 850740ea92..31ccbeab0e 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -94,11 +94,8 @@ typedef struct SDBus SDBus; =20 #define TYPE_SD_CARD "sd-card" typedef struct SDCardClass SDCardClass; -#define SD_CARD(obj) OBJECT_CHECK(SDState, (obj), TYPE_SD_CARD) -#define SD_CARD_CLASS(klass) \ - OBJECT_CLASS_CHECK(SDCardClass, (klass), TYPE_SD_CARD) -#define SD_CARD_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SDCardClass, (obj), TYPE_SD_CARD) +DECLARE_OBJ_CHECKERS(SDState, SDCardClass, + SD_CARD, TYPE_SD_CARD) =20 struct SDCardClass { /*< private >*/ @@ -134,9 +131,8 @@ struct SDCardClass { =20 #define TYPE_SD_BUS "sd-bus" typedef struct SDBusClass SDBusClass; -#define SD_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SD_BUS) -#define SD_BUS_CLASS(klass) OBJECT_CLASS_CHECK(SDBusClass, (klass), TYPE_S= D_BUS) -#define SD_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(SDBusClass, (obj), TYPE_SD_= BUS) +DECLARE_OBJ_CHECKERS(SDBus, SDBusClass, + SD_BUS, TYPE_SD_BUS) =20 struct SDBus { BusState qbus; diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 67b01fcb28..01a64c5442 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -115,11 +115,12 @@ typedef struct SDHCIState SDHCIState; #define SDHCI_QUIRK_NO_BUSY_IRQ BIT(14) =20 #define TYPE_PCI_SDHCI "sdhci-pci" -#define PCI_SDHCI(obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI) +DECLARE_INSTANCE_CHECKER(SDHCIState, PCI_SDHCI, + TYPE_PCI_SDHCI) =20 #define TYPE_SYSBUS_SDHCI "generic-sdhci" -#define SYSBUS_SDHCI(obj) \ - OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) +DECLARE_INSTANCE_CHECKER(SDHCIState, SYSBUS_SDHCI, + TYPE_SYSBUS_SDHCI) =20 #define TYPE_IMX_USDHC "imx-usdhc" =20 diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 21ad6327d2..6387f2b612 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -67,8 +67,8 @@ struct PIIXState { typedef struct PIIXState PIIX3State; =20 #define TYPE_PIIX3_PCI_DEVICE "pci-piix3" -#define PIIX3_PCI_DEVICE(obj) \ - OBJECT_CHECK(PIIX3State, (obj), TYPE_PIIX3_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, + TYPE_PIIX3_PCI_DEVICE) =20 extern PCIDevice *piix4_dev; =20 diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index 9c80ef54ff..a402665a9c 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -10,8 +10,8 @@ =20 #define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" typedef struct DMADeviceState DMADeviceState; -#define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \ - TYPE_SPARC32_DMA_DEVICE) +DECLARE_INSTANCE_CHECKER(DMADeviceState, SPARC32_DMA_DEVICE, + TYPE_SPARC32_DMA_DEVICE) =20 =20 struct DMADeviceState { @@ -26,8 +26,8 @@ struct DMADeviceState { =20 #define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" typedef struct ESPDMADeviceState ESPDMADeviceState; -#define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \ - TYPE_SPARC32_ESPDMA_DEVICE) +DECLARE_INSTANCE_CHECKER(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE, + TYPE_SPARC32_ESPDMA_DEVICE) =20 struct ESPDMADeviceState { DMADeviceState parent_obj; @@ -37,8 +37,8 @@ struct ESPDMADeviceState { =20 #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" typedef struct LEDMADeviceState LEDMADeviceState; -#define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \ - TYPE_SPARC32_LEDMA_DEVICE) +DECLARE_INSTANCE_CHECKER(LEDMADeviceState, SPARC32_LEDMA_DEVICE, + TYPE_SPARC32_LEDMA_DEVICE) =20 struct LEDMADeviceState { DMADeviceState parent_obj; @@ -48,8 +48,8 @@ struct LEDMADeviceState { =20 #define TYPE_SPARC32_DMA "sparc32-dma" typedef struct SPARC32DMAState SPARC32DMAState; -#define SPARC32_DMA(obj) OBJECT_CHECK(SPARC32DMAState, (obj), \ - TYPE_SPARC32_DMA) +DECLARE_INSTANCE_CHECKER(SPARC32DMAState, SPARC32_DMA, + TYPE_SPARC32_DMA) =20 struct SPARC32DMAState { SysBusDevice parent_obj; diff --git a/include/hw/sparc/sun4m_iommu.h b/include/hw/sparc/sun4m_iommu.h index 6095eed0af..4e2ab34cde 100644 --- a/include/hw/sparc/sun4m_iommu.h +++ b/include/hw/sparc/sun4m_iommu.h @@ -45,7 +45,8 @@ struct IOMMUState { typedef struct IOMMUState IOMMUState; =20 #define TYPE_SUN4M_IOMMU "sun4m-iommu" -#define SUN4M_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4M_IOMMU) +DECLARE_INSTANCE_CHECKER(IOMMUState, SUN4M_IOMMU, + TYPE_SUN4M_IOMMU) =20 #define TYPE_SUN4M_IOMMU_MEMORY_REGION "sun4m-iommu-memory-region" =20 diff --git a/include/hw/sparc/sun4u_iommu.h b/include/hw/sparc/sun4u_iommu.h index dfe10459e5..f94566a72c 100644 --- a/include/hw/sparc/sun4u_iommu.h +++ b/include/hw/sparc/sun4u_iommu.h @@ -44,7 +44,8 @@ struct IOMMUState { typedef struct IOMMUState IOMMUState; =20 #define TYPE_SUN4U_IOMMU "sun4u-iommu" -#define SUN4U_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4U_IOMMU) +DECLARE_INSTANCE_CHECKER(IOMMUState, SUN4U_IOMMU, + TYPE_SUN4U_IOMMU) =20 #define TYPE_SUN4U_IOMMU_MEMORY_REGION "sun4u-iommu-memory-region" =20 diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index a2072ffeea..8e023d8ff6 100644 --- a/include/hw/ssi/aspeed_smc.h +++ b/include/hw/ssi/aspeed_smc.h @@ -70,11 +70,8 @@ typedef struct AspeedSMCFlash { #define TYPE_ASPEED_SMC "aspeed.smc" typedef struct AspeedSMCClass AspeedSMCClass; typedef struct AspeedSMCState AspeedSMCState; -#define ASPEED_SMC(obj) OBJECT_CHECK(AspeedSMCState, (obj), TYPE_ASPEED_SM= C) -#define ASPEED_SMC_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedSMCClass, (klass), TYPE_ASPEED_SMC) -#define ASPEED_SMC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedSMCClass, (obj), TYPE_ASPEED_SMC) +DECLARE_OBJ_CHECKERS(AspeedSMCState, AspeedSMCClass, + ASPEED_SMC, TYPE_ASPEED_SMC) =20 struct AspeedSMCClass { SysBusDevice parent_obj; diff --git a/include/hw/ssi/imx_spi.h b/include/hw/ssi/imx_spi.h index 3a966af0ec..874fea492d 100644 --- a/include/hw/ssi/imx_spi.h +++ b/include/hw/ssi/imx_spi.h @@ -79,7 +79,8 @@ =20 #define TYPE_IMX_SPI "imx.spi" typedef struct IMXSPIState IMXSPIState; -#define IMX_SPI(obj) OBJECT_CHECK(IMXSPIState, (obj), TYPE_IMX_SPI) +DECLARE_INSTANCE_CHECKER(IMXSPIState, IMX_SPI, + TYPE_IMX_SPI) =20 struct IMXSPIState { /* */ diff --git a/include/hw/ssi/mss-spi.h b/include/hw/ssi/mss-spi.h index 40e1a5ac90..7c16cf6b49 100644 --- a/include/hw/ssi/mss-spi.h +++ b/include/hw/ssi/mss-spi.h @@ -32,7 +32,8 @@ =20 #define TYPE_MSS_SPI "mss-spi" typedef struct MSSSpiState MSSSpiState; -#define MSS_SPI(obj) OBJECT_CHECK(MSSSpiState, (obj), TYPE_MSS_SPI) +DECLARE_INSTANCE_CHECKER(MSSSpiState, MSS_SPI, + TYPE_MSS_SPI) =20 #define R_SPI_MAX 16 =20 diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h index 64aeb61eef..1f5da7cc44 100644 --- a/include/hw/ssi/pl022.h +++ b/include/hw/ssi/pl022.h @@ -26,7 +26,8 @@ =20 #define TYPE_PL022 "pl022" typedef struct PL022State PL022State; -#define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022) +DECLARE_INSTANCE_CHECKER(PL022State, PL022, + TYPE_PL022) =20 struct PL022State { SysBusDevice parent_obj; diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index b42765f415..b9286989fc 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -19,12 +19,8 @@ typedef struct SSISlaveClass SSISlaveClass; typedef enum SSICSMode SSICSMode; =20 #define TYPE_SSI_SLAVE "ssi-slave" -#define SSI_SLAVE(obj) \ - OBJECT_CHECK(SSISlave, (obj), TYPE_SSI_SLAVE) -#define SSI_SLAVE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SSISlaveClass, (klass), TYPE_SSI_SLAVE) -#define SSI_SLAVE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SSISlaveClass, (obj), TYPE_SSI_SLAVE) +DECLARE_OBJ_CHECKERS(SSISlave, SSISlaveClass, + SSI_SLAVE, TYPE_SSI_SLAVE) =20 #define SSI_GPIO_CS "ssi-gpio-cs" =20 diff --git a/include/hw/ssi/stm32f2xx_spi.h b/include/hw/ssi/stm32f2xx_spi.h index 1c8ff7d724..4bb36d04ed 100644 --- a/include/hw/ssi/stm32f2xx_spi.h +++ b/include/hw/ssi/stm32f2xx_spi.h @@ -46,8 +46,8 @@ =20 #define TYPE_STM32F2XX_SPI "stm32f2xx-spi" typedef struct STM32F2XXSPIState STM32F2XXSPIState; -#define STM32F2XX_SPI(obj) \ - OBJECT_CHECK(STM32F2XXSPIState, (obj), TYPE_STM32F2XX_SPI) +DECLARE_INSTANCE_CHECKER(STM32F2XXSPIState, STM32F2XX_SPI, + TYPE_STM32F2XX_SPI) =20 struct STM32F2XXSPIState { /* */ diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index 2171018601..b1ab347617 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -136,17 +136,13 @@ typedef struct XilinxSPIPSClass XilinxSPIPSClass; #define TYPE_XILINX_QSPIPS "xlnx.ps7-qspi" #define TYPE_XLNX_ZYNQMP_QSPIPS "xlnx.usmp-gqspi" =20 -#define XILINX_SPIPS(obj) \ - OBJECT_CHECK(XilinxSPIPS, (obj), TYPE_XILINX_SPIPS) -#define XILINX_SPIPS_CLASS(klass) \ - OBJECT_CLASS_CHECK(XilinxSPIPSClass, (klass), TYPE_XILINX_SPIPS) -#define XILINX_SPIPS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XilinxSPIPSClass, (obj), TYPE_XILINX_SPIPS) - -#define XILINX_QSPIPS(obj) \ - OBJECT_CHECK(XilinxQSPIPS, (obj), TYPE_XILINX_QSPIPS) - -#define XLNX_ZYNQMP_QSPIPS(obj) \ - OBJECT_CHECK(XlnxZynqMPQSPIPS, (obj), TYPE_XLNX_ZYNQMP_QSPIPS) +DECLARE_OBJ_CHECKERS(XilinxSPIPS, XilinxSPIPSClass, + XILINX_SPIPS, TYPE_XILINX_SPIPS) + +DECLARE_INSTANCE_CHECKER(XilinxQSPIPS, XILINX_QSPIPS, + TYPE_XILINX_QSPIPS) + +DECLARE_INSTANCE_CHECKER(XlnxZynqMPQSPIPS, XLNX_ZYNQMP_QSPIPS, + TYPE_XLNX_ZYNQMP_QSPIPS) =20 #endif /* XILINX_SPIPS_H */ diff --git a/include/hw/stream.h b/include/hw/stream.h index bd41750e94..e39d5a5b55 100644 --- a/include/hw/stream.h +++ b/include/hw/stream.h @@ -7,10 +7,8 @@ #define TYPE_STREAM_SLAVE "stream-slave" =20 typedef struct StreamSlaveClass StreamSlaveClass; -#define STREAM_SLAVE_CLASS(klass) \ - OBJECT_CLASS_CHECK(StreamSlaveClass, (klass), TYPE_STREAM_SLAVE) -#define STREAM_SLAVE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(StreamSlaveClass, (obj), TYPE_STREAM_SLAVE) +DECLARE_CLASS_CHECKERS(StreamSlaveClass, STREAM_SLAVE, + TYPE_STREAM_SLAVE) #define STREAM_SLAVE(obj) \ INTERFACE_CHECK(StreamSlave, (obj), TYPE_STREAM_SLAVE) =20 diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 3537e43f23..77e21bba18 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -11,18 +11,15 @@ #define QDEV_MAX_PIO 32 =20 #define TYPE_SYSTEM_BUS "System" -#define SYSTEM_BUS(obj) OBJECT_CHECK(BusState, (obj), TYPE_SYSTEM_BUS) +DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS, + TYPE_SYSTEM_BUS) =20 typedef struct SysBusDevice SysBusDevice; =20 #define TYPE_SYS_BUS_DEVICE "sys-bus-device" typedef struct SysBusDeviceClass SysBusDeviceClass; -#define SYS_BUS_DEVICE(obj) \ - OBJECT_CHECK(SysBusDevice, (obj), TYPE_SYS_BUS_DEVICE) -#define SYS_BUS_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SysBusDeviceClass, (klass), TYPE_SYS_BUS_DEVICE) -#define SYS_BUS_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SysBusDeviceClass, (obj), TYPE_SYS_BUS_DEVICE) +DECLARE_OBJ_CHECKERS(SysBusDevice, SysBusDeviceClass, + SYS_BUS_DEVICE, TYPE_SYS_BUS_DEVICE) =20 /** * SysBusDeviceClass: diff --git a/include/hw/timer/a9gtimer.h b/include/hw/timer/a9gtimer.h index 88811c6c8f..f6fcc4bfc6 100644 --- a/include/hw/timer/a9gtimer.h +++ b/include/hw/timer/a9gtimer.h @@ -30,7 +30,8 @@ =20 #define TYPE_A9_GTIMER "arm.cortex-a9-global-timer" typedef struct A9GTimerState A9GTimerState; -#define A9_GTIMER(obj) OBJECT_CHECK(A9GTimerState, (obj), TYPE_A9_GTIMER) +DECLARE_INSTANCE_CHECKER(A9GTimerState, A9_GTIMER, + TYPE_A9_GTIMER) =20 #define R_COUNTER_LO 0x00 #define R_COUNTER_HI 0x04 diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwin= ner-a10-pit.h index fa060c684d..9638e3c84c 100644 --- a/include/hw/timer/allwinner-a10-pit.h +++ b/include/hw/timer/allwinner-a10-pit.h @@ -7,7 +7,8 @@ =20 #define TYPE_AW_A10_PIT "allwinner-A10-timer" typedef struct AwA10PITState AwA10PITState; -#define AW_A10_PIT(obj) OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT) +DECLARE_INSTANCE_CHECKER(AwA10PITState, AW_A10_PIT, + TYPE_AW_A10_PIT) =20 #define AW_A10_PIT_TIMER_NR 6 #define AW_A10_PIT_TIMER_IRQ 0x1 diff --git a/include/hw/timer/arm_mptimer.h b/include/hw/timer/arm_mptimer.h index 643a256ecf..47d5e51686 100644 --- a/include/hw/timer/arm_mptimer.h +++ b/include/hw/timer/arm_mptimer.h @@ -37,8 +37,8 @@ typedef struct { =20 #define TYPE_ARM_MPTIMER "arm_mptimer" typedef struct ARMMPTimerState ARMMPTimerState; -#define ARM_MPTIMER(obj) \ - OBJECT_CHECK(ARMMPTimerState, (obj), TYPE_ARM_MPTIMER) +DECLARE_INSTANCE_CHECKER(ARMMPTimerState, ARM_MPTIMER, + TYPE_ARM_MPTIMER) =20 struct ARMMPTimerState { /*< private >*/ diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_sy= stick.h index 33df057958..b605688fee 100644 --- a/include/hw/timer/armv7m_systick.h +++ b/include/hw/timer/armv7m_systick.h @@ -18,7 +18,8 @@ #define TYPE_SYSTICK "armv7m_systick" =20 typedef struct SysTickState SysTickState; -#define SYSTICK(obj) OBJECT_CHECK(SysTickState, (obj), TYPE_SYSTICK) +DECLARE_INSTANCE_CHECKER(SysTickState, SYSTICK, + TYPE_SYSTICK) =20 struct SysTickState { /*< private >*/ diff --git a/include/hw/timer/aspeed_timer.h b/include/hw/timer/aspeed_time= r.h index c890aaa949..4c76f955c9 100644 --- a/include/hw/timer/aspeed_timer.h +++ b/include/hw/timer/aspeed_timer.h @@ -29,8 +29,8 @@ #define TYPE_ASPEED_TIMER "aspeed.timer" typedef struct AspeedTimerClass AspeedTimerClass; typedef struct AspeedTimerCtrlState AspeedTimerCtrlState; -#define ASPEED_TIMER(obj) \ - OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER) +DECLARE_OBJ_CHECKERS(AspeedTimerCtrlState, AspeedTimerClass, + ASPEED_TIMER, TYPE_ASPEED_TIMER) #define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400" #define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500" #define TYPE_ASPEED_2600_TIMER TYPE_ASPEED_TIMER "-ast2600" @@ -69,10 +69,6 @@ struct AspeedTimerCtrlState { AspeedSCUState *scu; }; =20 -#define ASPEED_TIMER_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedTimerClass, (klass), TYPE_ASPEED_TIMER) -#define ASPEED_TIMER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedTimerClass, (obj), TYPE_ASPEED_TIMER) =20 struct AspeedTimerClass { SysBusDeviceClass parent_class; diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h index 9efe75ce5e..d454bb31cb 100644 --- a/include/hw/timer/avr_timer16.h +++ b/include/hw/timer/avr_timer16.h @@ -43,8 +43,8 @@ enum NextInterrupt { =20 #define TYPE_AVR_TIMER16 "avr-timer16" typedef struct AVRTimer16State AVRTimer16State; -#define AVR_TIMER16(obj) \ - OBJECT_CHECK(AVRTimer16State, (obj), TYPE_AVR_TIMER16) +DECLARE_INSTANCE_CHECKER(AVRTimer16State, AVR_TIMER16, + TYPE_AVR_TIMER16) =20 struct AVRTimer16State { /* */ diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index 796f62cf88..64166bd712 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -15,8 +15,8 @@ =20 #define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer" typedef struct BCM2835SystemTimerState BCM2835SystemTimerState; -#define BCM2835_SYSTIMER(obj) \ - OBJECT_CHECK(BCM2835SystemTimerState, (obj), TYPE_BCM2835_SYSTIMER) +DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM2835_SYSTIMER, + TYPE_BCM2835_SYSTIMER) =20 struct BCM2835SystemTimerState { /*< private >*/ diff --git a/include/hw/timer/cmsdk-apb-dualtimer.h b/include/hw/timer/cmsd= k-apb-dualtimer.h index 8a1137aec7..7a5b9df5e5 100644 --- a/include/hw/timer/cmsdk-apb-dualtimer.h +++ b/include/hw/timer/cmsdk-apb-dualtimer.h @@ -32,8 +32,8 @@ =20 #define TYPE_CMSDK_APB_DUALTIMER "cmsdk-apb-dualtimer" typedef struct CMSDKAPBDualTimer CMSDKAPBDualTimer; -#define CMSDK_APB_DUALTIMER(obj) OBJECT_CHECK(CMSDKAPBDualTimer, (obj), \ - TYPE_CMSDK_APB_DUALTIMER) +DECLARE_INSTANCE_CHECKER(CMSDKAPBDualTimer, CMSDK_APB_DUALTIMER, + TYPE_CMSDK_APB_DUALTIMER) =20 =20 /* One of the two identical timer modules in the dual-timer module */ diff --git a/include/hw/timer/cmsdk-apb-timer.h b/include/hw/timer/cmsdk-ap= b-timer.h index a7ca523529..0912bc0f3c 100644 --- a/include/hw/timer/cmsdk-apb-timer.h +++ b/include/hw/timer/cmsdk-apb-timer.h @@ -19,8 +19,8 @@ =20 #define TYPE_CMSDK_APB_TIMER "cmsdk-apb-timer" typedef struct CMSDKAPBTIMER CMSDKAPBTIMER; -#define CMSDK_APB_TIMER(obj) OBJECT_CHECK(CMSDKAPBTIMER, (obj), \ - TYPE_CMSDK_APB_TIMER) +DECLARE_INSTANCE_CHECKER(CMSDKAPBTIMER, CMSDK_APB_TIMER, + TYPE_CMSDK_APB_TIMER) =20 struct CMSDKAPBTIMER { /*< private >*/ diff --git a/include/hw/timer/digic-timer.h b/include/hw/timer/digic-timer.h index 543bf8c6be..84a0ef473a 100644 --- a/include/hw/timer/digic-timer.h +++ b/include/hw/timer/digic-timer.h @@ -24,7 +24,8 @@ =20 #define TYPE_DIGIC_TIMER "digic-timer" typedef struct DigicTimerState DigicTimerState; -#define DIGIC_TIMER(obj) OBJECT_CHECK(DigicTimerState, (obj), TYPE_DIGIC_T= IMER) +DECLARE_INSTANCE_CHECKER(DigicTimerState, DIGIC_TIMER, + TYPE_DIGIC_TIMER) =20 #define DIGIC_TIMER_CONTROL 0x00 #define DIGIC_TIMER_CONTROL_RST 0x80000000 diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 6adbc31e7e..1a522a2457 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -42,12 +42,8 @@ typedef struct PITChannelInfo { #define TYPE_PIT_COMMON "pit-common" typedef struct PITCommonState PITCommonState; typedef struct PITCommonClass PITCommonClass; -#define PIT_COMMON(obj) \ - OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON) -#define PIT_COMMON_CLASS(klass) \ - OBJECT_CLASS_CHECK(PITCommonClass, (klass), TYPE_PIT_COMMON) -#define PIT_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PITCommonClass, (obj), TYPE_PIT_COMMON) +DECLARE_OBJ_CHECKERS(PITCommonState, PITCommonClass, + PIT_COMMON, TYPE_PIT_COMMON) =20 #define TYPE_I8254 "isa-pit" #define TYPE_KVM_I8254 "kvm-pit" diff --git a/include/hw/timer/imx_epit.h b/include/hw/timer/imx_epit.h index 1ca110caf5..39bcf81331 100644 --- a/include/hw/timer/imx_epit.h +++ b/include/hw/timer/imx_epit.h @@ -57,7 +57,8 @@ =20 #define TYPE_IMX_EPIT "imx.epit" typedef struct IMXEPITState IMXEPITState; -#define IMX_EPIT(obj) OBJECT_CHECK(IMXEPITState, (obj), TYPE_IMX_EPIT) +DECLARE_INSTANCE_CHECKER(IMXEPITState, IMX_EPIT, + TYPE_IMX_EPIT) =20 struct IMXEPITState { /*< private >*/ diff --git a/include/hw/timer/imx_gpt.h b/include/hw/timer/imx_gpt.h index b96633d8b2..ff5c8a351a 100644 --- a/include/hw/timer/imx_gpt.h +++ b/include/hw/timer/imx_gpt.h @@ -83,7 +83,8 @@ #define TYPE_IMX_GPT TYPE_IMX25_GPT =20 typedef struct IMXGPTState IMXGPTState; -#define IMX_GPT(obj) OBJECT_CHECK(IMXGPTState, (obj), TYPE_IMX_GPT) +DECLARE_INSTANCE_CHECKER(IMXGPTState, IMX_GPT, + TYPE_IMX_GPT) =20 struct IMXGPTState { /*< private >*/ diff --git a/include/hw/timer/mss-timer.h b/include/hw/timer/mss-timer.h index 011c5f1ba9..d207bae2c0 100644 --- a/include/hw/timer/mss-timer.h +++ b/include/hw/timer/mss-timer.h @@ -31,8 +31,8 @@ =20 #define TYPE_MSS_TIMER "mss-timer" typedef struct MSSTimerState MSSTimerState; -#define MSS_TIMER(obj) OBJECT_CHECK(MSSTimerState, \ - (obj), TYPE_MSS_TIMER) +DECLARE_INSTANCE_CHECKER(MSSTimerState, MSS_TIMER, + TYPE_MSS_TIMER) =20 /* * There are two 32-bit down counting timers. diff --git a/include/hw/timer/nrf51_timer.h b/include/hw/timer/nrf51_timer.h index b4eb29bd76..4261a03b95 100644 --- a/include/hw/timer/nrf51_timer.h +++ b/include/hw/timer/nrf51_timer.h @@ -18,7 +18,8 @@ #include "qom/object.h" #define TYPE_NRF51_TIMER "nrf51_soc.timer" typedef struct NRF51TimerState NRF51TimerState; -#define NRF51_TIMER(obj) OBJECT_CHECK(NRF51TimerState, (obj), TYPE_NRF51_T= IMER) +DECLARE_INSTANCE_CHECKER(NRF51TimerState, NRF51_TIMER, + TYPE_NRF51_TIMER) =20 #define NRF51_TIMER_REG_COUNT 4 =20 diff --git a/include/hw/timer/renesas_cmt.h b/include/hw/timer/renesas_cmt.h index 313f9e1965..1c0b65c1d5 100644 --- a/include/hw/timer/renesas_cmt.h +++ b/include/hw/timer/renesas_cmt.h @@ -15,7 +15,8 @@ =20 #define TYPE_RENESAS_CMT "renesas-cmt" typedef struct RCMTState RCMTState; -#define RCMT(obj) OBJECT_CHECK(RCMTState, (obj), TYPE_RENESAS_CMT) +DECLARE_INSTANCE_CHECKER(RCMTState, RCMT, + TYPE_RENESAS_CMT) =20 enum { CMT_CH =3D 2, diff --git a/include/hw/timer/renesas_tmr.h b/include/hw/timer/renesas_tmr.h index e2abcb13ad..caf7eec0dc 100644 --- a/include/hw/timer/renesas_tmr.h +++ b/include/hw/timer/renesas_tmr.h @@ -15,7 +15,8 @@ =20 #define TYPE_RENESAS_TMR "renesas-tmr" typedef struct RTMRState RTMRState; -#define RTMR(obj) OBJECT_CHECK(RTMRState, (obj), TYPE_RENESAS_TMR) +DECLARE_INSTANCE_CHECKER(RTMRState, RTMR, + TYPE_RENESAS_TMR) =20 enum timer_event { cmia =3D 0, diff --git a/include/hw/timer/stm32f2xx_timer.h b/include/hw/timer/stm32f2x= x_timer.h index 9eb9201085..90f40f1746 100644 --- a/include/hw/timer/stm32f2xx_timer.h +++ b/include/hw/timer/stm32f2xx_timer.h @@ -63,8 +63,8 @@ =20 #define TYPE_STM32F2XX_TIMER "stm32f2xx-timer" typedef struct STM32F2XXTimerState STM32F2XXTimerState; -#define STM32F2XXTIMER(obj) OBJECT_CHECK(STM32F2XXTimerState, \ - (obj), TYPE_STM32F2XX_TIMER) +DECLARE_INSTANCE_CHECKER(STM32F2XXTimerState, STM32F2XXTIMER, + TYPE_STM32F2XX_TIMER) =20 struct STM32F2XXTimerState { /* */ diff --git a/include/hw/usb.h b/include/hw/usb.h index e6ec0c891c..5783635491 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -266,12 +266,8 @@ struct USBDevice { =20 #define TYPE_USB_DEVICE "usb-device" typedef struct USBDeviceClass USBDeviceClass; -#define USB_DEVICE(obj) \ - OBJECT_CHECK(USBDevice, (obj), TYPE_USB_DEVICE) -#define USB_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(USBDeviceClass, (klass), TYPE_USB_DEVICE) -#define USB_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(USBDeviceClass, (obj), TYPE_USB_DEVICE) +DECLARE_OBJ_CHECKERS(USBDevice, USBDeviceClass, + USB_DEVICE, TYPE_USB_DEVICE) =20 typedef void (*USBDeviceRealize)(USBDevice *dev, Error **errp); typedef void (*USBDeviceUnrealize)(USBDevice *dev); @@ -479,7 +475,8 @@ bool usb_host_dev_is_scsi_storage(USBDevice *usbdev); /* usb-bus.c */ =20 #define TYPE_USB_BUS "usb-bus" -#define USB_BUS(obj) OBJECT_CHECK(USBBus, (obj), TYPE_USB_BUS) +DECLARE_INSTANCE_CHECKER(USBBus, USB_BUS, + TYPE_USB_BUS) =20 struct USBBus { BusState qbus; diff --git a/include/hw/usb/chipidea.h b/include/hw/usb/chipidea.h index 1db449e1c4..f0303b8721 100644 --- a/include/hw/usb/chipidea.h +++ b/include/hw/usb/chipidea.h @@ -13,6 +13,7 @@ struct ChipideaState { typedef struct ChipideaState ChipideaState; =20 #define TYPE_CHIPIDEA "usb-chipidea" -#define CHIPIDEA(obj) OBJECT_CHECK(ChipideaState, (obj), TYPE_CHIPIDEA) +DECLARE_INSTANCE_CHECKER(ChipideaState, CHIPIDEA, + TYPE_CHIPIDEA) =20 #endif /* CHIPIDEA_H */ diff --git a/include/hw/usb/imx-usb-phy.h b/include/hw/usb/imx-usb-phy.h index 9861acb5ac..f7f92fc462 100644 --- a/include/hw/usb/imx-usb-phy.h +++ b/include/hw/usb/imx-usb-phy.h @@ -40,7 +40,8 @@ enum IMXUsbPhyRegisters { =20 #define TYPE_IMX_USBPHY "imx.usbphy" typedef struct IMXUSBPHYState IMXUSBPHYState; -#define IMX_USBPHY(obj) OBJECT_CHECK(IMXUSBPHYState, (obj), TYPE_IMX_USBPH= Y) +DECLARE_INSTANCE_CHECKER(IMXUSBPHYState, IMX_USBPHY, + TYPE_IMX_USBPHY) =20 struct IMXUSBPHYState { /* */ diff --git a/include/hw/vfio/vfio-amd-xgbe.h b/include/hw/vfio/vfio-amd-xgb= e.h index b860ac0446..a894546c02 100644 --- a/include/hw/vfio/vfio-amd-xgbe.h +++ b/include/hw/vfio/vfio-amd-xgbe.h @@ -40,13 +40,7 @@ struct VFIOAmdXgbeDeviceClass { =20 typedef struct VFIOAmdXgbeDeviceClass VFIOAmdXgbeDeviceClass; =20 -#define VFIO_AMD_XGBE_DEVICE(obj) \ - OBJECT_CHECK(VFIOAmdXgbeDevice, (obj), TYPE_VFIO_AMD_XGBE) -#define VFIO_AMD_XGBE_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VFIOAmdXgbeDeviceClass, (klass), \ - TYPE_VFIO_AMD_XGBE) -#define VFIO_AMD_XGBE_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VFIOAmdXgbeDeviceClass, (obj), \ - TYPE_VFIO_AMD_XGBE) +DECLARE_OBJ_CHECKERS(VFIOAmdXgbeDevice, VFIOAmdXgbeDeviceClass, + VFIO_AMD_XGBE_DEVICE, TYPE_VFIO_AMD_XGBE) =20 #endif diff --git a/include/hw/vfio/vfio-calxeda-xgmac.h b/include/hw/vfio/vfio-ca= lxeda-xgmac.h index b19dc2160b..8482f151dd 100644 --- a/include/hw/vfio/vfio-calxeda-xgmac.h +++ b/include/hw/vfio/vfio-calxeda-xgmac.h @@ -37,13 +37,7 @@ struct VFIOCalxedaXgmacDeviceClass { }; typedef struct VFIOCalxedaXgmacDeviceClass VFIOCalxedaXgmacDeviceClass; =20 -#define VFIO_CALXEDA_XGMAC_DEVICE(obj) \ - OBJECT_CHECK(VFIOCalxedaXgmacDevice, (obj), TYPE_VFIO_CALXEDA_XGMAC) -#define VFIO_CALXEDA_XGMAC_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VFIOCalxedaXgmacDeviceClass, (klass), \ - TYPE_VFIO_CALXEDA_XGMAC) -#define VFIO_CALXEDA_XGMAC_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VFIOCalxedaXgmacDeviceClass, (obj), \ - TYPE_VFIO_CALXEDA_XGMAC) +DECLARE_OBJ_CHECKERS(VFIOCalxedaXgmacDevice, VFIOCalxedaXgmacDeviceClass, + VFIO_CALXEDA_XGMAC_DEVICE, TYPE_VFIO_CALXEDA_XGMAC) =20 #endif diff --git a/include/hw/vfio/vfio-platform.h b/include/hw/vfio/vfio-platfor= m.h index 248c23dba7..c414c3dffc 100644 --- a/include/hw/vfio/vfio-platform.h +++ b/include/hw/vfio/vfio-platform.h @@ -70,11 +70,7 @@ struct VFIOPlatformDeviceClass { }; typedef struct VFIOPlatformDeviceClass VFIOPlatformDeviceClass; =20 -#define VFIO_PLATFORM_DEVICE(obj) \ - OBJECT_CHECK(VFIOPlatformDevice, (obj), TYPE_VFIO_PLATFORM) -#define VFIO_PLATFORM_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VFIOPlatformDeviceClass, (klass), TYPE_VFIO_PLATFO= RM) -#define VFIO_PLATFORM_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VFIOPlatformDeviceClass, (obj), TYPE_VFIO_PLATFORM) +DECLARE_OBJ_CHECKERS(VFIOPlatformDevice, VFIOPlatformDeviceClass, + VFIO_PLATFORM_DEVICE, TYPE_VFIO_PLATFORM) =20 #endif /* HW_VFIO_VFIO_PLATFORM_H */ diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhos= t-scsi-common.h index f198f25119..5f0bf73d9d 100644 --- a/include/hw/virtio/vhost-scsi-common.h +++ b/include/hw/virtio/vhost-scsi-common.h @@ -21,8 +21,8 @@ =20 #define TYPE_VHOST_SCSI_COMMON "vhost-scsi-common" typedef struct VHostSCSICommon VHostSCSICommon; -#define VHOST_SCSI_COMMON(obj) \ - OBJECT_CHECK(VHostSCSICommon, (obj), TYPE_VHOST_SCSI_COMMON) +DECLARE_INSTANCE_CHECKER(VHostSCSICommon, VHOST_SCSI_COMMON, + TYPE_VHOST_SCSI_COMMON) =20 struct VHostSCSICommon { VirtIOSCSICommon parent_obj; diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h index 72ae842646..7a77644150 100644 --- a/include/hw/virtio/vhost-scsi.h +++ b/include/hw/virtio/vhost-scsi.h @@ -27,8 +27,8 @@ enum vhost_scsi_vq_list { =20 #define TYPE_VHOST_SCSI "vhost-scsi" typedef struct VHostSCSI VHostSCSI; -#define VHOST_SCSI(obj) \ - OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI) +DECLARE_INSTANCE_CHECKER(VHostSCSI, VHOST_SCSI, + TYPE_VHOST_SCSI) =20 struct VHostSCSI { VHostSCSICommon parent_obj; diff --git a/include/hw/virtio/vhost-user-blk.h b/include/hw/virtio/vhost-u= ser-blk.h index 9d38877907..dc40ab6f11 100644 --- a/include/hw/virtio/vhost-user-blk.h +++ b/include/hw/virtio/vhost-user-blk.h @@ -24,8 +24,8 @@ =20 #define TYPE_VHOST_USER_BLK "vhost-user-blk" typedef struct VHostUserBlk VHostUserBlk; -#define VHOST_USER_BLK(obj) \ - OBJECT_CHECK(VHostUserBlk, (obj), TYPE_VHOST_USER_BLK) +DECLARE_INSTANCE_CHECKER(VHostUserBlk, VHOST_USER_BLK, + TYPE_VHOST_USER_BLK) =20 #define VHOST_USER_BLK_AUTO_NUM_QUEUES UINT16_MAX =20 diff --git a/include/hw/virtio/vhost-user-fs.h b/include/hw/virtio/vhost-us= er-fs.h index fa82be0e8a..9033e6f902 100644 --- a/include/hw/virtio/vhost-user-fs.h +++ b/include/hw/virtio/vhost-user-fs.h @@ -22,8 +22,8 @@ =20 #define TYPE_VHOST_USER_FS "vhost-user-fs-device" typedef struct VHostUserFS VHostUserFS; -#define VHOST_USER_FS(obj) \ - OBJECT_CHECK(VHostUserFS, (obj), TYPE_VHOST_USER_FS) +DECLARE_INSTANCE_CHECKER(VHostUserFS, VHOST_USER_FS, + TYPE_VHOST_USER_FS) =20 typedef struct { CharBackend chardev; diff --git a/include/hw/virtio/vhost-user-scsi.h b/include/hw/virtio/vhost-= user-scsi.h index c4c4c29bf9..342d67ee9e 100644 --- a/include/hw/virtio/vhost-user-scsi.h +++ b/include/hw/virtio/vhost-user-scsi.h @@ -25,8 +25,8 @@ =20 #define TYPE_VHOST_USER_SCSI "vhost-user-scsi" typedef struct VHostUserSCSI VHostUserSCSI; -#define VHOST_USER_SCSI(obj) \ - OBJECT_CHECK(VHostUserSCSI, (obj), TYPE_VHOST_USER_SCSI) +DECLARE_INSTANCE_CHECKER(VHostUserSCSI, VHOST_USER_SCSI, + TYPE_VHOST_USER_SCSI) =20 struct VHostUserSCSI { VHostSCSICommon parent_obj; diff --git a/include/hw/virtio/vhost-user-vsock.h b/include/hw/virtio/vhost= -user-vsock.h index d7eda986b6..b3c40c16a3 100644 --- a/include/hw/virtio/vhost-user-vsock.h +++ b/include/hw/virtio/vhost-user-vsock.h @@ -18,8 +18,8 @@ =20 #define TYPE_VHOST_USER_VSOCK "vhost-user-vsock-device" typedef struct VHostUserVSock VHostUserVSock; -#define VHOST_USER_VSOCK(obj) \ - OBJECT_CHECK(VHostUserVSock, (obj), TYPE_VHOST_USER_VSOCK) +DECLARE_INSTANCE_CHECKER(VHostUserVSock, VHOST_USER_VSOCK, + TYPE_VHOST_USER_VSOCK) =20 typedef struct { CharBackend chardev; diff --git a/include/hw/virtio/vhost-vsock-common.h b/include/hw/virtio/vho= st-vsock-common.h index a181396215..60bfb68db1 100644 --- a/include/hw/virtio/vhost-vsock-common.h +++ b/include/hw/virtio/vhost-vsock-common.h @@ -17,8 +17,8 @@ =20 #define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common" typedef struct VHostVSockCommon VHostVSockCommon; -#define VHOST_VSOCK_COMMON(obj) \ - OBJECT_CHECK(VHostVSockCommon, (obj), TYPE_VHOST_VSOCK_COMMON) +DECLARE_INSTANCE_CHECKER(VHostVSockCommon, VHOST_VSOCK_COMMON, + TYPE_VHOST_VSOCK_COMMON) =20 enum { VHOST_VSOCK_SAVEVM_VERSION =3D 0, diff --git a/include/hw/virtio/vhost-vsock.h b/include/hw/virtio/vhost-vsoc= k.h index e13ff85d12..c561cc427a 100644 --- a/include/hw/virtio/vhost-vsock.h +++ b/include/hw/virtio/vhost-vsock.h @@ -19,8 +19,8 @@ =20 #define TYPE_VHOST_VSOCK "vhost-vsock-device" typedef struct VHostVSock VHostVSock; -#define VHOST_VSOCK(obj) \ - OBJECT_CHECK(VHostVSock, (obj), TYPE_VHOST_VSOCK) +DECLARE_INSTANCE_CHECKER(VHostVSock, VHOST_VSOCK, + TYPE_VHOST_VSOCK) =20 typedef struct { uint64_t guest_cid; diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-= balloon.h index a5b869a4d4..0d08f496d9 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -22,8 +22,8 @@ =20 #define TYPE_VIRTIO_BALLOON "virtio-balloon-device" typedef struct VirtIOBalloon VirtIOBalloon; -#define VIRTIO_BALLOON(obj) \ - OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON) +DECLARE_INSTANCE_CHECKER(VirtIOBalloon, VIRTIO_BALLOON, + TYPE_VIRTIO_BALLOON) =20 #define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000 =20 diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index d299b55cb9..29c9f32353 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -23,8 +23,8 @@ =20 #define TYPE_VIRTIO_BLK "virtio-blk-device" typedef struct VirtIOBlock VirtIOBlock; -#define VIRTIO_BLK(obj) \ - OBJECT_CHECK(VirtIOBlock, (obj), TYPE_VIRTIO_BLK) +DECLARE_INSTANCE_CHECKER(VirtIOBlock, VIRTIO_BLK, + TYPE_VIRTIO_BLK) =20 /* This is the last element of the write scatter-gather list */ struct virtio_blk_inhdr diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h index f3e9096370..ef8abe49c5 100644 --- a/include/hw/virtio/virtio-bus.h +++ b/include/hw/virtio/virtio-bus.h @@ -32,11 +32,8 @@ #define TYPE_VIRTIO_BUS "virtio-bus" typedef struct VirtioBusClass VirtioBusClass; typedef struct VirtioBusState VirtioBusState; -#define VIRTIO_BUS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtioBusClass, obj, TYPE_VIRTIO_BUS) -#define VIRTIO_BUS_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtioBusClass, klass, TYPE_VIRTIO_BUS) -#define VIRTIO_BUS(obj) OBJECT_CHECK(VirtioBusState, (obj), TYPE_VIRTIO_BU= S) +DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass, + VIRTIO_BUS, TYPE_VIRTIO_BUS) =20 =20 struct VirtioBusClass { diff --git a/include/hw/virtio/virtio-crypto.h b/include/hw/virtio/virtio-c= rypto.h index 4134e1b7ca..7969695983 100644 --- a/include/hw/virtio/virtio-crypto.h +++ b/include/hw/virtio/virtio-crypto.h @@ -33,8 +33,8 @@ do { \ =20 #define TYPE_VIRTIO_CRYPTO "virtio-crypto-device" typedef struct VirtIOCrypto VirtIOCrypto; -#define VIRTIO_CRYPTO(obj) \ - OBJECT_CHECK(VirtIOCrypto, (obj), TYPE_VIRTIO_CRYPTO) +DECLARE_INSTANCE_CHECKER(VirtIOCrypto, VIRTIO_CRYPTO, + TYPE_VIRTIO_CRYPTO) #define VIRTIO_CRYPTO_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_CRYPTO) =20 diff --git a/include/hw/virtio/virtio-gpu-pci.h b/include/hw/virtio/virtio-= gpu-pci.h index d727c8cada..5201792ede 100644 --- a/include/hw/virtio/virtio-gpu-pci.h +++ b/include/hw/virtio/virtio-gpu-pci.h @@ -24,8 +24,8 @@ typedef struct VirtIOGPUPCIBase VirtIOGPUPCIBase; * virtio-gpu-pci-base: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_GPU_PCI_BASE "virtio-gpu-pci-base" -#define VIRTIO_GPU_PCI_BASE(obj) \ - OBJECT_CHECK(VirtIOGPUPCIBase, (obj), TYPE_VIRTIO_GPU_PCI_BASE) +DECLARE_INSTANCE_CHECKER(VirtIOGPUPCIBase, VIRTIO_GPU_PCI_BASE, + TYPE_VIRTIO_GPU_PCI_BASE) =20 struct VirtIOGPUPCIBase { VirtIOPCIProxy parent_obj; diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index f464004bc2..72f8689e2e 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -27,22 +27,18 @@ #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base" typedef struct VirtIOGPUBase VirtIOGPUBase; typedef struct VirtIOGPUBaseClass VirtIOGPUBaseClass; -#define VIRTIO_GPU_BASE(obj) = \ - OBJECT_CHECK(VirtIOGPUBase, (obj), TYPE_VIRTIO_GPU_BASE) -#define VIRTIO_GPU_BASE_GET_CLASS(obj) = \ - OBJECT_GET_CLASS(VirtIOGPUBaseClass, obj, TYPE_VIRTIO_GPU_BASE) -#define VIRTIO_GPU_BASE_CLASS(klass) = \ - OBJECT_CLASS_CHECK(VirtIOGPUBaseClass, klass, TYPE_VIRTIO_GPU_BASE) +DECLARE_OBJ_CHECKERS(VirtIOGPUBase, VirtIOGPUBaseClass, + VIRTIO_GPU_BASE, TYPE_VIRTIO_GPU_BASE) =20 #define TYPE_VIRTIO_GPU "virtio-gpu-device" typedef struct VirtIOGPU VirtIOGPU; -#define VIRTIO_GPU(obj) \ - OBJECT_CHECK(VirtIOGPU, (obj), TYPE_VIRTIO_GPU) +DECLARE_INSTANCE_CHECKER(VirtIOGPU, VIRTIO_GPU, + TYPE_VIRTIO_GPU) =20 #define TYPE_VHOST_USER_GPU "vhost-user-gpu" typedef struct VhostUserGPU VhostUserGPU; -#define VHOST_USER_GPU(obj) \ - OBJECT_CHECK(VhostUserGPU, (obj), TYPE_VHOST_USER_GPU) +DECLARE_INSTANCE_CHECKER(VhostUserGPU, VHOST_USER_GPU, + TYPE_VHOST_USER_GPU) =20 #define VIRTIO_ID_GPU 16 =20 diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-in= put.h index c15e983d36..c54aa6aa72 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -21,14 +21,10 @@ typedef struct virtio_input_event virtio_input_event; #define TYPE_VIRTIO_INPUT "virtio-input-device" typedef struct VirtIOInput VirtIOInput; typedef struct VirtIOInputClass VirtIOInputClass; -#define VIRTIO_INPUT(obj) \ - OBJECT_CHECK(VirtIOInput, (obj), TYPE_VIRTIO_INPUT) +DECLARE_OBJ_CHECKERS(VirtIOInput, VirtIOInputClass, + VIRTIO_INPUT, TYPE_VIRTIO_INPUT) #define VIRTIO_INPUT_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT) -#define VIRTIO_INPUT_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtIOInputClass, obj, TYPE_VIRTIO_INPUT) -#define VIRTIO_INPUT_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtIOInputClass, klass, TYPE_VIRTIO_INPUT) =20 #define TYPE_VIRTIO_INPUT_HID "virtio-input-hid-device" #define TYPE_VIRTIO_KEYBOARD "virtio-keyboard-device" @@ -36,22 +32,22 @@ typedef struct VirtIOInputClass VirtIOInputClass; #define TYPE_VIRTIO_TABLET "virtio-tablet-device" =20 typedef struct VirtIOInputHID VirtIOInputHID; -#define VIRTIO_INPUT_HID(obj) \ - OBJECT_CHECK(VirtIOInputHID, (obj), TYPE_VIRTIO_INPUT_HID) +DECLARE_INSTANCE_CHECKER(VirtIOInputHID, VIRTIO_INPUT_HID, + TYPE_VIRTIO_INPUT_HID) #define VIRTIO_INPUT_HID_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HID) =20 #define TYPE_VIRTIO_INPUT_HOST "virtio-input-host-device" typedef struct VirtIOInputHost VirtIOInputHost; -#define VIRTIO_INPUT_HOST(obj) \ - OBJECT_CHECK(VirtIOInputHost, (obj), TYPE_VIRTIO_INPUT_HOST) +DECLARE_INSTANCE_CHECKER(VirtIOInputHost, VIRTIO_INPUT_HOST, + TYPE_VIRTIO_INPUT_HOST) #define VIRTIO_INPUT_HOST_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HOST) =20 #define TYPE_VHOST_USER_INPUT "vhost-user-input" typedef struct VHostUserInput VHostUserInput; -#define VHOST_USER_INPUT(obj) \ - OBJECT_CHECK(VHostUserInput, (obj), TYPE_VHOST_USER_INPUT) +DECLARE_INSTANCE_CHECKER(VHostUserInput, VHOST_USER_INPUT, + TYPE_VHOST_USER_INPUT) #define VHOST_USER_INPUT_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VHOST_USER_INPUT) =20 diff --git a/include/hw/virtio/virtio-iommu.h b/include/hw/virtio/virtio-io= mmu.h index d852980b30..ae9dc566c7 100644 --- a/include/hw/virtio/virtio-iommu.h +++ b/include/hw/virtio/virtio-iommu.h @@ -28,8 +28,8 @@ #define TYPE_VIRTIO_IOMMU "virtio-iommu-device" #define TYPE_VIRTIO_IOMMU_PCI "virtio-iommu-device-base" typedef struct VirtIOIOMMU VirtIOIOMMU; -#define VIRTIO_IOMMU(obj) \ - OBJECT_CHECK(VirtIOIOMMU, (obj), TYPE_VIRTIO_IOMMU) +DECLARE_INSTANCE_CHECKER(VirtIOIOMMU, VIRTIO_IOMMU, + TYPE_VIRTIO_IOMMU) =20 #define TYPE_VIRTIO_IOMMU_MEMORY_REGION "virtio-iommu-memory-region" =20 diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h index 08e37d8e84..5f0b81a967 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -23,12 +23,8 @@ =20 typedef struct VirtIOMEM VirtIOMEM; typedef struct VirtIOMEMClass VirtIOMEMClass; -#define VIRTIO_MEM(obj) \ - OBJECT_CHECK(VirtIOMEM, (obj), TYPE_VIRTIO_MEM) -#define VIRTIO_MEM_CLASS(oc) \ - OBJECT_CLASS_CHECK(VirtIOMEMClass, (oc), TYPE_VIRTIO_MEM) -#define VIRTIO_MEM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtIOMEMClass, (obj), TYPE_VIRTIO_MEM) +DECLARE_OBJ_CHECKERS(VirtIOMEM, VirtIOMEMClass, + VIRTIO_MEM, TYPE_VIRTIO_MEM) =20 #define VIRTIO_MEM_MEMDEV_PROP "memdev" #define VIRTIO_MEM_NODE_PROP "node" diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmi= o.h index 947fb02d3e..dca651fd14 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -38,8 +38,8 @@ /* virtio-mmio */ #define TYPE_VIRTIO_MMIO "virtio-mmio" typedef struct VirtIOMMIOProxy VirtIOMMIOProxy; -#define VIRTIO_MMIO(obj) \ - OBJECT_CHECK(VirtIOMMIOProxy, (obj), TYPE_VIRTIO_MMIO) +DECLARE_INSTANCE_CHECKER(VirtIOMMIOProxy, VIRTIO_MMIO, + TYPE_VIRTIO_MMIO) =20 #define VIRT_MAGIC 0x74726976 /* 'virt' */ #define VIRT_VERSION 2 diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 2e81b5bfcb..929ed232dd 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -23,8 +23,8 @@ =20 #define TYPE_VIRTIO_NET "virtio-net-device" typedef struct VirtIONet VirtIONet; -#define VIRTIO_NET(obj) \ - OBJECT_CHECK(VirtIONet, (obj), TYPE_VIRTIO_NET) +DECLARE_INSTANCE_CHECKER(VirtIONet, VIRTIO_NET, + TYPE_VIRTIO_NET) =20 #define TX_TIMER_INTERVAL 150000 /* 150 us */ =20 diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pme= m.h index 56bce2be7a..6c15abad70 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -22,12 +22,8 @@ =20 typedef struct VirtIOPMEM VirtIOPMEM; typedef struct VirtIOPMEMClass VirtIOPMEMClass; -#define VIRTIO_PMEM(obj) \ - OBJECT_CHECK(VirtIOPMEM, (obj), TYPE_VIRTIO_PMEM) -#define VIRTIO_PMEM_CLASS(oc) \ - OBJECT_CLASS_CHECK(VirtIOPMEMClass, (oc), TYPE_VIRTIO_PMEM) -#define VIRTIO_PMEM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtIOPMEMClass, (obj), TYPE_VIRTIO_PMEM) +DECLARE_OBJ_CHECKERS(VirtIOPMEM, VirtIOPMEMClass, + VIRTIO_PMEM, TYPE_VIRTIO_PMEM) =20 #define VIRTIO_PMEM_ADDR_PROP "memaddr" #define VIRTIO_PMEM_MEMDEV_PROP "memdev" diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index 34fb5f695f..3671c9ba19 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -19,8 +19,8 @@ =20 #define TYPE_VIRTIO_RNG "virtio-rng-device" typedef struct VirtIORNG VirtIORNG; -#define VIRTIO_RNG(obj) \ - OBJECT_CHECK(VirtIORNG, (obj), TYPE_VIRTIO_RNG) +DECLARE_INSTANCE_CHECKER(VirtIORNG, VIRTIO_RNG, + TYPE_VIRTIO_RNG) #define VIRTIO_RNG_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_RNG) =20 diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index bbf4b9a356..9a8a06fdd1 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -27,13 +27,13 @@ =20 #define TYPE_VIRTIO_SCSI_COMMON "virtio-scsi-common" typedef struct VirtIOSCSICommon VirtIOSCSICommon; -#define VIRTIO_SCSI_COMMON(obj) \ - OBJECT_CHECK(VirtIOSCSICommon, (obj), TYPE_VIRTIO_SCSI_COMMON) +DECLARE_INSTANCE_CHECKER(VirtIOSCSICommon, VIRTIO_SCSI_COMMON, + TYPE_VIRTIO_SCSI_COMMON) =20 #define TYPE_VIRTIO_SCSI "virtio-scsi-device" typedef struct VirtIOSCSI VirtIOSCSI; -#define VIRTIO_SCSI(obj) \ - OBJECT_CHECK(VirtIOSCSI, (obj), TYPE_VIRTIO_SCSI) +DECLARE_INSTANCE_CHECKER(VirtIOSCSI, VIRTIO_SCSI, + TYPE_VIRTIO_SCSI) =20 #define VIRTIO_SCSI_MAX_CHANNEL 0 #define VIRTIO_SCSI_MAX_TARGET 255 diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-s= erial.h index 94da09ec34..bbc76d5032 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -28,19 +28,15 @@ struct virtio_serial_conf { #define TYPE_VIRTIO_SERIAL_PORT "virtio-serial-port" typedef struct VirtIOSerialPort VirtIOSerialPort; typedef struct VirtIOSerialPortClass VirtIOSerialPortClass; -#define VIRTIO_SERIAL_PORT(obj) \ - OBJECT_CHECK(VirtIOSerialPort, (obj), TYPE_VIRTIO_SERIAL_PORT) -#define VIRTIO_SERIAL_PORT_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtIOSerialPortClass, (klass), TYPE_VIRTIO_SERIAL= _PORT) -#define VIRTIO_SERIAL_PORT_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtIOSerialPortClass, (obj), TYPE_VIRTIO_SERIAL_POR= T) +DECLARE_OBJ_CHECKERS(VirtIOSerialPort, VirtIOSerialPortClass, + VIRTIO_SERIAL_PORT, TYPE_VIRTIO_SERIAL_PORT) =20 typedef struct VirtIOSerial VirtIOSerial; =20 #define TYPE_VIRTIO_SERIAL_BUS "virtio-serial-bus" typedef struct VirtIOSerialBus VirtIOSerialBus; -#define VIRTIO_SERIAL_BUS(obj) \ - OBJECT_CHECK(VirtIOSerialBus, (obj), TYPE_VIRTIO_SERIAL_BUS) +DECLARE_INSTANCE_CHECKER(VirtIOSerialBus, VIRTIO_SERIAL_BUS, + TYPE_VIRTIO_SERIAL_BUS) =20 =20 struct VirtIOSerialPortClass { @@ -230,7 +226,7 @@ size_t virtio_serial_guest_ready(VirtIOSerialPort *port= ); void virtio_serial_throttle_port(VirtIOSerialPort *port, bool throttle); =20 #define TYPE_VIRTIO_SERIAL "virtio-serial-device" -#define VIRTIO_SERIAL(obj) \ - OBJECT_CHECK(VirtIOSerial, (obj), TYPE_VIRTIO_SERIAL) +DECLARE_INSTANCE_CHECKER(VirtIOSerial, VIRTIO_SERIAL, + TYPE_VIRTIO_SERIAL) =20 #endif diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 261d087de8..807280451b 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -69,12 +69,8 @@ typedef struct VirtQueueElement =20 #define TYPE_VIRTIO_DEVICE "virtio-device" typedef struct VirtioDeviceClass VirtioDeviceClass; -#define VIRTIO_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtioDeviceClass, obj, TYPE_VIRTIO_DEVICE) -#define VIRTIO_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtioDeviceClass, klass, TYPE_VIRTIO_DEVICE) -#define VIRTIO_DEVICE(obj) \ - OBJECT_CHECK(VirtIODevice, (obj), TYPE_VIRTIO_DEVICE) +DECLARE_OBJ_CHECKERS(VirtIODevice, VirtioDeviceClass, + VIRTIO_DEVICE, TYPE_VIRTIO_DEVICE) =20 enum virtio_device_endian { VIRTIO_DEVICE_ENDIAN_UNKNOWN, diff --git a/include/hw/vmstate-if.h b/include/hw/vmstate-if.h index eabf5b05ad..52df571d17 100644 --- a/include/hw/vmstate-if.h +++ b/include/hw/vmstate-if.h @@ -14,10 +14,8 @@ #define TYPE_VMSTATE_IF "vmstate-if" =20 typedef struct VMStateIfClass VMStateIfClass; -#define VMSTATE_IF_CLASS(klass) \ - OBJECT_CLASS_CHECK(VMStateIfClass, (klass), TYPE_VMSTATE_IF) -#define VMSTATE_IF_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VMStateIfClass, (obj), TYPE_VMSTATE_IF) +DECLARE_CLASS_CHECKERS(VMStateIfClass, VMSTATE_IF, + TYPE_VMSTATE_IF) #define VMSTATE_IF(obj) \ INTERFACE_CHECK(VMStateIf, (obj), TYPE_VMSTATE_IF) =20 diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog= /cmsdk-apb-watchdog.h index be2983eefa..63f4becf86 100644 --- a/include/hw/watchdog/cmsdk-apb-watchdog.h +++ b/include/hw/watchdog/cmsdk-apb-watchdog.h @@ -37,8 +37,8 @@ =20 #define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog" typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog; -#define CMSDK_APB_WATCHDOG(obj) OBJECT_CHECK(CMSDKAPBWatchdog, (obj), \ - TYPE_CMSDK_APB_WATCHDOG) +DECLARE_INSTANCE_CHECKER(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG, + TYPE_CMSDK_APB_WATCHDOG) =20 /* * This shares the same struct (and cast macro) as the base diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_asp= eed.h index ba9a0a1fd8..2ca1eb5432 100644 --- a/include/hw/watchdog/wdt_aspeed.h +++ b/include/hw/watchdog/wdt_aspeed.h @@ -17,8 +17,8 @@ #define TYPE_ASPEED_WDT "aspeed.wdt" typedef struct AspeedWDTClass AspeedWDTClass; typedef struct AspeedWDTState AspeedWDTState; -#define ASPEED_WDT(obj) \ - OBJECT_CHECK(AspeedWDTState, (obj), TYPE_ASPEED_WDT) +DECLARE_OBJ_CHECKERS(AspeedWDTState, AspeedWDTClass, + ASPEED_WDT, TYPE_ASPEED_WDT) #define TYPE_ASPEED_2400_WDT TYPE_ASPEED_WDT "-ast2400" #define TYPE_ASPEED_2500_WDT TYPE_ASPEED_WDT "-ast2500" #define TYPE_ASPEED_2600_WDT TYPE_ASPEED_WDT "-ast2600" @@ -38,10 +38,6 @@ struct AspeedWDTState { uint32_t pclk_freq; }; =20 -#define ASPEED_WDT_CLASS(klass) \ - OBJECT_CLASS_CHECK(AspeedWDTClass, (klass), TYPE_ASPEED_WDT) -#define ASPEED_WDT_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AspeedWDTClass, (obj), TYPE_ASPEED_WDT) =20 struct AspeedWDTClass { SysBusDeviceClass parent_class; diff --git a/include/hw/watchdog/wdt_diag288.h b/include/hw/watchdog/wdt_di= ag288.h index e611163821..f72c1d3318 100644 --- a/include/hw/watchdog/wdt_diag288.h +++ b/include/hw/watchdog/wdt_diag288.h @@ -7,12 +7,8 @@ #define TYPE_WDT_DIAG288 "diag288" typedef struct DIAG288Class DIAG288Class; typedef struct DIAG288State DIAG288State; -#define DIAG288(obj) \ - OBJECT_CHECK(DIAG288State, (obj), TYPE_WDT_DIAG288) -#define DIAG288_CLASS(klass) \ - OBJECT_CLASS_CHECK(DIAG288Class, (klass), TYPE_WDT_DIAG288) -#define DIAG288_GET_CLASS(obj) \ - OBJECT_GET_CLASS(DIAG288Class, (obj), TYPE_WDT_DIAG288) +DECLARE_OBJ_CHECKERS(DIAG288State, DIAG288Class, + DIAG288, TYPE_WDT_DIAG288) =20 #define WDT_DIAG288_INIT 0 #define WDT_DIAG288_CHANGE 1 diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h index 8757418b46..7665d93640 100644 --- a/include/hw/watchdog/wdt_imx2.h +++ b/include/hw/watchdog/wdt_imx2.h @@ -20,7 +20,8 @@ =20 #define TYPE_IMX2_WDT "imx2.wdt" typedef struct IMX2WdtState IMX2WdtState; -#define IMX2_WDT(obj) OBJECT_CHECK(IMX2WdtState, (obj), TYPE_IMX2_WDT) +DECLARE_INSTANCE_CHECKER(IMX2WdtState, IMX2_WDT, + TYPE_IMX2_WDT) =20 enum IMX2WdtRegisters { IMX2_WDT_WCR =3D 0x0000, /* Control Register */ diff --git a/include/hw/xen/xen-block.h b/include/hw/xen/xen-block.h index 54f2e35122..8ff5421dc3 100644 --- a/include/hw/xen/xen-block.h +++ b/include/hw/xen/xen-block.h @@ -71,12 +71,8 @@ struct XenBlockDeviceClass { typedef struct XenBlockDeviceClass XenBlockDeviceClass; =20 #define TYPE_XEN_BLOCK_DEVICE "xen-block" -#define XEN_BLOCK_DEVICE(obj) \ - OBJECT_CHECK(XenBlockDevice, (obj), TYPE_XEN_BLOCK_DEVICE) -#define XEN_BLOCK_DEVICE_CLASS(class) \ - OBJECT_CLASS_CHECK(XenBlockDeviceClass, (class), TYPE_XEN_BLOCK_DEVIC= E) -#define XEN_BLOCK_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XenBlockDeviceClass, (obj), TYPE_XEN_BLOCK_DEVICE) +DECLARE_OBJ_CHECKERS(XenBlockDevice, XenBlockDeviceClass, + XEN_BLOCK_DEVICE, TYPE_XEN_BLOCK_DEVICE) =20 struct XenDiskDevice { XenBlockDevice blockdev; @@ -84,8 +80,8 @@ struct XenDiskDevice { typedef struct XenDiskDevice XenDiskDevice; =20 #define TYPE_XEN_DISK_DEVICE "xen-disk" -#define XEN_DISK_DEVICE(obj) \ - OBJECT_CHECK(XenDiskDevice, (obj), TYPE_XEN_DISK_DEVICE) +DECLARE_INSTANCE_CHECKER(XenDiskDevice, XEN_DISK_DEVICE, + TYPE_XEN_DISK_DEVICE) =20 struct XenCDRomDevice { XenBlockDevice blockdev; @@ -93,7 +89,7 @@ struct XenCDRomDevice { typedef struct XenCDRomDevice XenCDRomDevice; =20 #define TYPE_XEN_CDROM_DEVICE "xen-cdrom" -#define XEN_CDROM_DEVICE(obj) \ - OBJECT_CHECK(XenCDRomDevice, (obj), TYPE_XEN_CDROM_DEVICE) +DECLARE_INSTANCE_CHECKER(XenCDRomDevice, XEN_CDROM_DEVICE, + TYPE_XEN_CDROM_DEVICE) =20 #endif /* HW_XEN_BLOCK_H */ diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 910cf49161..35fec7c905 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -60,12 +60,8 @@ struct XenDeviceClass { typedef struct XenDeviceClass XenDeviceClass; =20 #define TYPE_XEN_DEVICE "xen-device" -#define XEN_DEVICE(obj) \ - OBJECT_CHECK(XenDevice, (obj), TYPE_XEN_DEVICE) -#define XEN_DEVICE_CLASS(class) \ - OBJECT_CLASS_CHECK(XenDeviceClass, (class), TYPE_XEN_DEVICE) -#define XEN_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XenDeviceClass, (obj), TYPE_XEN_DEVICE) +DECLARE_OBJ_CHECKERS(XenDevice, XenDeviceClass, + XEN_DEVICE, TYPE_XEN_DEVICE) =20 struct XenBus { BusState qbus; @@ -84,12 +80,8 @@ struct XenBusClass { typedef struct XenBusClass XenBusClass; =20 #define TYPE_XEN_BUS "xen-bus" -#define XEN_BUS(obj) \ - OBJECT_CHECK(XenBus, (obj), TYPE_XEN_BUS) -#define XEN_BUS_CLASS(class) \ - OBJECT_CLASS_CHECK(XenBusClass, (class), TYPE_XEN_BUS) -#define XEN_BUS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XenBusClass, (obj), TYPE_XEN_BUS) +DECLARE_OBJ_CHECKERS(XenBus, XenBusClass, + XEN_BUS, TYPE_XEN_BUS) =20 void xen_bus_init(void); =20 diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legac= y-backend.h index 89b51e05fc..ba7a3c59bb 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -11,8 +11,8 @@ #define TYPE_XENBACKEND "xen-backend" =20 typedef struct XenLegacyDevice XenLegacyDevice; -#define XENBACKEND_DEVICE(obj) \ - OBJECT_CHECK(XenLegacyDevice, (obj), TYPE_XENBACKEND) +DECLARE_INSTANCE_CHECKER(XenLegacyDevice, XENBACKEND_DEVICE, + TYPE_XENBACKEND) =20 /* variables */ extern struct xs_handle *xenstore; diff --git a/include/io/channel-buffer.h b/include/io/channel-buffer.h index 344d5957fd..89632ef437 100644 --- a/include/io/channel-buffer.h +++ b/include/io/channel-buffer.h @@ -26,8 +26,8 @@ =20 #define TYPE_QIO_CHANNEL_BUFFER "qio-channel-buffer" typedef struct QIOChannelBuffer QIOChannelBuffer; -#define QIO_CHANNEL_BUFFER(obj) \ - OBJECT_CHECK(QIOChannelBuffer, (obj), TYPE_QIO_CHANNEL_BUFFER) +DECLARE_INSTANCE_CHECKER(QIOChannelBuffer, QIO_CHANNEL_BUFFER, + TYPE_QIO_CHANNEL_BUFFER) =20 =20 /** diff --git a/include/io/channel-command.h b/include/io/channel-command.h index b1671062d0..4b64ff011b 100644 --- a/include/io/channel-command.h +++ b/include/io/channel-command.h @@ -26,8 +26,8 @@ =20 #define TYPE_QIO_CHANNEL_COMMAND "qio-channel-command" typedef struct QIOChannelCommand QIOChannelCommand; -#define QIO_CHANNEL_COMMAND(obj) \ - OBJECT_CHECK(QIOChannelCommand, (obj), TYPE_QIO_CHANNEL_COMMAND) +DECLARE_INSTANCE_CHECKER(QIOChannelCommand, QIO_CHANNEL_COMMAND, + TYPE_QIO_CHANNEL_COMMAND) =20 =20 =20 diff --git a/include/io/channel-file.h b/include/io/channel-file.h index d91c9f5bc1..c6caf179d9 100644 --- a/include/io/channel-file.h +++ b/include/io/channel-file.h @@ -26,8 +26,8 @@ =20 #define TYPE_QIO_CHANNEL_FILE "qio-channel-file" typedef struct QIOChannelFile QIOChannelFile; -#define QIO_CHANNEL_FILE(obj) \ - OBJECT_CHECK(QIOChannelFile, (obj), TYPE_QIO_CHANNEL_FILE) +DECLARE_INSTANCE_CHECKER(QIOChannelFile, QIO_CHANNEL_FILE, + TYPE_QIO_CHANNEL_FILE) =20 =20 /** diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h index ee898d991b..62e3e2e970 100644 --- a/include/io/channel-socket.h +++ b/include/io/channel-socket.h @@ -28,8 +28,8 @@ =20 #define TYPE_QIO_CHANNEL_SOCKET "qio-channel-socket" typedef struct QIOChannelSocket QIOChannelSocket; -#define QIO_CHANNEL_SOCKET(obj) \ - OBJECT_CHECK(QIOChannelSocket, (obj), TYPE_QIO_CHANNEL_SOCKET) +DECLARE_INSTANCE_CHECKER(QIOChannelSocket, QIO_CHANNEL_SOCKET, + TYPE_QIO_CHANNEL_SOCKET) =20 =20 /** diff --git a/include/io/channel-tls.h b/include/io/channel-tls.h index ebd42f981e..036bf54195 100644 --- a/include/io/channel-tls.h +++ b/include/io/channel-tls.h @@ -28,8 +28,8 @@ =20 #define TYPE_QIO_CHANNEL_TLS "qio-channel-tls" typedef struct QIOChannelTLS QIOChannelTLS; -#define QIO_CHANNEL_TLS(obj) \ - OBJECT_CHECK(QIOChannelTLS, (obj), TYPE_QIO_CHANNEL_TLS) +DECLARE_INSTANCE_CHECKER(QIOChannelTLS, QIO_CHANNEL_TLS, + TYPE_QIO_CHANNEL_TLS) =20 =20 /** diff --git a/include/io/channel-websock.h b/include/io/channel-websock.h index 5ab8811306..b07eddabe1 100644 --- a/include/io/channel-websock.h +++ b/include/io/channel-websock.h @@ -28,8 +28,8 @@ =20 #define TYPE_QIO_CHANNEL_WEBSOCK "qio-channel-websock" typedef struct QIOChannelWebsock QIOChannelWebsock; -#define QIO_CHANNEL_WEBSOCK(obj) \ - OBJECT_CHECK(QIOChannelWebsock, (obj), TYPE_QIO_CHANNEL_WEBSOCK) +DECLARE_INSTANCE_CHECKER(QIOChannelWebsock, QIO_CHANNEL_WEBSOCK, + TYPE_QIO_CHANNEL_WEBSOCK) =20 typedef union QIOChannelWebsockMask QIOChannelWebsockMask; =20 diff --git a/include/io/channel.h b/include/io/channel.h index 67b9768eff..3ebdc7954f 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -28,12 +28,8 @@ #define TYPE_QIO_CHANNEL "qio-channel" typedef struct QIOChannel QIOChannel; typedef struct QIOChannelClass QIOChannelClass; -#define QIO_CHANNEL(obj) \ - OBJECT_CHECK(QIOChannel, (obj), TYPE_QIO_CHANNEL) -#define QIO_CHANNEL_CLASS(klass) \ - OBJECT_CLASS_CHECK(QIOChannelClass, klass, TYPE_QIO_CHANNEL) -#define QIO_CHANNEL_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QIOChannelClass, obj, TYPE_QIO_CHANNEL) +DECLARE_OBJ_CHECKERS(QIOChannel, QIOChannelClass, + QIO_CHANNEL, TYPE_QIO_CHANNEL) =20 =20 #define QIO_CHANNEL_ERR_BLOCK -2 diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h index 5e720bf267..96a3186b6b 100644 --- a/include/io/dns-resolver.h +++ b/include/io/dns-resolver.h @@ -28,12 +28,8 @@ #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver" typedef struct QIODNSResolver QIODNSResolver; typedef struct QIODNSResolverClass QIODNSResolverClass; -#define QIO_DNS_RESOLVER(obj) \ - OBJECT_CHECK(QIODNSResolver, (obj), TYPE_QIO_DNS_RESOLVER) -#define QIO_DNS_RESOLVER_CLASS(klass) \ - OBJECT_CLASS_CHECK(QIODNSResolverClass, klass, TYPE_QIO_DNS_RESOLVER) -#define QIO_DNS_RESOLVER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QIODNSResolverClass, obj, TYPE_QIO_DNS_RESOLVER) +DECLARE_OBJ_CHECKERS(QIODNSResolver, QIODNSResolverClass, + QIO_DNS_RESOLVER, TYPE_QIO_DNS_RESOLVER) =20 =20 /** diff --git a/include/io/net-listener.h b/include/io/net-listener.h index fbdd2dbf9a..93367db291 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -27,12 +27,8 @@ #define TYPE_QIO_NET_LISTENER "qio-net-listener" typedef struct QIONetListener QIONetListener; typedef struct QIONetListenerClass QIONetListenerClass; -#define QIO_NET_LISTENER(obj) \ - OBJECT_CHECK(QIONetListener, (obj), TYPE_QIO_NET_LISTENER) -#define QIO_NET_LISTENER_CLASS(klass) \ - OBJECT_CLASS_CHECK(QIONetListenerClass, klass, TYPE_QIO_NET_LISTENER) -#define QIO_NET_LISTENER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QIONetListenerClass, obj, TYPE_QIO_NET_LISTENER) +DECLARE_OBJ_CHECKERS(QIONetListener, QIONetListenerClass, + QIO_NET_LISTENER, TYPE_QIO_NET_LISTENER) =20 =20 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener, diff --git a/include/net/can_emu.h b/include/net/can_emu.h index 7e90fd8a45..150f91a657 100644 --- a/include/net/can_emu.h +++ b/include/net/can_emu.h @@ -100,8 +100,8 @@ struct CanBusClientState { }; =20 #define TYPE_CAN_BUS "can-bus" -#define CAN_BUS(obj) \ - OBJECT_CHECK(CanBusState, (obj), TYPE_CAN_BUS) +DECLARE_INSTANCE_CHECKER(CanBusState, CAN_BUS, + TYPE_CAN_BUS) =20 int can_bus_filter_match(struct qemu_can_filter *filter, qemu_canid_t can_= id); =20 diff --git a/include/net/can_host.h b/include/net/can_host.h index 13b6a191dd..18979c2e2d 100644 --- a/include/net/can_host.h +++ b/include/net/can_host.h @@ -34,12 +34,8 @@ #define TYPE_CAN_HOST "can-host" typedef struct CanHostClass CanHostClass; typedef struct CanHostState CanHostState; -#define CAN_HOST_CLASS(klass) \ - OBJECT_CLASS_CHECK(CanHostClass, (klass), TYPE_CAN_HOST) -#define CAN_HOST_GET_CLASS(obj) \ - OBJECT_GET_CLASS(CanHostClass, (obj), TYPE_CAN_HOST) -#define CAN_HOST(obj) \ - OBJECT_CHECK(CanHostState, (obj), TYPE_CAN_HOST) +DECLARE_OBJ_CHECKERS(CanHostState, CanHostClass, + CAN_HOST, TYPE_CAN_HOST) =20 struct CanHostState { ObjectClass oc; diff --git a/include/net/filter.h b/include/net/filter.h index 0d4f011bc0..e7e593128a 100644 --- a/include/net/filter.h +++ b/include/net/filter.h @@ -16,12 +16,8 @@ =20 #define TYPE_NETFILTER "netfilter" typedef struct NetFilterClass NetFilterClass; -#define NETFILTER(obj) \ - OBJECT_CHECK(NetFilterState, (obj), TYPE_NETFILTER) -#define NETFILTER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(NetFilterClass, (obj), TYPE_NETFILTER) -#define NETFILTER_CLASS(klass) \ - OBJECT_CLASS_CHECK(NetFilterClass, (klass), TYPE_NETFILTER) +DECLARE_OBJ_CHECKERS(NetFilterState, NetFilterClass, + NETFILTER, TYPE_NETFILTER) =20 typedef void (FilterSetup) (NetFilterState *nf, Error **errp); typedef void (FilterCleanup) (NetFilterState *nf); diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index 2be985f86e..f118fb516b 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -7,12 +7,8 @@ #define TYPE_USER_CREATABLE "user-creatable" =20 typedef struct UserCreatableClass UserCreatableClass; -#define USER_CREATABLE_CLASS(klass) \ - OBJECT_CLASS_CHECK(UserCreatableClass, (klass), \ - TYPE_USER_CREATABLE) -#define USER_CREATABLE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(UserCreatableClass, (obj), \ - TYPE_USER_CREATABLE) +DECLARE_CLASS_CHECKERS(UserCreatableClass, USER_CREATABLE, + TYPE_USER_CREATABLE) #define USER_CREATABLE(obj) \ INTERFACE_CHECK(UserCreatable, (obj), \ TYPE_USER_CREATABLE) diff --git a/include/scsi/pr-manager.h b/include/scsi/pr-manager.h index 2c699e4030..f801fe9533 100644 --- a/include/scsi/pr-manager.h +++ b/include/scsi/pr-manager.h @@ -11,12 +11,8 @@ =20 typedef struct PRManager PRManager; typedef struct PRManagerClass PRManagerClass; -#define PR_MANAGER_CLASS(klass) \ - OBJECT_CLASS_CHECK(PRManagerClass, (klass), TYPE_PR_MANAGER) -#define PR_MANAGER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PRManagerClass, (obj), TYPE_PR_MANAGER) -#define PR_MANAGER(obj) \ - OBJECT_CHECK(PRManager, (obj), TYPE_PR_MANAGER) +DECLARE_OBJ_CHECKERS(PRManager, PRManagerClass, + PR_MANAGER, TYPE_PR_MANAGER) =20 struct sg_io_hdr; =20 diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index 2bda18be12..6189f6aa7a 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -61,12 +61,8 @@ typedef struct AccelClass AccelClass; #define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL #define ACCEL_CLASS_NAME(a) (a ACCEL_CLASS_SUFFIX) =20 -#define ACCEL_CLASS(klass) \ - OBJECT_CLASS_CHECK(AccelClass, (klass), TYPE_ACCEL) -#define ACCEL(obj) \ - OBJECT_CHECK(AccelState, (obj), TYPE_ACCEL) -#define ACCEL_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL) +DECLARE_OBJ_CHECKERS(AccelState, AccelClass, + ACCEL, TYPE_ACCEL) =20 AccelClass *accel_find(const char *opt_name); int accel_init_machine(AccelState *accel, MachineState *ms); diff --git a/include/sysemu/cryptodev.h b/include/sysemu/cryptodev.h index e11526271a..65c017cf81 100644 --- a/include/sysemu/cryptodev.h +++ b/include/sysemu/cryptodev.h @@ -39,15 +39,8 @@ =20 typedef struct CryptoDevBackend CryptoDevBackend; typedef struct CryptoDevBackendClass CryptoDevBackendClass; -#define CRYPTODEV_BACKEND(obj) \ - OBJECT_CHECK(CryptoDevBackend, \ - (obj), TYPE_CRYPTODEV_BACKEND) -#define CRYPTODEV_BACKEND_GET_CLASS(obj) \ - OBJECT_GET_CLASS(CryptoDevBackendClass, \ - (obj), TYPE_CRYPTODEV_BACKEND) -#define CRYPTODEV_BACKEND_CLASS(klass) \ - OBJECT_CLASS_CHECK(CryptoDevBackendClass, \ - (klass), TYPE_CRYPTODEV_BACKEND) +DECLARE_OBJ_CHECKERS(CryptoDevBackend, CryptoDevBackendClass, + CRYPTODEV_BACKEND, TYPE_CRYPTODEV_BACKEND) =20 =20 #define MAX_CRYPTO_QUEUE_NUM 64 diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 7b775b6687..1e6078f872 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -22,12 +22,8 @@ #define TYPE_MEMORY_BACKEND "memory-backend" typedef struct HostMemoryBackend HostMemoryBackend; typedef struct HostMemoryBackendClass HostMemoryBackendClass; -#define MEMORY_BACKEND(obj) \ - OBJECT_CHECK(HostMemoryBackend, (obj), TYPE_MEMORY_BACKEND) -#define MEMORY_BACKEND_GET_CLASS(obj) \ - OBJECT_GET_CLASS(HostMemoryBackendClass, (obj), TYPE_MEMORY_BACKEND) -#define MEMORY_BACKEND_CLASS(klass) \ - OBJECT_CLASS_CHECK(HostMemoryBackendClass, (klass), TYPE_MEMORY_BACKEN= D) +DECLARE_OBJ_CHECKERS(HostMemoryBackend, HostMemoryBackendClass, + MEMORY_BACKEND, TYPE_MEMORY_BACKEND) =20 /* hostmem-ram.c */ /** diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 566b5f52fc..1398679458 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -37,7 +37,7 @@ void hvf_vcpu_destroy(CPUState *); #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf") =20 typedef struct HVFState HVFState; -#define HVF_STATE(obj) \ - OBJECT_CHECK(HVFState, (obj), TYPE_HVF_ACCEL) +DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE, + TYPE_HVF_ACCEL) =20 #endif diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index 42902ffb9f..0c5284dbbc 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -40,8 +40,8 @@ struct IOThread { }; typedef struct IOThread IOThread; =20 -#define IOTHREAD(obj) \ - OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD) +DECLARE_INSTANCE_CHECKER(IOThread, IOTHREAD, + TYPE_IOTHREAD) =20 char *iothread_get_id(IOThread *iothread); IOThread *iothread_by_id(const char *id); diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 3e89884c54..5bbea53883 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -204,8 +204,8 @@ struct KVMState; =20 #define TYPE_KVM_ACCEL ACCEL_CLASS_NAME("kvm") typedef struct KVMState KVMState; -#define KVM_STATE(obj) \ - OBJECT_CHECK(KVMState, (obj), TYPE_KVM_ACCEL) +DECLARE_INSTANCE_CHECKER(KVMState, KVM_STATE, + TYPE_KVM_ACCEL) =20 extern KVMState *kvm_state; typedef struct Notifier Notifier; diff --git a/include/sysemu/rng-random.h b/include/sysemu/rng-random.h index 87e82dd7a3..58033ac3fe 100644 --- a/include/sysemu/rng-random.h +++ b/include/sysemu/rng-random.h @@ -16,7 +16,8 @@ =20 #define TYPE_RNG_RANDOM "rng-random" typedef struct RngRandom RngRandom; -#define RNG_RANDOM(obj) OBJECT_CHECK(RngRandom, (obj), TYPE_RNG_RANDOM) +DECLARE_INSTANCE_CHECKER(RngRandom, RNG_RANDOM, + TYPE_RNG_RANDOM) =20 =20 #endif diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index c38da7d342..f8fc948109 100644 --- a/include/sysemu/rng.h +++ b/include/sysemu/rng.h @@ -19,12 +19,8 @@ #define TYPE_RNG_BACKEND "rng-backend" typedef struct RngBackend RngBackend; typedef struct RngBackendClass RngBackendClass; -#define RNG_BACKEND(obj) \ - OBJECT_CHECK(RngBackend, (obj), TYPE_RNG_BACKEND) -#define RNG_BACKEND_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RngBackendClass, (obj), TYPE_RNG_BACKEND) -#define RNG_BACKEND_CLASS(klass) \ - OBJECT_CLASS_CHECK(RngBackendClass, (klass), TYPE_RNG_BACKEND) +DECLARE_OBJ_CHECKERS(RngBackend, RngBackendClass, + RNG_BACKEND, TYPE_RNG_BACKEND) =20 #define TYPE_RNG_BUILTIN "rng-builtin" =20 diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 04673cab53..1a85564e47 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -27,10 +27,8 @@ typedef enum TPMVersion { =20 #define TYPE_TPM_IF "tpm-if" typedef struct TPMIfClass TPMIfClass; -#define TPM_IF_CLASS(klass) \ - OBJECT_CLASS_CHECK(TPMIfClass, (klass), TYPE_TPM_IF) -#define TPM_IF_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TPMIfClass, (obj), TYPE_TPM_IF) +DECLARE_CLASS_CHECKERS(TPMIfClass, TPM_IF, + TYPE_TPM_IF) #define TPM_IF(obj) \ INTERFACE_CHECK(TPMIf, (obj), TYPE_TPM_IF) =20 diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 740c94c6cd..e038b79d34 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -21,12 +21,8 @@ #define TYPE_TPM_BACKEND "tpm-backend" typedef struct TPMBackend TPMBackend; typedef struct TPMBackendClass TPMBackendClass; -#define TPM_BACKEND(obj) \ - OBJECT_CHECK(TPMBackend, (obj), TYPE_TPM_BACKEND) -#define TPM_BACKEND_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TPMBackendClass, (obj), TYPE_TPM_BACKEND) -#define TPM_BACKEND_CLASS(klass) \ - OBJECT_CLASS_CHECK(TPMBackendClass, (klass), TYPE_TPM_BACKEND) +DECLARE_OBJ_CHECKERS(TPMBackend, TPMBackendClass, + TPM_BACKEND, TYPE_TPM_BACKEND) =20 =20 typedef struct TPMBackendCmd { diff --git a/include/sysemu/vhost-user-backend.h b/include/sysemu/vhost-use= r-backend.h index 89eb5eaf65..e4c85e33c0 100644 --- a/include/sysemu/vhost-user-backend.h +++ b/include/sysemu/vhost-user-backend.h @@ -24,12 +24,8 @@ #define TYPE_VHOST_USER_BACKEND "vhost-user-backend" typedef struct VhostUserBackend VhostUserBackend; typedef struct VhostUserBackendClass VhostUserBackendClass; -#define VHOST_USER_BACKEND(obj) \ - OBJECT_CHECK(VhostUserBackend, (obj), TYPE_VHOST_USER_BACKEND) -#define VHOST_USER_BACKEND_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VhostUserBackendClass, (obj), TYPE_VHOST_USER_BACKEND) -#define VHOST_USER_BACKEND_CLASS(klass) \ - OBJECT_CLASS_CHECK(VhostUserBackendClass, (klass), TYPE_VHOST_USER_BAC= KEND) +DECLARE_OBJ_CHECKERS(VhostUserBackend, VhostUserBackendClass, + VHOST_USER_BACKEND, TYPE_VHOST_USER_BACKEND) =20 =20 struct VhostUserBackendClass { diff --git a/include/ui/console.h b/include/ui/console.h index 2a74a27d50..8602203523 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -107,12 +107,8 @@ void kbd_put_keysym(int keysym); =20 #define TYPE_QEMU_CONSOLE "qemu-console" typedef struct QemuConsoleClass QemuConsoleClass; -#define QEMU_CONSOLE(obj) \ - OBJECT_CHECK(QemuConsole, (obj), TYPE_QEMU_CONSOLE) -#define QEMU_CONSOLE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QemuConsoleClass, (obj), TYPE_QEMU_CONSOLE) -#define QEMU_CONSOLE_CLASS(klass) \ - OBJECT_CLASS_CHECK(QemuConsoleClass, (klass), TYPE_QEMU_CONSOLE) +DECLARE_OBJ_CHECKERS(QemuConsole, QemuConsoleClass, + QEMU_CONSOLE, TYPE_QEMU_CONSOLE) =20 =20 struct QemuConsoleClass { diff --git a/migration/migration.h b/migration/migration.h index 4103e549bb..bdc7450da3 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -116,12 +116,8 @@ void fill_destination_postcopy_migration_info(Migratio= nInfo *info); #define TYPE_MIGRATION "migration" =20 typedef struct MigrationClass MigrationClass; -#define MIGRATION_OBJ_CLASS(klass) \ - OBJECT_CLASS_CHECK(MigrationClass, (klass), TYPE_MIGRATION) -#define MIGRATION_OBJ(obj) \ - OBJECT_CHECK(MigrationState, (obj), TYPE_MIGRATION) -#define MIGRATION_OBJ_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MigrationClass, (obj), TYPE_MIGRATION) +DECLARE_OBJ_CHECKERS(MigrationState, MigrationClass, + MIGRATION_OBJ, TYPE_MIGRATION) =20 struct MigrationClass { /*< private >*/ diff --git a/target/alpha/cpu-qom.h b/target/alpha/cpu-qom.h index 1124668cf0..45350318c9 100644 --- a/target/alpha/cpu-qom.h +++ b/target/alpha/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct AlphaCPU AlphaCPU; typedef struct AlphaCPUClass AlphaCPUClass; -#define ALPHA_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(AlphaCPUClass, (klass), TYPE_ALPHA_CPU) -#define ALPHA_CPU(obj) \ - OBJECT_CHECK(AlphaCPU, (obj), TYPE_ALPHA_CPU) -#define ALPHA_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AlphaCPUClass, (obj), TYPE_ALPHA_CPU) +DECLARE_OBJ_CHECKERS(AlphaCPU, AlphaCPUClass, + ALPHA_CPU, TYPE_ALPHA_CPU) =20 /** * AlphaCPUClass: diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index d0c68b01c5..92d58f84fe 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -29,12 +29,8 @@ struct arm_boot_info; =20 typedef struct ARMCPU ARMCPU; typedef struct ARMCPUClass ARMCPUClass; -#define ARM_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMCPUClass, (klass), TYPE_ARM_CPU) -#define ARM_CPU(obj) \ - OBJECT_CHECK(ARMCPU, (obj), TYPE_ARM_CPU) -#define ARM_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMCPUClass, (obj), TYPE_ARM_CPU) +DECLARE_OBJ_CHECKERS(ARMCPU, ARMCPUClass, + ARM_CPU, TYPE_ARM_CPU) =20 #define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU =20 @@ -67,10 +63,8 @@ struct ARMCPUClass { =20 #define TYPE_AARCH64_CPU "aarch64-cpu" typedef struct AArch64CPUClass AArch64CPUClass; -#define AARCH64_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(AArch64CPUClass, (klass), TYPE_AARCH64_CPU) -#define AARCH64_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AArch64CPUClass, (obj), TYPE_AARCH64_CPU) +DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU, + TYPE_AARCH64_CPU) =20 struct AArch64CPUClass { /*< private >*/ diff --git a/target/arm/idau.h b/target/arm/idau.h index 2f09bbb34f..0ef5251971 100644 --- a/target/arm/idau.h +++ b/target/arm/idau.h @@ -34,10 +34,8 @@ #define IDAU_INTERFACE(obj) \ INTERFACE_CHECK(IDAUInterface, (obj), TYPE_IDAU_INTERFACE) typedef struct IDAUInterfaceClass IDAUInterfaceClass; -#define IDAU_INTERFACE_CLASS(class) \ - OBJECT_CLASS_CHECK(IDAUInterfaceClass, (class), TYPE_IDAU_INTERFACE) -#define IDAU_INTERFACE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IDAUInterfaceClass, (obj), TYPE_IDAU_INTERFACE) +DECLARE_CLASS_CHECKERS(IDAUInterfaceClass, IDAU_INTERFACE, + TYPE_IDAU_INTERFACE) =20 typedef struct IDAUInterface IDAUInterface; =20 diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h index fac8430253..1bbfbb2087 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -28,12 +28,8 @@ =20 typedef struct AVRCPU AVRCPU; typedef struct AVRCPUClass AVRCPUClass; -#define AVR_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(AVRCPUClass, (klass), TYPE_AVR_CPU) -#define AVR_CPU(obj) \ - OBJECT_CHECK(AVRCPU, (obj), TYPE_AVR_CPU) -#define AVR_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AVRCPUClass, (obj), TYPE_AVR_CPU) +DECLARE_OBJ_CHECKERS(AVRCPU, AVRCPUClass, + AVR_CPU, TYPE_AVR_CPU) =20 /** * AVRCPUClass: diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index cac3e9af1b..eced6ef7c9 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct CRISCPU CRISCPU; typedef struct CRISCPUClass CRISCPUClass; -#define CRIS_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(CRISCPUClass, (klass), TYPE_CRIS_CPU) -#define CRIS_CPU(obj) \ - OBJECT_CHECK(CRISCPU, (obj), TYPE_CRIS_CPU) -#define CRIS_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(CRISCPUClass, (obj), TYPE_CRIS_CPU) +DECLARE_OBJ_CHECKERS(CRISCPU, CRISCPUClass, + CRIS_CPU, TYPE_CRIS_CPU) =20 /** * CRISCPUClass: diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index 295b2aaf19..5c5aa0c053 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct HPPACPU HPPACPU; typedef struct HPPACPUClass HPPACPUClass; -#define HPPA_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(HPPACPUClass, (klass), TYPE_HPPA_CPU) -#define HPPA_CPU(obj) \ - OBJECT_CHECK(HPPACPU, (obj), TYPE_HPPA_CPU) -#define HPPA_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(HPPACPUClass, (obj), TYPE_HPPA_CPU) +DECLARE_OBJ_CHECKERS(HPPACPU, HPPACPUClass, + HPPA_CPU, TYPE_HPPA_CPU) =20 /** * HPPACPUClass: diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index 6b0bf476e5..05b52ba74c 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -32,12 +32,8 @@ =20 typedef struct X86CPU X86CPU; typedef struct X86CPUClass X86CPUClass; -#define X86_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(X86CPUClass, (klass), TYPE_X86_CPU) -#define X86_CPU(obj) \ - OBJECT_CHECK(X86CPU, (obj), TYPE_X86_CPU) -#define X86_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(X86CPUClass, (obj), TYPE_X86_CPU) +DECLARE_OBJ_CHECKERS(X86CPU, X86CPUClass, + X86_CPU, TYPE_X86_CPU) =20 typedef struct X86CPUModel X86CPUModel; =20 diff --git a/target/lm32/cpu-qom.h b/target/lm32/cpu-qom.h index 2c0654b695..9bf2f82ffe 100644 --- a/target/lm32/cpu-qom.h +++ b/target/lm32/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct LM32CPU LM32CPU; typedef struct LM32CPUClass LM32CPUClass; -#define LM32_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(LM32CPUClass, (klass), TYPE_LM32_CPU) -#define LM32_CPU(obj) \ - OBJECT_CHECK(LM32CPU, (obj), TYPE_LM32_CPU) -#define LM32_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(LM32CPUClass, (obj), TYPE_LM32_CPU) +DECLARE_OBJ_CHECKERS(LM32CPU, LM32CPUClass, + LM32_CPU, TYPE_LM32_CPU) =20 /** * LM32CPUClass: diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index 3b199be545..241a3b19af 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct M68kCPU M68kCPU; typedef struct M68kCPUClass M68kCPUClass; -#define M68K_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(M68kCPUClass, (klass), TYPE_M68K_CPU) -#define M68K_CPU(obj) \ - OBJECT_CHECK(M68kCPU, (obj), TYPE_M68K_CPU) -#define M68K_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(M68kCPUClass, (obj), TYPE_M68K_CPU) +DECLARE_OBJ_CHECKERS(M68kCPU, M68kCPUClass, + M68K_CPU, TYPE_M68K_CPU) =20 /* * M68kCPUClass: diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index 564fa18ccb..73c2237f98 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct MicroBlazeCPU MicroBlazeCPU; typedef struct MicroBlazeCPUClass MicroBlazeCPUClass; -#define MICROBLAZE_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(MicroBlazeCPUClass, (klass), TYPE_MICROBLAZE_CPU) -#define MICROBLAZE_CPU(obj) \ - OBJECT_CHECK(MicroBlazeCPU, (obj), TYPE_MICROBLAZE_CPU) -#define MICROBLAZE_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MicroBlazeCPUClass, (obj), TYPE_MICROBLAZE_CPU) +DECLARE_OBJ_CHECKERS(MicroBlazeCPU, MicroBlazeCPUClass, + MICROBLAZE_CPU, TYPE_MICROBLAZE_CPU) =20 /** * MicroBlazeCPUClass: diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index 3a5fd9561e..82f45a828c 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -31,12 +31,8 @@ =20 typedef struct MIPSCPU MIPSCPU; typedef struct MIPSCPUClass MIPSCPUClass; -#define MIPS_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(MIPSCPUClass, (klass), TYPE_MIPS_CPU) -#define MIPS_CPU(obj) \ - OBJECT_CHECK(MIPSCPU, (obj), TYPE_MIPS_CPU) -#define MIPS_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MIPSCPUClass, (obj), TYPE_MIPS_CPU) +DECLARE_OBJ_CHECKERS(MIPSCPU, MIPSCPUClass, + MIPS_CPU, TYPE_MIPS_CPU) =20 /** * MIPSCPUClass: diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index af4d6abf16..a9832a2d85 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -53,12 +53,8 @@ typedef struct CPUMoxieState { =20 typedef struct MoxieCPU MoxieCPU; typedef struct MoxieCPUClass MoxieCPUClass; -#define MOXIE_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(MoxieCPUClass, (klass), TYPE_MOXIE_CPU) -#define MOXIE_CPU(obj) \ - OBJECT_CHECK(MoxieCPU, (obj), TYPE_MOXIE_CPU) -#define MOXIE_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MoxieCPUClass, (obj), TYPE_MOXIE_CPU) +DECLARE_OBJ_CHECKERS(MoxieCPU, MoxieCPUClass, + MOXIE_CPU, TYPE_MOXIE_CPU) =20 /** * MoxieCPUClass: diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 7162cbdf5c..0b91a3634b 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -34,12 +34,8 @@ typedef struct CPUNios2State CPUNios2State; =20 typedef struct Nios2CPU Nios2CPU; typedef struct Nios2CPUClass Nios2CPUClass; -#define NIOS2_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(Nios2CPUClass, (klass), TYPE_NIOS2_CPU) -#define NIOS2_CPU(obj) \ - OBJECT_CHECK(Nios2CPU, (obj), TYPE_NIOS2_CPU) -#define NIOS2_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(Nios2CPUClass, (obj), TYPE_NIOS2_CPU) +DECLARE_OBJ_CHECKERS(Nios2CPU, Nios2CPUClass, + NIOS2_CPU, TYPE_NIOS2_CPU) =20 /** * Nios2CPUClass: diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index ab0dd55358..5e6d8a40d6 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -31,12 +31,8 @@ struct OpenRISCCPU; =20 typedef struct OpenRISCCPU OpenRISCCPU; typedef struct OpenRISCCPUClass OpenRISCCPUClass; -#define OPENRISC_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(OpenRISCCPUClass, (klass), TYPE_OPENRISC_CPU) -#define OPENRISC_CPU(obj) \ - OBJECT_CHECK(OpenRISCCPU, (obj), TYPE_OPENRISC_CPU) -#define OPENRISC_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(OpenRISCCPUClass, (obj), TYPE_OPENRISC_CPU) +DECLARE_OBJ_CHECKERS(OpenRISCCPU, OpenRISCCPUClass, + OPENRISC_CPU, TYPE_OPENRISC_CPU) =20 /** * OpenRISCCPUClass: diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 017f0efc7b..f7e600c7b3 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -31,12 +31,8 @@ =20 typedef struct PowerPCCPU PowerPCCPU; typedef struct PowerPCCPUClass PowerPCCPUClass; -#define POWERPC_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(PowerPCCPUClass, (klass), TYPE_POWERPC_CPU) -#define POWERPC_CPU(obj) \ - OBJECT_CHECK(PowerPCCPU, (obj), TYPE_POWERPC_CPU) -#define POWERPC_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PowerPCCPUClass, (obj), TYPE_POWERPC_CPU) +DECLARE_OBJ_CHECKERS(PowerPCCPU, PowerPCCPUClass, + POWERPC_CPU, TYPE_POWERPC_CPU) =20 typedef struct CPUPPCState CPUPPCState; typedef struct ppc_tb_t ppc_tb_t; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 1c6fbfcfdb..766e9c5c26 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1222,14 +1222,8 @@ struct PPCVirtualHypervisorClass { }; =20 #define TYPE_PPC_VIRTUAL_HYPERVISOR "ppc-virtual-hypervisor" -#define PPC_VIRTUAL_HYPERVISOR(obj) \ - OBJECT_CHECK(PPCVirtualHypervisor, (obj), TYPE_PPC_VIRTUAL_HYPERVISOR) -#define PPC_VIRTUAL_HYPERVISOR_CLASS(klass) \ - OBJECT_CLASS_CHECK(PPCVirtualHypervisorClass, (klass), \ - TYPE_PPC_VIRTUAL_HYPERVISOR) -#define PPC_VIRTUAL_HYPERVISOR_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PPCVirtualHypervisorClass, (obj), \ - TYPE_PPC_VIRTUAL_HYPERVISOR) +DECLARE_OBJ_CHECKERS(PPCVirtualHypervisor, PPCVirtualHypervisorClass, + PPC_VIRTUAL_HYPERVISOR, TYPE_PPC_VIRTUAL_HYPERVISOR) #endif /* CONFIG_USER_ONLY */ =20 void ppc_cpu_do_interrupt(CPUState *cpu); diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index ff86613d94..04ccb78738 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -234,12 +234,8 @@ struct CPURISCVState { =20 typedef struct RISCVCPU RISCVCPU; typedef struct RISCVCPUClass RISCVCPUClass; -#define RISCV_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(RISCVCPUClass, (klass), TYPE_RISCV_CPU) -#define RISCV_CPU(obj) \ - OBJECT_CHECK(RISCVCPU, (obj), TYPE_RISCV_CPU) -#define RISCV_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RISCVCPUClass, (obj), TYPE_RISCV_CPU) +DECLARE_OBJ_CHECKERS(RISCVCPU, RISCVCPUClass, + RISCV_CPU, TYPE_RISCV_CPU) =20 /** * RISCVCPUClass: diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index dd96469e04..05f5773ab1 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -28,12 +28,8 @@ =20 typedef struct RXCPU RXCPU; typedef struct RXCPUClass RXCPUClass; -#define RX_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(RXCPUClass, (klass), TYPE_RX_CPU) -#define RX_CPU(obj) \ - OBJECT_CHECK(RXCPU, (obj), TYPE_RX_CPU) -#define RX_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RXCPUClass, (obj), TYPE_RX_CPU) +DECLARE_OBJ_CHECKERS(RXCPU, RXCPUClass, + RX_CPU, TYPE_RX_CPU) =20 /* * RXCPUClass: diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 13f1f2659e..5f0dccdac1 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -27,12 +27,8 @@ =20 typedef struct S390CPU S390CPU; typedef struct S390CPUClass S390CPUClass; -#define S390_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(S390CPUClass, (klass), TYPE_S390_CPU) -#define S390_CPU(obj) \ - OBJECT_CHECK(S390CPU, (obj), TYPE_S390_CPU) -#define S390_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(S390CPUClass, (obj), TYPE_S390_CPU) +DECLARE_OBJ_CHECKERS(S390CPU, S390CPUClass, + S390_CPU, TYPE_S390_CPU) =20 typedef struct S390CPUModel S390CPUModel; typedef struct S390CPUDef S390CPUDef; diff --git a/target/sh4/cpu-qom.h b/target/sh4/cpu-qom.h index bf71c0f8e5..b04b2bb4bf 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -31,12 +31,8 @@ =20 typedef struct SuperHCPU SuperHCPU; typedef struct SuperHCPUClass SuperHCPUClass; -#define SUPERH_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(SuperHCPUClass, (klass), TYPE_SUPERH_CPU) -#define SUPERH_CPU(obj) \ - OBJECT_CHECK(SuperHCPU, (obj), TYPE_SUPERH_CPU) -#define SUPERH_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SuperHCPUClass, (obj), TYPE_SUPERH_CPU) +DECLARE_OBJ_CHECKERS(SuperHCPU, SuperHCPUClass, + SUPERH_CPU, TYPE_SUPERH_CPU) =20 /** * SuperHCPUClass: diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index b7cc81e5f3..42cb631d45 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -31,12 +31,8 @@ =20 typedef struct SPARCCPU SPARCCPU; typedef struct SPARCCPUClass SPARCCPUClass; -#define SPARC_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(SPARCCPUClass, (klass), TYPE_SPARC_CPU) -#define SPARC_CPU(obj) \ - OBJECT_CHECK(SPARCCPU, (obj), TYPE_SPARC_CPU) -#define SPARC_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SPARCCPUClass, (obj), TYPE_SPARC_CPU) +DECLARE_OBJ_CHECKERS(SPARCCPU, SPARCCPUClass, + SPARC_CPU, TYPE_SPARC_CPU) =20 typedef struct sparc_def_t sparc_def_t; /** diff --git a/target/tilegx/cpu.h b/target/tilegx/cpu.h index d6cc1d2982..d4cf70dc15 100644 --- a/target/tilegx/cpu.h +++ b/target/tilegx/cpu.h @@ -101,12 +101,8 @@ typedef struct CPUTLGState { =20 typedef struct TileGXCPU TileGXCPU; typedef struct TileGXCPUClass TileGXCPUClass; -#define TILEGX_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(TileGXCPUClass, (klass), TYPE_TILEGX_CPU) -#define TILEGX_CPU(obj) \ - OBJECT_CHECK(TileGXCPU, (obj), TYPE_TILEGX_CPU) -#define TILEGX_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TileGXCPUClass, (obj), TYPE_TILEGX_CPU) +DECLARE_OBJ_CHECKERS(TileGXCPU, TileGXCPUClass, + TILEGX_CPU, TYPE_TILEGX_CPU) =20 /** * TileGXCPUClass: diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index cef466da74..1988c26093 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -26,12 +26,8 @@ =20 typedef struct TriCoreCPU TriCoreCPU; typedef struct TriCoreCPUClass TriCoreCPUClass; -#define TRICORE_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(TriCoreCPUClass, (klass), TYPE_TRICORE_CPU) -#define TRICORE_CPU(obj) \ - OBJECT_CHECK(TriCoreCPU, (obj), TYPE_TRICORE_CPU) -#define TRICORE_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TriCoreCPUClass, (obj), TYPE_TRICORE_CPU) +DECLARE_OBJ_CHECKERS(TriCoreCPU, TriCoreCPUClass, + TRICORE_CPU, TYPE_TRICORE_CPU) =20 struct TriCoreCPUClass { /*< private >*/ diff --git a/target/unicore32/cpu-qom.h b/target/unicore32/cpu-qom.h index 6a1cb1c82d..5b67ac532d 100644 --- a/target/unicore32/cpu-qom.h +++ b/target/unicore32/cpu-qom.h @@ -18,12 +18,8 @@ =20 typedef struct UniCore32CPU UniCore32CPU; typedef struct UniCore32CPUClass UniCore32CPUClass; -#define UNICORE32_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(UniCore32CPUClass, (klass), TYPE_UNICORE32_CPU) -#define UNICORE32_CPU(obj) \ - OBJECT_CHECK(UniCore32CPU, (obj), TYPE_UNICORE32_CPU) -#define UNICORE32_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(UniCore32CPUClass, (obj), TYPE_UNICORE32_CPU) +DECLARE_OBJ_CHECKERS(UniCore32CPU, UniCore32CPUClass, + UNICORE32_CPU, TYPE_UNICORE32_CPU) =20 /** * UniCore32CPUClass: diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index cd9f31dc84..ef13262b42 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -36,12 +36,8 @@ =20 typedef struct XtensaCPU XtensaCPU; typedef struct XtensaCPUClass XtensaCPUClass; -#define XTENSA_CPU_CLASS(class) \ - OBJECT_CLASS_CHECK(XtensaCPUClass, (class), TYPE_XTENSA_CPU) -#define XTENSA_CPU(obj) \ - OBJECT_CHECK(XtensaCPU, (obj), TYPE_XTENSA_CPU) -#define XTENSA_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(XtensaCPUClass, (obj), TYPE_XTENSA_CPU) +DECLARE_OBJ_CHECKERS(XtensaCPU, XtensaCPUClass, + XTENSA_CPU, TYPE_XTENSA_CPU) =20 typedef struct XtensaConfig XtensaConfig; =20 diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 7dba29cc48..7098ad96c3 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -46,8 +46,8 @@ typedef struct TCGState TCGState; =20 #define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg") =20 -#define TCG_STATE(obj) \ - OBJECT_CHECK(TCGState, (obj), TYPE_TCG_ACCEL) +DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, + TYPE_TCG_ACCEL) =20 /* mask must never be zero, except for A20 change call */ static void tcg_handle_interrupt(CPUState *cpu, int mask) diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index 84bd84efe7..f047ad0362 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -37,9 +37,8 @@ =20 typedef struct CryptoDevBackendBuiltin CryptoDevBackendBuiltin; -#define CRYPTODEV_BACKEND_BUILTIN(obj) \ - OBJECT_CHECK(CryptoDevBackendBuiltin, \ - (obj), TYPE_CRYPTODEV_BACKEND_BUILTIN) +DECLARE_INSTANCE_CHECKER(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTI= N, + TYPE_CRYPTODEV_BACKEND_BUILTIN) =20 =20 typedef struct CryptoDevBackendBuiltinSession { diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index 5e903f6507..41089dede1 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -40,9 +40,8 @@ #define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user" =20 typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser; -#define CRYPTODEV_BACKEND_VHOST_USER(obj) \ - OBJECT_CHECK(CryptoDevBackendVhostUser, \ - (obj), TYPE_CRYPTODEV_BACKEND_VHOST_USER) +DECLARE_INSTANCE_CHECKER(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOS= T_USER, + TYPE_CRYPTODEV_BACKEND_VHOST_USER) =20 =20 struct CryptoDevBackendVhostUser { diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index 0473c5c335..bfbd4f09f1 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -25,12 +25,8 @@ typedef struct DBusVMState DBusVMState; typedef struct DBusVMStateClass DBusVMStateClass; =20 #define TYPE_DBUS_VMSTATE "dbus-vmstate" -#define DBUS_VMSTATE(obj) \ - OBJECT_CHECK(DBusVMState, (obj), TYPE_DBUS_VMSTATE) -#define DBUS_VMSTATE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(DBusVMStateClass, (obj), TYPE_DBUS_VMSTATE) -#define DBUS_VMSTATE_CLASS(klass) \ - OBJECT_CLASS_CHECK(DBusVMStateClass, (klass), TYPE_DBUS_VMSTATE) +DECLARE_OBJ_CHECKERS(DBusVMState, DBusVMStateClass, + DBUS_VMSTATE, TYPE_DBUS_VMSTATE) =20 struct DBusVMStateClass { ObjectClass parent_class; diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 2c3bcb8291..a3b2e8209e 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -20,8 +20,8 @@ #include "qom/object.h" =20 typedef struct HostMemoryBackendFile HostMemoryBackendFile; -#define MEMORY_BACKEND_FILE(obj) \ - OBJECT_CHECK(HostMemoryBackendFile, (obj), TYPE_MEMORY_BACKEND_FILE) +DECLARE_INSTANCE_CHECKER(HostMemoryBackendFile, MEMORY_BACKEND_FILE, + TYPE_MEMORY_BACKEND_FILE) =20 =20 struct HostMemoryBackendFile { diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 45114bd641..8cf6bcbda2 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -22,8 +22,8 @@ #define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd" =20 typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd; -#define MEMORY_BACKEND_MEMFD(obj) \ - OBJECT_CHECK(HostMemoryBackendMemfd, (obj), TYPE_MEMORY_BACKEND_MEMFD) +DECLARE_INSTANCE_CHECKER(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD, + TYPE_MEMORY_BACKEND_MEMFD) =20 =20 struct HostMemoryBackendMemfd { diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c index 4bf073c963..459be97a5a 100644 --- a/backends/rng-builtin.c +++ b/backends/rng-builtin.c @@ -12,7 +12,8 @@ #include "qom/object.h" =20 typedef struct RngBuiltin RngBuiltin; -#define RNG_BUILTIN(obj) OBJECT_CHECK(RngBuiltin, (obj), TYPE_RNG_BUILTIN) +DECLARE_INSTANCE_CHECKER(RngBuiltin, RNG_BUILTIN, + TYPE_RNG_BUILTIN) =20 struct RngBuiltin { RngBackend parent; diff --git a/backends/rng-egd.c b/backends/rng-egd.c index ee1854f31c..d905fe657c 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -20,7 +20,8 @@ =20 #define TYPE_RNG_EGD "rng-egd" typedef struct RngEgd RngEgd; -#define RNG_EGD(obj) OBJECT_CHECK(RngEgd, (obj), TYPE_RNG_EGD) +DECLARE_INSTANCE_CHECKER(RngEgd, RNG_EGD, + TYPE_RNG_EGD) =20 struct RngEgd { RngBackend parent; diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index 2509c8d327..13657d9aba 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -46,8 +46,8 @@ =20 #define TYPE_TPM_EMULATOR "tpm-emulator" typedef struct TPMEmulator TPMEmulator; -#define TPM_EMULATOR(obj) \ - OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR) +DECLARE_INSTANCE_CHECKER(TPMEmulator, TPM_EMULATOR, + TYPE_TPM_EMULATOR) =20 #define TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(S, cap) (((S)->caps & (cap)) =3D= =3D (cap)) =20 diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c index b703f7e412..10722e0a41 100644 --- a/backends/tpm/tpm_passthrough.c +++ b/backends/tpm/tpm_passthrough.c @@ -37,8 +37,8 @@ =20 #define TYPE_TPM_PASSTHROUGH "tpm-passthrough" typedef struct TPMPassthruState TPMPassthruState; -#define TPM_PASSTHROUGH(obj) \ - OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH) +DECLARE_INSTANCE_CHECKER(TPMPassthruState, TPM_PASSTHROUGH, + TYPE_TPM_PASSTHROUGH) =20 /* data structures */ struct TPMPassthruState { diff --git a/chardev/baum.c b/chardev/baum.c index cb906060d9..5deca778bc 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -105,7 +105,8 @@ struct BaumChardev { typedef struct BaumChardev BaumChardev; =20 #define TYPE_CHARDEV_BRAILLE "chardev-braille" -#define BAUM_CHARDEV(obj) OBJECT_CHECK(BaumChardev, (obj), TYPE_CHARDEV_BR= AILLE) +DECLARE_INSTANCE_CHECKER(BaumChardev, BAUM_CHARDEV, + TYPE_CHARDEV_BRAILLE) =20 /* Let's assume NABCC by default */ enum way { diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c index bebe050705..66e4589b2b 100644 --- a/chardev/char-parallel.c +++ b/chardev/char-parallel.c @@ -57,8 +57,8 @@ struct ParallelChardev { }; typedef struct ParallelChardev ParallelChardev; =20 -#define PARALLEL_CHARDEV(obj) \ - OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL) +DECLARE_INSTANCE_CHECKER(ParallelChardev, PARALLEL_CHARDEV, + TYPE_CHARDEV_PARALLEL) =20 static int pp_hw_mode(ParallelChardev *s, uint16_t mode) { @@ -185,8 +185,6 @@ struct ParallelChardev { }; typedef struct ParallelChardev ParallelChardev; =20 -#define PARALLEL_CHARDEV(obj) \ - OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL) =20 static int pp_ioctl(Chardev *chr, int cmd, void *arg) { diff --git a/chardev/char-pty.c b/chardev/char-pty.c index 963fe4f0ca..a2d1e7c985 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -45,7 +45,8 @@ struct PtyChardev { }; typedef struct PtyChardev PtyChardev; =20 -#define PTY_CHARDEV(obj) OBJECT_CHECK(PtyChardev, (obj), TYPE_CHARDEV_PTY) +DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV, + TYPE_CHARDEV_PTY) =20 static void pty_chr_state(Chardev *chr, int connected); =20 diff --git a/chardev/char-ringbuf.c b/chardev/char-ringbuf.c index 301a5d8634..d40d21d3cf 100644 --- a/chardev/char-ringbuf.c +++ b/chardev/char-ringbuf.c @@ -42,8 +42,8 @@ struct RingBufChardev { }; typedef struct RingBufChardev RingBufChardev; =20 -#define RINGBUF_CHARDEV(obj) \ - OBJECT_CHECK(RingBufChardev, (obj), TYPE_CHARDEV_RINGBUF) +DECLARE_INSTANCE_CHECKER(RingBufChardev, RINGBUF_CHARDEV, + TYPE_CHARDEV_RINGBUF) =20 static size_t ringbuf_count(const Chardev *chr) { diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 9435b7d643..95e45812d5 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -88,8 +88,8 @@ struct SocketChardev { }; typedef struct SocketChardev SocketChardev; =20 -#define SOCKET_CHARDEV(obj) \ - OBJECT_CHECK(SocketChardev, (obj), TYPE_CHARDEV_SOCKET) +DECLARE_INSTANCE_CHECKER(SocketChardev, SOCKET_CHARDEV, + TYPE_CHARDEV_SOCKET) =20 static gboolean socket_reconnect_timeout(gpointer opaque); static void tcp_chr_telnet_init(Chardev *chr); diff --git a/chardev/char-udp.c b/chardev/char-udp.c index 58be3487e6..16b5dbce58 100644 --- a/chardev/char-udp.c +++ b/chardev/char-udp.c @@ -45,7 +45,8 @@ struct UdpChardev { }; typedef struct UdpChardev UdpChardev; =20 -#define UDP_CHARDEV(obj) OBJECT_CHECK(UdpChardev, (obj), TYPE_CHARDEV_UDP) +DECLARE_INSTANCE_CHECKER(UdpChardev, UDP_CHARDEV, + TYPE_CHARDEV_UDP) =20 /* Called with chr_write_lock held. */ static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len) diff --git a/chardev/char-win-stdio.c b/chardev/char-win-stdio.c index 980e0d1356..a4771ab82e 100644 --- a/chardev/char-win-stdio.c +++ b/chardev/char-win-stdio.c @@ -40,8 +40,8 @@ struct WinStdioChardev { }; typedef struct WinStdioChardev WinStdioChardev; =20 -#define WIN_STDIO_CHARDEV(obj) \ - OBJECT_CHECK(WinStdioChardev, (obj), TYPE_CHARDEV_WIN_STDIO) +DECLARE_INSTANCE_CHECKER(WinStdioChardev, WIN_STDIO_CHARDEV, + TYPE_CHARDEV_WIN_STDIO) =20 static void win_stdio_wait_func(void *opaque) { diff --git a/chardev/msmouse.c b/chardev/msmouse.c index 0a7926697c..eb9231dcdb 100644 --- a/chardev/msmouse.c +++ b/chardev/msmouse.c @@ -45,8 +45,8 @@ struct MouseChardev { typedef struct MouseChardev MouseChardev; =20 #define TYPE_CHARDEV_MSMOUSE "chardev-msmouse" -#define MOUSE_CHARDEV(obj) \ - OBJECT_CHECK(MouseChardev, (obj), TYPE_CHARDEV_MSMOUSE) +DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV, + TYPE_CHARDEV_MSMOUSE) =20 static void msmouse_chr_accept_input(Chardev *chr) { diff --git a/chardev/testdev.c b/chardev/testdev.c index bbae59c941..a92caca3c3 100644 --- a/chardev/testdev.c +++ b/chardev/testdev.c @@ -40,8 +40,8 @@ struct TestdevChardev { typedef struct TestdevChardev TestdevChardev; =20 #define TYPE_CHARDEV_TESTDEV "chardev-testdev" -#define TESTDEV_CHARDEV(obj) \ - OBJECT_CHECK(TestdevChardev, (obj), TYPE_CHARDEV_TESTDEV) +DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV, + TYPE_CHARDEV_TESTDEV) =20 /* Try to interpret a whole incoming packet */ static int testdev_eat_packet(TestdevChardev *testdev) diff --git a/chardev/wctablet.c b/chardev/wctablet.c index 361a12fdd4..95e005f5a5 100644 --- a/chardev/wctablet.c +++ b/chardev/wctablet.c @@ -86,8 +86,8 @@ struct TabletChardev { typedef struct TabletChardev TabletChardev; =20 #define TYPE_CHARDEV_WCTABLET "chardev-wctablet" -#define WCTABLET_CHARDEV(obj) \ - OBJECT_CHECK(TabletChardev, (obj), TYPE_CHARDEV_WCTABLET) +DECLARE_INSTANCE_CHECKER(TabletChardev, WCTABLET_CHARDEV, + TYPE_CHARDEV_WCTABLET) =20 =20 static void wctablet_chr_accept_input(Chardev *chr); diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index ba39184650..1574f7db3e 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -93,8 +93,8 @@ struct PIIX4PMState { }; typedef struct PIIX4PMState PIIX4PMState; =20 -#define PIIX4_PM(obj) \ - OBJECT_CHECK(PIIX4PMState, (obj), TYPE_PIIX4_PM) +DECLARE_INSTANCE_CHECKER(PIIX4PMState, PIIX4_PM, + TYPE_PIIX4_PM) =20 static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, PCIBus *bus, PIIX4PMState *s); diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index bd484e42bd..d02b14d89f 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -51,8 +51,8 @@ typedef struct TyphoonPchip { } TyphoonPchip; =20 typedef struct TyphoonState TyphoonState; -#define TYPHOON_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(TyphoonState, (obj), TYPE_TYPHOON_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(TyphoonState, TYPHOON_PCI_HOST_BRIDGE, + TYPE_TYPHOON_PCI_HOST_BRIDGE) =20 struct TyphoonState { PCIHostState parent_obj; diff --git a/hw/arm/collie.c b/hw/arm/collie.c index 82ffc82dc7..a49f4a1c7c 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -28,8 +28,8 @@ struct CollieMachineState { typedef struct CollieMachineState CollieMachineState; =20 #define TYPE_COLLIE_MACHINE MACHINE_TYPE_NAME("collie") -#define COLLIE_MACHINE(obj) \ - OBJECT_CHECK(CollieMachineState, obj, TYPE_COLLIE_MACHINE) +DECLARE_INSTANCE_CHECKER(CollieMachineState, COLLIE_MACHINE, + TYPE_COLLIE_MACHINE) =20 static struct arm_boot_info collie_binfo =3D { .loader_start =3D SA_SDCS0, diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index cbf6e72ad6..e2ace803ef 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -157,8 +157,8 @@ static const MemoryRegionOps hb_mem_ops =3D { =20 #define TYPE_HIGHBANK_REGISTERS "highbank-regs" typedef struct HighbankRegsState HighbankRegsState; -#define HIGHBANK_REGISTERS(obj) \ - OBJECT_CHECK(HighbankRegsState, (obj), TYPE_HIGHBANK_REGISTERS) +DECLARE_INSTANCE_CHECKER(HighbankRegsState, HIGHBANK_REGISTERS, + TYPE_HIGHBANK_REGISTERS) =20 struct HighbankRegsState { /*< private >*/ diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 75e608e68e..19989b61b9 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -30,8 +30,8 @@ =20 #define TYPE_INTEGRATOR_CM "integrator_core" typedef struct IntegratorCMState IntegratorCMState; -#define INTEGRATOR_CM(obj) \ - OBJECT_CHECK(IntegratorCMState, (obj), TYPE_INTEGRATOR_CM) +DECLARE_INSTANCE_CHECKER(IntegratorCMState, INTEGRATOR_CM, + TYPE_INTEGRATOR_CM) =20 struct IntegratorCMState { /*< private >*/ @@ -329,8 +329,8 @@ static void integratorcm_realize(DeviceState *d, Error = **errp) =20 #define TYPE_INTEGRATOR_PIC "integrator_pic" typedef struct icp_pic_state icp_pic_state; -#define INTEGRATOR_PIC(obj) \ - OBJECT_CHECK(icp_pic_state, (obj), TYPE_INTEGRATOR_PIC) +DECLARE_INSTANCE_CHECKER(icp_pic_state, INTEGRATOR_PIC, + TYPE_INTEGRATOR_PIC) =20 struct icp_pic_state { /*< private >*/ @@ -469,8 +469,8 @@ static void icp_pic_init(Object *obj) =20 #define TYPE_ICP_CONTROL_REGS "icp-ctrl-regs" typedef struct ICPCtrlRegsState ICPCtrlRegsState; -#define ICP_CONTROL_REGS(obj) \ - OBJECT_CHECK(ICPCtrlRegsState, (obj), TYPE_ICP_CONTROL_REGS) +DECLARE_INSTANCE_CHECKER(ICPCtrlRegsState, ICP_CONTROL_REGS, + TYPE_ICP_CONTROL_REGS) =20 struct ICPCtrlRegsState { /*< private >*/ diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index e94f711e89..9a4a3d357a 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -30,8 +30,8 @@ typedef struct MicrobitMachineState MicrobitMachineState; =20 #define TYPE_MICROBIT_MACHINE MACHINE_TYPE_NAME("microbit") =20 -#define MICROBIT_MACHINE(obj) \ - OBJECT_CHECK(MicrobitMachineState, obj, TYPE_MICROBIT_MACHINE) +DECLARE_INSTANCE_CHECKER(MicrobitMachineState, MICROBIT_MACHINE, + TYPE_MICROBIT_MACHINE) =20 static void microbit_init(MachineState *machine) { diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 8870aea814..dbf7d63dc8 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -108,12 +108,8 @@ typedef struct MPS2TZMachineState MPS2TZMachineState; #define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505") #define TYPE_MPS2TZ_AN521_MACHINE MACHINE_TYPE_NAME("mps2-an521") =20 -#define MPS2TZ_MACHINE(obj) \ - OBJECT_CHECK(MPS2TZMachineState, obj, TYPE_MPS2TZ_MACHINE) -#define MPS2TZ_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MPS2TZMachineClass, obj, TYPE_MPS2TZ_MACHINE) -#define MPS2TZ_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(MPS2TZMachineClass, klass, TYPE_MPS2TZ_MACHINE) +DECLARE_OBJ_CHECKERS(MPS2TZMachineState, MPS2TZMachineClass, + MPS2TZ_MACHINE, TYPE_MPS2TZ_MACHINE) =20 /* Main SYSCLK frequency in Hz */ #define SYSCLK_FRQ 20000000 diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index b5173e398d..4ee5c38459 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -84,12 +84,8 @@ typedef struct MPS2MachineState MPS2MachineState; #define TYPE_MPS2_AN385_MACHINE MACHINE_TYPE_NAME("mps2-an385") #define TYPE_MPS2_AN511_MACHINE MACHINE_TYPE_NAME("mps2-an511") =20 -#define MPS2_MACHINE(obj) \ - OBJECT_CHECK(MPS2MachineState, obj, TYPE_MPS2_MACHINE) -#define MPS2_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MPS2MachineClass, obj, TYPE_MPS2_MACHINE) -#define MPS2_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(MPS2MachineClass, klass, TYPE_MPS2_MACHINE) +DECLARE_OBJ_CHECKERS(MPS2MachineState, MPS2MachineClass, + MPS2_MACHINE, TYPE_MPS2_MACHINE) =20 /* Main SYSCLK frequency in Hz */ #define SYSCLK_FRQ 25000000 diff --git a/hw/arm/musca.c b/hw/arm/musca.c index 7fd8634ac5..16015255c8 100644 --- a/hw/arm/musca.c +++ b/hw/arm/musca.c @@ -90,12 +90,8 @@ typedef struct MuscaMachineState MuscaMachineState; #define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a") #define TYPE_MUSCA_B1_MACHINE MACHINE_TYPE_NAME("musca-b1") =20 -#define MUSCA_MACHINE(obj) \ - OBJECT_CHECK(MuscaMachineState, obj, TYPE_MUSCA_MACHINE) -#define MUSCA_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(MuscaMachineClass, obj, TYPE_MUSCA_MACHINE) -#define MUSCA_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(MuscaMachineClass, klass, TYPE_MUSCA_MACHINE) +DECLARE_OBJ_CHECKERS(MuscaMachineState, MuscaMachineClass, + MUSCA_MACHINE, TYPE_MUSCA_MACHINE) =20 /* * Main SYSCLK frequency in Hz diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 695699e01e..2117a04171 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -156,8 +156,8 @@ typedef struct mv88w8618_rx_desc { =20 #define TYPE_MV88W8618_ETH "mv88w8618_eth" typedef struct mv88w8618_eth_state mv88w8618_eth_state; -#define MV88W8618_ETH(obj) \ - OBJECT_CHECK(mv88w8618_eth_state, (obj), TYPE_MV88W8618_ETH) +DECLARE_INSTANCE_CHECKER(mv88w8618_eth_state, MV88W8618_ETH, + TYPE_MV88W8618_ETH) =20 struct mv88w8618_eth_state { /*< private >*/ @@ -486,8 +486,8 @@ static const TypeInfo mv88w8618_eth_info =3D { =20 #define TYPE_MUSICPAL_LCD "musicpal_lcd" typedef struct musicpal_lcd_state musicpal_lcd_state; -#define MUSICPAL_LCD(obj) \ - OBJECT_CHECK(musicpal_lcd_state, (obj), TYPE_MUSICPAL_LCD) +DECLARE_INSTANCE_CHECKER(musicpal_lcd_state, MUSICPAL_LCD, + TYPE_MUSICPAL_LCD) =20 struct musicpal_lcd_state { /*< private >*/ @@ -704,8 +704,8 @@ static const TypeInfo musicpal_lcd_info =3D { =20 #define TYPE_MV88W8618_PIC "mv88w8618_pic" typedef struct mv88w8618_pic_state mv88w8618_pic_state; -#define MV88W8618_PIC(obj) \ - OBJECT_CHECK(mv88w8618_pic_state, (obj), TYPE_MV88W8618_PIC) +DECLARE_INSTANCE_CHECKER(mv88w8618_pic_state, MV88W8618_PIC, + TYPE_MV88W8618_PIC) =20 struct mv88w8618_pic_state { /*< private >*/ @@ -842,8 +842,8 @@ typedef struct mv88w8618_timer_state { =20 #define TYPE_MV88W8618_PIT "mv88w8618_pit" typedef struct mv88w8618_pit_state mv88w8618_pit_state; -#define MV88W8618_PIT(obj) \ - OBJECT_CHECK(mv88w8618_pit_state, (obj), TYPE_MV88W8618_PIT) +DECLARE_INSTANCE_CHECKER(mv88w8618_pit_state, MV88W8618_PIT, + TYPE_MV88W8618_PIT) =20 struct mv88w8618_pit_state { /*< private >*/ @@ -1010,8 +1010,8 @@ static const TypeInfo mv88w8618_pit_info =3D { =20 #define TYPE_MV88W8618_FLASHCFG "mv88w8618_flashcfg" typedef struct mv88w8618_flashcfg_state mv88w8618_flashcfg_state; -#define MV88W8618_FLASHCFG(obj) \ - OBJECT_CHECK(mv88w8618_flashcfg_state, (obj), TYPE_MV88W8618_FLASHCFG) +DECLARE_INSTANCE_CHECKER(mv88w8618_flashcfg_state, MV88W8618_FLASHCFG, + TYPE_MV88W8618_FLASHCFG) =20 struct mv88w8618_flashcfg_state { /*< private >*/ @@ -1103,8 +1103,8 @@ struct MusicPalMiscState { typedef struct MusicPalMiscState MusicPalMiscState; =20 #define TYPE_MUSICPAL_MISC "musicpal-misc" -#define MUSICPAL_MISC(obj) \ - OBJECT_CHECK(MusicPalMiscState, (obj), TYPE_MUSICPAL_MISC) +DECLARE_INSTANCE_CHECKER(MusicPalMiscState, MUSICPAL_MISC, + TYPE_MUSICPAL_MISC) =20 static uint64_t musicpal_misc_read(void *opaque, hwaddr offset, unsigned size) @@ -1210,8 +1210,8 @@ static void mv88w8618_wlan_realize(DeviceState *dev, = Error **errp) =20 #define TYPE_MUSICPAL_GPIO "musicpal_gpio" typedef struct musicpal_gpio_state musicpal_gpio_state; -#define MUSICPAL_GPIO(obj) \ - OBJECT_CHECK(musicpal_gpio_state, (obj), TYPE_MUSICPAL_GPIO) +DECLARE_INSTANCE_CHECKER(musicpal_gpio_state, MUSICPAL_GPIO, + TYPE_MUSICPAL_GPIO) =20 struct musicpal_gpio_state { /*< private >*/ @@ -1461,8 +1461,8 @@ static const TypeInfo musicpal_gpio_info =3D { =20 #define TYPE_MUSICPAL_KEY "musicpal_key" typedef struct musicpal_key_state musicpal_key_state; -#define MUSICPAL_KEY(obj) \ - OBJECT_CHECK(musicpal_key_state, (obj), TYPE_MUSICPAL_KEY) +DECLARE_INSTANCE_CHECKER(musicpal_key_state, MUSICPAL_KEY, + TYPE_MUSICPAL_KEY) =20 struct musicpal_key_state { /*< private >*/ diff --git a/hw/arm/palm.c b/hw/arm/palm.c index ddabb0e2d6..abc6495489 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -134,8 +134,8 @@ static void palmte_button_event(void *opaque, int keyco= de) =20 #define TYPE_PALM_MISC_GPIO "palm-misc-gpio" typedef struct PalmMiscGPIOState PalmMiscGPIOState; -#define PALM_MISC_GPIO(obj) \ - OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO) +DECLARE_INSTANCE_CHECKER(PalmMiscGPIOState, PALM_MISC_GPIO, + TYPE_PALM_MISC_GPIO) =20 struct PalmMiscGPIOState { SysBusDevice parent_obj; diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index a48a32ee09..701baa84ca 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -471,8 +471,8 @@ static const VMStateDescription vmstate_pxa2xx_mm =3D { =20 #define TYPE_PXA2XX_SSP "pxa2xx-ssp" typedef struct PXA2xxSSPState PXA2xxSSPState; -#define PXA2XX_SSP(obj) \ - OBJECT_CHECK(PXA2xxSSPState, (obj), TYPE_PXA2XX_SSP) +DECLARE_INSTANCE_CHECKER(PXA2xxSSPState, PXA2XX_SSP, + TYPE_PXA2XX_SSP) =20 /* Synchronous Serial Ports */ struct PXA2xxSSPState { @@ -812,8 +812,8 @@ static void pxa2xx_ssp_init(Object *obj) =20 #define TYPE_PXA2XX_RTC "pxa2xx_rtc" typedef struct PXA2xxRTCState PXA2xxRTCState; -#define PXA2XX_RTC(obj) \ - OBJECT_CHECK(PXA2xxRTCState, (obj), TYPE_PXA2XX_RTC) +DECLARE_INSTANCE_CHECKER(PXA2xxRTCState, PXA2XX_RTC, + TYPE_PXA2XX_RTC) =20 struct PXA2xxRTCState { /*< private >*/ @@ -1246,8 +1246,8 @@ static const TypeInfo pxa2xx_rtc_sysbus_info =3D { =20 #define TYPE_PXA2XX_I2C_SLAVE "pxa2xx-i2c-slave" typedef struct PXA2xxI2CSlaveState PXA2xxI2CSlaveState; -#define PXA2XX_I2C_SLAVE(obj) \ - OBJECT_CHECK(PXA2xxI2CSlaveState, (obj), TYPE_PXA2XX_I2C_SLAVE) +DECLARE_INSTANCE_CHECKER(PXA2xxI2CSlaveState, PXA2XX_I2C_SLAVE, + TYPE_PXA2XX_I2C_SLAVE) =20 struct PXA2xxI2CSlaveState { I2CSlave parent_obj; diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index 2cd6dd929e..16bbe4fb70 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -23,8 +23,8 @@ =20 #define TYPE_PXA2XX_GPIO "pxa2xx-gpio" typedef struct PXA2xxGPIOInfo PXA2xxGPIOInfo; -#define PXA2XX_GPIO(obj) \ - OBJECT_CHECK(PXA2xxGPIOInfo, (obj), TYPE_PXA2XX_GPIO) +DECLARE_INSTANCE_CHECKER(PXA2xxGPIOInfo, PXA2XX_GPIO, + TYPE_PXA2XX_GPIO) =20 struct PXA2xxGPIOInfo { /*< private >*/ diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 00e72fde4e..cb52a9dff3 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -39,8 +39,8 @@ =20 #define TYPE_PXA2XX_PIC "pxa2xx_pic" typedef struct PXA2xxPICState PXA2xxPICState; -#define PXA2XX_PIC(obj) \ - OBJECT_CHECK(PXA2xxPICState, (obj), TYPE_PXA2XX_PIC) +DECLARE_INSTANCE_CHECKER(PXA2xxPICState, PXA2XX_PIC, + TYPE_PXA2XX_PIC) =20 struct PXA2xxPICState { /*< private >*/ diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index d9f7eeb06b..d2f674587d 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -53,13 +53,9 @@ struct RaspiMachineClass { typedef struct RaspiMachineClass RaspiMachineClass; =20 #define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common") -#define RASPI_MACHINE(obj) \ - OBJECT_CHECK(RaspiMachineState, (obj), TYPE_RASPI_MACHINE) +DECLARE_OBJ_CHECKERS(RaspiMachineState, RaspiMachineClass, + RASPI_MACHINE, TYPE_RASPI_MACHINE) =20 -#define RASPI_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(RaspiMachineClass, (klass), TYPE_RASPI_MACHINE) -#define RASPI_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RaspiMachineClass, (obj), TYPE_RASPI_MACHINE) =20 /* * Board revision codes: diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index a638fb369e..ac68b4640d 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -98,8 +98,8 @@ struct SBSAMachineState { typedef struct SBSAMachineState SBSAMachineState; =20 #define TYPE_SBSA_MACHINE MACHINE_TYPE_NAME("sbsa-ref") -#define SBSA_MACHINE(obj) \ - OBJECT_CHECK(SBSAMachineState, (obj), TYPE_SBSA_MACHINE) +DECLARE_INSTANCE_CHECKER(SBSAMachineState, SBSA_MACHINE, + TYPE_SBSA_MACHINE) =20 static const MemMapEntry sbsa_ref_memmap[] =3D { /* 512M boot ROM */ diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 0bf5745eb2..a7ad667f06 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -59,12 +59,8 @@ struct SpitzMachineState { typedef struct SpitzMachineState SpitzMachineState; =20 #define TYPE_SPITZ_MACHINE "spitz-common" -#define SPITZ_MACHINE(obj) \ - OBJECT_CHECK(SpitzMachineState, obj, TYPE_SPITZ_MACHINE) -#define SPITZ_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SpitzMachineClass, obj, TYPE_SPITZ_MACHINE) -#define SPITZ_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SpitzMachineClass, klass, TYPE_SPITZ_MACHINE) +DECLARE_OBJ_CHECKERS(SpitzMachineState, SpitzMachineClass, + SPITZ_MACHINE, TYPE_SPITZ_MACHINE) =20 #define zaurus_printf(format, ...) \ fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__) @@ -89,7 +85,8 @@ typedef struct SpitzMachineState SpitzMachineState; =20 #define TYPE_SL_NAND "sl-nand" typedef struct SLNANDState SLNANDState; -#define SL_NAND(obj) OBJECT_CHECK(SLNANDState, (obj), TYPE_SL_NAND) +DECLARE_INSTANCE_CHECKER(SLNANDState, SL_NAND, + TYPE_SL_NAND) =20 struct SLNANDState { SysBusDevice parent_obj; @@ -266,8 +263,8 @@ static const int spitz_gpiomap[5] =3D { =20 #define TYPE_SPITZ_KEYBOARD "spitz-keyboard" typedef struct SpitzKeyboardState SpitzKeyboardState; -#define SPITZ_KEYBOARD(obj) \ - OBJECT_CHECK(SpitzKeyboardState, (obj), TYPE_SPITZ_KEYBOARD) +DECLARE_INSTANCE_CHECKER(SpitzKeyboardState, SPITZ_KEYBOARD, + TYPE_SPITZ_KEYBOARD) =20 struct SpitzKeyboardState { SysBusDevice parent_obj; @@ -586,7 +583,8 @@ static void spitz_keyboard_realize(DeviceState *dev, Er= ror **errp) =20 #define TYPE_SPITZ_LCDTG "spitz-lcdtg" typedef struct SpitzLCDTG SpitzLCDTG; -#define SPITZ_LCDTG(obj) OBJECT_CHECK(SpitzLCDTG, (obj), TYPE_SPITZ_LCDTG) +DECLARE_INSTANCE_CHECKER(SpitzLCDTG, SPITZ_LCDTG, + TYPE_SPITZ_LCDTG) =20 struct SpitzLCDTG { SSISlave ssidev; @@ -675,7 +673,8 @@ static void spitz_lcdtg_realize(SSISlave *ssi, Error **= errp) =20 #define TYPE_CORGI_SSP "corgi-ssp" typedef struct CorgiSSPState CorgiSSPState; -#define CORGI_SSP(obj) OBJECT_CHECK(CorgiSSPState, (obj), TYPE_CORGI_SSP) +DECLARE_INSTANCE_CHECKER(CorgiSSPState, CORGI_SSP, + TYPE_CORGI_SSP) =20 /* "Demux" the signal based on current chipselect */ struct CorgiSSPState { @@ -827,8 +826,8 @@ static void spitz_akita_i2c_setup(PXA2xxState *cpu) */ #define TYPE_SPITZ_MISC_GPIO "spitz-misc-gpio" typedef struct SpitzMiscGPIOState SpitzMiscGPIOState; -#define SPITZ_MISC_GPIO(obj) \ - OBJECT_CHECK(SpitzMiscGPIOState, (obj), TYPE_SPITZ_MISC_GPIO) +DECLARE_INSTANCE_CHECKER(SpitzMiscGPIOState, SPITZ_MISC_GPIO, + TYPE_SPITZ_MISC_GPIO) =20 struct SpitzMiscGPIOState { SysBusDevice parent_obj; diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index d8d7d3a43b..d6fc4a4681 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -59,8 +59,8 @@ typedef const struct { =20 #define TYPE_STELLARIS_GPTM "stellaris-gptm" typedef struct gptm_state gptm_state; -#define STELLARIS_GPTM(obj) \ - OBJECT_CHECK(gptm_state, (obj), TYPE_STELLARIS_GPTM) +DECLARE_INSTANCE_CHECKER(gptm_state, STELLARIS_GPTM, + TYPE_STELLARIS_GPTM) =20 struct gptm_state { SysBusDevice parent_obj; @@ -722,8 +722,8 @@ static int stellaris_sys_init(uint32_t base, qemu_irq i= rq, =20 #define TYPE_STELLARIS_I2C "stellaris-i2c" typedef struct stellaris_i2c_state stellaris_i2c_state; -#define STELLARIS_I2C(obj) \ - OBJECT_CHECK(stellaris_i2c_state, (obj), TYPE_STELLARIS_I2C) +DECLARE_INSTANCE_CHECKER(stellaris_i2c_state, STELLARIS_I2C, + TYPE_STELLARIS_I2C) =20 struct stellaris_i2c_state { SysBusDevice parent_obj; @@ -936,8 +936,8 @@ static void stellaris_i2c_init(Object *obj) =20 #define TYPE_STELLARIS_ADC "stellaris-adc" typedef struct StellarisADCState stellaris_adc_state; -#define STELLARIS_ADC(obj) \ - OBJECT_CHECK(stellaris_adc_state, (obj), TYPE_STELLARIS_ADC) +DECLARE_INSTANCE_CHECKER(stellaris_adc_state, STELLARIS_ADC, + TYPE_STELLARIS_ADC) =20 struct StellarisADCState { SysBusDevice parent_obj; diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 8faeaf8079..0fe829b868 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -86,8 +86,8 @@ static struct { =20 #define TYPE_STRONGARM_PIC "strongarm_pic" typedef struct StrongARMPICState StrongARMPICState; -#define STRONGARM_PIC(obj) \ - OBJECT_CHECK(StrongARMPICState, (obj), TYPE_STRONGARM_PIC) +DECLARE_INSTANCE_CHECKER(StrongARMPICState, STRONGARM_PIC, + TYPE_STRONGARM_PIC) =20 struct StrongARMPICState { SysBusDevice parent_obj; @@ -255,8 +255,8 @@ static const TypeInfo strongarm_pic_info =3D { =20 #define TYPE_STRONGARM_RTC "strongarm-rtc" typedef struct StrongARMRTCState StrongARMRTCState; -#define STRONGARM_RTC(obj) \ - OBJECT_CHECK(StrongARMRTCState, (obj), TYPE_STRONGARM_RTC) +DECLARE_INSTANCE_CHECKER(StrongARMRTCState, STRONGARM_RTC, + TYPE_STRONGARM_RTC) =20 struct StrongARMRTCState { SysBusDevice parent_obj; @@ -482,8 +482,8 @@ static const TypeInfo strongarm_rtc_sysbus_info =3D { =20 #define TYPE_STRONGARM_GPIO "strongarm-gpio" typedef struct StrongARMGPIOInfo StrongARMGPIOInfo; -#define STRONGARM_GPIO(obj) \ - OBJECT_CHECK(StrongARMGPIOInfo, (obj), TYPE_STRONGARM_GPIO) +DECLARE_INSTANCE_CHECKER(StrongARMGPIOInfo, STRONGARM_GPIO, + TYPE_STRONGARM_GPIO) =20 struct StrongARMGPIOInfo { SysBusDevice busdev; @@ -721,8 +721,8 @@ static const TypeInfo strongarm_gpio_info =3D { =20 #define TYPE_STRONGARM_PPC "strongarm-ppc" typedef struct StrongARMPPCInfo StrongARMPPCInfo; -#define STRONGARM_PPC(obj) \ - OBJECT_CHECK(StrongARMPPCInfo, (obj), TYPE_STRONGARM_PPC) +DECLARE_INSTANCE_CHECKER(StrongARMPPCInfo, STRONGARM_PPC, + TYPE_STRONGARM_PPC) =20 struct StrongARMPPCInfo { SysBusDevice parent_obj; @@ -922,8 +922,8 @@ static const TypeInfo strongarm_ppc_info =3D { =20 #define TYPE_STRONGARM_UART "strongarm-uart" typedef struct StrongARMUARTState StrongARMUARTState; -#define STRONGARM_UART(obj) \ - OBJECT_CHECK(StrongARMUARTState, (obj), TYPE_STRONGARM_UART) +DECLARE_INSTANCE_CHECKER(StrongARMUARTState, STRONGARM_UART, + TYPE_STRONGARM_UART) =20 struct StrongARMUARTState { SysBusDevice parent_obj; @@ -1354,8 +1354,8 @@ static const TypeInfo strongarm_uart_info =3D { =20 #define TYPE_STRONGARM_SSP "strongarm-ssp" typedef struct StrongARMSSPState StrongARMSSPState; -#define STRONGARM_SSP(obj) \ - OBJECT_CHECK(StrongARMSSPState, (obj), TYPE_STRONGARM_SSP) +DECLARE_INSTANCE_CHECKER(StrongARMSSPState, STRONGARM_SSP, + TYPE_STRONGARM_SSP) =20 struct StrongARMSSPState { SysBusDevice parent_obj; diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 6ec83a2e2d..2ef6c7b288 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -76,8 +76,8 @@ static void tosa_microdrive_attach(PXA2xxState *cpu) =20 #define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio" typedef struct TosaMiscGPIOState TosaMiscGPIOState; -#define TOSA_MISC_GPIO(obj) \ - OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO) +DECLARE_INSTANCE_CHECKER(TosaMiscGPIOState, TOSA_MISC_GPIO, + TYPE_TOSA_MISC_GPIO) =20 struct TosaMiscGPIOState { SysBusDevice parent_obj; @@ -173,7 +173,8 @@ static void tosa_ssp_realize(SSISlave *dev, Error **err= p) =20 #define TYPE_TOSA_DAC "tosa_dac" typedef struct TosaDACState TosaDACState; -#define TOSA_DAC(obj) OBJECT_CHECK(TosaDACState, (obj), TYPE_TOSA_DAC) +DECLARE_INSTANCE_CHECKER(TosaDACState, TOSA_DAC, + TYPE_TOSA_DAC) =20 struct TosaDACState { I2CSlave parent_obj; diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 0e2d74cef2..2ba69f24b7 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -36,8 +36,8 @@ =20 #define TYPE_VERSATILE_PB_SIC "versatilepb_sic" typedef struct vpb_sic_state vpb_sic_state; -#define VERSATILE_PB_SIC(obj) \ - OBJECT_CHECK(vpb_sic_state, (obj), TYPE_VERSATILE_PB_SIC) +DECLARE_INSTANCE_CHECKER(vpb_sic_state, VERSATILE_PB_SIC, + TYPE_VERSATILE_PB_SIC) =20 struct vpb_sic_state { SysBusDevice parent_obj; diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 4c2c377823..01bb4bba1e 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -183,12 +183,8 @@ typedef struct VexpressMachineState VexpressMachineSta= te; #define TYPE_VEXPRESS_MACHINE "vexpress" #define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME("vexpress-a9") #define TYPE_VEXPRESS_A15_MACHINE MACHINE_TYPE_NAME("vexpress-a15") -#define VEXPRESS_MACHINE(obj) \ - OBJECT_CHECK(VexpressMachineState, (obj), TYPE_VEXPRESS_MACHINE) -#define VEXPRESS_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VexpressMachineClass, obj, TYPE_VEXPRESS_MACHINE) -#define VEXPRESS_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VexpressMachineClass, klass, TYPE_VEXPRESS_MACHINE) +DECLARE_OBJ_CHECKERS(VexpressMachineState, VexpressMachineClass, + VEXPRESS_MACHINE, TYPE_VEXPRESS_MACHINE) =20 typedef void DBoardInitFn(const VexpressMachineState *machine, ram_addr_t ram_size, diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index bce99ef7be..9eb9cea8d4 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -41,8 +41,8 @@ =20 #define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") typedef struct ZynqMachineState ZynqMachineState; -#define ZYNQ_MACHINE(obj) \ - OBJECT_CHECK(ZynqMachineState, (obj), TYPE_ZYNQ_MACHINE) +DECLARE_INSTANCE_CHECKER(ZynqMachineState, ZYNQ_MACHINE, + TYPE_ZYNQ_MACHINE) =20 /* board base frequency: 33.333333 MHz */ #define PS_CLK_FREQUENCY (100 * 1000 * 1000 / 3) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index ffa9dd476b..5a01e856fd 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -26,8 +26,8 @@ =20 #define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt") typedef struct VersalVirt VersalVirt; -#define XLNX_VERSAL_VIRT_MACHINE(obj) \ - OBJECT_CHECK(VersalVirt, (obj), TYPE_XLNX_VERSAL_VIRT_MACHINE) +DECLARE_INSTANCE_CHECKER(VersalVirt, XLNX_VERSAL_VIRT_MACHINE, + TYPE_XLNX_VERSAL_VIRT_MACHINE) =20 struct VersalVirt { MachineState parent_obj; diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 74f48325ac..19d5a4d4e0 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -39,8 +39,8 @@ struct XlnxZCU102 { typedef struct XlnxZCU102 XlnxZCU102; =20 #define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102") -#define ZCU102_MACHINE(obj) \ - OBJECT_CHECK(XlnxZCU102, (obj), TYPE_ZCU102_MACHINE) +DECLARE_INSTANCE_CHECKER(XlnxZCU102, ZCU102_MACHINE, + TYPE_ZCU102_MACHINE) =20 =20 static bool zcu102_get_secure(Object *obj, Error **errp) diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 9c69481269..72ecb6df29 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -114,7 +114,8 @@ struct ZipitLCD { typedef struct ZipitLCD ZipitLCD; =20 #define TYPE_ZIPIT_LCD "zipit-lcd" -#define ZIPIT_LCD(obj) OBJECT_CHECK(ZipitLCD, (obj), TYPE_ZIPIT_LCD) +DECLARE_INSTANCE_CHECKER(ZipitLCD, ZIPIT_LCD, + TYPE_ZIPIT_LCD) =20 static uint32_t zipit_lcd_transfer(SSISlave *dev, uint32_t value) { @@ -198,7 +199,8 @@ static const TypeInfo zipit_lcd_info =3D { =20 #define TYPE_AER915 "aer915" typedef struct AER915State AER915State; -#define AER915(obj) OBJECT_CHECK(AER915State, (obj), TYPE_AER915) +DECLARE_INSTANCE_CHECKER(AER915State, AER915, + TYPE_AER915) =20 struct AER915State { I2CSlave parent_obj; diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 9614419b7a..eb8a7f032d 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -128,8 +128,8 @@ enum { =20 #define TYPE_AC97 "AC97" typedef struct AC97LinkState AC97LinkState; -#define AC97(obj) \ - OBJECT_CHECK(AC97LinkState, (obj), TYPE_AC97) +DECLARE_INSTANCE_CHECKER(AC97LinkState, AC97, + TYPE_AC97) =20 #define REC_MASK 7 enum { diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index a216fe1925..870116e324 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -53,7 +53,8 @@ =20 #define TYPE_ADLIB "adlib" typedef struct AdlibState AdlibState; -#define ADLIB(obj) OBJECT_CHECK(AdlibState, (obj), TYPE_ADLIB) +DECLARE_INSTANCE_CHECKER(AdlibState, ADLIB, + TYPE_ADLIB) =20 struct AdlibState { ISADevice parent_obj; diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c index 2b868051c3..8e9554ce9b 100644 --- a/hw/audio/cs4231.c +++ b/hw/audio/cs4231.c @@ -39,8 +39,8 @@ =20 #define TYPE_CS4231 "SUNW,CS4231" typedef struct CSState CSState; -#define CS4231(obj) \ - OBJECT_CHECK(CSState, (obj), TYPE_CS4231) +DECLARE_INSTANCE_CHECKER(CSState, CS4231, + TYPE_CS4231) =20 struct CSState { SysBusDevice parent_obj; diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index fc064a93d7..7d60ce6f0e 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -64,7 +64,8 @@ static struct { =20 #define TYPE_CS4231A "cs4231a" typedef struct CSState CSState; -#define CS4231A(obj) OBJECT_CHECK (CSState, (obj), TYPE_CS4231A) +DECLARE_INSTANCE_CHECKER(CSState, CS4231A, + TYPE_CS4231A) =20 struct CSState { ISADevice dev; diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index bd620d5ee2..a824f8949e 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -293,8 +293,8 @@ struct chan_bits { }; =20 #define TYPE_ES1370 "ES1370" -#define ES1370(obj) \ - OBJECT_CHECK(ES1370State, (obj), TYPE_ES1370) +DECLARE_INSTANCE_CHECKER(ES1370State, ES1370, + TYPE_ES1370) =20 static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl, uint32_t *old_freq, uint32_t *new_freq); diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 3cd62d43d7..307fd48315 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -44,7 +44,8 @@ =20 #define TYPE_GUS "gus" typedef struct GUSState GUSState; -#define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS) +DECLARE_INSTANCE_CHECKER(GUSState, GUS, + TYPE_GUS) =20 struct GUSState { ISADevice dev; diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 8dee2915be..77d31b91a4 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -172,7 +172,8 @@ struct HDAAudioStream { }; =20 #define TYPE_HDA_AUDIO "hda-audio" -#define HDA_AUDIO(obj) OBJECT_CHECK(HDAAudioState, (obj), TYPE_HDA_AUDIO) +DECLARE_INSTANCE_CHECKER(HDAAudioState, HDA_AUDIO, + TYPE_HDA_AUDIO) =20 struct HDAAudioState { HDACodecDevice hda; diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index de30443c2e..4330213fff 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -204,8 +204,8 @@ struct IntelHDAState { =20 #define TYPE_INTEL_HDA_GENERIC "intel-hda-generic" =20 -#define INTEL_HDA(obj) \ - OBJECT_CHECK(IntelHDAState, (obj), TYPE_INTEL_HDA_GENERIC) +DECLARE_INSTANCE_CHECKER(IntelHDAState, INTEL_HDA, + TYPE_INTEL_HDA_GENERIC) =20 struct IntelHDAReg { const char *name; /* register name */ diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index 5f2e7f3b73..c8641562cc 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -44,8 +44,8 @@ #define MP_AUDIO_MONO (1 << 14) =20 typedef struct mv88w8618_audio_state mv88w8618_audio_state; -#define MV88W8618_AUDIO(obj) \ - OBJECT_CHECK(mv88w8618_audio_state, (obj), TYPE_MV88W8618_AUDIO) +DECLARE_INSTANCE_CHECKER(mv88w8618_audio_state, MV88W8618_AUDIO, + TYPE_MV88W8618_AUDIO) =20 struct mv88w8618_audio_state { SysBusDevice parent_obj; diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c index 4eacd4071a..7893539019 100644 --- a/hw/audio/milkymist-ac97.c +++ b/hw/audio/milkymist-ac97.c @@ -57,8 +57,8 @@ enum { =20 #define TYPE_MILKYMIST_AC97 "milkymist-ac97" typedef struct MilkymistAC97State MilkymistAC97State; -#define MILKYMIST_AC97(obj) \ - OBJECT_CHECK(MilkymistAC97State, (obj), TYPE_MILKYMIST_AC97) +DECLARE_INSTANCE_CHECKER(MilkymistAC97State, MILKYMIST_AC97, + TYPE_MILKYMIST_AC97) =20 struct MilkymistAC97State { SysBusDevice parent_obj; diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 57edbe652c..cbee8855fb 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -41,7 +41,8 @@ #define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ) =20 typedef struct PCSpkState PCSpkState; -#define PC_SPEAKER(obj) OBJECT_CHECK(PCSpkState, (obj), TYPE_PC_SPEAKER) +DECLARE_INSTANCE_CHECKER(PCSpkState, PC_SPEAKER, + TYPE_PC_SPEAKER) =20 struct PCSpkState { ISADevice parent_obj; diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c index e514a8cd70..570a234b72 100644 --- a/hw/audio/pl041.c +++ b/hw/audio/pl041.c @@ -79,7 +79,8 @@ typedef struct { =20 #define TYPE_PL041 "pl041" typedef struct PL041State PL041State; -#define PL041(obj) OBJECT_CHECK(PL041State, (obj), TYPE_PL041) +DECLARE_INSTANCE_CHECKER(PL041State, PL041, + TYPE_PL041) =20 struct PL041State { SysBusDevice parent_obj; diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 840f743e41..6aa2c0fb93 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -51,7 +51,8 @@ static const char e3[] =3D "COPYRIGHT (C) CREATIVE TECHNO= LOGY LTD, 1992."; =20 #define TYPE_SB16 "sb16" typedef struct SB16State SB16State; -#define SB16(obj) OBJECT_CHECK (SB16State, (obj), TYPE_SB16) +DECLARE_INSTANCE_CHECKER(SB16State, SB16, + TYPE_SB16) =20 struct SB16State { ISADevice parent_obj; diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index dae23f43a4..7d6fcfec03 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -28,7 +28,8 @@ typedef struct { } WMRate; =20 typedef struct WM8750State WM8750State; -#define WM8750(obj) OBJECT_CHECK(WM8750State, (obj), TYPE_WM8750) +DECLARE_INSTANCE_CHECKER(WM8750State, WM8750, + TYPE_WM8750) =20 struct WM8750State { I2CSlave parent_obj; diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c index c24183c07f..3c8388490d 100644 --- a/hw/avr/arduino.c +++ b/hw/avr/arduino.c @@ -36,12 +36,8 @@ typedef struct ArduinoMachineClass ArduinoMachineClass; =20 #define TYPE_ARDUINO_MACHINE \ MACHINE_TYPE_NAME("arduino") -#define ARDUINO_MACHINE(obj) \ - OBJECT_CHECK(ArduinoMachineState, (obj), TYPE_ARDUINO_MACHINE) -#define ARDUINO_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(ArduinoMachineClass, (klass), TYPE_ARDUINO_MACH= INE) -#define ARDUINO_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ArduinoMachineClass, (obj), TYPE_ARDUINO_MACHINE) +DECLARE_OBJ_CHECKERS(ArduinoMachineState, ArduinoMachineClass, + ARDUINO_MACHINE, TYPE_ARDUINO_MACHINE) =20 static void arduino_machine_init(MachineState *machine) { diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c index c3b8e05110..44c6afebbb 100644 --- a/hw/avr/atmega.c +++ b/hw/avr/atmega.c @@ -63,10 +63,8 @@ struct AtmegaMcuClass { }; typedef struct AtmegaMcuClass AtmegaMcuClass; =20 -#define ATMEGA_MCU_CLASS(klass) \ - OBJECT_CLASS_CHECK(AtmegaMcuClass, (klass), TYPE_ATMEGA_MCU) -#define ATMEGA_MCU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(AtmegaMcuClass, (obj), TYPE_ATMEGA_MCU) +DECLARE_CLASS_CHECKERS(AtmegaMcuClass, ATMEGA_MCU, + TYPE_ATMEGA_MCU) =20 static const peripheral_cfg dev168_328[PERIFMAX] =3D { [USART0] =3D { 0xc0, POWER0, 1 }, diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 70bfb136e4..224bac504f 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -66,7 +66,8 @@ =20 #define TYPE_FLOPPY_BUS "floppy-bus" typedef struct FloppyBus FloppyBus; -#define FLOPPY_BUS(obj) OBJECT_CHECK(FloppyBus, (obj), TYPE_FLOPPY_BUS) +DECLARE_INSTANCE_CHECKER(FloppyBus, FLOPPY_BUS, + TYPE_FLOPPY_BUS) =20 typedef struct FDCtrl FDCtrl; typedef struct FDrive FDrive; @@ -497,8 +498,8 @@ static const BlockDevOps fd_block_ops =3D { =20 #define TYPE_FLOPPY_DRIVE "floppy" typedef struct FloppyDrive FloppyDrive; -#define FLOPPY_DRIVE(obj) \ - OBJECT_CHECK(FloppyDrive, (obj), TYPE_FLOPPY_DRIVE) +DECLARE_INSTANCE_CHECKER(FloppyDrive, FLOPPY_DRIVE, + TYPE_FLOPPY_DRIVE) =20 struct FloppyDrive { DeviceState qdev; @@ -890,7 +891,8 @@ static FloppyDriveType get_fallback_drive_type(FDrive *= drv) =20 #define TYPE_SYSBUS_FDC "base-sysbus-fdc" typedef struct FDCtrlSysBus FDCtrlSysBus; -#define SYSBUS_FDC(obj) OBJECT_CHECK(FDCtrlSysBus, (obj), TYPE_SYSBUS_FDC) +DECLARE_INSTANCE_CHECKER(FDCtrlSysBus, SYSBUS_FDC, + TYPE_SYSBUS_FDC) =20 struct FDCtrlSysBus { /*< private >*/ @@ -901,7 +903,8 @@ struct FDCtrlSysBus { }; =20 typedef struct FDCtrlISABus FDCtrlISABus; -#define ISA_FDC(obj) OBJECT_CHECK(FDCtrlISABus, (obj), TYPE_ISA_FDC) +DECLARE_INSTANCE_CHECKER(FDCtrlISABus, ISA_FDC, + TYPE_ISA_FDC) =20 struct FDCtrlISABus { ISADevice parent_obj; diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 9de4f9b274..8dae779c76 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -465,12 +465,8 @@ struct M25P80Class { typedef struct M25P80Class M25P80Class; =20 #define TYPE_M25P80 "m25p80-generic" -#define M25P80(obj) \ - OBJECT_CHECK(Flash, (obj), TYPE_M25P80) -#define M25P80_CLASS(klass) \ - OBJECT_CLASS_CHECK(M25P80Class, (klass), TYPE_M25P80) -#define M25P80_GET_CLASS(obj) \ - OBJECT_GET_CLASS(M25P80Class, (obj), TYPE_M25P80) +DECLARE_OBJ_CHECKERS(Flash, M25P80Class, + M25P80, TYPE_M25P80) =20 static inline Manufacturer get_man(Flash *s) { diff --git a/hw/block/nand.c b/hw/block/nand.c index 7c7a08b7aa..5c8112ed5a 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -90,8 +90,8 @@ struct NANDFlashState { =20 #define TYPE_NAND "nand" =20 -#define NAND(obj) \ - OBJECT_CHECK(NANDFlashState, (obj), TYPE_NAND) +DECLARE_INSTANCE_CHECKER(NANDFlashState, NAND, + TYPE_NAND) =20 static void mem_and(uint8_t *dest, const uint8_t *src, size_t n) { diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 5fe235d11d..19f55aba66 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -41,7 +41,8 @@ =20 #define TYPE_ONE_NAND "onenand" typedef struct OneNANDState OneNANDState; -#define ONE_NAND(obj) OBJECT_CHECK(OneNANDState, (obj), TYPE_ONE_NAND) +DECLARE_INSTANCE_CHECKER(OneNANDState, ONE_NAND, + TYPE_ONE_NAND) =20 struct OneNANDState { SysBusDevice parent_obj; diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c index 219e88efee..daaaca0f39 100644 --- a/hw/char/debugcon.c +++ b/hw/char/debugcon.c @@ -34,8 +34,8 @@ =20 #define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon" typedef struct ISADebugconState ISADebugconState; -#define ISA_DEBUGCON_DEVICE(obj) \ - OBJECT_CHECK(ISADebugconState, (obj), TYPE_ISA_DEBUGCON_DEVICE) +DECLARE_INSTANCE_CHECKER(ISADebugconState, ISA_DEBUGCON_DEVICE, + TYPE_ISA_DEBUGCON_DEVICE) =20 //#define DEBUG_DEBUGCON =20 diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index 9ca9f21c4d..d9fba2ae6c 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -51,8 +51,8 @@ =20 #define TYPE_ETRAX_FS_SERIAL "etraxfs,serial" typedef struct ETRAXSerial ETRAXSerial; -#define ETRAX_SERIAL(obj) \ - OBJECT_CHECK(ETRAXSerial, (obj), TYPE_ETRAX_FS_SERIAL) +DECLARE_INSTANCE_CHECKER(ETRAXSerial, ETRAX_SERIAL, + TYPE_ETRAX_FS_SERIAL) =20 struct ETRAXSerial { SysBusDevice parent_obj; diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index e3a21dfdb8..b8ea34edbd 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -140,8 +140,8 @@ typedef struct { =20 #define TYPE_EXYNOS4210_UART "exynos4210.uart" typedef struct Exynos4210UartState Exynos4210UartState; -#define EXYNOS4210_UART(obj) \ - OBJECT_CHECK(Exynos4210UartState, (obj), TYPE_EXYNOS4210_UART) +DECLARE_INSTANCE_CHECKER(Exynos4210UartState, EXYNOS4210_UART, + TYPE_EXYNOS4210_UART) =20 struct Exynos4210UartState { SysBusDevice parent_obj; diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index f48ad21c7c..6fd88d83ad 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -74,8 +74,8 @@ #define FIFO_LENGTH 1024 =20 typedef struct UART UART; -#define GRLIB_APB_UART(obj) \ - OBJECT_CHECK(UART, (obj), TYPE_GRLIB_APB_UART) +DECLARE_INSTANCE_CHECKER(UART, GRLIB_APB_UART, + TYPE_GRLIB_APB_UART) =20 struct UART { SysBusDevice parent_obj; diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index c7ea7f8da9..2c987df8ad 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -123,8 +123,8 @@ struct IPOctalState { =20 #define TYPE_IPOCTAL "ipoctal232" =20 -#define IPOCTAL(obj) \ - OBJECT_CHECK(IPOctalState, (obj), TYPE_IPOCTAL) +DECLARE_INSTANCE_CHECKER(IPOctalState, IPOCTAL, + TYPE_IPOCTAL) =20 static const VMStateDescription vmstate_scc2698_channel =3D { .name =3D "scc2698_channel", diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c index e7af76ad1a..5723f2e189 100644 --- a/hw/char/lm32_juart.c +++ b/hw/char/lm32_juart.c @@ -43,7 +43,8 @@ enum { }; =20 typedef struct LM32JuartState LM32JuartState; -#define LM32_JUART(obj) OBJECT_CHECK(LM32JuartState, (obj), TYPE_LM32_JUAR= T) +DECLARE_INSTANCE_CHECKER(LM32JuartState, LM32_JUART, + TYPE_LM32_JUART) =20 struct LM32JuartState { SysBusDevice parent_obj; diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 8aff78592b..624bc83c5f 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -96,7 +96,8 @@ enum { =20 #define TYPE_LM32_UART "lm32-uart" typedef struct LM32UartState LM32UartState; -#define LM32_UART(obj) OBJECT_CHECK(LM32UartState, (obj), TYPE_LM32_UART) +DECLARE_INSTANCE_CHECKER(LM32UartState, LM32_UART, + TYPE_LM32_UART) =20 struct LM32UartState { SysBusDevice parent_obj; diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index d6745da72a..f6baa3ce77 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -38,7 +38,8 @@ struct mcf_uart_state { typedef struct mcf_uart_state mcf_uart_state; =20 #define TYPE_MCF_UART "mcf-uart" -#define MCF_UART(obj) OBJECT_CHECK(mcf_uart_state, (obj), TYPE_MCF_UART) +DECLARE_INSTANCE_CHECKER(mcf_uart_state, MCF_UART, + TYPE_MCF_UART) =20 /* UART Status Register bits. */ #define MCF_UART_RxRDY 0x01 diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index 300a9150cf..41204a0e28 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -59,8 +59,8 @@ enum { =20 #define TYPE_MILKYMIST_UART "milkymist-uart" typedef struct MilkymistUartState MilkymistUartState; -#define MILKYMIST_UART(obj) \ - OBJECT_CHECK(MilkymistUartState, (obj), TYPE_MILKYMIST_UART) +DECLARE_INSTANCE_CHECKER(MilkymistUartState, MILKYMIST_UART, + TYPE_MILKYMIST_UART) =20 struct MilkymistUartState { SysBusDevice parent_obj; diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 73ac5ee9e3..ddb14f3197 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -94,8 +94,8 @@ typedef struct ParallelState { =20 #define TYPE_ISA_PARALLEL "isa-parallel" typedef struct ISAParallelState ISAParallelState; -#define ISA_PARALLEL(obj) \ - OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL) +DECLARE_INSTANCE_CHECKER(ISAParallelState, ISA_PARALLEL, + TYPE_ISA_PARALLEL) =20 struct ISAParallelState { ISADevice parent_obj; diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 0b77af68a4..81f6d0ed4f 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -49,8 +49,8 @@ struct SCLPConsoleLM { typedef struct SCLPConsoleLM SCLPConsoleLM; =20 #define TYPE_SCLPLM_CONSOLE "sclplmconsole" -#define SCLPLM_CONSOLE(obj) \ - OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE) +DECLARE_INSTANCE_CHECKER(SCLPConsoleLM, SCLPLM_CONSOLE, + TYPE_SCLPLM_CONSOLE) =20 /* * Character layer call-back functions diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index 3919368570..aa72ab40b9 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -45,8 +45,8 @@ struct SCLPConsole { typedef struct SCLPConsole SCLPConsole; =20 #define TYPE_SCLP_CONSOLE "sclpconsole" -#define SCLP_CONSOLE(obj) \ - OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE) +DECLARE_INSTANCE_CHECKER(SCLPConsole, SCLP_CONSOLE, + TYPE_SCLP_CONSOLE) =20 /* character layer call-back functions */ =20 diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 3d1c9a2d75..d4aad81a85 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -35,7 +35,8 @@ #include "qom/object.h" =20 typedef struct ISASerialState ISASerialState; -#define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIA= L) +DECLARE_INSTANCE_CHECKER(ISASerialState, ISA_SERIAL, + TYPE_ISA_SERIAL) =20 struct ISASerialState { ISADevice parent_obj; diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index 649f08c20e..f68948154e 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -43,7 +43,8 @@ struct PCISerialState { typedef struct PCISerialState PCISerialState; =20 #define TYPE_PCI_SERIAL "pci-serial" -#define PCI_SERIAL(s) OBJECT_CHECK(PCISerialState, (s), TYPE_PCI_SERIAL) +DECLARE_INSTANCE_CHECKER(PCISerialState, PCI_SERIAL, + TYPE_PCI_SERIAL) =20 static void serial_pci_realize(PCIDevice *dev, Error **errp) { diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index 9944933c16..dd6dd2d8c3 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -21,8 +21,8 @@ struct SpaprVioVty { typedef struct SpaprVioVty SpaprVioVty; =20 #define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty" -#define VIO_SPAPR_VTY_DEVICE(obj) \ - OBJECT_CHECK(SpaprVioVty, (obj), TYPE_VIO_SPAPR_VTY_DEVICE) +DECLARE_INSTANCE_CHECKER(SpaprVioVty, VIO_SPAPR_VTY_DEVICE, + TYPE_VIO_SPAPR_VTY_DEVICE) =20 static int vty_can_receive(void *opaque) { diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 4efd6a9433..d77981bb6d 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -39,8 +39,8 @@ struct Terminal3270 { typedef struct Terminal3270 Terminal3270; =20 #define TYPE_TERMINAL_3270 "x-terminal3270" -#define TERMINAL_3270(obj) \ - OBJECT_CHECK(Terminal3270, (obj), TYPE_TERMINAL_3270) +DECLARE_INSTANCE_CHECKER(Terminal3270, TERMINAL_3270, + TYPE_TERMINAL_3270) =20 static int terminal_can_read(void *opaque) { diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index 31144c68b6..bc752cf90f 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -23,8 +23,8 @@ =20 #define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport" typedef struct VirtConsole VirtConsole; -#define VIRTIO_CONSOLE(obj) \ - OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE_SERIAL_PORT) +DECLARE_INSTANCE_CHECKER(VirtConsole, VIRTIO_CONSOLE, + TYPE_VIRTIO_CONSOLE_SERIAL_PORT) =20 struct VirtConsole { VirtIOSerialPort parent_obj; diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index e7ab97d58d..8e9f9cd9ec 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -54,8 +54,8 @@ =20 #define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite" typedef struct XilinxUARTLite XilinxUARTLite; -#define XILINX_UARTLITE(obj) \ - OBJECT_CHECK(XilinxUARTLite, (obj), TYPE_XILINX_UARTLITE) +DECLARE_INSTANCE_CHECKER(XilinxUARTLite, XILINX_UARTLITE, + TYPE_XILINX_UARTLITE) =20 struct XilinxUARTLite { SysBusDevice parent_obj; diff --git a/hw/core/irq.c b/hw/core/irq.c index fb3045b912..8a9cbdd556 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -26,7 +26,8 @@ #include "hw/irq.h" #include "qom/object.h" =20 -#define IRQ(obj) OBJECT_CHECK(struct IRQState, (obj), TYPE_IRQ) +DECLARE_INSTANCE_CHECKER(struct IRQState, IRQ, + TYPE_IRQ) =20 struct IRQState { Object parent_obj; diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index 1f1df08cfa..fb547aceef 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -19,8 +19,8 @@ =20 #define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore" typedef struct mpcore_rirq_state mpcore_rirq_state; -#define REALVIEW_MPCORE_RIRQ(obj) \ - OBJECT_CHECK(mpcore_rirq_state, (obj), TYPE_REALVIEW_MPCORE_RIRQ) +DECLARE_INSTANCE_CHECKER(mpcore_rirq_state, REALVIEW_MPCORE_RIRQ, + TYPE_REALVIEW_MPCORE_RIRQ) =20 /* Dummy PIC to route IRQ lines. The baseboard has 4 independent IRQ controllers. The output of these, plus some of the raw input lines diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c index 59bbce3979..4b87ee7135 100644 --- a/hw/display/ads7846.c +++ b/hw/display/ads7846.c @@ -32,7 +32,8 @@ struct ADS7846State { typedef struct ADS7846State ADS7846State; =20 #define TYPE_ADS7846 "ads7846" -#define ADS7846(obj) OBJECT_CHECK(ADS7846State, (obj), TYPE_ADS7846) +DECLARE_INSTANCE_CHECKER(ADS7846State, ADS7846, + TYPE_ADS7846) =20 /* Control-byte bitfields */ #define CB_PD0 (1 << 0) diff --git a/hw/display/artist.c b/hw/display/artist.c index b2fc642002..b96589eabf 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -26,7 +26,8 @@ =20 #define TYPE_ARTIST "artist" typedef struct ARTISTState ARTISTState; -#define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST) +DECLARE_INSTANCE_CHECKER(ARTISTState, ARTIST, + TYPE_ARTIST) =20 #ifdef HOST_WORDS_BIGENDIAN #define ROP8OFF(_i) (3 - (_i)) diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index ef92f3a4e7..41587388c4 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -58,8 +58,8 @@ struct BochsDisplayState { typedef struct BochsDisplayState BochsDisplayState; =20 #define TYPE_BOCHS_DISPLAY "bochs-display" -#define BOCHS_DISPLAY(obj) OBJECT_CHECK(BochsDisplayState, (obj), \ - TYPE_BOCHS_DISPLAY) +DECLARE_INSTANCE_CHECKER(BochsDisplayState, BOCHS_DISPLAY, + TYPE_BOCHS_DISPLAY) =20 static const VMStateDescription vmstate_bochs_display =3D { .name =3D "bochs-display", diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 49d7e777f9..d66ba9ad6a 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -67,7 +67,8 @@ =20 #define TYPE_CG3 "cgthree" typedef struct CG3State CG3State; -#define CG3(obj) OBJECT_CHECK(CG3State, (obj), TYPE_CG3) +DECLARE_INSTANCE_CHECKER(CG3State, CG3, + TYPE_CG3) =20 struct CG3State { SysBusDevice parent_obj; diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 6a15f926ad..2fa2424dbe 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -186,8 +186,8 @@ struct PCICirrusVGAState { typedef struct PCICirrusVGAState PCICirrusVGAState; =20 #define TYPE_PCI_CIRRUS_VGA "cirrus-vga" -#define PCI_CIRRUS_VGA(obj) \ - OBJECT_CHECK(PCICirrusVGAState, (obj), TYPE_PCI_CIRRUS_VGA) +DECLARE_INSTANCE_CHECKER(PCICirrusVGAState, PCI_CIRRUS_VGA, + TYPE_PCI_CIRRUS_VGA) =20 static uint8_t rop_to_index[256]; =20 diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c index 28d1fa41e7..e6adee1df4 100644 --- a/hw/display/cirrus_vga_isa.c +++ b/hw/display/cirrus_vga_isa.c @@ -34,8 +34,8 @@ =20 #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga" typedef struct ISACirrusVGAState ISACirrusVGAState; -#define ISA_CIRRUS_VGA(obj) \ - OBJECT_CHECK(ISACirrusVGAState, (obj), TYPE_ISA_CIRRUS_VGA) +DECLARE_INSTANCE_CHECKER(ISACirrusVGAState, ISA_CIRRUS_VGA, + TYPE_ISA_CIRRUS_VGA) =20 struct ISACirrusVGAState { ISADevice parent_obj; diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 993b7e9dae..3ef8698eb7 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -295,8 +295,8 @@ struct Exynos4210fimdWindow { =20 #define TYPE_EXYNOS4210_FIMD "exynos4210.fimd" typedef struct Exynos4210fimdState Exynos4210fimdState; -#define EXYNOS4210_FIMD(obj) \ - OBJECT_CHECK(Exynos4210fimdState, (obj), TYPE_EXYNOS4210_FIMD) +DECLARE_INSTANCE_CHECKER(Exynos4210fimdState, EXYNOS4210_FIMD, + TYPE_EXYNOS4210_FIMD) =20 struct Exynos4210fimdState { SysBusDevice parent_obj; diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index df674c3c01..4a32fe4c94 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -488,7 +488,8 @@ static void g364fb_init(DeviceState *dev, G364State *s) =20 #define TYPE_G364 "sysbus-g364" typedef struct G364SysBusState G364SysBusState; -#define G364(obj) OBJECT_CHECK(G364SysBusState, (obj), TYPE_G364) +DECLARE_INSTANCE_CHECKER(G364SysBusState, G364, + TYPE_G364) =20 struct G364SysBusState { SysBusDevice parent_obj; diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c index 97ec36878b..647d05f602 100644 --- a/hw/display/jazz_led.c +++ b/hw/display/jazz_led.c @@ -37,7 +37,8 @@ typedef enum { =20 #define TYPE_JAZZ_LED "jazz-led" typedef struct LedState LedState; -#define JAZZ_LED(obj) OBJECT_CHECK(LedState, (obj), TYPE_JAZZ_LED) +DECLARE_INSTANCE_CHECKER(LedState, JAZZ_LED, + TYPE_JAZZ_LED) =20 struct LedState { SysBusDevice parent_obj; diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c index 66cb8e6a60..8a9e7c23fb 100644 --- a/hw/display/milkymist-tmu2.c +++ b/hw/display/milkymist-tmu2.c @@ -84,8 +84,8 @@ struct vertex { =20 #define TYPE_MILKYMIST_TMU2 "milkymist-tmu2" typedef struct MilkymistTMU2State MilkymistTMU2State; -#define MILKYMIST_TMU2(obj) \ - OBJECT_CHECK(MilkymistTMU2State, (obj), TYPE_MILKYMIST_TMU2) +DECLARE_INSTANCE_CHECKER(MilkymistTMU2State, MILKYMIST_TMU2, + TYPE_MILKYMIST_TMU2) =20 struct MilkymistTMU2State { SysBusDevice parent_obj; diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c index bbf412d9a0..2c879129fb 100644 --- a/hw/display/milkymist-vgafb.c +++ b/hw/display/milkymist-vgafb.c @@ -70,8 +70,8 @@ enum { =20 #define TYPE_MILKYMIST_VGAFB "milkymist-vgafb" typedef struct MilkymistVgafbState MilkymistVgafbState; -#define MILKYMIST_VGAFB(obj) \ - OBJECT_CHECK(MilkymistVgafbState, (obj), TYPE_MILKYMIST_VGAFB) +DECLARE_INSTANCE_CHECKER(MilkymistVgafbState, MILKYMIST_VGAFB, + TYPE_MILKYMIST_VGAFB) =20 struct MilkymistVgafbState { SysBusDevice parent_obj; diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c index 068dc0656f..94db0202a3 100644 --- a/hw/display/next-fb.c +++ b/hw/display/next-fb.c @@ -33,7 +33,8 @@ #include "qom/object.h" =20 typedef struct NeXTFbState NeXTFbState; -#define NEXTFB(obj) OBJECT_CHECK(NeXTFbState, (obj), TYPE_NEXTFB) +DECLARE_INSTANCE_CHECKER(NeXTFbState, NEXTFB, + TYPE_NEXTFB) =20 struct NeXTFbState { SysBusDevice parent_obj; diff --git a/hw/display/pl110.c b/hw/display/pl110.c index 4cf953c2f4..af51a2b9e7 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -50,7 +50,8 @@ enum pl110_version =20 #define TYPE_PL110 "pl110" typedef struct PL110State PL110State; -#define PL110(obj) OBJECT_CHECK(PL110State, (obj), TYPE_PL110) +DECLARE_INSTANCE_CHECKER(PL110State, PL110, + TYPE_PL110) =20 struct PL110State { SysBusDevice parent_obj; diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c index dae32b9fda..8c0094397f 100644 --- a/hw/display/ramfb-standalone.c +++ b/hw/display/ramfb-standalone.c @@ -8,7 +8,8 @@ #include "qom/object.h" =20 typedef struct RAMFBStandaloneState RAMFBStandaloneState; -#define RAMFB(obj) OBJECT_CHECK(RAMFBStandaloneState, (obj), TYPE_RAMFB_DE= VICE) +DECLARE_INSTANCE_CHECKER(RAMFBStandaloneState, RAMFB, + TYPE_RAMFB_DEVICE) =20 struct RAMFBStandaloneState { SysBusDevice parent_obj; diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c index 4bf2c559cd..d88166f449 100644 --- a/hw/display/sii9022.c +++ b/hw/display/sii9022.c @@ -37,7 +37,8 @@ =20 #define TYPE_SII9022 "sii9022" typedef struct sii9022_state sii9022_state; -#define SII9022(obj) OBJECT_CHECK(sii9022_state, (obj), TYPE_SII9022) +DECLARE_INSTANCE_CHECKER(sii9022_state, SII9022, + TYPE_SII9022) =20 struct sii9022_state { I2CSlave parent_obj; diff --git a/hw/display/sm501.c b/hw/display/sm501.c index f886c1e51b..51120c6c3e 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1933,8 +1933,8 @@ static const VMStateDescription vmstate_sm501_state = =3D { =20 #define TYPE_SYSBUS_SM501 "sysbus-sm501" typedef struct SM501SysBusState SM501SysBusState; -#define SYSBUS_SM501(obj) \ - OBJECT_CHECK(SM501SysBusState, (obj), TYPE_SYSBUS_SM501) +DECLARE_INSTANCE_CHECKER(SM501SysBusState, SYSBUS_SM501, + TYPE_SYSBUS_SM501) =20 struct SM501SysBusState { /*< private >*/ @@ -2037,7 +2037,8 @@ static const TypeInfo sm501_sysbus_info =3D { =20 #define TYPE_PCI_SM501 "sm501" typedef struct SM501PCIState SM501PCIState; -#define PCI_SM501(obj) OBJECT_CHECK(SM501PCIState, (obj), TYPE_PCI_SM501) +DECLARE_INSTANCE_CHECKER(SM501PCIState, PCI_SM501, + TYPE_PCI_SM501) =20 struct SM501PCIState { /*< private >*/ diff --git a/hw/display/ssd0303.c b/hw/display/ssd0303.c index 8804567c1f..0378573a42 100644 --- a/hw/display/ssd0303.c +++ b/hw/display/ssd0303.c @@ -48,7 +48,8 @@ enum ssd0303_cmd { =20 #define TYPE_SSD0303 "ssd0303" typedef struct ssd0303_state ssd0303_state; -#define SSD0303(obj) OBJECT_CHECK(ssd0303_state, (obj), TYPE_SSD0303) +DECLARE_INSTANCE_CHECKER(ssd0303_state, SSD0303, + TYPE_SSD0303) =20 struct ssd0303_state { I2CSlave parent_obj; diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c index c9d79cfcd3..037da81127 100644 --- a/hw/display/ssd0323.c +++ b/hw/display/ssd0323.c @@ -69,7 +69,8 @@ struct ssd0323_state { typedef struct ssd0323_state ssd0323_state; =20 #define TYPE_SSD0323 "ssd0323" -#define SSD0323(obj) OBJECT_CHECK(ssd0323_state, (obj), TYPE_SSD0323) +DECLARE_INSTANCE_CHECKER(ssd0323_state, SSD0323, + TYPE_SSD0323) =20 =20 static uint32_t ssd0323_transfer(SSISlave *dev, uint32_t data) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 5c75589919..69e901a800 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -57,7 +57,8 @@ =20 #define TYPE_TCX "SUNW,tcx" typedef struct TCXState TCXState; -#define TCX(obj) OBJECT_CHECK(TCXState, (obj), TYPE_TCX) +DECLARE_INSTANCE_CHECKER(TCXState, TCX, + TYPE_TCX) =20 struct TCXState { SysBusDevice parent_obj; diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c index 50efc3760a..0ebfcca9d1 100644 --- a/hw/display/vga-isa.c +++ b/hw/display/vga-isa.c @@ -36,7 +36,8 @@ =20 #define TYPE_ISA_VGA "isa-vga" typedef struct ISAVGAState ISAVGAState; -#define ISA_VGA(obj) OBJECT_CHECK(ISAVGAState, (obj), TYPE_ISA_VGA) +DECLARE_INSTANCE_CHECKER(ISAVGAState, ISA_VGA, + TYPE_ISA_VGA) =20 struct ISAVGAState { ISADevice parent_obj; diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index 852cbf36e9..3b45fa3bad 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -54,7 +54,8 @@ struct PCIVGAState { typedef struct PCIVGAState PCIVGAState; =20 #define TYPE_PCI_VGA "pci-vga" -#define PCI_VGA(obj) OBJECT_CHECK(PCIVGAState, (obj), TYPE_PCI_VGA) +DECLARE_INSTANCE_CHECKER(PCIVGAState, PCI_VGA, + TYPE_PCI_VGA) =20 static const VMStateDescription vmstate_vga_pci =3D { .name =3D "vga", diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pc= i.c index 678b762bbb..a02b23ecaf 100644 --- a/hw/display/vhost-user-gpu-pci.c +++ b/hw/display/vhost-user-gpu-pci.c @@ -15,8 +15,8 @@ =20 #define TYPE_VHOST_USER_GPU_PCI "vhost-user-gpu-pci" typedef struct VhostUserGPUPCI VhostUserGPUPCI; -#define VHOST_USER_GPU_PCI(obj) \ - OBJECT_CHECK(VhostUserGPUPCI, (obj), TYPE_VHOST_USER_GPU_PCI) +DECLARE_INSTANCE_CHECKER(VhostUserGPUPCI, VHOST_USER_GPU_PCI, + TYPE_VHOST_USER_GPU_PCI) =20 struct VhostUserGPUPCI { VirtIOGPUPCIBase parent_obj; diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c index 2cc9616bea..7110ea6231 100644 --- a/hw/display/vhost-user-vga.c +++ b/hw/display/vhost-user-vga.c @@ -16,8 +16,8 @@ #define TYPE_VHOST_USER_VGA "vhost-user-vga" =20 typedef struct VhostUserVGA VhostUserVGA; -#define VHOST_USER_VGA(obj) \ - OBJECT_CHECK(VhostUserVGA, (obj), TYPE_VHOST_USER_VGA) +DECLARE_INSTANCE_CHECKER(VhostUserVGA, VHOST_USER_VGA, + TYPE_VHOST_USER_VGA) =20 struct VhostUserVGA { VirtIOVGABase parent_obj; diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index 7248ec30c7..d742a30aec 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -67,8 +67,8 @@ static const TypeInfo virtio_gpu_pci_base_info =3D { =20 #define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci" typedef struct VirtIOGPUPCI VirtIOGPUPCI; -#define VIRTIO_GPU_PCI(obj) \ - OBJECT_CHECK(VirtIOGPUPCI, (obj), TYPE_VIRTIO_GPU_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOGPUPCI, VIRTIO_GPU_PCI, + TYPE_VIRTIO_GPU_PCI) =20 struct VirtIOGPUPCI { VirtIOGPUPCIBase parent_obj; diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 0bb98ede75..17e5658d43 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -204,8 +204,8 @@ static TypeInfo virtio_vga_base_info =3D { #define TYPE_VIRTIO_VGA "virtio-vga" =20 typedef struct VirtIOVGA VirtIOVGA; -#define VIRTIO_VGA(obj) \ - OBJECT_CHECK(VirtIOVGA, (obj), TYPE_VIRTIO_VGA) +DECLARE_INSTANCE_CHECKER(VirtIOVGA, VIRTIO_VGA, + TYPE_VIRTIO_VGA) =20 struct VirtIOVGA { VirtIOVGABase parent_obj; diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 076dfcedd7..bef0d7d69a 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -86,8 +86,8 @@ struct vmsvga_state_s { =20 #define TYPE_VMWARE_SVGA "vmware-svga" =20 -#define VMWARE_SVGA(obj) \ - OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VMWARE_SVGA) +DECLARE_INSTANCE_CHECKER(struct pci_vmsvga_state_s, VMWARE_SVGA, + TYPE_VMWARE_SVGA) =20 struct pci_vmsvga_state_s { /*< private >*/ diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index c12946aaef..5b7ff635f7 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -33,7 +33,8 @@ =20 #define TYPE_I82374 "i82374" typedef struct I82374State I82374State; -#define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374) +DECLARE_INSTANCE_CHECKER(I82374State, I82374, + TYPE_I82374) =20 //#define DEBUG_I82374 =20 diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 380d45db8f..859586fd2f 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -272,7 +272,8 @@ struct PL330State { }; =20 #define TYPE_PL330 "pl330" -#define PL330(obj) OBJECT_CHECK(PL330State, (obj), TYPE_PL330) +DECLARE_INSTANCE_CHECKER(PL330State, PL330, + TYPE_PL330) =20 static const VMStateDescription vmstate_pl330 =3D { .name =3D "pl330", diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c index 72e7b395b0..825e3dc0ac 100644 --- a/hw/dma/puv3_dma.c +++ b/hw/dma/puv3_dma.c @@ -24,7 +24,8 @@ =20 #define TYPE_PUV3_DMA "puv3_dma" typedef struct PUV3DMAState PUV3DMAState; -#define PUV3_DMA(obj) OBJECT_CHECK(PUV3DMAState, (obj), TYPE_PUV3_DMA) +DECLARE_INSTANCE_CHECKER(PUV3DMAState, PUV3_DMA, + TYPE_PUV3_DMA) =20 struct PUV3DMAState { SysBusDevice parent_obj; diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index 6ae8035831..4f6c0e5e5e 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -36,7 +36,8 @@ typedef struct { =20 #define TYPE_PXA2XX_DMA "pxa2xx-dma" typedef struct PXA2xxDMAState PXA2xxDMAState; -#define PXA2XX_DMA(obj) OBJECT_CHECK(PXA2xxDMAState, (obj), TYPE_PXA2XX_DM= A) +DECLARE_INSTANCE_CHECKER(PXA2xxDMAState, PXA2XX_DMA, + TYPE_PXA2XX_DMA) =20 struct PXA2xxDMAState { SysBusDevice parent_obj; diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 7d6eaf5e96..c584815d06 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -57,8 +57,8 @@ typedef struct dma_pagetable_entry { =20 #define TYPE_RC4030 "rc4030" typedef struct rc4030State rc4030State; -#define RC4030(obj) \ - OBJECT_CHECK(rc4030State, (obj), TYPE_RC4030) +DECLARE_INSTANCE_CHECKER(rc4030State, RC4030, + TYPE_RC4030) =20 #define TYPE_RC4030_IOMMU_MEMORY_REGION "rc4030-iommu-memory-region" =20 diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 6d48fea8fe..f313453495 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -44,17 +44,15 @@ #define TYPE_XILINX_AXI_DMA_CONTROL_STREAM "xilinx-axi-dma-control-stream" =20 typedef struct XilinxAXIDMA XilinxAXIDMA; -#define XILINX_AXI_DMA(obj) \ - OBJECT_CHECK(XilinxAXIDMA, (obj), TYPE_XILINX_AXI_DMA) +DECLARE_INSTANCE_CHECKER(XilinxAXIDMA, XILINX_AXI_DMA, + TYPE_XILINX_AXI_DMA) =20 typedef struct XilinxAXIDMAStreamSlave XilinxAXIDMAStreamSlave; -#define XILINX_AXI_DMA_DATA_STREAM(obj) \ - OBJECT_CHECK(XilinxAXIDMAStreamSlave, (obj),\ - TYPE_XILINX_AXI_DMA_DATA_STREAM) +DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSlave, XILINX_AXI_DMA_DATA_STRE= AM, + TYPE_XILINX_AXI_DMA_DATA_STREAM) =20 -#define XILINX_AXI_DMA_CONTROL_STREAM(obj) \ - OBJECT_CHECK(XilinxAXIDMAStreamSlave, (obj),\ - TYPE_XILINX_AXI_DMA_CONTROL_STREAM) +DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSlave, XILINX_AXI_DMA_CONTROL_S= TREAM, + TYPE_XILINX_AXI_DMA_CONTROL_STREAM) =20 #define R_DMACR (0x00 / 4) #define R_DMASR (0x04 / 4) diff --git a/hw/gpio/gpio_key.c b/hw/gpio/gpio_key.c index 2500a23c6e..86aa78aae4 100644 --- a/hw/gpio/gpio_key.c +++ b/hw/gpio/gpio_key.c @@ -32,7 +32,8 @@ =20 #define TYPE_GPIOKEY "gpio-key" typedef struct GPIOKEYState GPIOKEYState; -#define GPIOKEY(obj) OBJECT_CHECK(GPIOKEYState, (obj), TYPE_GPIOKEY) +DECLARE_INSTANCE_CHECKER(GPIOKEYState, GPIOKEY, + TYPE_GPIOKEY) #define GPIO_KEY_LATENCY 100 /* 100ms */ =20 struct GPIOKEYState { diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index dd7e7f293d..5511047f35 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -18,7 +18,8 @@ =20 #define TYPE_MAX7310 "max7310" typedef struct MAX7310State MAX7310State; -#define MAX7310(obj) OBJECT_CHECK(MAX7310State, (obj), TYPE_MAX7310) +DECLARE_INSTANCE_CHECKER(MAX7310State, MAX7310, + TYPE_MAX7310) =20 struct MAX7310State { I2CSlave parent_obj; diff --git a/hw/gpio/mpc8xxx.c b/hw/gpio/mpc8xxx.c index b33462e4db..dac8b1be38 100644 --- a/hw/gpio/mpc8xxx.c +++ b/hw/gpio/mpc8xxx.c @@ -28,7 +28,8 @@ =20 #define TYPE_MPC8XXX_GPIO "mpc8xxx_gpio" typedef struct MPC8XXXGPIOState MPC8XXXGPIOState; -#define MPC8XXX_GPIO(obj) OBJECT_CHECK(MPC8XXXGPIOState, (obj), TYPE_MPC8X= XX_GPIO) +DECLARE_INSTANCE_CHECKER(MPC8XXXGPIOState, MPC8XXX_GPIO, + TYPE_MPC8XXX_GPIO) =20 struct MPC8XXXGPIOState { SysBusDevice parent_obj; diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c index 6c36407079..3420df0d1f 100644 --- a/hw/gpio/pl061.c +++ b/hw/gpio/pl061.c @@ -36,7 +36,8 @@ static const uint8_t pl061_id_luminary[12] =3D =20 #define TYPE_PL061 "pl061" typedef struct PL061State PL061State; -#define PL061(obj) OBJECT_CHECK(PL061State, (obj), TYPE_PL061) +DECLARE_INSTANCE_CHECKER(PL061State, PL061, + TYPE_PL061) =20 #define N_GPIOS 8 =20 diff --git a/hw/gpio/puv3_gpio.c b/hw/gpio/puv3_gpio.c index 5e0ee783dc..98ea2b4c2e 100644 --- a/hw/gpio/puv3_gpio.c +++ b/hw/gpio/puv3_gpio.c @@ -20,7 +20,8 @@ =20 #define TYPE_PUV3_GPIO "puv3_gpio" typedef struct PUV3GPIOState PUV3GPIOState; -#define PUV3_GPIO(obj) OBJECT_CHECK(PUV3GPIOState, (obj), TYPE_PUV3_GPIO) +DECLARE_INSTANCE_CHECKER(PUV3GPIOState, PUV3_GPIO, + TYPE_PUV3_GPIO) =20 struct PUV3GPIOState { SysBusDevice parent_obj; diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c index 048e40c072..3d25c55d06 100644 --- a/hw/gpio/zaurus.c +++ b/hw/gpio/zaurus.c @@ -29,7 +29,8 @@ =20 #define TYPE_SCOOP "scoop" typedef struct ScoopInfo ScoopInfo; -#define SCOOP(obj) OBJECT_CHECK(ScoopInfo, (obj), TYPE_SCOOP) +DECLARE_INSTANCE_CHECKER(ScoopInfo, SCOOP, + TYPE_SCOOP) =20 struct ScoopInfo { SysBusDevice parent_obj; diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index fa739adc7b..c0c9b8a2b8 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -82,8 +82,8 @@ #define DINO_MEM_CHUNK_SIZE (8 * MiB) =20 typedef struct DinoState DinoState; -#define DINO_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(DinoState, DINO_PCI_HOST_BRIDGE, + TYPE_DINO_PCI_HOST_BRIDGE) =20 #define DINO800_REGS (1 + (DINO_TLTIM - DINO_GMASK) / 4) static const uint32_t reg800_keep_bits[DINO800_REGS] =3D { diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 1acb9ce631..c0b970f55c 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -54,8 +54,8 @@ #define ICR_TOC_BIT LASI_BIT(1) /* bit 1 in ICR */ =20 typedef struct LasiState LasiState; -#define LASI_CHIP(obj) \ - OBJECT_CHECK(LasiState, (obj), TYPE_LASI_CHIP) +DECLARE_INSTANCE_CHECKER(LasiState, LASI_CHIP, + TYPE_LASI_CHIP) =20 struct LasiState { PCIHostState parent_obj; diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c index 5dfa9d77e1..aa5a2a9bd8 100644 --- a/hw/hyperv/hyperv.c +++ b/hw/hyperv/hyperv.c @@ -38,7 +38,8 @@ struct SynICState { typedef struct SynICState SynICState; =20 #define TYPE_SYNIC "hyperv-synic" -#define SYNIC(obj) OBJECT_CHECK(SynICState, (obj), TYPE_SYNIC) +DECLARE_INSTANCE_CHECKER(SynICState, SYNIC, + TYPE_SYNIC) =20 static bool synic_enabled; =20 diff --git a/hw/hyperv/hyperv_testdev.c b/hw/hyperv/hyperv_testdev.c index 8f78fce088..f6ee98e00c 100644 --- a/hw/hyperv/hyperv_testdev.c +++ b/hw/hyperv/hyperv_testdev.c @@ -50,8 +50,8 @@ struct HypervTestDev { typedef struct HypervTestDev HypervTestDev; =20 #define TYPE_HYPERV_TEST_DEV "hyperv-testdev" -#define HYPERV_TEST_DEV(obj) \ - OBJECT_CHECK(HypervTestDev, (obj), TYPE_HYPERV_TEST_DEV) +DECLARE_INSTANCE_CHECKER(HypervTestDev, HYPERV_TEST_DEV, + TYPE_HYPERV_TEST_DEV) =20 enum { HV_TEST_DEV_SINT_ROUTE_CREATE =3D 1, diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index 4ff3c0b4ec..c1b9f298d9 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -164,7 +164,8 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBus = *bus) =20 #define TYPE_GPIO_I2C "gpio_i2c" typedef struct GPIOI2CState GPIOI2CState; -#define GPIO_I2C(obj) OBJECT_CHECK(GPIOI2CState, (obj), TYPE_GPIO_I2C) +DECLARE_INSTANCE_CHECKER(GPIOI2CState, GPIO_I2C, + TYPE_GPIO_I2C) =20 struct GPIOI2CState { SysBusDevice parent_obj; diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c index 9d2f780d2a..ff82226e9f 100644 --- a/hw/i2c/exynos4210_i2c.c +++ b/hw/i2c/exynos4210_i2c.c @@ -35,8 +35,8 @@ =20 #define TYPE_EXYNOS4_I2C "exynos4210.i2c" typedef struct Exynos4210I2CState Exynos4210I2CState; -#define EXYNOS4_I2C(obj) \ - OBJECT_CHECK(Exynos4210I2CState, (obj), TYPE_EXYNOS4_I2C) +DECLARE_INSTANCE_CHECKER(Exynos4210I2CState, EXYNOS4_I2C, + TYPE_EXYNOS4_I2C) =20 /* Exynos4210 I2C memory map */ #define EXYNOS4_I2C_MEM_SIZE 0x14 diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 232a277da4..156a25a8e9 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -38,8 +38,8 @@ =20 #define TYPE_MPC_I2C "mpc-i2c" typedef struct MPCI2CState MPCI2CState; -#define MPC_I2C(obj) \ - OBJECT_CHECK(MPCI2CState, (obj), TYPE_MPC_I2C) +DECLARE_INSTANCE_CHECKER(MPCI2CState, MPC_I2C, + TYPE_MPC_I2C) =20 #define MPC_I2C_ADR 0x00 #define MPC_I2C_FDR 0x04 diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 4f98012f1c..c6777844cf 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -38,8 +38,8 @@ #define TYPE_SMBUS_EEPROM "smbus-eeprom" =20 typedef struct SMBusEEPROMDevice SMBusEEPROMDevice; -#define SMBUS_EEPROM(obj) \ - OBJECT_CHECK(SMBusEEPROMDevice, (obj), TYPE_SMBUS_EEPROM) +DECLARE_INSTANCE_CHECKER(SMBusEEPROMDevice, SMBUS_EEPROM, + TYPE_SMBUS_EEPROM) =20 #define SMBUS_EEPROM_SIZE 256 =20 diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 44d26fcf39..2d4578511d 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -31,8 +31,8 @@ #include "qom/object.h" =20 typedef struct ICH9SMBState ICH9SMBState; -#define ICH9_SMB_DEVICE(obj) \ - OBJECT_CHECK(ICH9SMBState, (obj), TYPE_ICH9_SMB_DEVICE) +DECLARE_INSTANCE_CHECKER(ICH9SMBState, ICH9_SMB_DEVICE, + TYPE_ICH9_SMB_DEVICE) =20 struct ICH9SMBState { PCIDevice dev; diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index 3ab386d671..3a04ba3969 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -30,8 +30,8 @@ #include "qom/object.h" =20 typedef ArmSbconI2CState VersatileI2CState; -#define VERSATILE_I2C(obj) \ - OBJECT_CHECK(VersatileI2CState, (obj), TYPE_VERSATILE_I2C) +DECLARE_INSTANCE_CHECKER(VersatileI2CState, VERSATILE_I2C, + TYPE_VERSATILE_I2C) =20 =20 =20 diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 94ece445af..37f47540e5 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -33,7 +33,8 @@ =20 #define TYPE_KVM_CLOCK "kvmclock" typedef struct KVMClockState KVMClockState; -#define KVM_CLOCK(obj) OBJECT_CHECK(KVMClockState, (obj), TYPE_KVM_CLOCK) +DECLARE_INSTANCE_CHECKER(KVMClockState, KVM_CLOCK, + TYPE_KVM_CLOCK) =20 struct KVMClockState { /*< private >*/ diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index d3e4142b16..e18fd337fa 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -41,11 +41,8 @@ =20 typedef struct KVMPITClass KVMPITClass; typedef struct KVMPITState KVMPITState; -#define KVM_PIT(obj) OBJECT_CHECK(KVMPITState, (obj), TYPE_KVM_I8254) -#define KVM_PIT_CLASS(class) \ - OBJECT_CLASS_CHECK(KVMPITClass, (class), TYPE_KVM_I8254) -#define KVM_PIT_GET_CLASS(obj) \ - OBJECT_GET_CLASS(KVMPITClass, (obj), TYPE_KVM_I8254) +DECLARE_OBJ_CHECKERS(KVMPITState, KVMPITClass, + KVM_PIT, TYPE_KVM_I8254) =20 struct KVMPITState { PITCommonState parent_obj; diff --git a/hw/i386/kvm/i8259.c b/hw/i386/kvm/i8259.c index b256f97c83..3f8bf69e9c 100644 --- a/hw/i386/kvm/i8259.c +++ b/hw/i386/kvm/i8259.c @@ -21,10 +21,8 @@ =20 #define TYPE_KVM_I8259 "kvm-i8259" typedef struct KVMPICClass KVMPICClass; -#define KVM_PIC_CLASS(class) \ - OBJECT_CLASS_CHECK(KVMPICClass, (class), TYPE_KVM_I8259) -#define KVM_PIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(KVMPICClass, (obj), TYPE_KVM_I8259) +DECLARE_CLASS_CHECKERS(KVMPICClass, KVM_PIC, + TYPE_KVM_I8259) =20 /** * KVMPICClass: diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 857d9f4a61..a4e05f086e 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -74,7 +74,8 @@ struct VAPICROMState { typedef struct VAPICROMState VAPICROMState; =20 #define TYPE_VAPIC "kvmvapic" -#define VAPIC(obj) OBJECT_CHECK(VAPICROMState, (obj), TYPE_VAPIC) +DECLARE_INSTANCE_CHECKER(VAPICROMState, VAPIC, + TYPE_VAPIC) =20 #define TPR_INSTR_ABS_MODRM 0x1 #define TPR_INSTR_MATCH_MODRM_REG 0x2 diff --git a/hw/i386/port92.c b/hw/i386/port92.c index 48200def5d..c00dcb261b 100644 --- a/hw/i386/port92.c +++ b/hw/i386/port92.c @@ -15,7 +15,8 @@ #include "qom/object.h" =20 typedef struct Port92State Port92State; -#define PORT92(obj) OBJECT_CHECK(Port92State, (obj), TYPE_PORT92) +DECLARE_INSTANCE_CHECKER(Port92State, PORT92, + TYPE_PORT92) =20 struct Port92State { ISADevice parent_obj; diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index d187de3745..ae4cbc7add 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -52,7 +52,8 @@ =20 #define TYPE_VMMOUSE "vmmouse" typedef struct VMMouseState VMMouseState; -#define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE) +DECLARE_INSTANCE_CHECKER(VMMouseState, VMMOUSE, + TYPE_VMMOUSE) =20 struct VMMouseState { ISADevice parent_obj; diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index 3720834630..df52b6f903 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -64,7 +64,8 @@ #define VCPU_INFO_RESERVED_BIT 31 =20 typedef struct VMPortState VMPortState; -#define VMPORT(obj) OBJECT_CHECK(VMPortState, (obj), TYPE_VMPORT) +DECLARE_INSTANCE_CHECKER(VMPortState, VMPORT, + TYPE_VMPORT) =20 struct VMPortState { ISADevice parent_obj; diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index e8dbd580c5..a8bbe8c833 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -72,8 +72,8 @@ struct PCIXenPlatformState { typedef struct PCIXenPlatformState PCIXenPlatformState; =20 #define TYPE_XEN_PLATFORM "xen-platform" -#define XEN_PLATFORM(obj) \ - OBJECT_CHECK(PCIXenPlatformState, (obj), TYPE_XEN_PLATFORM) +DECLARE_INSTANCE_CHECKER(PCIXenPlatformState, XEN_PLATFORM, + TYPE_XEN_PLATFORM) =20 #define XEN_PLATFORM_IOPORT 0x10 =20 diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 518c66d0bf..67f83616d3 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -41,8 +41,8 @@ #define TYPE_XEN_PV_DEVICE "xen-pvdevice" =20 typedef struct XenPVDevice XenPVDevice; -#define XEN_PV_DEVICE(obj) \ - OBJECT_CHECK(XenPVDevice, (obj), TYPE_XEN_PV_DEVICE) +DECLARE_INSTANCE_CHECKER(XenPVDevice, XEN_PV_DEVICE, + TYPE_XEN_PV_DEVICE) =20 struct XenPVDevice { /*< private >*/ diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 438f74e67c..9a3489691b 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -39,7 +39,8 @@ =20 #define TYPE_ISA_IDE "isa-ide" typedef struct ISAIDEState ISAIDEState; -#define ISA_IDE(obj) OBJECT_CHECK(ISAIDEState, (obj), TYPE_ISA_IDE) +DECLARE_INSTANCE_CHECKER(ISAIDEState, ISA_IDE, + TYPE_ISA_IDE) =20 struct ISAIDEState { ISADevice parent_obj; diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index 28f171bf15..6e7f5df901 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -35,7 +35,8 @@ =20 #define TYPE_MICRODRIVE "microdrive" typedef struct MicroDriveState MicroDriveState; -#define MICRODRIVE(obj) OBJECT_CHECK(MicroDriveState, (obj), TYPE_MICRODRI= VE) +DECLARE_INSTANCE_CHECKER(MicroDriveState, MICRODRIVE, + TYPE_MICRODRIVE) =20 /***********************************************************/ /* CF-ATA Microdrive */ diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index 501afdfaaa..4bf6e3a8b7 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -41,7 +41,8 @@ =20 #define TYPE_MMIO_IDE "mmio-ide" typedef struct MMIOIDEState MMIOState; -#define MMIO_IDE(obj) OBJECT_CHECK(MMIOState, (obj), TYPE_MMIO_IDE) +DECLARE_INSTANCE_CHECKER(MMIOState, MMIO_IDE, + TYPE_MMIO_IDE) =20 struct MMIOIDEState { /*< private >*/ diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 11c5b88bbf..968c239ab8 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -20,7 +20,7 @@ =20 #define TYPE_SII3112_PCI "sii3112" typedef struct SiI3112PCIState SiI3112PCIState; -#define SII3112_PCI(obj) OBJECT_CHECK(SiI3112PCIState, (obj), \ +DECLARE_INSTANCE_CHECKER(SiI3112PCIState, SII3112_PCI, TYPE_SII3112_PCI) =20 typedef struct SiI3112Regs { diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c index a439bf6361..fe0c363d64 100644 --- a/hw/input/adb-kbd.c +++ b/hw/input/adb-kbd.c @@ -34,7 +34,8 @@ =20 typedef struct ADBKeyboardClass ADBKeyboardClass; typedef struct KBDState KBDState; -#define ADB_KEYBOARD(obj) OBJECT_CHECK(KBDState, (obj), TYPE_ADB_KEYBOARD) +DECLARE_OBJ_CHECKERS(KBDState, ADBKeyboardClass, + ADB_KEYBOARD, TYPE_ADB_KEYBOARD) =20 struct KBDState { /*< private >*/ @@ -45,10 +46,6 @@ struct KBDState { int rptr, wptr, count; }; =20 -#define ADB_KEYBOARD_CLASS(class) \ - OBJECT_CLASS_CHECK(ADBKeyboardClass, (class), TYPE_ADB_KEYBOARD) -#define ADB_KEYBOARD_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ADBKeyboardClass, (obj), TYPE_ADB_KEYBOARD) =20 struct ADBKeyboardClass { /*< private >*/ diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c index 8e4cf470d4..f5750909b4 100644 --- a/hw/input/adb-mouse.c +++ b/hw/input/adb-mouse.c @@ -33,7 +33,8 @@ =20 typedef struct ADBMouseClass ADBMouseClass; typedef struct MouseState MouseState; -#define ADB_MOUSE(obj) OBJECT_CHECK(MouseState, (obj), TYPE_ADB_MOUSE) +DECLARE_OBJ_CHECKERS(MouseState, ADBMouseClass, + ADB_MOUSE, TYPE_ADB_MOUSE) =20 struct MouseState { /*< public >*/ @@ -44,10 +45,6 @@ struct MouseState { int dx, dy, dz; }; =20 -#define ADB_MOUSE_CLASS(class) \ - OBJECT_CLASS_CHECK(ADBMouseClass, (class), TYPE_ADB_MOUSE) -#define ADB_MOUSE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ADBMouseClass, (obj), TYPE_ADB_MOUSE) =20 struct ADBMouseClass { /*< public >*/ diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index aab94d2815..70245fd817 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -29,7 +29,8 @@ =20 #define TYPE_LM8323 "lm8323" typedef struct LM823KbdState LM823KbdState; -#define LM8323(obj) OBJECT_CHECK(LM823KbdState, (obj), TYPE_LM8323) +DECLARE_INSTANCE_CHECKER(LM823KbdState, LM8323, + TYPE_LM8323) =20 struct LM823KbdState { I2CSlave parent_obj; diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c index 8b5ffd28f2..eaaf8adde4 100644 --- a/hw/input/milkymist-softusb.c +++ b/hw/input/milkymist-softusb.c @@ -52,8 +52,8 @@ enum { =20 #define TYPE_MILKYMIST_SOFTUSB "milkymist-softusb" typedef struct MilkymistSoftUsbState MilkymistSoftUsbState; -#define MILKYMIST_SOFTUSB(obj) \ - OBJECT_CHECK(MilkymistSoftUsbState, (obj), TYPE_MILKYMIST_SOFTUSB) +DECLARE_INSTANCE_CHECKER(MilkymistSoftUsbState, MILKYMIST_SOFTUSB, + TYPE_MILKYMIST_SOFTUSB) =20 struct MilkymistSoftUsbState { SysBusDevice parent_obj; diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 8eb6866953..7c53ae97da 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -18,7 +18,8 @@ =20 #define TYPE_PL050 "pl050" typedef struct PL050State PL050State; -#define PL050(obj) OBJECT_CHECK(PL050State, (obj), TYPE_PL050) +DECLARE_INSTANCE_CHECKER(PL050State, PL050, + TYPE_PL050) =20 struct PL050State { SysBusDevice parent_obj; diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index 8fb566d187..04d7a6d68b 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -38,7 +38,8 @@ =20 #define TYPE_ARM_GICV2M "arm-gicv2m" typedef struct ARMGICv2mState ARMGICv2mState; -#define ARM_GICV2M(obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2= M) +DECLARE_INSTANCE_CHECKER(ARMGICv2mState, ARM_GICV2M, + TYPE_ARM_GICV2M) =20 #define GICV2M_NUM_SPI_MAX 128 =20 diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c index cf4b3c5850..54ed4c77f7 100644 --- a/hw/intc/etraxfs_pic.c +++ b/hw/intc/etraxfs_pic.c @@ -39,8 +39,8 @@ #define R_MAX 5 =20 #define TYPE_ETRAX_FS_PIC "etraxfs,pic" -#define ETRAX_FS_PIC(obj) \ - OBJECT_CHECK(struct etrax_pic, (obj), TYPE_ETRAX_FS_PIC) +DECLARE_INSTANCE_CHECKER(struct etrax_pic, ETRAX_FS_PIC, + TYPE_ETRAX_FS_PIC) =20 struct etrax_pic { diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index 8e54f156c4..7b01481ab8 100644 --- a/hw/intc/exynos4210_combiner.c +++ b/hw/intc/exynos4210_combiner.c @@ -65,8 +65,8 @@ typedef struct CombinerGroupState { =20 #define TYPE_EXYNOS4210_COMBINER "exynos4210.combiner" typedef struct Exynos4210CombinerState Exynos4210CombinerState; -#define EXYNOS4210_COMBINER(obj) \ - OBJECT_CHECK(Exynos4210CombinerState, (obj), TYPE_EXYNOS4210_COMBINER) +DECLARE_INSTANCE_CHECKER(Exynos4210CombinerState, EXYNOS4210_COMBINER, + TYPE_EXYNOS4210_COMBINER) =20 struct Exynos4210CombinerState { SysBusDevice parent_obj; diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index ded31466ce..f9487673fc 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -266,8 +266,8 @@ uint32_t exynos4210_get_irq(uint32_t grp, uint32_t bit) =20 #define TYPE_EXYNOS4210_GIC "exynos4210.gic" typedef struct Exynos4210GicState Exynos4210GicState; -#define EXYNOS4210_GIC(obj) \ - OBJECT_CHECK(Exynos4210GicState, (obj), TYPE_EXYNOS4210_GIC) +DECLARE_INSTANCE_CHECKER(Exynos4210GicState, EXYNOS4210_GIC, + TYPE_EXYNOS4210_GIC) =20 struct Exynos4210GicState { SysBusDevice parent_obj; @@ -385,8 +385,8 @@ type_init(exynos4210_gic_register_types) =20 #define TYPE_EXYNOS4210_IRQ_GATE "exynos4210.irq_gate" typedef struct Exynos4210IRQGateState Exynos4210IRQGateState; -#define EXYNOS4210_IRQ_GATE(obj) \ - OBJECT_CHECK(Exynos4210IRQGateState, (obj), TYPE_EXYNOS4210_IRQ_GATE) +DECLARE_INSTANCE_CHECKER(Exynos4210IRQGateState, EXYNOS4210_IRQ_GATE, + TYPE_EXYNOS4210_IRQ_GATE) =20 struct Exynos4210IRQGateState { SysBusDevice parent_obj; diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c index 5a60396390..9b34a8ae03 100644 --- a/hw/intc/grlib_irqmp.c +++ b/hw/intc/grlib_irqmp.c @@ -52,7 +52,8 @@ #define EXTENDED_OFFSET 0xC0 =20 typedef struct IRQMP IRQMP; -#define GRLIB_IRQMP(obj) OBJECT_CHECK(IRQMP, (obj), TYPE_GRLIB_IRQMP) +DECLARE_INSTANCE_CHECKER(IRQMP, GRLIB_IRQMP, + TYPE_GRLIB_IRQMP) =20 typedef struct IRQMPState IRQMPState; =20 diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index 9663207d34..344fd04db1 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -39,8 +39,8 @@ =20 #define TYPE_I8259 "isa-i8259" typedef struct PICClass PICClass; -#define PIC_CLASS(class) OBJECT_CLASS_CHECK(PICClass, (class), TYPE_I8259) -#define PIC_GET_CLASS(obj) OBJECT_GET_CLASS(PICClass, (obj), TYPE_I8259) +DECLARE_CLASS_CHECKERS(PICClass, PIC, + TYPE_I8259) =20 /** * PICClass: diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c index b08d9822ab..e8b4015efd 100644 --- a/hw/intc/lm32_pic.c +++ b/hw/intc/lm32_pic.c @@ -31,7 +31,8 @@ =20 #define TYPE_LM32_PIC "lm32-pic" typedef struct LM32PicState LM32PicState; -#define LM32_PIC(obj) OBJECT_CHECK(LM32PicState, (obj), TYPE_LM32_PIC) +DECLARE_INSTANCE_CHECKER(LM32PicState, LM32_PIC, + TYPE_LM32_PIC) =20 struct LM32PicState { SysBusDevice parent_obj; diff --git a/hw/intc/loongson_liointc.c b/hw/intc/loongson_liointc.c index e11ca68647..30fb375b72 100644 --- a/hw/intc/loongson_liointc.c +++ b/hw/intc/loongson_liointc.c @@ -44,8 +44,8 @@ #define R_END 0x64 =20 #define TYPE_LOONGSON_LIOINTC "loongson.liointc" -#define LOONGSON_LIOINTC(obj) \ - OBJECT_CHECK(struct loongson_liointc, (obj), TYPE_LOONGSON_LIOINTC) +DECLARE_INSTANCE_CHECKER(struct loongson_liointc, LOONGSON_LIOINTC, + TYPE_LOONGSON_LIOINTC) =20 struct loongson_liointc { SysBusDevice parent_obj; diff --git a/hw/intc/nios2_iic.c b/hw/intc/nios2_iic.c index 2594381a95..aa26f059a1 100644 --- a/hw/intc/nios2_iic.c +++ b/hw/intc/nios2_iic.c @@ -29,8 +29,8 @@ =20 #define TYPE_ALTERA_IIC "altera,iic" typedef struct AlteraIIC AlteraIIC; -#define ALTERA_IIC(obj) \ - OBJECT_CHECK(AlteraIIC, (obj), TYPE_ALTERA_IIC) +DECLARE_INSTANCE_CHECKER(AlteraIIC, ALTERA_IIC, + TYPE_ALTERA_IIC) =20 struct AlteraIIC { SysBusDevice parent_obj; diff --git a/hw/intc/ompic.c b/hw/intc/ompic.c index 8dd763d6c5..a8ea621d9e 100644 --- a/hw/intc/ompic.c +++ b/hw/intc/ompic.c @@ -19,7 +19,8 @@ =20 #define TYPE_OR1K_OMPIC "or1k-ompic" typedef struct OR1KOMPICState OR1KOMPICState; -#define OR1K_OMPIC(obj) OBJECT_CHECK(OR1KOMPICState, (obj), TYPE_OR1K_OMPI= C) +DECLARE_INSTANCE_CHECKER(OR1KOMPICState, OR1K_OMPIC, + TYPE_OR1K_OMPIC) =20 #define OMPIC_CTRL_IRQ_ACK (1 << 31) #define OMPIC_CTRL_IRQ_GEN (1 << 30) diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index 3f5891a8a1..8c8fbeddfe 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -40,8 +40,8 @@ #define GCR_RESET 0x80000000 =20 typedef struct KVMOpenPICState KVMOpenPICState; -#define KVM_OPENPIC(obj) \ - OBJECT_CHECK(KVMOpenPICState, (obj), TYPE_KVM_OPENPIC) +DECLARE_INSTANCE_CHECKER(KVMOpenPICState, KVM_OPENPIC, + TYPE_KVM_OPENPIC) =20 struct KVMOpenPICState { /*< private >*/ diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c index 4f2aa58642..ee3206132f 100644 --- a/hw/intc/pl190.c +++ b/hw/intc/pl190.c @@ -23,7 +23,8 @@ =20 #define TYPE_PL190 "pl190" typedef struct PL190State PL190State; -#define PL190(obj) OBJECT_CHECK(PL190State, (obj), TYPE_PL190) +DECLARE_INSTANCE_CHECKER(PL190State, PL190, + TYPE_PL190) =20 struct PL190State { SysBusDevice parent_obj; diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c index 3a8bc154ba..8bceede256 100644 --- a/hw/intc/puv3_intc.c +++ b/hw/intc/puv3_intc.c @@ -21,7 +21,8 @@ =20 #define TYPE_PUV3_INTC "puv3_intc" typedef struct PUV3INTCState PUV3INTCState; -#define PUV3_INTC(obj) OBJECT_CHECK(PUV3INTCState, (obj), TYPE_PUV3_INTC) +DECLARE_INSTANCE_CHECKER(PUV3INTCState, PUV3_INTC, + TYPE_PUV3_INTC) =20 struct PUV3INTCState { SysBusDevice parent_obj; diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index c4ae10d978..35d91afa55 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -576,11 +576,9 @@ struct KVMS390FLICStateClass { }; typedef struct KVMS390FLICStateClass KVMS390FLICStateClass; =20 -#define KVM_S390_FLIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(KVMS390FLICStateClass, (obj), TYPE_KVM_S390_FLIC) +DECLARE_CLASS_CHECKERS(KVMS390FLICStateClass, KVM_S390_FLIC, + TYPE_KVM_S390_FLIC) =20 -#define KVM_S390_FLIC_CLASS(klass) \ - OBJECT_CLASS_CHECK(KVMS390FLICStateClass, (klass), TYPE_KVM_S390_FLIC) =20 static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) { diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index 7675556868..4a72ef5d0d 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -60,8 +60,8 @@ typedef struct SLAVIO_CPUINTCTLState { =20 #define TYPE_SLAVIO_INTCTL "slavio_intctl" typedef struct SLAVIO_INTCTLState SLAVIO_INTCTLState; -#define SLAVIO_INTCTL(obj) \ - OBJECT_CHECK(SLAVIO_INTCTLState, (obj), TYPE_SLAVIO_INTCTL) +DECLARE_INSTANCE_CHECKER(SLAVIO_INTCTLState, SLAVIO_INTCTL, + TYPE_SLAVIO_INTCTL) =20 struct SLAVIO_INTCTLState { SysBusDevice parent_obj; diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index ed1c2bcfb8..4c4397b3d2 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -42,7 +42,8 @@ #define R_MAX 8 =20 #define TYPE_XILINX_INTC "xlnx.xps-intc" -#define XILINX_INTC(obj) OBJECT_CHECK(struct xlx_pic, (obj), TYPE_XILINX_I= NTC) +DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, + TYPE_XILINX_INTC) =20 struct xlx_pic { diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index 81d3521d8f..b35e1d2ac4 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -73,8 +73,8 @@ typedef struct TPCI200State TPCI200State; =20 #define TYPE_TPCI200 "tpci200" =20 -#define TPCI200(obj) \ - OBJECT_CHECK(TPCI200State, (obj), TYPE_TPCI200) +DECLARE_INSTANCE_CHECKER(TPCI200State, TPCI200, + TYPE_TPCI200) =20 static const uint8_t local_config_regs[] =3D { 0x00, 0xFF, 0xFF, 0x0F, 0x00, 0xFC, 0xFF, 0x0F, 0x00, 0x00, 0x00, diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 018667e0ca..159831cbc5 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -63,8 +63,8 @@ =20 #define TYPE_IPMI_BMC_EXTERN "ipmi-bmc-extern" typedef struct IPMIBmcExtern IPMIBmcExtern; -#define IPMI_BMC_EXTERN(obj) OBJECT_CHECK(IPMIBmcExtern, (obj), \ - TYPE_IPMI_BMC_EXTERN) +DECLARE_INSTANCE_CHECKER(IPMIBmcExtern, IPMI_BMC_EXTERN, + TYPE_IPMI_BMC_EXTERN) struct IPMIBmcExtern { IPMIBmc parent; =20 diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index 90b3ba1232..0b69acc2e9 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -35,8 +35,8 @@ =20 #define TYPE_ISA_IPMI_BT "isa-ipmi-bt" typedef struct ISAIPMIBTDevice ISAIPMIBTDevice; -#define ISA_IPMI_BT(obj) OBJECT_CHECK(ISAIPMIBTDevice, (obj), \ - TYPE_ISA_IPMI_BT) +DECLARE_INSTANCE_CHECKER(ISAIPMIBTDevice, ISA_IPMI_BT, + TYPE_ISA_IPMI_BT) =20 struct ISAIPMIBTDevice { ISADevice dev; diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index ac7caa26ec..af69e9a008 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -35,8 +35,8 @@ =20 #define TYPE_ISA_IPMI_KCS "isa-ipmi-kcs" typedef struct ISAIPMIKCSDevice ISAIPMIKCSDevice; -#define ISA_IPMI_KCS(obj) OBJECT_CHECK(ISAIPMIKCSDevice, (obj), \ - TYPE_ISA_IPMI_KCS) +DECLARE_INSTANCE_CHECKER(ISAIPMIKCSDevice, ISA_IPMI_KCS, + TYPE_ISA_IPMI_KCS) =20 struct ISAIPMIKCSDevice { ISADevice dev; diff --git a/hw/ipmi/pci_ipmi_bt.c b/hw/ipmi/pci_ipmi_bt.c index cfc7275042..7e5ecea6cc 100644 --- a/hw/ipmi/pci_ipmi_bt.c +++ b/hw/ipmi/pci_ipmi_bt.c @@ -30,8 +30,8 @@ =20 #define TYPE_PCI_IPMI_BT "pci-ipmi-bt" typedef struct PCIIPMIBTDevice PCIIPMIBTDevice; -#define PCI_IPMI_BT(obj) OBJECT_CHECK(PCIIPMIBTDevice, (obj), \ - TYPE_PCI_IPMI_BT) +DECLARE_INSTANCE_CHECKER(PCIIPMIBTDevice, PCI_IPMI_BT, + TYPE_PCI_IPMI_BT) =20 struct PCIIPMIBTDevice { PCIDevice dev; diff --git a/hw/ipmi/pci_ipmi_kcs.c b/hw/ipmi/pci_ipmi_kcs.c index e4a1603d4e..c2a283a982 100644 --- a/hw/ipmi/pci_ipmi_kcs.c +++ b/hw/ipmi/pci_ipmi_kcs.c @@ -30,8 +30,8 @@ =20 #define TYPE_PCI_IPMI_KCS "pci-ipmi-kcs" typedef struct PCIIPMIKCSDevice PCIIPMIKCSDevice; -#define PCI_IPMI_KCS(obj) OBJECT_CHECK(PCIIPMIKCSDevice, (obj), \ - TYPE_PCI_IPMI_KCS) +DECLARE_INSTANCE_CHECKER(PCIIPMIKCSDevice, PCI_IPMI_KCS, + TYPE_PCI_IPMI_KCS) =20 struct PCIIPMIKCSDevice { PCIDevice dev; diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c index baa8389331..cd4c05dd1b 100644 --- a/hw/ipmi/smbus_ipmi.c +++ b/hw/ipmi/smbus_ipmi.c @@ -31,7 +31,8 @@ =20 #define TYPE_SMBUS_IPMI "smbus-ipmi" typedef struct SMBusIPMIDevice SMBusIPMIDevice; -#define SMBUS_IPMI(obj) OBJECT_CHECK(SMBusIPMIDevice, (obj), TYPE_SMBUS_IP= MI) +DECLARE_INSTANCE_CHECKER(SMBusIPMIDevice, SMBUS_IPMI, + TYPE_SMBUS_IPMI) =20 #define SSIF_IPMI_REQUEST 2 #define SSIF_IPMI_MULTI_PART_REQUEST_START 6 diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 4060d22c07..1dcf525f3f 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -28,8 +28,8 @@ =20 #define TYPE_I82378 "i82378" typedef struct I82378State I82378State; -#define I82378(obj) \ - OBJECT_CHECK(I82378State, (obj), TYPE_I82378) +DECLARE_INSTANCE_CHECKER(I82378State, I82378, + TYPE_I82378) =20 struct I82378State { PCIDevice parent_obj; diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index fdbc20e30a..8e3ac845b8 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -54,8 +54,8 @@ struct PIIX4State { }; typedef struct PIIX4State PIIX4State; =20 -#define PIIX4_PCI_DEVICE(obj) \ - OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(PIIX4State, PIIX4_PCI_DEVICE, + TYPE_PIIX4_PCI_DEVICE) =20 static void piix4_isa_reset(DeviceState *dev) { diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 24047538d0..1e6b48b2a2 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -51,8 +51,8 @@ struct VT82C686BState { typedef struct VT82C686BState VT82C686BState; =20 #define TYPE_VT82C686B_DEVICE "VT82C686B" -#define VT82C686B_DEVICE(obj) \ - OBJECT_CHECK(VT82C686BState, (obj), TYPE_VT82C686B_DEVICE) +DECLARE_INSTANCE_CHECKER(VT82C686BState, VT82C686B_DEVICE, + TYPE_VT82C686B_DEVICE) =20 static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data, unsigned size) @@ -182,16 +182,16 @@ struct VT686MC97State { typedef struct VT686MC97State VT686MC97State; =20 #define TYPE_VT82C686B_PM_DEVICE "VT82C686B_PM" -#define VT82C686B_PM_DEVICE(obj) \ - OBJECT_CHECK(VT686PMState, (obj), TYPE_VT82C686B_PM_DEVICE) +DECLARE_INSTANCE_CHECKER(VT686PMState, VT82C686B_PM_DEVICE, + TYPE_VT82C686B_PM_DEVICE) =20 #define TYPE_VT82C686B_MC97_DEVICE "VT82C686B_MC97" -#define VT82C686B_MC97_DEVICE(obj) \ - OBJECT_CHECK(VT686MC97State, (obj), TYPE_VT82C686B_MC97_DEVICE) +DECLARE_INSTANCE_CHECKER(VT686MC97State, VT82C686B_MC97_DEVICE, + TYPE_VT82C686B_MC97_DEVICE) =20 #define TYPE_VT82C686B_AC97_DEVICE "VT82C686B_AC97" -#define VT82C686B_AC97_DEVICE(obj) \ - OBJECT_CHECK(VT686AC97State, (obj), TYPE_VT82C686B_AC97_DEVICE) +DECLARE_INSTANCE_CHECKER(VT686AC97State, VT82C686B_AC97_DEVICE, + TYPE_VT82C686B_AC97_DEVICE) =20 static void pm_update_sci(VT686PMState *s) { diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c index e628567cf3..7ee447240b 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -19,7 +19,8 @@ =20 #define TYPE_MCF_INTC "mcf-intc" typedef struct mcf_intc_state mcf_intc_state; -#define MCF_INTC(obj) OBJECT_CHECK(mcf_intc_state, (obj), TYPE_MCF_INTC) +DECLARE_INSTANCE_CHECKER(mcf_intc_state, MCF_INTC, + TYPE_MCF_INTC) =20 struct mcf_intc_state { SysBusDevice parent_obj; diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 25168c449f..cbd913b0a2 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -39,7 +39,8 @@ =20 #define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube") typedef struct NeXTState NeXTState; -#define NEXT_MACHINE(obj) OBJECT_CHECK(NeXTState, (obj), TYPE_NEXT_MACHINE) +DECLARE_INSTANCE_CHECKER(NeXTState, NEXT_MACHINE, + TYPE_NEXT_MACHINE) =20 #define ENTRY 0x0100001e #define RAM_SIZE 0x4000000 diff --git a/hw/m68k/next-kbd.c b/hw/m68k/next-kbd.c index a6316314ea..c7ca3fbbc9 100644 --- a/hw/m68k/next-kbd.c +++ b/hw/m68k/next-kbd.c @@ -39,7 +39,8 @@ #include "qom/object.h" =20 typedef struct NextKBDState NextKBDState; -#define NEXTKBD(obj) OBJECT_CHECK(NextKBDState, (obj), TYPE_NEXTKBD) +DECLARE_INSTANCE_CHECKER(NextKBDState, NEXTKBD, + TYPE_NEXTKBD) =20 /* following defintions from next68k netbsd */ #define CSR_INT 0x00800000 diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pm= u.c index f679aeee0d..ab9924bf20 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -30,8 +30,8 @@ =20 #define TYPE_XLNX_ZYNQMP_PMU_SOC "xlnx,zynqmp-pmu-soc" typedef struct XlnxZynqMPPMUSoCState XlnxZynqMPPMUSoCState; -#define XLNX_ZYNQMP_PMU_SOC(obj) OBJECT_CHECK(XlnxZynqMPPMUSoCState, (obj)= , \ - TYPE_XLNX_ZYNQMP_PMU_SOC) +DECLARE_INSTANCE_CHECKER(XlnxZynqMPPMUSoCState, XLNX_ZYNQMP_PMU_SOC, + TYPE_XLNX_ZYNQMP_PMU_SOC) =20 #define XLNX_ZYNQMP_PMU_ROM_SIZE 0x8000 #define XLNX_ZYNQMP_PMU_ROM_ADDR 0xFFD00000 diff --git a/hw/mips/boston.c b/hw/mips/boston.c index e2c35b4fd8..1b3f69e949 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -45,7 +45,8 @@ =20 #define TYPE_MIPS_BOSTON "mips-boston" typedef struct BostonState BostonState; -#define BOSTON(obj) OBJECT_CHECK(BostonState, (obj), TYPE_MIPS_BOSTON) +DECLARE_INSTANCE_CHECKER(BostonState, BOSTON, + TYPE_MIPS_BOSTON) =20 struct BostonState { SysBusDevice parent_obj; diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index bd7ec182fb..b613e1e011 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -232,8 +232,8 @@ #define TYPE_GT64120_PCI_HOST_BRIDGE "gt64120" =20 typedef struct GT64120State GT64120State; -#define GT64120_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(GT64120State, (obj), TYPE_GT64120_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(GT64120State, GT64120_PCI_HOST_BRIDGE, + TYPE_GT64120_PCI_HOST_BRIDGE) =20 struct GT64120State { PCIHostState parent_obj; diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 86ae544104..5b73ea4692 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -90,7 +90,8 @@ typedef struct { =20 #define TYPE_MIPS_MALTA "mips-malta" typedef struct MaltaState MaltaState; -#define MIPS_MALTA(obj) OBJECT_CHECK(MaltaState, (obj), TYPE_MIPS_MALTA) +DECLARE_INSTANCE_CHECKER(MaltaState, MIPS_MALTA, + TYPE_MIPS_MALTA) =20 struct MaltaState { SysBusDevice parent_obj; diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index e3c7b1765c..dca3fba028 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -91,7 +91,8 @@ struct AppleSMCData { }; =20 typedef struct AppleSMCState AppleSMCState; -#define APPLE_SMC(obj) OBJECT_CHECK(AppleSMCState, (obj), TYPE_APPLE_SMC) +DECLARE_INSTANCE_CHECKER(AppleSMCState, APPLE_SMC, + TYPE_APPLE_SMC) =20 struct AppleSMCState { ISADevice parent_obj; diff --git a/hw/misc/arm_integrator_debug.c b/hw/misc/arm_integrator_debug.c index 4ad2b6a98b..822deffc0c 100644 --- a/hw/misc/arm_integrator_debug.c +++ b/hw/misc/arm_integrator_debug.c @@ -22,8 +22,8 @@ #include "qom/object.h" =20 typedef struct IntegratorDebugState IntegratorDebugState; -#define INTEGRATOR_DEBUG(obj) \ - OBJECT_CHECK(IntegratorDebugState, (obj), TYPE_INTEGRATOR_DEBUG) +DECLARE_INSTANCE_CHECKER(IntegratorDebugState, INTEGRATOR_DEBUG, + TYPE_INTEGRATOR_DEBUG) =20 struct IntegratorDebugState { SysBusDevice parent_obj; diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c index f75d7988cc..93948c3bd8 100644 --- a/hw/misc/arm_l2x0.c +++ b/hw/misc/arm_l2x0.c @@ -31,7 +31,8 @@ =20 #define TYPE_ARM_L2X0 "l2x0" typedef struct L2x0State L2x0State; -#define ARM_L2X0(obj) OBJECT_CHECK(L2x0State, (obj), TYPE_ARM_L2X0) +DECLARE_INSTANCE_CHECKER(L2x0State, ARM_L2X0, + TYPE_ARM_L2X0) =20 struct L2x0State { SysBusDevice parent_obj; diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index a3faa516d6..f0f49e76e8 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -24,8 +24,8 @@ =20 #define TYPE_ARM_SYSCTL "realview_sysctl" typedef struct arm_sysctl_state arm_sysctl_state; -#define ARM_SYSCTL(obj) \ - OBJECT_CHECK(arm_sysctl_state, (obj), TYPE_ARM_SYSCTL) +DECLARE_INSTANCE_CHECKER(arm_sysctl_state, ARM_SYSCTL, + TYPE_ARM_SYSCTL) =20 struct arm_sysctl_state { SysBusDevice parent_obj; diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index 6c1f9adc38..c6b0cffd77 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -15,8 +15,8 @@ =20 #define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit" typedef struct ISADebugExitState ISADebugExitState; -#define ISA_DEBUG_EXIT_DEVICE(obj) \ - OBJECT_CHECK(ISADebugExitState, (obj), TYPE_ISA_DEBUG_EXIT_DEVICE) +DECLARE_INSTANCE_CHECKER(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE, + TYPE_ISA_DEBUG_EXIT_DEVICE) =20 struct ISADebugExitState { ISADevice parent_obj; diff --git a/hw/misc/eccmemctl.c b/hw/misc/eccmemctl.c index 47bec04c8e..468c2a491d 100644 --- a/hw/misc/eccmemctl.c +++ b/hw/misc/eccmemctl.c @@ -128,7 +128,8 @@ =20 #define TYPE_ECC_MEMCTL "eccmemctl" typedef struct ECCState ECCState; -#define ECC_MEMCTL(obj) OBJECT_CHECK(ECCState, (obj), TYPE_ECC_MEMCTL) +DECLARE_INSTANCE_CHECKER(ECCState, ECC_MEMCTL, + TYPE_ECC_MEMCTL) =20 struct ECCState { SysBusDevice parent_obj; diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 2db9d63eeb..0ff9d1ac78 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -35,7 +35,8 @@ =20 #define TYPE_PCI_EDU_DEVICE "edu" typedef struct EduState EduState; -#define EDU(obj) OBJECT_CHECK(EduState, obj, TYPE_PCI_EDU_DEVICE) +DECLARE_INSTANCE_CHECKER(EduState, EDU, + TYPE_PCI_EDU_DEVICE) =20 #define FACT_IRQ 0x00000001 #define DMA_IRQ 0x00000100 diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index ec3e510b3e..57dcdfbe14 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -19,7 +19,8 @@ =20 #define TYPE_EMPTY_SLOT "empty_slot" typedef struct EmptySlot EmptySlot; -#define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT) +DECLARE_INSTANCE_CHECKER(EmptySlot, EMPTY_SLOT, + TYPE_EMPTY_SLOT) =20 struct EmptySlot { SysBusDevice parent_obj; diff --git a/hw/misc/exynos4210_clk.c b/hw/misc/exynos4210_clk.c index c54f360aa8..4b469f6419 100644 --- a/hw/misc/exynos4210_clk.c +++ b/hw/misc/exynos4210_clk.c @@ -26,8 +26,8 @@ =20 #define TYPE_EXYNOS4210_CLK "exynos4210.clk" typedef struct Exynos4210ClkState Exynos4210ClkState; -#define EXYNOS4210_CLK(obj) \ - OBJECT_CHECK(Exynos4210ClkState, (obj), TYPE_EXYNOS4210_CLK) +DECLARE_INSTANCE_CHECKER(Exynos4210ClkState, EXYNOS4210_CLK, + TYPE_EXYNOS4210_CLK) =20 #define CLK_PLL_LOCKED BIT(29) =20 diff --git a/hw/misc/exynos4210_pmu.c b/hw/misc/exynos4210_pmu.c index e6bbb1f7c8..b19b82a88c 100644 --- a/hw/misc/exynos4210_pmu.c +++ b/hw/misc/exynos4210_pmu.c @@ -396,8 +396,8 @@ static const Exynos4210PmuReg exynos4210_pmu_regs[] =3D= { =20 #define TYPE_EXYNOS4210_PMU "exynos4210.pmu" typedef struct Exynos4210PmuState Exynos4210PmuState; -#define EXYNOS4210_PMU(obj) \ - OBJECT_CHECK(Exynos4210PmuState, (obj), TYPE_EXYNOS4210_PMU) +DECLARE_INSTANCE_CHECKER(Exynos4210PmuState, EXYNOS4210_PMU, + TYPE_EXYNOS4210_PMU) =20 struct Exynos4210PmuState { SysBusDevice parent_obj; diff --git a/hw/misc/exynos4210_rng.c b/hw/misc/exynos4210_rng.c index 3e2ec4f543..13ec6e188b 100644 --- a/hw/misc/exynos4210_rng.c +++ b/hw/misc/exynos4210_rng.c @@ -37,8 +37,8 @@ =20 #define TYPE_EXYNOS4210_RNG "exynos4210.rng" typedef struct Exynos4210RngState Exynos4210RngState; -#define EXYNOS4210_RNG(obj) \ - OBJECT_CHECK(Exynos4210RngState, (obj), TYPE_EXYNOS4210_RNG) +DECLARE_INSTANCE_CHECKER(Exynos4210RngState, EXYNOS4210_RNG, + TYPE_EXYNOS4210_RNG) =20 /* * Exynos4220, PRNG, only polling mode is supported. diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 1f65f6f2ac..e321e5cb69 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -59,20 +59,20 @@ =20 #define TYPE_IVSHMEM_COMMON "ivshmem-common" typedef struct IVShmemState IVShmemState; -#define IVSHMEM_COMMON(obj) \ - OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_COMMON) +DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM_COMMON, + TYPE_IVSHMEM_COMMON) =20 #define TYPE_IVSHMEM_PLAIN "ivshmem-plain" -#define IVSHMEM_PLAIN(obj) \ - OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_PLAIN) +DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM_PLAIN, + TYPE_IVSHMEM_PLAIN) =20 #define TYPE_IVSHMEM_DOORBELL "ivshmem-doorbell" -#define IVSHMEM_DOORBELL(obj) \ - OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_DOORBELL) +DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM_DOORBELL, + TYPE_IVSHMEM_DOORBELL) =20 #define TYPE_IVSHMEM "ivshmem" -#define IVSHMEM(obj) \ - OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM) +DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM, + TYPE_IVSHMEM) =20 typedef struct Peer { int nb_eventfds; diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c index cf3ed5a49c..f25715e09e 100644 --- a/hw/misc/milkymist-hpdmc.c +++ b/hw/misc/milkymist-hpdmc.c @@ -45,8 +45,8 @@ enum { =20 #define TYPE_MILKYMIST_HPDMC "milkymist-hpdmc" typedef struct MilkymistHpdmcState MilkymistHpdmcState; -#define MILKYMIST_HPDMC(obj) \ - OBJECT_CHECK(MilkymistHpdmcState, (obj), TYPE_MILKYMIST_HPDMC) +DECLARE_INSTANCE_CHECKER(MilkymistHpdmcState, MILKYMIST_HPDMC, + TYPE_MILKYMIST_HPDMC) =20 struct MilkymistHpdmcState { SysBusDevice parent_obj; diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c index 81251792c1..489bb8873f 100644 --- a/hw/misc/milkymist-pfpu.c +++ b/hw/misc/milkymist-pfpu.c @@ -122,8 +122,8 @@ static const char *opcode_to_str[] =3D { =20 #define TYPE_MILKYMIST_PFPU "milkymist-pfpu" typedef struct MilkymistPFPUState MilkymistPFPUState; -#define MILKYMIST_PFPU(obj) \ - OBJECT_CHECK(MilkymistPFPUState, (obj), TYPE_MILKYMIST_PFPU) +DECLARE_INSTANCE_CHECKER(MilkymistPFPUState, MILKYMIST_PFPU, + TYPE_MILKYMIST_PFPU) =20 struct MilkymistPFPUState { SysBusDevice parent_obj; diff --git a/hw/misc/mst_fpga.c b/hw/misc/mst_fpga.c index 314dd5fcbd..f74d8cdd4a 100644 --- a/hw/misc/mst_fpga.c +++ b/hw/misc/mst_fpga.c @@ -42,8 +42,8 @@ =20 #define TYPE_MAINSTONE_FPGA "mainstone-fpga" typedef struct mst_irq_state mst_irq_state; -#define MAINSTONE_FPGA(obj) \ - OBJECT_CHECK(mst_irq_state, (obj), TYPE_MAINSTONE_FPGA) +DECLARE_INSTANCE_CHECKER(mst_irq_state, MAINSTONE_FPGA, + TYPE_MAINSTONE_FPGA) =20 struct mst_irq_state { SysBusDevice parent_obj; diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c index b7f3fcb254..577a15bf58 100644 --- a/hw/misc/pc-testdev.c +++ b/hw/misc/pc-testdev.c @@ -57,8 +57,8 @@ struct PCTestdev { typedef struct PCTestdev PCTestdev; =20 #define TYPE_TESTDEV "pc-testdev" -#define TESTDEV(obj) \ - OBJECT_CHECK(PCTestdev, (obj), TYPE_TESTDEV) +DECLARE_INSTANCE_CHECKER(PCTestdev, TESTDEV, + TYPE_TESTDEV) =20 static uint64_t test_irq_line_read(void *opaque, hwaddr addr, unsigned siz= e) { diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c index 9cd51b1afd..b7686e27d7 100644 --- a/hw/misc/pca9552.c +++ b/hw/misc/pca9552.c @@ -34,10 +34,8 @@ struct PCA955xClass { }; typedef struct PCA955xClass PCA955xClass; =20 -#define PCA955X_CLASS(klass) \ - OBJECT_CLASS_CHECK(PCA955xClass, (klass), TYPE_PCA955X) -#define PCA955X_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCA955xClass, (obj), TYPE_PCA955X) +DECLARE_CLASS_CHECKERS(PCA955xClass, PCA955X, + TYPE_PCA955X) =20 #define PCA9552_LED_ON 0x0 #define PCA9552_LED_OFF 0x1 diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index db6d0d5a71..86d4816769 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -96,8 +96,8 @@ typedef struct PCITestDevState PCITestDevState; =20 #define TYPE_PCI_TEST_DEV "pci-testdev" =20 -#define PCI_TEST_DEV(obj) \ - OBJECT_CHECK(PCITestDevState, (obj), TYPE_PCI_TEST_DEV) +DECLARE_INSTANCE_CHECKER(PCITestDevState, PCI_TEST_DEV, + TYPE_PCI_TEST_DEV) =20 #define IOTEST_IS_MEM(i) (strcmp(IOTEST_TYPE(i), "portio")) #define IOTEST_REGION(d, i) (IOTEST_IS_MEM(i) ? &(d)->mmio : &(d)->portio) diff --git a/hw/misc/puv3_pm.c b/hw/misc/puv3_pm.c index e549c0ff21..cac8497f81 100644 --- a/hw/misc/puv3_pm.c +++ b/hw/misc/puv3_pm.c @@ -20,7 +20,8 @@ =20 #define TYPE_PUV3_PM "puv3_pm" typedef struct PUV3PMState PUV3PMState; -#define PUV3_PM(obj) OBJECT_CHECK(PUV3PMState, (obj), TYPE_PUV3_PM) +DECLARE_INSTANCE_CHECKER(PUV3PMState, PUV3_PM, + TYPE_PUV3_PM) =20 struct PUV3PMState { SysBusDevice parent_obj; diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 894c67e6cc..598d5471a4 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -31,8 +31,8 @@ #define PVPANIC_CRASHLOADED (1 << PVPANIC_F_CRASHLOADED) =20 typedef struct PVPanicState PVPanicState; -#define ISA_PVPANIC_DEVICE(obj) \ - OBJECT_CHECK(PVPanicState, (obj), TYPE_PVPANIC) +DECLARE_INSTANCE_CHECKER(PVPanicState, ISA_PVPANIC_DEVICE, + TYPE_PVPANIC) =20 static void handle_event(int event) { diff --git a/hw/misc/sga.c b/hw/misc/sga.c index e5cc2da3d3..477f587ef3 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -35,7 +35,8 @@ =20 #define TYPE_SGA "sga" typedef struct ISASGAState ISASGAState; -#define SGA(obj) OBJECT_CHECK(ISASGAState, (obj), TYPE_SGA) +DECLARE_INSTANCE_CHECKER(ISASGAState, SGA, + TYPE_SGA) =20 struct ISASGAState { ISADevice parent_obj; diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c index f1a039b5a9..ab27ad462e 100644 --- a/hw/misc/slavio_misc.c +++ b/hw/misc/slavio_misc.c @@ -41,7 +41,8 @@ =20 #define TYPE_SLAVIO_MISC "slavio_misc" typedef struct MiscState MiscState; -#define SLAVIO_MISC(obj) OBJECT_CHECK(MiscState, (obj), TYPE_SLAVIO_MISC) +DECLARE_INSTANCE_CHECKER(MiscState, SLAVIO_MISC, + TYPE_SLAVIO_MISC) =20 struct MiscState { SysBusDevice parent_obj; @@ -65,7 +66,8 @@ struct MiscState { =20 #define TYPE_APC "apc" typedef struct APCState APCState; -#define APC(obj) OBJECT_CHECK(APCState, (obj), TYPE_APC) +DECLARE_INSTANCE_CHECKER(APCState, APC, + TYPE_APC) =20 struct APCState { SysBusDevice parent_obj; diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c index a289c83360..212d6e0e83 100644 --- a/hw/misc/tmp421.c +++ b/hw/misc/tmp421.c @@ -74,12 +74,9 @@ struct TMP421Class { typedef struct TMP421Class TMP421Class; =20 #define TYPE_TMP421 "tmp421-generic" -#define TMP421(obj) OBJECT_CHECK(TMP421State, (obj), TYPE_TMP421) +DECLARE_OBJ_CHECKERS(TMP421State, TMP421Class, + TMP421, TYPE_TMP421) =20 -#define TMP421_CLASS(klass) \ - OBJECT_CLASS_CHECK(TMP421Class, (klass), TYPE_TMP421) -#define TMP421_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TMP421Class, (obj), TYPE_TMP421) =20 /* the TMP421 registers */ #define TMP421_STATUS_REG 0x08 diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c index 223f533ce8..bedf09a6f5 100644 --- a/hw/misc/zynq_slcr.c +++ b/hw/misc/zynq_slcr.c @@ -184,7 +184,8 @@ REG32(DDRIOB, 0xb40) =20 #define TYPE_ZYNQ_SLCR "xilinx,zynq_slcr" typedef struct ZynqSLCRState ZynqSLCRState; -#define ZYNQ_SLCR(obj) OBJECT_CHECK(ZynqSLCRState, (obj), TYPE_ZYNQ_SLCR) +DECLARE_INSTANCE_CHECKER(ZynqSLCRState, ZYNQ_SLCR, + TYPE_ZYNQ_SLCR) =20 struct ZynqSLCRState { SysBusDevice parent_obj; diff --git a/hw/net/can/can_kvaser_pci.c b/hw/net/can/can_kvaser_pci.c index a84d98817c..168b3a620d 100644 --- a/hw/net/can/can_kvaser_pci.c +++ b/hw/net/can/can_kvaser_pci.c @@ -48,8 +48,8 @@ #define TYPE_CAN_PCI_DEV "kvaser_pci" =20 typedef struct KvaserPCIState KvaserPCIState; -#define KVASER_PCI_DEV(obj) \ - OBJECT_CHECK(KvaserPCIState, (obj), TYPE_CAN_PCI_DEV) +DECLARE_INSTANCE_CHECKER(KvaserPCIState, KVASER_PCI_DEV, + TYPE_CAN_PCI_DEV) =20 #ifndef KVASER_PCI_VENDOR_ID1 #define KVASER_PCI_VENDOR_ID1 0x10e8 /* the PCI device and vendor I= Ds */ diff --git a/hw/net/can/can_mioe3680_pci.c b/hw/net/can/can_mioe3680_pci.c index 8ded64c9b8..7a79e2605a 100644 --- a/hw/net/can/can_mioe3680_pci.c +++ b/hw/net/can/can_mioe3680_pci.c @@ -44,8 +44,8 @@ #define TYPE_CAN_PCI_DEV "mioe3680_pci" =20 typedef struct Mioe3680PCIState Mioe3680PCIState; -#define MIOe3680_PCI_DEV(obj) \ - OBJECT_CHECK(Mioe3680PCIState, (obj), TYPE_CAN_PCI_DEV) +DECLARE_INSTANCE_CHECKER(Mioe3680PCIState, MIOe3680_PCI_DEV, + TYPE_CAN_PCI_DEV) =20 /* the PCI device and vendor IDs */ #ifndef MIOe3680_PCI_VENDOR_ID1 diff --git a/hw/net/can/can_pcm3680_pci.c b/hw/net/can/can_pcm3680_pci.c index f39228da89..8ef4e74af0 100644 --- a/hw/net/can/can_pcm3680_pci.c +++ b/hw/net/can/can_pcm3680_pci.c @@ -44,8 +44,8 @@ #define TYPE_CAN_PCI_DEV "pcm3680_pci" =20 typedef struct Pcm3680iPCIState Pcm3680iPCIState; -#define PCM3680i_PCI_DEV(obj) \ - OBJECT_CHECK(Pcm3680iPCIState, (obj), TYPE_CAN_PCI_DEV) +DECLARE_INSTANCE_CHECKER(Pcm3680iPCIState, PCM3680i_PCI_DEV, + TYPE_CAN_PCI_DEV) =20 /* the PCI device and vendor IDs */ #ifndef PCM3680i_PCI_VENDOR_ID1 diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index b065d428ee..56b96e9b0f 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -152,7 +152,8 @@ do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA= _ARGS__); } while (0) =20 #define TYPE_DP8393X "dp8393x" typedef struct dp8393xState dp8393xState; -#define DP8393X(obj) OBJECT_CHECK(dp8393xState, (obj), TYPE_DP8393X) +DECLARE_INSTANCE_CHECKER(dp8393xState, DP8393X, + TYPE_DP8393X) =20 struct dp8393xState { SysBusDevice parent_obj; diff --git a/hw/net/e1000.c b/hw/net/e1000.c index f8925a10e6..83347cbd87 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -151,13 +151,9 @@ typedef struct E1000BaseClass E1000BaseClass; =20 #define TYPE_E1000_BASE "e1000-base" =20 -#define E1000(obj) \ - OBJECT_CHECK(E1000State, (obj), TYPE_E1000_BASE) +DECLARE_OBJ_CHECKERS(E1000State, E1000BaseClass, + E1000, TYPE_E1000_BASE) =20 -#define E1000_CLASS(klass) \ - OBJECT_CLASS_CHECK(E1000BaseClass, (klass), TYPE_E1000_BASE) -#define E1000_GET_CLASS(obj) \ - OBJECT_GET_CLASS(E1000BaseClass, (obj), TYPE_E1000_BASE) =20 static void e1000_link_up(E1000State *s) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index d631765f2a..938d44f198 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -57,7 +57,8 @@ =20 #define TYPE_E1000E "e1000e" typedef struct E1000EState E1000EState; -#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E) +DECLARE_INSTANCE_CHECKER(E1000EState, E1000E, + TYPE_E1000E) =20 struct E1000EState { PCIDevice parent_obj; diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index 2bd37f6d0f..36d898ad16 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -325,8 +325,8 @@ static void mdio_cycle(struct qemu_mdio *bus) =20 #define TYPE_ETRAX_FS_ETH "etraxfs-eth" typedef struct ETRAXFSEthState ETRAXFSEthState; -#define ETRAX_FS_ETH(obj) \ - OBJECT_CHECK(ETRAXFSEthState, (obj), TYPE_ETRAX_FS_ETH) +DECLARE_INSTANCE_CHECKER(ETRAXFSEthState, ETRAX_FS_ETH, + TYPE_ETRAX_FS_ETH) =20 struct ETRAXFSEthState { SysBusDevice parent_obj; diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index 5d7f966aea..57a59accd0 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -182,7 +182,8 @@ static const VMStateDescription vmstate_lan9118_packet = =3D { }; =20 typedef struct lan9118_state lan9118_state; -#define LAN9118(obj) OBJECT_CHECK(lan9118_state, (obj), TYPE_LAN9118) +DECLARE_INSTANCE_CHECKER(lan9118_state, LAN9118, + TYPE_LAN9118) =20 struct lan9118_state { SysBusDevice parent_obj; diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 0ed01fec90..41a8543edf 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -100,8 +100,8 @@ typedef struct MilkymistMinimac2MdioState MilkymistMini= mac2MdioState; =20 #define TYPE_MILKYMIST_MINIMAC2 "milkymist-minimac2" typedef struct MilkymistMinimac2State MilkymistMinimac2State; -#define MILKYMIST_MINIMAC2(obj) \ - OBJECT_CHECK(MilkymistMinimac2State, (obj), TYPE_MILKYMIST_MINIMAC2) +DECLARE_INSTANCE_CHECKER(MilkymistMinimac2State, MILKYMIST_MINIMAC2, + TYPE_MILKYMIST_MINIMAC2) =20 struct MilkymistMinimac2State { SysBusDevice parent_obj; diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c index 094951abb3..61dbd575da 100644 --- a/hw/net/mipsnet.c +++ b/hw/net/mipsnet.c @@ -26,7 +26,8 @@ =20 #define TYPE_MIPS_NET "mipsnet" typedef struct MIPSnetState MIPSnetState; -#define MIPS_NET(obj) OBJECT_CHECK(MIPSnetState, (obj), TYPE_MIPS_NET) +DECLARE_INSTANCE_CHECKER(MIPSnetState, MIPS_NET, + TYPE_MIPS_NET) =20 struct MIPSnetState { SysBusDevice parent_obj; diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 716f3b6618..688a0cc4f6 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -34,7 +34,8 @@ #include "qom/object.h" =20 typedef struct ISANE2000State ISANE2000State; -#define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE200= 0) +DECLARE_INSTANCE_CHECKER(ISANE2000State, ISA_NE2000, + TYPE_ISA_NE2000) =20 struct ISANE2000State { ISADevice parent_obj; diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c index 6e3257d2f7..5cd204c30c 100644 --- a/hw/net/opencores_eth.c +++ b/hw/net/opencores_eth.c @@ -273,7 +273,8 @@ typedef struct desc { =20 #define TYPE_OPEN_ETH "open_eth" typedef struct OpenEthState OpenEthState; -#define OPEN_ETH(obj) OBJECT_CHECK(OpenEthState, (obj), TYPE_OPEN_ETH) +DECLARE_INSTANCE_CHECKER(OpenEthState, OPEN_ETH, + TYPE_OPEN_ETH) =20 struct OpenEthState { SysBusDevice parent_obj; diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 27f6566d5f..449970bc52 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -53,8 +53,8 @@ #define TYPE_PCI_PCNET "pcnet" =20 typedef struct PCIPCNetState PCIPCNetState; -#define PCI_PCNET(obj) \ - OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET) +DECLARE_INSTANCE_CHECKER(PCIPCNetState, PCI_PCNET, + TYPE_PCI_PCNET) =20 struct PCIPCNetState { /*< private >*/ diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 69d7f36e98..9246388f58 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -95,8 +95,8 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *= fmt, ...) #define TYPE_RTL8139 "rtl8139" =20 typedef struct RTL8139State RTL8139State; -#define RTL8139(obj) \ - OBJECT_CHECK(RTL8139State, (obj), TYPE_RTL8139) +DECLARE_INSTANCE_CHECKER(RTL8139State, RTL8139, + TYPE_RTL8139) =20 /* Symbolic offsets to registers. */ enum RTL8139_registers { diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index 12da4b1f73..9fad904321 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -26,7 +26,8 @@ =20 #define TYPE_SMC91C111 "smc91c111" typedef struct smc91c111_state smc91c111_state; -#define SMC91C111(obj) OBJECT_CHECK(smc91c111_state, (obj), TYPE_SMC91C111) +DECLARE_INSTANCE_CHECKER(smc91c111_state, SMC91C111, + TYPE_SMC91C111) =20 struct smc91c111_state { SysBusDevice parent_obj; diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index 94b61a646c..d34cb29607 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -86,8 +86,8 @@ typedef uint64_t vlan_bd_t; =20 #define TYPE_VIO_SPAPR_VLAN_DEVICE "spapr-vlan" typedef struct SpaprVioVlan SpaprVioVlan; -#define VIO_SPAPR_VLAN_DEVICE(obj) \ - OBJECT_CHECK(SpaprVioVlan, (obj), TYPE_VIO_SPAPR_VLAN_DEVICE) +DECLARE_INSTANCE_CHECKER(SpaprVioVlan, VIO_SPAPR_VLAN_DEVICE, + TYPE_VIO_SPAPR_VLAN_DEVICE) =20 #define RX_POOL_MAX_BDS 4096 #define RX_MAX_POOLS 5 diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index 786dc9a6c6..9f13afa4e4 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -52,8 +52,8 @@ do { fprintf(stderr, "stellaris_enet: error: " fmt , ## _= _VA_ARGS__);} while (0) =20 #define TYPE_STELLARIS_ENET "stellaris_enet" typedef struct stellaris_enet_state stellaris_enet_state; -#define STELLARIS_ENET(obj) \ - OBJECT_CHECK(stellaris_enet_state, (obj), TYPE_STELLARIS_ENET) +DECLARE_INSTANCE_CHECKER(stellaris_enet_state, STELLARIS_ENET, + TYPE_STELLARIS_ENET) =20 typedef struct { uint8_t data[2048]; diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 103a4e19d9..91753830a7 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -24,7 +24,8 @@ #define TYPE_SUNGEM "sungem" =20 typedef struct SunGEMState SunGEMState; -#define SUNGEM(obj) OBJECT_CHECK(SunGEMState, (obj), TYPE_SUNGEM) +DECLARE_INSTANCE_CHECKER(SunGEMState, SUNGEM, + TYPE_SUNGEM) =20 #define MAX_PACKET_SIZE 9016 =20 diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 43fb8da97c..7364ba1019 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -131,7 +131,8 @@ =20 #define TYPE_SUNHME "sunhme" typedef struct SunHMEState SunHMEState; -#define SUNHME(obj) OBJECT_CHECK(SunHMEState, (obj), TYPE_SUNHME) +DECLARE_INSTANCE_CHECKER(SunHMEState, SUNHME, + TYPE_SUNHME) =20 /* Maximum size of buffer */ #define HME_FIFO_SIZE 0x800 diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index ca3dddad92..eff299f629 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -135,10 +135,8 @@ struct VMXNET3Class { }; typedef struct VMXNET3Class VMXNET3Class; =20 -#define VMXNET3_DEVICE_CLASS(klass) \ - OBJECT_CLASS_CHECK(VMXNET3Class, (klass), TYPE_VMXNET3) -#define VMXNET3_DEVICE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VMXNET3Class, (obj), TYPE_VMXNET3) +DECLARE_CLASS_CHECKERS(VMXNET3Class, VMXNET3_DEVICE, + TYPE_VMXNET3) =20 static inline void vmxnet3_ring_init(PCIDevice *d, Vmxnet3Ring *ring, diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index 10eebebe52..a066550023 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -141,7 +141,8 @@ typedef struct RxTxStats { =20 #define TYPE_XGMAC "xgmac" typedef struct XgmacState XgmacState; -#define XGMAC(obj) OBJECT_CHECK(XgmacState, (obj), TYPE_XGMAC) +DECLARE_INSTANCE_CHECKER(XgmacState, XGMAC, + TYPE_XGMAC) =20 struct XgmacState { SysBusDevice parent_obj; diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 18f28a386e..10a33cb4a5 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -44,17 +44,15 @@ #define TYPE_XILINX_AXI_ENET_CONTROL_STREAM "xilinx-axienet-control-stream" =20 typedef struct XilinxAXIEnet XilinxAXIEnet; -#define XILINX_AXI_ENET(obj) \ - OBJECT_CHECK(XilinxAXIEnet, (obj), TYPE_XILINX_AXI_ENET) +DECLARE_INSTANCE_CHECKER(XilinxAXIEnet, XILINX_AXI_ENET, + TYPE_XILINX_AXI_ENET) =20 typedef struct XilinxAXIEnetStreamSlave XilinxAXIEnetStreamSlave; -#define XILINX_AXI_ENET_DATA_STREAM(obj) \ - OBJECT_CHECK(XilinxAXIEnetStreamSlave, (obj),\ - TYPE_XILINX_AXI_ENET_DATA_STREAM) +DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSlave, XILINX_AXI_ENET_DATA_ST= REAM, + TYPE_XILINX_AXI_ENET_DATA_STREAM) =20 -#define XILINX_AXI_ENET_CONTROL_STREAM(obj) \ - OBJECT_CHECK(XilinxAXIEnetStreamSlave, (obj),\ - TYPE_XILINX_AXI_ENET_CONTROL_STREAM) +DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSlave, XILINX_AXI_ENET_CONTROL= _STREAM, + TYPE_XILINX_AXI_ENET_CONTROL_STREAM) =20 /* Advertisement control register. */ #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index adf477960e..6e09f7e422 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -53,8 +53,8 @@ #define CTRL_S 0x1 =20 #define TYPE_XILINX_ETHLITE "xlnx.xps-ethernetlite" -#define XILINX_ETHLITE(obj) \ - OBJECT_CHECK(struct xlx_ethlite, (obj), TYPE_XILINX_ETHLITE) +DECLARE_INSTANCE_CHECKER(struct xlx_ethlite, XILINX_ETHLITE, + TYPE_XILINX_ETHLITE) =20 struct xlx_ethlite { diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c index 99e27e9174..44fb7a94d3 100644 --- a/hw/nvram/ds1225y.c +++ b/hw/nvram/ds1225y.c @@ -111,7 +111,8 @@ static const VMStateDescription vmstate_nvram =3D { =20 #define TYPE_DS1225Y "ds1225y" typedef struct SysBusNvRamState SysBusNvRamState; -#define DS1225Y(obj) OBJECT_CHECK(SysBusNvRamState, (obj), TYPE_DS1225Y) +DECLARE_INSTANCE_CHECKER(SysBusNvRamState, DS1225Y, + TYPE_DS1225Y) =20 struct SysBusNvRamState { SysBusDevice parent_obj; diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c index 4bf7519bc7..3e93dbbffb 100644 --- a/hw/nvram/eeprom_at24c.c +++ b/hw/nvram/eeprom_at24c.c @@ -29,7 +29,8 @@ =20 #define TYPE_AT24C_EE "at24c-eeprom" typedef struct EEPROMState EEPROMState; -#define AT24C_EE(obj) OBJECT_CHECK(EEPROMState, (obj), TYPE_AT24C_EE) +DECLARE_INSTANCE_CHECKER(EEPROMState, AT24C_EE, + TYPE_AT24C_EE) =20 struct EEPROMState { I2CSlave parent_obj; diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index b9218e0b89..57ccc174f2 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -51,8 +51,8 @@ struct SpaprNvram { typedef struct SpaprNvram SpaprNvram; =20 #define TYPE_VIO_SPAPR_NVRAM "spapr-nvram" -#define VIO_SPAPR_NVRAM(obj) \ - OBJECT_CHECK(SpaprNvram, (obj), TYPE_VIO_SPAPR_NVRAM) +DECLARE_INSTANCE_CHECKER(SpaprNvram, VIO_SPAPR_NVRAM, + TYPE_VIO_SPAPR_NVRAM) =20 #define MIN_NVRAM_SIZE (8 * KiB) #define DEFAULT_NVRAM_SIZE (64 * KiB) diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c index b35866d8d1..e88998d88c 100644 --- a/hw/pci-bridge/dec.c +++ b/hw/pci-bridge/dec.c @@ -35,7 +35,8 @@ #include "qom/object.h" =20 typedef struct DECState DECState; -#define DEC_21154(obj) OBJECT_CHECK(DECState, (obj), TYPE_DEC_21154) +DECLARE_INSTANCE_CHECKER(DECState, DEC_21154, + TYPE_DEC_21154) =20 struct DECState { PCIHostState parent_obj; diff --git a/hw/pci-bridge/gen_pcie_root_port.c b/hw/pci-bridge/gen_pcie_ro= ot_port.c index b62e20a648..67c71d566b 100644 --- a/hw/pci-bridge/gen_pcie_root_port.c +++ b/hw/pci-bridge/gen_pcie_root_port.c @@ -21,8 +21,8 @@ =20 #define TYPE_GEN_PCIE_ROOT_PORT "pcie-root-port" typedef struct GenPCIERootPort GenPCIERootPort; -#define GEN_PCIE_ROOT_PORT(obj) \ - OBJECT_CHECK(GenPCIERootPort, (obj), TYPE_GEN_PCIE_ROOT_PORT) +DECLARE_INSTANCE_CHECKER(GenPCIERootPort, GEN_PCIE_ROOT_PORT, + TYPE_GEN_PCIE_ROOT_PORT) =20 #define GEN_PCIE_ROOT_PORT_AER_OFFSET 0x100 #define GEN_PCIE_ROOT_PORT_ACS_OFFSET \ diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index bd1b10c848..b86d76caf3 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -36,8 +36,8 @@ #define TYPE_PCI_BRIDGE_DEV "pci-bridge" #define TYPE_PCI_BRIDGE_SEAT_DEV "pci-bridge-seat" typedef struct PCIBridgeDev PCIBridgeDev; -#define PCI_BRIDGE_DEV(obj) \ - OBJECT_CHECK(PCIBridgeDev, (obj), TYPE_PCI_BRIDGE_DEV) +DECLARE_INSTANCE_CHECKER(PCIBridgeDev, PCI_BRIDGE_DEV, + TYPE_PCI_BRIDGE_DEV) =20 struct PCIBridgeDev { /*< private >*/ diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 4a31ee3748..aedded1064 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -26,10 +26,12 @@ =20 #define TYPE_PXB_BUS "pxb-bus" typedef struct PXBBus PXBBus; -#define PXB_BUS(obj) OBJECT_CHECK(PXBBus, (obj), TYPE_PXB_BUS) +DECLARE_INSTANCE_CHECKER(PXBBus, PXB_BUS, + TYPE_PXB_BUS) =20 #define TYPE_PXB_PCIE_BUS "pxb-pcie-bus" -#define PXB_PCIE_BUS(obj) OBJECT_CHECK(PXBBus, (obj), TYPE_PXB_PCIE_BUS) +DECLARE_INSTANCE_CHECKER(PXBBus, PXB_PCIE_BUS, + TYPE_PXB_PCIE_BUS) =20 struct PXBBus { /*< private >*/ @@ -41,10 +43,12 @@ struct PXBBus { =20 #define TYPE_PXB_DEVICE "pxb" typedef struct PXBDev PXBDev; -#define PXB_DEV(obj) OBJECT_CHECK(PXBDev, (obj), TYPE_PXB_DEVICE) +DECLARE_INSTANCE_CHECKER(PXBDev, PXB_DEV, + TYPE_PXB_DEVICE) =20 #define TYPE_PXB_PCIE_DEVICE "pxb-pcie" -#define PXB_PCIE_DEV(obj) OBJECT_CHECK(PXBDev, (obj), TYPE_PXB_PCIE_DEVICE) +DECLARE_INSTANCE_CHECKER(PXBDev, PXB_PCIE_DEV, + TYPE_PXB_PCIE_DEVICE) =20 struct PXBDev { /*< private >*/ diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridg= e.c index 1178cd8620..abc98f8cd9 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -30,8 +30,8 @@ struct PCIEPCIBridge { typedef struct PCIEPCIBridge PCIEPCIBridge; =20 #define TYPE_PCIE_PCI_BRIDGE_DEV "pcie-pci-bridge" -#define PCIE_PCI_BRIDGE_DEV(obj) \ - OBJECT_CHECK(PCIEPCIBridge, (obj), TYPE_PCIE_PCI_BRIDGE_DEV) +DECLARE_INSTANCE_CHECKER(PCIEPCIBridge, PCIE_PCI_BRIDGE_DEV, + TYPE_PCIE_PCI_BRIDGE_DEV) =20 static void pcie_pci_bridge_realize(PCIDevice *d, Error **errp) { diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 3b37f4f542..d10fbd39d3 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -240,12 +240,12 @@ struct BonitoState { }; =20 #define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" -#define BONITO_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(BonitoState, (obj), TYPE_BONITO_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(BonitoState, BONITO_PCI_HOST_BRIDGE, + TYPE_BONITO_PCI_HOST_BRIDGE) =20 #define TYPE_PCI_BONITO "Bonito" -#define PCI_BONITO(obj) \ - OBJECT_CHECK(PCIBonitoState, (obj), TYPE_PCI_BONITO) +DECLARE_INSTANCE_CHECKER(PCIBonitoState, PCI_BONITO, + TYPE_PCI_BONITO) =20 static void bonito_writel(void *opaque, hwaddr addr, uint64_t val, unsigned size) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 48a16269ad..fd7d6dcc06 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -36,8 +36,8 @@ #include "qom/object.h" =20 typedef struct GrackleState GrackleState; -#define GRACKLE_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(GrackleState, (obj), TYPE_GRACKLE_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(GrackleState, GRACKLE_PCI_HOST_BRIDGE, + TYPE_GRACKLE_PCI_HOST_BRIDGE) =20 struct GrackleState { PCIHostState parent_obj; diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index ead7b7ef1c..93c62235ca 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -43,8 +43,8 @@ */ =20 typedef struct I440FXState I440FXState; -#define I440FX_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(I440FXState, I440FX_PCI_HOST_BRIDGE, + TYPE_I440FX_PCI_HOST_BRIDGE) =20 struct I440FXState { PCIHostState parent_obj; diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 180a91a846..a7f9685005 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -878,8 +878,8 @@ static IOMMUTLBEntry pnv_phb3_translate_iommu(IOMMUMemo= ryRegion *iommu, } =20 #define TYPE_PNV_PHB3_IOMMU_MEMORY_REGION "pnv-phb3-iommu-memory-region" -#define PNV_PHB3_IOMMU_MEMORY_REGION(obj) \ - OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_PNV_PHB3_IOMMU_MEMORY_REGI= ON) +DECLARE_INSTANCE_CHECKER(IOMMUMemoryRegion, PNV_PHB3_IOMMU_MEMORY_REGION, + TYPE_PNV_PHB3_IOMMU_MEMORY_REGION) =20 static void pnv_phb3_iommu_memory_region_class_init(ObjectClass *klass, void *data) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index ec85de5c74..03daf40a23 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1043,8 +1043,8 @@ static IOMMUTLBEntry pnv_phb4_translate_iommu(IOMMUMe= moryRegion *iommu, } =20 #define TYPE_PNV_PHB4_IOMMU_MEMORY_REGION "pnv-phb4-iommu-memory-region" -#define PNV_PHB4_IOMMU_MEMORY_REGION(obj) \ - OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_PNV_PHB4_IOMMU_MEMORY_REGI= ON) +DECLARE_INSTANCE_CHECKER(IOMMUMemoryRegion, PNV_PHB4_IOMMU_MEMORY_REGION, + TYPE_PNV_PHB4_IOMMU_MEMORY_REGION) =20 static void pnv_phb4_iommu_memory_region_class_init(ObjectClass *klass, void *data) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index b29e2be9ae..f376374e24 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -93,8 +93,8 @@ struct pci_inbound { #define TYPE_PPC_E500_PCI_HOST_BRIDGE "e500-pcihost" =20 typedef struct PPCE500PCIState PPCE500PCIState; -#define PPC_E500_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(PPCE500PCIState, (obj), TYPE_PPC_E500_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(PPCE500PCIState, PPC_E500_PCI_HOST_BRIDGE, + TYPE_PPC_E500_PCI_HOST_BRIDGE) =20 struct PPCE500PCIState { PCIHostState parent_obj; @@ -117,8 +117,8 @@ struct PPCE500PCIState { =20 #define TYPE_PPC_E500_PCI_BRIDGE "e500-host-bridge" typedef struct PPCE500PCIBridgeState PPCE500PCIBridgeState; -#define PPC_E500_PCI_BRIDGE(obj) \ - OBJECT_CHECK(PPCE500PCIBridgeState, (obj), TYPE_PPC_E500_PCI_BRIDGE) +DECLARE_INSTANCE_CHECKER(PPCE500PCIBridgeState, PPC_E500_PCI_BRIDGE, + TYPE_PPC_E500_PCI_BRIDGE) =20 struct PPCE500PCIBridgeState { /*< private >*/ diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index af0c2eb941..b234fd7c8a 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -44,8 +44,8 @@ #define TYPE_RAVEN_PCI_HOST_BRIDGE "raven-pcihost" =20 typedef struct RavenPCIState RavenPCIState; -#define RAVEN_PCI_DEVICE(obj) \ - OBJECT_CHECK(RavenPCIState, (obj), TYPE_RAVEN_PCI_DEVICE) +DECLARE_INSTANCE_CHECKER(RavenPCIState, RAVEN_PCI_DEVICE, + TYPE_RAVEN_PCI_DEVICE) =20 struct RavenPCIState { PCIDevice dev; @@ -56,8 +56,8 @@ struct RavenPCIState { }; =20 typedef struct PRePPCIState PREPPCIState; -#define RAVEN_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(PREPPCIState, (obj), TYPE_RAVEN_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(PREPPCIState, RAVEN_PCI_HOST_BRIDGE, + TYPE_RAVEN_PCI_HOST_BRIDGE) =20 struct PRePPCIState { PCIHostState parent_obj; diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index e0d00baf94..3553277f94 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -158,12 +158,12 @@ static const VMStateDescription pci_vpb_vmstate =3D { }; =20 #define TYPE_VERSATILE_PCI "versatile_pci" -#define PCI_VPB(obj) \ - OBJECT_CHECK(PCIVPBState, (obj), TYPE_VERSATILE_PCI) +DECLARE_INSTANCE_CHECKER(PCIVPBState, PCI_VPB, + TYPE_VERSATILE_PCI) =20 #define TYPE_VERSATILE_PCI_HOST "versatile_pci_host" -#define PCI_VPB_HOST(obj) \ - OBJECT_CHECK(PCIDevice, (obj), TYPE_VERSATILE_PCI_HOST) +DECLARE_INSTANCE_CHECKER(PCIDevice, PCI_VPB_HOST, + TYPE_VERSATILE_PCI_HOST) =20 typedef enum { PCI_IMAP0 =3D 0x0, diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index f74bcdca16..b76b5e4701 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -56,7 +56,8 @@ =20 #define TYPE_MPC8544_GUTS "mpc8544-guts" typedef struct GutsState GutsState; -#define MPC8544_GUTS(obj) OBJECT_CHECK(GutsState, (obj), TYPE_MPC8544_GUTS) +DECLARE_INSTANCE_CHECKER(GutsState, MPC8544_GUTS, + TYPE_MPC8544_GUTS) =20 struct GutsState { /*< private >*/ diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index f82d520d25..a564fcd600 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -47,8 +47,8 @@ struct PLBInMap { =20 #define TYPE_PPC440_PCIX_HOST_BRIDGE "ppc440-pcix-host" typedef struct PPC440PCIXState PPC440PCIXState; -#define PPC440_PCIX_HOST_BRIDGE(obj) \ - OBJECT_CHECK(PPC440PCIXState, (obj), TYPE_PPC440_PCIX_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(PPC440PCIXState, PPC440_PCIX_HOST_BRIDGE, + TYPE_PPC440_PCIX_HOST_BRIDGE) =20 #define PPC440_PCIX_NR_POMS 3 #define PPC440_PCIX_NR_PIMS 3 diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 73cb93a3a5..d9ca6bba9b 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1034,8 +1034,8 @@ void ppc4xx_dma_init(CPUPPCState *env, int dcr_base) =20 #define TYPE_PPC460EX_PCIE_HOST "ppc460ex-pcie-host" typedef struct PPC460EXPCIEState PPC460EXPCIEState; -#define PPC460EX_PCIE_HOST(obj) \ - OBJECT_CHECK(PPC460EXPCIEState, (obj), TYPE_PPC460EX_PCIE_HOST) +DECLARE_INSTANCE_CHECKER(PPC460EXPCIEState, PPC460EX_PCIE_HOST, + TYPE_PPC460EX_PCIE_HOST) =20 struct PPC460EXPCIEState { PCIExpressHost host; diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 77ec675960..5303685dc5 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -45,8 +45,8 @@ struct PCITargetMap { }; =20 typedef struct PPC4xxPCIState PPC4xxPCIState; -#define PPC4xx_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(PPC4xxPCIState, (obj), TYPE_PPC4xx_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(PPC4xxPCIState, PPC4xx_PCI_HOST_BRIDGE, + TYPE_PPC4xx_PCI_HOST_BRIDGE) =20 #define PPC4xx_PCI_NR_PMMS 3 #define PPC4xx_PCI_NR_PTMS 2 diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c index b1b6d559c4..cd8000ad73 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -48,7 +48,8 @@ typedef struct spin_info { =20 #define TYPE_E500_SPIN "e500-spin" typedef struct SpinState SpinState; -#define E500_SPIN(obj) OBJECT_CHECK(SpinState, (obj), TYPE_E500_SPIN) +DECLARE_INSTANCE_CHECKER(SpinState, E500_SPIN, + TYPE_E500_SPIN) =20 struct SpinState { SysBusDevice parent_obj; diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index d13044acce..d1e2fb3f8b 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -37,8 +37,8 @@ =20 #define TYPE_PREP_SYSTEMIO "prep-systemio" typedef struct PrepSystemIoState PrepSystemIoState; -#define PREP_SYSTEMIO(obj) \ - OBJECT_CHECK(PrepSystemIoState, (obj), TYPE_PREP_SYSTEMIO) +DECLARE_INSTANCE_CHECKER(PrepSystemIoState, PREP_SYSTEMIO, + TYPE_PREP_SYSTEMIO) =20 /* Bit as defined in PowerPC Reference Plaform v1.1, sect. 6.1.5, p. 132 */ #define PREP_BIT(n) (1 << (7 - (n))) diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index ec25a701dc..56e96010b8 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -30,8 +30,8 @@ =20 #define TYPE_RS6000MC "rs6000-mc" typedef struct RS6000MCState RS6000MCState; -#define RS6000MC_DEVICE(obj) \ - OBJECT_CHECK(RS6000MCState, (obj), TYPE_RS6000MC) +DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC_DEVICE, + TYPE_RS6000MC) =20 struct RS6000MCState { ISADevice parent_obj; diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index b400438394..6c99633faa 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -31,8 +31,8 @@ #include "qom/object.h" =20 typedef struct SpaprRngState SpaprRngState; -#define SPAPR_RNG(obj) \ - OBJECT_CHECK(SpaprRngState, (obj), TYPE_SPAPR_RNG) +DECLARE_INSTANCE_CHECKER(SpaprRngState, SPAPR_RNG, + TYPE_SPAPR_RNG) =20 struct SpaprRngState { /*< private >*/ diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c index 8b2b7973d8..10fac3d9c9 100644 --- a/hw/rtc/ds1338.c +++ b/hw/rtc/ds1338.c @@ -31,7 +31,8 @@ =20 #define TYPE_DS1338 "ds1338" typedef struct DS1338State DS1338State; -#define DS1338(obj) OBJECT_CHECK(DS1338State, (obj), TYPE_DS1338) +DECLARE_INSTANCE_CHECKER(DS1338State, DS1338, + TYPE_DS1338) =20 struct DS1338State { I2CSlave parent_obj; diff --git a/hw/rtc/exynos4210_rtc.c b/hw/rtc/exynos4210_rtc.c index a95f07ef0b..f8a4fe8a47 100644 --- a/hw/rtc/exynos4210_rtc.c +++ b/hw/rtc/exynos4210_rtc.c @@ -86,8 +86,8 @@ =20 #define TYPE_EXYNOS4210_RTC "exynos4210.rtc" typedef struct Exynos4210RTCState Exynos4210RTCState; -#define EXYNOS4210_RTC(obj) \ - OBJECT_CHECK(Exynos4210RTCState, (obj), TYPE_EXYNOS4210_RTC) +DECLARE_INSTANCE_CHECKER(Exynos4210RTCState, EXYNOS4210_RTC, + TYPE_EXYNOS4210_RTC) =20 struct Exynos4210RTCState { SysBusDevice parent_obj; diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c index 31445e9691..0b7048c3f4 100644 --- a/hw/rtc/m41t80.c +++ b/hw/rtc/m41t80.c @@ -18,7 +18,8 @@ =20 #define TYPE_M41T80 "m41t80" typedef struct M41t80State M41t80State; -#define M41T80(obj) OBJECT_CHECK(M41t80State, (obj), TYPE_M41T80) +DECLARE_INSTANCE_CHECKER(M41t80State, M41T80, + TYPE_M41T80) =20 struct M41t80State { I2CSlave parent_obj; diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index dc608e0b02..cae315e488 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -35,12 +35,8 @@ #define TYPE_M48TXX_ISA "isa-m48txx" typedef struct M48txxISADeviceClass M48txxISADeviceClass; typedef struct M48txxISAState M48txxISAState; -#define M48TXX_ISA_GET_CLASS(obj) \ - OBJECT_GET_CLASS(M48txxISADeviceClass, (obj), TYPE_M48TXX_ISA) -#define M48TXX_ISA_CLASS(klass) \ - OBJECT_CLASS_CHECK(M48txxISADeviceClass, (klass), TYPE_M48TXX_ISA) -#define M48TXX_ISA(obj) \ - OBJECT_CHECK(M48txxISAState, (obj), TYPE_M48TXX_ISA) +DECLARE_OBJ_CHECKERS(M48txxISAState, M48txxISADeviceClass, + M48TXX_ISA, TYPE_M48TXX_ISA) =20 struct M48txxISAState { ISADevice parent_obj; diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index 9f5a96af82..6525206976 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -45,12 +45,8 @@ #define TYPE_M48TXX_SYS_BUS "sysbus-m48txx" typedef struct M48txxSysBusDeviceClass M48txxSysBusDeviceClass; typedef struct M48txxSysBusState M48txxSysBusState; -#define M48TXX_SYS_BUS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(M48txxSysBusDeviceClass, (obj), TYPE_M48TXX_SYS_BUS) -#define M48TXX_SYS_BUS_CLASS(klass) \ - OBJECT_CLASS_CHECK(M48txxSysBusDeviceClass, (klass), TYPE_M48TXX_SYS_B= US) -#define M48TXX_SYS_BUS(obj) \ - OBJECT_CHECK(M48txxSysBusState, (obj), TYPE_M48TXX_SYS_BUS) +DECLARE_OBJ_CHECKERS(M48txxSysBusState, M48txxSysBusDeviceClass, + M48TXX_SYS_BUS, TYPE_M48TXX_SYS_BUS) =20 /* * Chipset docs: diff --git a/hw/rtc/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c index b5ebefd1b2..18979d25d0 100644 --- a/hw/rtc/sun4v-rtc.c +++ b/hw/rtc/sun4v-rtc.c @@ -21,7 +21,8 @@ =20 #define TYPE_SUN4V_RTC "sun4v_rtc" typedef struct Sun4vRtc Sun4vRtc; -#define SUN4V_RTC(obj) OBJECT_CHECK(Sun4vRtc, (obj), TYPE_SUN4V_RTC) +DECLARE_INSTANCE_CHECKER(Sun4vRtc, SUN4V_RTC, + TYPE_SUN4V_RTC) =20 struct Sun4vRtc { SysBusDevice parent_obj; diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c index d46f21430c..4f83eff5c3 100644 --- a/hw/rtc/twl92230.c +++ b/hw/rtc/twl92230.c @@ -35,7 +35,8 @@ =20 #define TYPE_TWL92230 "twl92230" typedef struct MenelausState MenelausState; -#define TWL92230(obj) OBJECT_CHECK(MenelausState, (obj), TYPE_TWL92230) +DECLARE_INSTANCE_CHECKER(MenelausState, TWL92230, + TYPE_TWL92230) =20 struct MenelausState { I2CSlave parent_obj; diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index ed7f695c2a..417ec0564b 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -54,13 +54,9 @@ typedef struct RxGdbSimMachineState RxGdbSimMachineState; =20 #define TYPE_RX_GDBSIM_MACHINE MACHINE_TYPE_NAME("rx62n-common") =20 -#define RX_GDBSIM_MACHINE(obj) \ - OBJECT_CHECK(RxGdbSimMachineState, (obj), TYPE_RX_GDBSIM_MACHINE) +DECLARE_OBJ_CHECKERS(RxGdbSimMachineState, RxGdbSimMachineClass, + RX_GDBSIM_MACHINE, TYPE_RX_GDBSIM_MACHINE) =20 -#define RX_GDBSIM_MACHINE_CLASS(klass) \ - OBJECT_CLASS_CHECK(RxGdbSimMachineClass, (klass), TYPE_RX_GDBSIM_MACHI= NE) -#define RX_GDBSIM_MACHINE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RxGdbSimMachineClass, (obj), TYPE_RX_GDBSIM_MACHINE) =20 static void rx_load_image(RXCPU *cpu, const char *filename, uint32_t start, uint32_t size) diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index d2935c5429..6eb4eea700 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -72,10 +72,8 @@ struct RX62NClass { }; typedef struct RX62NClass RX62NClass; =20 -#define RX62N_MCU_CLASS(klass) \ - OBJECT_CLASS_CHECK(RX62NClass, (klass), TYPE_RX62N_MCU) -#define RX62N_MCU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(RX62NClass, (obj), TYPE_RX62N_MCU) +DECLARE_CLASS_CHECKERS(RX62NClass, RX62N_MCU, + TYPE_RX62N_MCU) =20 /* * IRQ -> IPR mapping table diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 544f5f19b3..2ce96dc56e 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -38,8 +38,8 @@ #define TYPE_AM53C974_DEVICE "am53c974" =20 typedef struct PCIESPState PCIESPState; -#define PCI_ESP(obj) \ - OBJECT_CHECK(PCIESPState, (obj), TYPE_AM53C974_DEVICE) +DECLARE_INSTANCE_CHECKER(PCIESPState, PCI_ESP, + TYPE_AM53C974_DEVICE) =20 #define DMA_CMD 0x0 #define DMA_STC 0x1 @@ -417,8 +417,8 @@ struct DC390State { typedef struct DC390State DC390State; =20 #define TYPE_DC390_DEVICE "dc390" -#define DC390(obj) \ - OBJECT_CHECK(DC390State, obj, TYPE_DC390_DEVICE) +DECLARE_INSTANCE_CHECKER(DC390State, DC390, + TYPE_DC390_DEVICE) =20 #define EE_ADAPT_SCSI_ID 64 #define EE_MODE2 65 diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 0e40587c18..e8354a47da 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -310,8 +310,8 @@ typedef struct LSIState LSIState; #define TYPE_LSI53C810 "lsi53c810" #define TYPE_LSI53C895A "lsi53c895a" =20 -#define LSI53C895A(obj) \ - OBJECT_CHECK(LSIState, (obj), TYPE_LSI53C895A) +DECLARE_INSTANCE_CHECKER(LSIState, LSI53C895A, + TYPE_LSI53C895A) =20 static const char *scsi_phases[] =3D { "DOUT", diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index aab0b36598..e90c00823a 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -134,13 +134,9 @@ typedef struct MegasasBaseClass MegasasBaseClass; #define TYPE_MEGASAS_GEN1 "megasas" #define TYPE_MEGASAS_GEN2 "megasas-gen2" =20 -#define MEGASAS(obj) \ - OBJECT_CHECK(MegasasState, (obj), TYPE_MEGASAS_BASE) +DECLARE_OBJ_CHECKERS(MegasasState, MegasasBaseClass, + MEGASAS, TYPE_MEGASAS_BASE) =20 -#define MEGASAS_CLASS(oc) \ - OBJECT_CLASS_CHECK(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE) -#define MEGASAS_GET_CLASS(oc) \ - OBJECT_GET_CLASS(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE) =20 #define MEGASAS_INTR_DISABLED_MASK 0xFFFFFFFF =20 diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index ea66422c2b..1f0388a755 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -57,12 +57,8 @@ =20 typedef struct SCSIDiskClass SCSIDiskClass; typedef struct SCSIDiskState SCSIDiskState; -#define SCSI_DISK_BASE(obj) \ - OBJECT_CHECK(SCSIDiskState, (obj), TYPE_SCSI_DISK_BASE) -#define SCSI_DISK_BASE_CLASS(klass) \ - OBJECT_CLASS_CHECK(SCSIDiskClass, (klass), TYPE_SCSI_DISK_BASE) -#define SCSI_DISK_BASE_GET_CLASS(obj) \ - OBJECT_GET_CLASS(SCSIDiskClass, (obj), TYPE_SCSI_DISK_BASE) +DECLARE_OBJ_CHECKERS(SCSIDiskState, SCSIDiskClass, + SCSI_DISK_BASE, TYPE_SCSI_DISK_BASE) =20 struct SCSIDiskClass { SCSIDeviceClass parent_class; diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index b6ab78d08a..e7e95cb701 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -92,8 +92,8 @@ typedef struct vscsi_req { =20 #define TYPE_VIO_SPAPR_VSCSI_DEVICE "spapr-vscsi" typedef struct VSCSIState VSCSIState; -#define VIO_SPAPR_VSCSI_DEVICE(obj) \ - OBJECT_CHECK(VSCSIState, (obj), TYPE_VIO_SPAPR_VSCSI_DEVICE) +DECLARE_INSTANCE_CHECKER(VSCSIState, VIO_SPAPR_VSCSI_DEVICE, + TYPE_VIO_SPAPR_VSCSI_DEVICE) =20 struct VSCSIState { SpaprVioDevice vdev; diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index aa0d57b970..40095bed09 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -65,12 +65,9 @@ typedef struct PVSCSIClass PVSCSIClass; =20 #define TYPE_PVSCSI "pvscsi" typedef struct PVSCSIState PVSCSIState; -#define PVSCSI(obj) OBJECT_CHECK(PVSCSIState, (obj), TYPE_PVSCSI) +DECLARE_OBJ_CHECKERS(PVSCSIState, PVSCSIClass, + PVSCSI, TYPE_PVSCSI) =20 -#define PVSCSI_CLASS(klass) \ - OBJECT_CLASS_CHECK(PVSCSIClass, (klass), TYPE_PVSCSI) -#define PVSCSI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PVSCSIClass, (obj), TYPE_PVSCSI) =20 /* Compatibility flags for migration */ #define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT 0 diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index 0da5b84398..4d3ec28f5d 100644 --- a/hw/sd/milkymist-memcard.c +++ b/hw/sd/milkymist-memcard.c @@ -65,8 +65,8 @@ enum { =20 #define TYPE_MILKYMIST_MEMCARD "milkymist-memcard" typedef struct MilkymistMemcardState MilkymistMemcardState; -#define MILKYMIST_MEMCARD(obj) \ - OBJECT_CHECK(MilkymistMemcardState, (obj), TYPE_MILKYMIST_MEMCARD) +DECLARE_INSTANCE_CHECKER(MilkymistMemcardState, MILKYMIST_MEMCARD, + TYPE_MILKYMIST_MEMCARD) =20 #define TYPE_MILKYMIST_SDBUS "milkymist-sdbus" =20 diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index cb2ef0fb39..7829e933a5 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -24,7 +24,8 @@ =20 #define TYPE_PL181 "pl181" typedef struct PL181State PL181State; -#define PL181(obj) OBJECT_CHECK(PL181State, (obj), TYPE_PL181) +DECLARE_INSTANCE_CHECKER(PL181State, PL181, + TYPE_PL181) =20 #define TYPE_PL181_BUS "pl181-bus" =20 diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index 517c17a2c4..dd07258d4e 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -55,7 +55,8 @@ struct ssi_sd_state { typedef struct ssi_sd_state ssi_sd_state; =20 #define TYPE_SSI_SD "ssi-sd" -#define SSI_SD(obj) OBJECT_CHECK(ssi_sd_state, (obj), TYPE_SSI_SD) +DECLARE_INSTANCE_CHECKER(ssi_sd_state, SSI_SD, + TYPE_SSI_SD) =20 /* State word bits. */ #define SSI_SDR_LOCKED 0x0001 diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c index 378d44b946..dc73845125 100644 --- a/hw/sh4/sh_pci.c +++ b/hw/sh4/sh_pci.c @@ -36,8 +36,8 @@ #define TYPE_SH_PCI_HOST_BRIDGE "sh_pci" =20 typedef struct SHPCIState SHPCIState; -#define SH_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(SHPCIState, (obj), TYPE_SH_PCI_HOST_BRIDGE) +DECLARE_INSTANCE_CHECKER(SHPCIState, SH_PCI_HOST_BRIDGE, + TYPE_SH_PCI_HOST_BRIDGE) =20 struct SHPCIState { PCIHostState parent_obj; diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 5772e2f336..5ed922d436 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -593,8 +593,8 @@ static void idreg_init(hwaddr addr) } =20 typedef struct IDRegState IDRegState; -#define MACIO_ID_REGISTER(obj) \ - OBJECT_CHECK(IDRegState, (obj), TYPE_MACIO_ID_REGISTER) +DECLARE_INSTANCE_CHECKER(IDRegState, MACIO_ID_REGISTER, + TYPE_MACIO_ID_REGISTER) =20 struct IDRegState { SysBusDevice parent_obj; @@ -636,7 +636,8 @@ static const TypeInfo idreg_info =3D { =20 #define TYPE_TCX_AFX "tcx_afx" typedef struct AFXState AFXState; -#define TCX_AFX(obj) OBJECT_CHECK(AFXState, (obj), TYPE_TCX_AFX) +DECLARE_INSTANCE_CHECKER(AFXState, TCX_AFX, + TYPE_TCX_AFX) =20 struct AFXState { SysBusDevice parent_obj; @@ -690,7 +691,8 @@ static const TypeInfo afx_info =3D { =20 #define TYPE_OPENPROM "openprom" typedef struct PROMState PROMState; -#define OPENPROM(obj) OBJECT_CHECK(PROMState, (obj), TYPE_OPENPROM) +DECLARE_INSTANCE_CHECKER(PROMState, OPENPROM, + TYPE_OPENPROM) =20 struct PROMState { SysBusDevice parent_obj; @@ -779,7 +781,8 @@ static const TypeInfo prom_info =3D { =20 #define TYPE_SUN4M_MEMORY "memory" typedef struct RamDevice RamDevice; -#define SUN4M_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4M_MEMORY) +DECLARE_INSTANCE_CHECKER(RamDevice, SUN4M_RAM, + TYPE_SUN4M_MEMORY) =20 struct RamDevice { SysBusDevice parent_obj; diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 7aab59dea9..67985414e2 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -93,7 +93,8 @@ struct EbusState { typedef struct EbusState EbusState; =20 #define TYPE_EBUS "ebus" -#define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS) +DECLARE_INSTANCE_CHECKER(EbusState, EBUS, + TYPE_EBUS) =20 const char *fw_cfg_arch_key_name(uint16_t key) { @@ -229,7 +230,8 @@ typedef struct ResetData { =20 #define TYPE_SUN4U_POWER "power" typedef struct PowerDevice PowerDevice; -#define SUN4U_POWER(obj) OBJECT_CHECK(PowerDevice, (obj), TYPE_SUN4U_POWER) +DECLARE_INSTANCE_CHECKER(PowerDevice, SUN4U_POWER, + TYPE_SUN4U_POWER) =20 struct PowerDevice { SysBusDevice parent_obj; @@ -403,7 +405,8 @@ static const TypeInfo ebus_info =3D { =20 #define TYPE_OPENPROM "openprom" typedef struct PROMState PROMState; -#define OPENPROM(obj) OBJECT_CHECK(PROMState, (obj), TYPE_OPENPROM) +DECLARE_INSTANCE_CHECKER(PROMState, OPENPROM, + TYPE_OPENPROM) =20 struct PROMState { SysBusDevice parent_obj; @@ -492,7 +495,8 @@ static const TypeInfo prom_info =3D { =20 #define TYPE_SUN4U_MEMORY "memory" typedef struct RamDevice RamDevice; -#define SUN4U_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4U_MEMORY) +DECLARE_INSTANCE_CHECKER(RamDevice, SUN4U_RAM, + TYPE_SUN4U_MEMORY) =20 struct RamDevice { SysBusDevice parent_obj; diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index 5366a80d45..faf7633e70 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -24,7 +24,8 @@ struct SSIBus { }; =20 #define TYPE_SSI_BUS "SSI" -#define SSI_BUS(obj) OBJECT_CHECK(SSIBus, (obj), TYPE_SSI_BUS) +DECLARE_INSTANCE_CHECKER(SSIBus, SSI_BUS, + TYPE_SSI_BUS) =20 static const TypeInfo ssi_bus_info =3D { .name =3D TYPE_SSI_BUS, diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c index 8ed83bec8a..34fc8da69a 100644 --- a/hw/ssi/xilinx_spi.c +++ b/hw/ssi/xilinx_spi.c @@ -80,7 +80,8 @@ =20 #define TYPE_XILINX_SPI "xlnx.xps-spi" typedef struct XilinxSPI XilinxSPI; -#define XILINX_SPI(obj) OBJECT_CHECK(XilinxSPI, (obj), TYPE_XILINX_SPI) +DECLARE_INSTANCE_CHECKER(XilinxSPI, XILINX_SPI, + TYPE_XILINX_SPI) =20 struct XilinxSPI { SysBusDevice parent_obj; diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c index 93bd5b9587..c694c98d08 100644 --- a/hw/timer/altera_timer.c +++ b/hw/timer/altera_timer.c @@ -46,8 +46,8 @@ =20 #define TYPE_ALTERA_TIMER "ALTR.timer" typedef struct AlteraTimer AlteraTimer; -#define ALTERA_TIMER(obj) \ - OBJECT_CHECK(AlteraTimer, (obj), TYPE_ALTERA_TIMER) +DECLARE_INSTANCE_CHECKER(AlteraTimer, ALTERA_TIMER, + TYPE_ALTERA_TIMER) =20 struct AlteraTimer { SysBusDevice busdev; diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index d728a80937..79117f45b0 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -192,7 +192,8 @@ static arm_timer_state *arm_timer_init(uint32_t freq) =20 #define TYPE_SP804 "sp804" typedef struct SP804State SP804State; -#define SP804(obj) OBJECT_CHECK(SP804State, (obj), TYPE_SP804) +DECLARE_INSTANCE_CHECKER(SP804State, SP804, + TYPE_SP804) =20 struct SP804State { SysBusDevice parent_obj; @@ -313,8 +314,8 @@ static void sp804_realize(DeviceState *dev, Error **err= p) =20 #define TYPE_INTEGRATOR_PIT "integrator_pit" typedef struct icp_pit_state icp_pit_state; -#define INTEGRATOR_PIT(obj) \ - OBJECT_CHECK(icp_pit_state, (obj), TYPE_INTEGRATOR_PIT) +DECLARE_INSTANCE_CHECKER(icp_pit_state, INTEGRATOR_PIT, + TYPE_INTEGRATOR_PIT) =20 struct icp_pit_state { SysBusDevice parent_obj; diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c index 24de679d9c..52e637545a 100644 --- a/hw/timer/cadence_ttc.c +++ b/hw/timer/cadence_ttc.c @@ -71,8 +71,8 @@ typedef struct { =20 #define TYPE_CADENCE_TTC "cadence_ttc" typedef struct CadenceTTCState CadenceTTCState; -#define CADENCE_TTC(obj) \ - OBJECT_CHECK(CadenceTTCState, (obj), TYPE_CADENCE_TTC) +DECLARE_INSTANCE_CHECKER(CadenceTTCState, CADENCE_TTC, + TYPE_CADENCE_TTC) =20 struct CadenceTTCState { SysBusDevice parent_obj; diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index 92b8999b79..48f2e3ade2 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -50,8 +50,8 @@ =20 #define TYPE_ETRAX_FS_TIMER "etraxfs,timer" typedef struct ETRAXTimerState ETRAXTimerState; -#define ETRAX_TIMER(obj) \ - OBJECT_CHECK(ETRAXTimerState, (obj), TYPE_ETRAX_FS_TIMER) +DECLARE_INSTANCE_CHECKER(ETRAXTimerState, ETRAX_TIMER, + TYPE_ETRAX_FS_TIMER) =20 struct ETRAXTimerState { SysBusDevice parent_obj; diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c index aa8753ded8..0329cae3d9 100644 --- a/hw/timer/exynos4210_mct.c +++ b/hw/timer/exynos4210_mct.c @@ -244,8 +244,8 @@ typedef struct { =20 #define TYPE_EXYNOS4210_MCT "exynos4210.mct" typedef struct Exynos4210MCTState Exynos4210MCTState; -#define EXYNOS4210_MCT(obj) \ - OBJECT_CHECK(Exynos4210MCTState, (obj), TYPE_EXYNOS4210_MCT) +DECLARE_INSTANCE_CHECKER(Exynos4210MCTState, EXYNOS4210_MCT, + TYPE_EXYNOS4210_MCT) =20 struct Exynos4210MCTState { SysBusDevice parent_obj; diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c index 34224020c0..5340fc0425 100644 --- a/hw/timer/exynos4210_pwm.c +++ b/hw/timer/exynos4210_pwm.c @@ -104,8 +104,8 @@ typedef struct { =20 #define TYPE_EXYNOS4210_PWM "exynos4210.pwm" typedef struct Exynos4210PWMState Exynos4210PWMState; -#define EXYNOS4210_PWM(obj) \ - OBJECT_CHECK(Exynos4210PWMState, (obj), TYPE_EXYNOS4210_PWM) +DECLARE_INSTANCE_CHECKER(Exynos4210PWMState, EXYNOS4210_PWM, + TYPE_EXYNOS4210_PWM) =20 struct Exynos4210PWMState { SysBusDevice parent_obj; diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c index 91d42837c9..e539fc24f0 100644 --- a/hw/timer/grlib_gptimer.c +++ b/hw/timer/grlib_gptimer.c @@ -57,8 +57,8 @@ #define TIMER_BASE 0x10 =20 typedef struct GPTimerUnit GPTimerUnit; -#define GRLIB_GPTIMER(obj) \ - OBJECT_CHECK(GPTimerUnit, (obj), TYPE_GRLIB_GPTIMER) +DECLARE_INSTANCE_CHECKER(GPTimerUnit, GRLIB_GPTIMER, + TYPE_GRLIB_GPTIMER) =20 typedef struct GPTimer GPTimer; =20 diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 07b3c0f9be..44bbe3a536 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -49,7 +49,8 @@ #define HPET_MSI_SUPPORT 0 =20 typedef struct HPETState HPETState; -#define HPET(obj) OBJECT_CHECK(HPETState, (obj), TYPE_HPET) +DECLARE_INSTANCE_CHECKER(HPETState, HPET, + TYPE_HPET) =20 struct HPETState; typedef struct HPETTimer { /* timers */ diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c index 54639d13d8..c01ee2c72a 100644 --- a/hw/timer/i8254.c +++ b/hw/timer/i8254.c @@ -38,8 +38,8 @@ #define RW_STATE_WORD1 4 =20 typedef struct PITClass PITClass; -#define PIT_CLASS(class) OBJECT_CLASS_CHECK(PITClass, (class), TYPE_I8254) -#define PIT_GET_CLASS(obj) OBJECT_GET_CLASS(PITClass, (obj), TYPE_I8254) +DECLARE_CLASS_CHECKERS(PITClass, PIT, + TYPE_I8254) =20 struct PITClass { PITCommonClass parent_class; diff --git a/hw/timer/lm32_timer.c b/hw/timer/lm32_timer.c index 807ceb514c..93ecb51a97 100644 --- a/hw/timer/lm32_timer.c +++ b/hw/timer/lm32_timer.c @@ -57,7 +57,8 @@ enum { =20 #define TYPE_LM32_TIMER "lm32-timer" typedef struct LM32TimerState LM32TimerState; -#define LM32_TIMER(obj) OBJECT_CHECK(LM32TimerState, (obj), TYPE_LM32_TIME= R) +DECLARE_INSTANCE_CHECKER(LM32TimerState, LM32_TIMER, + TYPE_LM32_TIMER) =20 struct LM32TimerState { SysBusDevice parent_obj; diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c index 3667a09c99..29500e0457 100644 --- a/hw/timer/milkymist-sysctl.c +++ b/hw/timer/milkymist-sysctl.c @@ -64,8 +64,8 @@ enum { =20 #define TYPE_MILKYMIST_SYSCTL "milkymist-sysctl" typedef struct MilkymistSysctlState MilkymistSysctlState; -#define MILKYMIST_SYSCTL(obj) \ - OBJECT_CHECK(MilkymistSysctlState, (obj), TYPE_MILKYMIST_SYSCTL) +DECLARE_INSTANCE_CHECKER(MilkymistSysctlState, MILKYMIST_SYSCTL, + TYPE_MILKYMIST_SYSCTL) =20 struct MilkymistSysctlState { SysBusDevice parent_obj; diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index 8d61c670de..3a35ac2b0a 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -22,7 +22,8 @@ =20 #define TYPE_PUV3_OST "puv3_ost" typedef struct PUV3OSTState PUV3OSTState; -#define PUV3_OST(obj) OBJECT_CHECK(PUV3OSTState, (obj), TYPE_PUV3_OST) +DECLARE_INSTANCE_CHECKER(PUV3OSTState, PUV3_OST, + TYPE_PUV3_OST) =20 /* puv3 ostimer implementation. */ struct PUV3OSTState { diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c index c73cc721e1..8c3a1f5489 100644 --- a/hw/timer/pxa2xx_timer.c +++ b/hw/timer/pxa2xx_timer.c @@ -68,8 +68,8 @@ static int pxa2xx_timer4_freq[8] =3D { =20 #define TYPE_PXA2XX_TIMER "pxa2xx-timer" typedef struct PXA2xxTimerInfo PXA2xxTimerInfo; -#define PXA2XX_TIMER(obj) \ - OBJECT_CHECK(PXA2xxTimerInfo, (obj), TYPE_PXA2XX_TIMER) +DECLARE_INSTANCE_CHECKER(PXA2xxTimerInfo, PXA2XX_TIMER, + TYPE_PXA2XX_TIMER) =20 =20 typedef struct { diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index 28d612372b..08d6888015 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -61,8 +61,8 @@ typedef struct CPUTimerState { =20 #define TYPE_SLAVIO_TIMER "slavio_timer" typedef struct SLAVIO_TIMERState SLAVIO_TIMERState; -#define SLAVIO_TIMER(obj) \ - OBJECT_CHECK(SLAVIO_TIMERState, (obj), TYPE_SLAVIO_TIMER) +DECLARE_INSTANCE_CHECKER(SLAVIO_TIMERState, SLAVIO_TIMER, + TYPE_SLAVIO_TIMER) =20 struct SLAVIO_TIMERState { SysBusDevice parent_obj; diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index c262f6d96f..1eb927eb84 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -62,8 +62,8 @@ struct xlx_timer }; =20 #define TYPE_XILINX_TIMER "xlnx.xps-timer" -#define XILINX_TIMER(obj) \ - OBJECT_CHECK(struct timerblock, (obj), TYPE_XILINX_TIMER) +DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, + TYPE_XILINX_TIMER) =20 struct timerblock { diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index 53e89b43e5..aa9c00aad3 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm/tpm_crb.c @@ -47,7 +47,8 @@ struct CRBState { }; typedef struct CRBState CRBState; =20 -#define CRB(obj) OBJECT_CHECK(CRBState, (obj), TYPE_TPM_CRB) +DECLARE_INSTANCE_CHECKER(CRBState, CRB, + TYPE_TPM_CRB) =20 #define CRB_INTF_TYPE_CRB_ACTIVE 0b1 #define CRB_INTF_VERSION_CRB 0b1 diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c index 08db85baea..e3775adc57 100644 --- a/hw/tpm/tpm_spapr.c +++ b/hw/tpm/tpm_spapr.c @@ -31,8 +31,8 @@ #define DEBUG_SPAPR 0 =20 typedef struct SpaprTpmState SpaprTpmState; -#define VIO_SPAPR_VTPM(obj) \ - OBJECT_CHECK(SpaprTpmState, (obj), TYPE_TPM_SPAPR) +DECLARE_INSTANCE_CHECKER(SpaprTpmState, VIO_SPAPR_VTPM, + TYPE_TPM_SPAPR) =20 typedef struct TpmCrq { uint8_t valid; /* 0x80: cmd; 0xc0: init crq */ diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index 9a0ab24a27..fafdcffa9c 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -40,7 +40,8 @@ struct TPMStateISA { }; typedef struct TPMStateISA TPMStateISA; =20 -#define TPM_TIS_ISA(obj) OBJECT_CHECK(TPMStateISA, (obj), TYPE_TPM_TIS_ISA) +DECLARE_INSTANCE_CHECKER(TPMStateISA, TPM_TIS_ISA, + TYPE_TPM_TIS_ISA) =20 static int tpm_tis_pre_save_isa(void *opaque) { diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c index 46a92182fc..20b28eeb28 100644 --- a/hw/tpm/tpm_tis_sysbus.c +++ b/hw/tpm/tpm_tis_sysbus.c @@ -40,7 +40,8 @@ struct TPMStateSysBus { }; typedef struct TPMStateSysBus TPMStateSysBus; =20 -#define TPM_TIS_SYSBUS(obj) OBJECT_CHECK(TPMStateSysBus, (obj), TYPE_TPM_T= IS_SYSBUS) +DECLARE_INSTANCE_CHECKER(TPMStateSysBus, TPM_TIS_SYSBUS, + TYPE_TPM_TIS_SYSBUS) =20 static int tpm_tis_pre_save_sysbus(void *opaque) { diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index a84f5783dc..5e4649d367 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -47,8 +47,8 @@ do {\ =20 #define TYPE_EMULATED_CCID "ccid-card-emulated" typedef struct EmulatedState EmulatedState; -#define EMULATED_CCID_CARD(obj) \ - OBJECT_CHECK(EmulatedState, (obj), TYPE_EMULATED_CCID) +DECLARE_INSTANCE_CHECKER(EmulatedState, EMULATED_CCID_CARD, + TYPE_EMULATED_CCID) =20 #define BACKEND_NSS_EMULATED_NAME "nss-emulated" #define BACKEND_CERTIFICATES_NAME "certificates" diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 9c9d6857da..e8e9d37e88 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -65,8 +65,8 @@ struct PassthruState { }; =20 #define TYPE_CCID_PASSTHRU "ccid-card-passthru" -#define PASSTHRU_CCID_CARD(obj) \ - OBJECT_CHECK(PassthruState, (obj), TYPE_CCID_PASSTHRU) +DECLARE_INSTANCE_CHECKER(PassthruState, PASSTHRU_CCID_CARD, + TYPE_CCID_PASSTHRU) =20 /* * VSCard protocol over chardev diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 3fc8addae1..65247ca799 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -657,7 +657,8 @@ struct USBAudioState { typedef struct USBAudioState USBAudioState; =20 #define TYPE_USB_AUDIO "usb-audio" -#define USB_AUDIO(obj) OBJECT_CHECK(USBAudioState, (obj), TYPE_USB_AUDIO) +DECLARE_INSTANCE_CHECKER(USBAudioState, USB_AUDIO, + TYPE_USB_AUDIO) =20 static void output_callback(void *opaque, int avail) { diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 4d1de647bc..05cfe6baca 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -47,7 +47,8 @@ struct USBHIDState { typedef struct USBHIDState USBHIDState; =20 #define TYPE_USB_HID "usb-hid" -#define USB_HID(obj) OBJECT_CHECK(USBHIDState, (obj), TYPE_USB_HID) +DECLARE_INSTANCE_CHECKER(USBHIDState, USB_HID, + TYPE_USB_HID) =20 enum { STR_MANUFACTURER =3D 1, diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 07e395aa5f..7a182f9bec 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -53,7 +53,8 @@ struct USBHubState { typedef struct USBHubState USBHubState; =20 #define TYPE_USB_HUB "usb-hub" -#define USB_HUB(obj) OBJECT_CHECK(USBHubState, (obj), TYPE_USB_HUB) +DECLARE_INSTANCE_CHECKER(USBHubState, USB_HUB, + TYPE_USB_HUB) =20 #define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE) #define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 6df70a0844..c61c0e0878 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -238,7 +238,8 @@ typedef struct { } QEMU_PACKED ObjectInfo; =20 #define TYPE_USB_MTP "usb-mtp" -#define USB_MTP(obj) OBJECT_CHECK(MTPState, (obj), TYPE_USB_MTP) +DECLARE_INSTANCE_CHECKER(MTPState, USB_MTP, + TYPE_USB_MTP) =20 #define QEMU_STORAGE_ID 0x00010001 =20 diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index b60f8e52f5..cd32f57685 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -656,7 +656,8 @@ struct USBNetState { typedef struct USBNetState USBNetState; =20 #define TYPE_USB_NET "usb-net" -#define USB_NET(obj) OBJECT_CHECK(USBNetState, (obj), TYPE_USB_NET) +DECLARE_INSTANCE_CHECKER(USBNetState, USB_NET, + TYPE_USB_NET) =20 static int is_rndis(USBNetState *s) { diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 8f13f2fd31..1a58851d4b 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -113,7 +113,8 @@ struct USBSerialState { typedef struct USBSerialState USBSerialState; =20 #define TYPE_USB_SERIAL "usb-serial-dev" -#define USB_SERIAL_DEV(obj) OBJECT_CHECK(USBSerialState, (obj), TYPE_USB_S= ERIAL) +DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL_DEV, + TYPE_USB_SERIAL) =20 enum { STR_MANUFACTURER =3D 1, diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index a9898187b8..432508c478 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -62,7 +62,8 @@ do { \ =20 #define CCID_DEV_NAME "usb-ccid" typedef struct USBCCIDState USBCCIDState; -#define USB_CCID_DEV(obj) OBJECT_CHECK(USBCCIDState, (obj), CCID_DEV_NAME) +DECLARE_INSTANCE_CHECKER(USBCCIDState, USB_CCID_DEV, + CCID_DEV_NAME) /* * The two options for variable sized buffers: * make them constant size, for large enough constant, @@ -1176,7 +1177,8 @@ static Property ccid_props[] =3D { }; =20 #define TYPE_CCID_BUS "ccid-bus" -#define CCID_BUS(obj) OBJECT_CHECK(CCIDBus, (obj), TYPE_CCID_BUS) +DECLARE_INSTANCE_CHECKER(CCIDBus, CCID_BUS, + TYPE_CCID_BUS) =20 static const TypeInfo ccid_bus_info =3D { .name =3D TYPE_CCID_BUS, diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 55a04293a4..648340323f 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -70,7 +70,8 @@ struct MSDState { typedef struct MSDState MSDState; =20 #define TYPE_USB_STORAGE "usb-storage-dev" -#define USB_STORAGE_DEV(obj) OBJECT_CHECK(MSDState, (obj), TYPE_USB_STORAG= E) +DECLARE_INSTANCE_CHECKER(MSDState, USB_STORAGE_DEV, + TYPE_USB_STORAGE) =20 struct usb_msd_cbw { uint32_t sig; diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index 1d27bb942b..c36c8e7820 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -133,7 +133,8 @@ struct UASDevice { }; =20 #define TYPE_USB_UAS "usb-uas" -#define USB_UAS(obj) OBJECT_CHECK(UASDevice, (obj), TYPE_USB_UAS) +DECLARE_INSTANCE_CHECKER(UASDevice, USB_UAS, + TYPE_USB_UAS) =20 struct UASRequest { uint16_t tag; diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c index e2dae6a86d..85c4d827bf 100644 --- a/hw/usb/dev-wacom.c +++ b/hw/usb/dev-wacom.c @@ -56,7 +56,8 @@ struct USBWacomState { typedef struct USBWacomState USBWacomState; =20 #define TYPE_USB_WACOM "usb-wacom-tablet" -#define USB_WACOM(obj) OBJECT_CHECK(USBWacomState, (obj), TYPE_USB_WACOM) +DECLARE_INSTANCE_CHECKER(USBWacomState, USB_WACOM, + TYPE_USB_WACOM) =20 enum { STR_MANUFACTURER =3D 1, diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 82fe967196..f8168a06a3 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -33,7 +33,8 @@ =20 #define TYPE_PCI_OHCI "pci-ohci" typedef struct OHCIPCIState OHCIPCIState; -#define PCI_OHCI(obj) OBJECT_CHECK(OHCIPCIState, (obj), TYPE_PCI_OHCI) +DECLARE_INSTANCE_CHECKER(OHCIPCIState, PCI_OHCI, + TYPE_PCI_OHCI) =20 struct OHCIPCIState { /*< private >*/ diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 31ec5f4702..27ca237d71 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -161,7 +161,8 @@ static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td); static void uhci_resume(void *opaque); =20 #define TYPE_UHCI "pci-uhci-usb" -#define UHCI(obj) OBJECT_CHECK(UHCIState, (obj), TYPE_UHCI) +DECLARE_INSTANCE_CHECKER(UHCIState, UHCI, + TYPE_UHCI) =20 static inline int32_t uhci_queue_token(UHCI_TD *td) { diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 30779c8ff4..2ba1de68df 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -62,8 +62,8 @@ =20 #define TYPE_USB_HOST_DEVICE "usb-host" typedef struct USBHostDevice USBHostDevice; -#define USB_HOST_DEVICE(obj) \ - OBJECT_CHECK(USBHostDevice, (obj), TYPE_USB_HOST_DEVICE) +DECLARE_INSTANCE_CHECKER(USBHostDevice, USB_HOST_DEVICE, + TYPE_USB_HOST_DEVICE) =20 typedef struct USBHostRequest USBHostRequest; typedef struct USBHostIsoXfer USBHostIsoXfer; diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 344fdc3d66..a079ecd50c 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -145,7 +145,8 @@ struct USBRedirDevice { }; =20 #define TYPE_USB_REDIR "usb-redir" -#define USB_REDIRECT(obj) OBJECT_CHECK(USBRedirDevice, (obj), TYPE_USB_RED= IR) +DECLARE_INSTANCE_CHECKER(USBRedirDevice, USB_REDIRECT, + TYPE_USB_REDIR) =20 static void usbredir_hello(void *priv, struct usb_redir_hello_header *h); static void usbredir_device_connect(void *priv, diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index a15ee515d7..2bee3ae59f 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -32,7 +32,8 @@ =20 #define TYPE_TUSB6010 "tusb6010" typedef struct TUSBState TUSBState; -#define TUSB(obj) OBJECT_CHECK(TUSBState, (obj), TYPE_TUSB6010) +DECLARE_INSTANCE_CHECKER(TUSBState, TUSB, + TYPE_TUSB6010) =20 struct TUSBState { SysBusDevice parent_obj; diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index eb74e57b23..f399ec0a31 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -38,8 +38,8 @@ struct VFIOAPDevice { }; typedef struct VFIOAPDevice VFIOAPDevice; =20 -#define VFIO_AP_DEVICE(obj) \ - OBJECT_CHECK(VFIOAPDevice, (obj), VFIO_AP_DEVICE_TYPE) +DECLARE_INSTANCE_CHECKER(VFIOAPDevice, VFIO_AP_DEVICE, + VFIO_AP_DEVICE_TYPE) =20 static void vfio_ap_compute_needs_reset(VFIODevice *vdev) { diff --git a/hw/virtio/vhost-scsi-pci.c b/hw/virtio/vhost-scsi-pci.c index b30a04d7cd..cb71a294fa 100644 --- a/hw/virtio/vhost-scsi-pci.c +++ b/hw/virtio/vhost-scsi-pci.c @@ -30,8 +30,8 @@ typedef struct VHostSCSIPCI VHostSCSIPCI; * vhost-scsi-pci: This extends VirtioPCIProxy. */ #define TYPE_VHOST_SCSI_PCI "vhost-scsi-pci-base" -#define VHOST_SCSI_PCI(obj) \ - OBJECT_CHECK(VHostSCSIPCI, (obj), TYPE_VHOST_SCSI_PCI) +DECLARE_INSTANCE_CHECKER(VHostSCSIPCI, VHOST_SCSI_PCI, + TYPE_VHOST_SCSI_PCI) =20 struct VHostSCSIPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/vhost-user-blk-pci.c b/hw/virtio/vhost-user-blk-pci.c index 51d0858281..33b404d8a2 100644 --- a/hw/virtio/vhost-user-blk-pci.c +++ b/hw/virtio/vhost-user-blk-pci.c @@ -35,8 +35,8 @@ typedef struct VHostUserBlkPCI VHostUserBlkPCI; * vhost-user-blk-pci: This extends VirtioPCIProxy. */ #define TYPE_VHOST_USER_BLK_PCI "vhost-user-blk-pci-base" -#define VHOST_USER_BLK_PCI(obj) \ - OBJECT_CHECK(VHostUserBlkPCI, (obj), TYPE_VHOST_USER_BLK_PCI) +DECLARE_INSTANCE_CHECKER(VHostUserBlkPCI, VHOST_USER_BLK_PCI, + TYPE_VHOST_USER_BLK_PCI) =20 struct VHostUserBlkPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c index 6b01561c2f..8bb389bd28 100644 --- a/hw/virtio/vhost-user-fs-pci.c +++ b/hw/virtio/vhost-user-fs-pci.c @@ -26,8 +26,8 @@ typedef struct VHostUserFSPCI VHostUserFSPCI; =20 #define TYPE_VHOST_USER_FS_PCI "vhost-user-fs-pci-base" =20 -#define VHOST_USER_FS_PCI(obj) \ - OBJECT_CHECK(VHostUserFSPCI, (obj), TYPE_VHOST_USER_FS_PCI) +DECLARE_INSTANCE_CHECKER(VHostUserFSPCI, VHOST_USER_FS_PCI, + TYPE_VHOST_USER_FS_PCI) =20 static Property vhost_user_fs_pci_properties[] =3D { DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, diff --git a/hw/virtio/vhost-user-input-pci.c b/hw/virtio/vhost-user-input-= pci.c index b072fb576a..c9d3e9113a 100644 --- a/hw/virtio/vhost-user-input-pci.c +++ b/hw/virtio/vhost-user-input-pci.c @@ -16,8 +16,8 @@ typedef struct VHostUserInputPCI VHostUserInputPCI; =20 #define TYPE_VHOST_USER_INPUT_PCI "vhost-user-input-pci" =20 -#define VHOST_USER_INPUT_PCI(obj) \ - OBJECT_CHECK(VHostUserInputPCI, (obj), TYPE_VHOST_USER_INPUT_PCI) +DECLARE_INSTANCE_CHECKER(VHostUserInputPCI, VHOST_USER_INPUT_PCI, + TYPE_VHOST_USER_INPUT_PCI) =20 struct VHostUserInputPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/vhost-user-scsi-pci.c b/hw/virtio/vhost-user-scsi-pc= i.c index 773104e351..d5343412a1 100644 --- a/hw/virtio/vhost-user-scsi-pci.c +++ b/hw/virtio/vhost-user-scsi-pci.c @@ -36,8 +36,8 @@ typedef struct VHostUserSCSIPCI VHostUserSCSIPCI; =20 #define TYPE_VHOST_USER_SCSI_PCI "vhost-user-scsi-pci-base" -#define VHOST_USER_SCSI_PCI(obj) \ - OBJECT_CHECK(VHostUserSCSIPCI, (obj), TYPE_VHOST_USER_SCSI_PCI) +DECLARE_INSTANCE_CHECKER(VHostUserSCSIPCI, VHOST_USER_SCSI_PCI, + TYPE_VHOST_USER_SCSI_PCI) =20 struct VHostUserSCSIPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/vhost-user-vsock-pci.c b/hw/virtio/vhost-user-vsock-= pci.c index 65bfc91d2d..763f89984e 100644 --- a/hw/virtio/vhost-user-vsock-pci.c +++ b/hw/virtio/vhost-user-vsock-pci.c @@ -21,8 +21,8 @@ typedef struct VHostUserVSockPCI VHostUserVSockPCI; * vhost-user-vsock-pci: This extends VirtioPCIProxy. */ #define TYPE_VHOST_USER_VSOCK_PCI "vhost-user-vsock-pci-base" -#define VHOST_USER_VSOCK_PCI(obj) \ - OBJECT_CHECK(VHostUserVSockPCI, (obj), TYPE_VHOST_USER_VSOCK_PCI) +DECLARE_INSTANCE_CHECKER(VHostUserVSockPCI, VHOST_USER_VSOCK_PCI, + TYPE_VHOST_USER_VSOCK_PCI) =20 struct VHostUserVSockPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/vhost-vsock-pci.c b/hw/virtio/vhost-vsock-pci.c index 49fcddcb5a..e56067b427 100644 --- a/hw/virtio/vhost-vsock-pci.c +++ b/hw/virtio/vhost-vsock-pci.c @@ -25,8 +25,8 @@ typedef struct VHostVSockPCI VHostVSockPCI; * vhost-vsock-pci: This extends VirtioPCIProxy. */ #define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci-base" -#define VHOST_VSOCK_PCI(obj) \ - OBJECT_CHECK(VHostVSockPCI, (obj), TYPE_VHOST_VSOCK_PCI) +DECLARE_INSTANCE_CHECKER(VHostVSockPCI, VHOST_VSOCK_PCI, + TYPE_VHOST_VSOCK_PCI) =20 struct VHostVSockPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-9p-pci.c b/hw/virtio/virtio-9p-pci.c index 8ea357b868..e07adcd9ea 100644 --- a/hw/virtio/virtio-9p-pci.c +++ b/hw/virtio/virtio-9p-pci.c @@ -27,8 +27,8 @@ =20 #define TYPE_VIRTIO_9P_PCI "virtio-9p-pci-base" typedef struct V9fsPCIState V9fsPCIState; -#define VIRTIO_9P_PCI(obj) \ - OBJECT_CHECK(V9fsPCIState, (obj), TYPE_VIRTIO_9P_PCI) +DECLARE_INSTANCE_CHECKER(V9fsPCIState, VIRTIO_9P_PCI, + TYPE_VIRTIO_9P_PCI) =20 struct V9fsPCIState { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c index 35378c7309..a2c5cc7207 100644 --- a/hw/virtio/virtio-balloon-pci.c +++ b/hw/virtio/virtio-balloon-pci.c @@ -27,8 +27,8 @@ typedef struct VirtIOBalloonPCI VirtIOBalloonPCI; * virtio-balloon-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_BALLOON_PCI "virtio-balloon-pci-base" -#define VIRTIO_BALLOON_PCI(obj) \ - OBJECT_CHECK(VirtIOBalloonPCI, (obj), TYPE_VIRTIO_BALLOON_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOBalloonPCI, VIRTIO_BALLOON_PCI, + TYPE_VIRTIO_BALLOON_PCI) =20 struct VirtIOBalloonPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-blk-pci.c b/hw/virtio/virtio-blk-pci.c index a2aa614ef4..9d5795810c 100644 --- a/hw/virtio/virtio-blk-pci.c +++ b/hw/virtio/virtio-blk-pci.c @@ -30,8 +30,8 @@ typedef struct VirtIOBlkPCI VirtIOBlkPCI; * virtio-blk-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci-base" -#define VIRTIO_BLK_PCI(obj) \ - OBJECT_CHECK(VirtIOBlkPCI, (obj), TYPE_VIRTIO_BLK_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOBlkPCI, VIRTIO_BLK_PCI, + TYPE_VIRTIO_BLK_PCI) =20 struct VirtIOBlkPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c index 518a87a36e..0783dc2f7e 100644 --- a/hw/virtio/virtio-crypto-pci.c +++ b/hw/virtio/virtio-crypto-pci.c @@ -29,8 +29,8 @@ typedef struct VirtIOCryptoPCI VirtIOCryptoPCI; * virtio-crypto-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_CRYPTO_PCI "virtio-crypto-pci" -#define VIRTIO_CRYPTO_PCI(obj) \ - OBJECT_CHECK(VirtIOCryptoPCI, (obj), TYPE_VIRTIO_CRYPTO_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOCryptoPCI, VIRTIO_CRYPTO_PCI, + TYPE_VIRTIO_CRYPTO_PCI) =20 struct VirtIOCryptoPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-input-host-pci.c b/hw/virtio/virtio-input-hos= t-pci.c index 4d8479c92e..0ac360de4f 100644 --- a/hw/virtio/virtio-input-host-pci.c +++ b/hw/virtio/virtio-input-host-pci.c @@ -16,8 +16,8 @@ typedef struct VirtIOInputHostPCI VirtIOInputHostPCI; =20 #define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci" -#define VIRTIO_INPUT_HOST_PCI(obj) \ - OBJECT_CHECK(VirtIOInputHostPCI, (obj), TYPE_VIRTIO_INPUT_HOST_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOInputHostPCI, VIRTIO_INPUT_HOST_PCI, + TYPE_VIRTIO_INPUT_HOST_PCI) =20 struct VirtIOInputHostPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-input-pci.c b/hw/virtio/virtio-input-pci.c index 429dd4d7ab..85acd3d2eb 100644 --- a/hw/virtio/virtio-input-pci.c +++ b/hw/virtio/virtio-input-pci.c @@ -20,8 +20,8 @@ typedef struct VirtIOInputHIDPCI VirtIOInputHIDPCI; /* * virtio-input-pci: This extends VirtioPCIProxy. */ -#define VIRTIO_INPUT_PCI(obj) \ - OBJECT_CHECK(VirtIOInputPCI, (obj), TYPE_VIRTIO_INPUT_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOInputPCI, VIRTIO_INPUT_PCI, + TYPE_VIRTIO_INPUT_PCI) =20 struct VirtIOInputPCI { VirtIOPCIProxy parent_obj; @@ -32,8 +32,8 @@ struct VirtIOInputPCI { #define TYPE_VIRTIO_KEYBOARD_PCI "virtio-keyboard-pci" #define TYPE_VIRTIO_MOUSE_PCI "virtio-mouse-pci" #define TYPE_VIRTIO_TABLET_PCI "virtio-tablet-pci" -#define VIRTIO_INPUT_HID_PCI(obj) \ - OBJECT_CHECK(VirtIOInputHIDPCI, (obj), TYPE_VIRTIO_INPUT_HID_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOInputHIDPCI, VIRTIO_INPUT_HID_PCI, + TYPE_VIRTIO_INPUT_HID_PCI) =20 struct VirtIOInputHIDPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 17451f5a78..76540e57b1 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -24,8 +24,8 @@ typedef struct VirtIOIOMMUPCI VirtIOIOMMUPCI; * virtio-iommu-pci: This extends VirtioPCIProxy. * */ -#define VIRTIO_IOMMU_PCI(obj) \ - OBJECT_CHECK(VirtIOIOMMUPCI, (obj), TYPE_VIRTIO_IOMMU_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOIOMMUPCI, VIRTIO_IOMMU_PCI, + TYPE_VIRTIO_IOMMU_PCI) =20 struct VirtIOIOMMUPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index 498fc02d8f..292d13d278 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -30,8 +30,8 @@ typedef struct VirtIONetPCI VirtIONetPCI; * virtio-net-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_NET_PCI "virtio-net-pci-base" -#define VIRTIO_NET_PCI(obj) \ - OBJECT_CHECK(VirtIONetPCI, (obj), TYPE_VIRTIO_NET_PCI) +DECLARE_INSTANCE_CHECKER(VirtIONetPCI, VIRTIO_NET_PCI, + TYPE_VIRTIO_NET_PCI) =20 struct VirtIONetPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c index 8f953dff83..c1f916268b 100644 --- a/hw/virtio/virtio-rng-pci.c +++ b/hw/virtio/virtio-rng-pci.c @@ -23,8 +23,8 @@ typedef struct VirtIORngPCI VirtIORngPCI; * virtio-rng-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci-base" -#define VIRTIO_RNG_PCI(obj) \ - OBJECT_CHECK(VirtIORngPCI, (obj), TYPE_VIRTIO_RNG_PCI) +DECLARE_INSTANCE_CHECKER(VirtIORngPCI, VIRTIO_RNG_PCI, + TYPE_VIRTIO_RNG_PCI) =20 struct VirtIORngPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-scsi-pci.c b/hw/virtio/virtio-scsi-pci.c index 7a7ffa43f8..97fab74236 100644 --- a/hw/virtio/virtio-scsi-pci.c +++ b/hw/virtio/virtio-scsi-pci.c @@ -27,8 +27,8 @@ typedef struct VirtIOSCSIPCI VirtIOSCSIPCI; * virtio-scsi-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_SCSI_PCI "virtio-scsi-pci-base" -#define VIRTIO_SCSI_PCI(obj) \ - OBJECT_CHECK(VirtIOSCSIPCI, (obj), TYPE_VIRTIO_SCSI_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOSCSIPCI, VIRTIO_SCSI_PCI, + TYPE_VIRTIO_SCSI_PCI) =20 struct VirtIOSCSIPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/virtio/virtio-serial-pci.c b/hw/virtio/virtio-serial-pci.c index 1bd769e88d..35bcd961c9 100644 --- a/hw/virtio/virtio-serial-pci.c +++ b/hw/virtio/virtio-serial-pci.c @@ -29,8 +29,8 @@ typedef struct VirtIOSerialPCI VirtIOSerialPCI; * virtio-serial-pci: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_SERIAL_PCI "virtio-serial-pci-base" -#define VIRTIO_SERIAL_PCI(obj) \ - OBJECT_CHECK(VirtIOSerialPCI, (obj), TYPE_VIRTIO_SERIAL_PCI) +DECLARE_INSTANCE_CHECKER(VirtIOSerialPCI, VIRTIO_SERIAL_PCI, + TYPE_VIRTIO_SERIAL_PCI) =20 struct VirtIOSerialPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index eaa2b39ab8..4f64899a56 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -105,8 +105,8 @@ struct I6300State { typedef struct I6300State I6300State; =20 #define TYPE_WATCHDOG_I6300ESB_DEVICE "i6300esb" -#define WATCHDOG_I6300ESB_DEVICE(obj) \ - OBJECT_CHECK(I6300State, (obj), TYPE_WATCHDOG_I6300ESB_DEVICE) +DECLARE_INSTANCE_CHECKER(I6300State, WATCHDOG_I6300ESB_DEVICE, + TYPE_WATCHDOG_I6300ESB_DEVICE) =20 /* This function is called when the watchdog has either been enabled * (hence it starts counting down) or has been keep-alived. diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c index 1a7a8f695f..177aaa503f 100644 --- a/hw/watchdog/wdt_ib700.c +++ b/hw/watchdog/wdt_ib700.c @@ -38,7 +38,8 @@ =20 #define TYPE_IB700 "ib700" typedef struct IB700state IB700State; -#define IB700(obj) OBJECT_CHECK(IB700State, (obj), TYPE_IB700) +DECLARE_INSTANCE_CHECKER(IB700State, IB700, + TYPE_IB700) =20 struct IB700state { ISADevice parent_obj; diff --git a/iothread.c b/iothread.c index 263ec6e5bc..3a3860a09c 100644 --- a/iothread.c +++ b/iothread.c @@ -26,10 +26,8 @@ =20 typedef ObjectClass IOThreadClass; =20 -#define IOTHREAD_GET_CLASS(obj) \ - OBJECT_GET_CLASS(IOThreadClass, obj, TYPE_IOTHREAD) -#define IOTHREAD_CLASS(klass) \ - OBJECT_CLASS_CHECK(IOThreadClass, klass, TYPE_IOTHREAD) +DECLARE_CLASS_CHECKERS(IOThreadClass, IOTHREAD, + TYPE_IOTHREAD) =20 #ifdef CONFIG_POSIX /* Benchmark results from 2016 on NVMe SSD drives show max polling times a= round diff --git a/migration/rdma.c b/migration/rdma.c index 0a90f0d420..1dc563ec3f 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -399,8 +399,8 @@ typedef struct RDMAContext { =20 #define TYPE_QIO_CHANNEL_RDMA "qio-channel-rdma" typedef struct QIOChannelRDMA QIOChannelRDMA; -#define QIO_CHANNEL_RDMA(obj) \ - OBJECT_CHECK(QIOChannelRDMA, (obj), TYPE_QIO_CHANNEL_RDMA) +DECLARE_INSTANCE_CHECKER(QIOChannelRDMA, QIO_CHANNEL_RDMA, + TYPE_QIO_CHANNEL_RDMA) =20 =20 =20 diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c index 0082aa6c3e..f933bd2db2 100644 --- a/net/can/can_socketcan.c +++ b/net/can/can_socketcan.c @@ -48,8 +48,8 @@ =20 #define TYPE_CAN_HOST_SOCKETCAN "can-host-socketcan" typedef struct CanHostSocketCAN CanHostSocketCAN; -#define CAN_HOST_SOCKETCAN(obj) \ - OBJECT_CHECK(CanHostSocketCAN, (obj), TYPE_CAN_HOST_SOCKETCAN) +DECLARE_INSTANCE_CHECKER(CanHostSocketCAN, CAN_HOST_SOCKETCAN, + TYPE_CAN_HOST_SOCKETCAN) =20 #define CAN_READ_BUF_LEN 5 struct CanHostSocketCAN { diff --git a/net/colo-compare.c b/net/colo-compare.c index be3ca5f8c5..bc3808fb4d 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -37,8 +37,8 @@ =20 #define TYPE_COLO_COMPARE "colo-compare" typedef struct CompareState CompareState; -#define COLO_COMPARE(obj) \ - OBJECT_CHECK(CompareState, (obj), TYPE_COLO_COMPARE) +DECLARE_INSTANCE_CHECKER(CompareState, COLO_COMPARE, + TYPE_COLO_COMPARE) =20 static QTAILQ_HEAD(, CompareState) net_compares =3D QTAILQ_HEAD_INITIALIZER(net_compares); diff --git a/net/dump.c b/net/dump.c index 454672d73d..42e64a6f29 100644 --- a/net/dump.c +++ b/net/dump.c @@ -141,8 +141,8 @@ static int net_dump_state_init(DumpState *s, const char= *filename, #define TYPE_FILTER_DUMP "filter-dump" =20 typedef struct NetFilterDumpState NetFilterDumpState; -#define FILTER_DUMP(obj) \ - OBJECT_CHECK(NetFilterDumpState, (obj), TYPE_FILTER_DUMP) +DECLARE_INSTANCE_CHECKER(NetFilterDumpState, FILTER_DUMP, + TYPE_FILTER_DUMP) =20 struct NetFilterDumpState { NetFilterState nfs; diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 78f7f0b36b..6ade7a19b8 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -19,8 +19,8 @@ #define TYPE_FILTER_BUFFER "filter-buffer" =20 typedef struct FilterBufferState FilterBufferState; -#define FILTER_BUFFER(obj) \ - OBJECT_CHECK(FilterBufferState, (obj), TYPE_FILTER_BUFFER) +DECLARE_INSTANCE_CHECKER(FilterBufferState, FILTER_BUFFER, + TYPE_FILTER_BUFFER) =20 struct FilterBufferState { NetFilterState parent_obj; diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 3fd3b90d1d..088d4dcace 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -23,12 +23,12 @@ =20 #define TYPE_FILTER_MIRROR "filter-mirror" typedef struct MirrorState MirrorState; -#define FILTER_MIRROR(obj) \ - OBJECT_CHECK(MirrorState, (obj), TYPE_FILTER_MIRROR) +DECLARE_INSTANCE_CHECKER(MirrorState, FILTER_MIRROR, + TYPE_FILTER_MIRROR) =20 #define TYPE_FILTER_REDIRECTOR "filter-redirector" -#define FILTER_REDIRECTOR(obj) \ - OBJECT_CHECK(MirrorState, (obj), TYPE_FILTER_REDIRECTOR) +DECLARE_INSTANCE_CHECKER(MirrorState, FILTER_REDIRECTOR, + TYPE_FILTER_REDIRECTOR) =20 #define REDIRECTOR_MAX_LEN NET_BUFSIZE =20 diff --git a/net/filter-replay.c b/net/filter-replay.c index a0b99aaf86..78696c162e 100644 --- a/net/filter-replay.c +++ b/net/filter-replay.c @@ -24,8 +24,8 @@ #define TYPE_FILTER_REPLAY "filter-replay" =20 typedef struct NetFilterReplayState NetFilterReplayState; -#define FILTER_REPLAY(obj) \ - OBJECT_CHECK(NetFilterReplayState, (obj), TYPE_FILTER_REPLAY) +DECLARE_INSTANCE_CHECKER(NetFilterReplayState, FILTER_REPLAY, + TYPE_FILTER_REPLAY) =20 struct NetFilterReplayState { NetFilterState nfs; diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index c28d959942..113e293207 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -25,8 +25,8 @@ =20 #define TYPE_FILTER_REWRITER "filter-rewriter" typedef struct RewriterState RewriterState; -#define FILTER_COLO_REWRITER(obj) \ - OBJECT_CHECK(RewriterState, (obj), TYPE_FILTER_REWRITER) +DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_COLO_REWRITER, + TYPE_FILTER_REWRITER) =20 #define FAILOVER_MODE_ON true #define FAILOVER_MODE_OFF false diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c index 59ba4b70ae..d735b1e7f6 100644 --- a/scsi/pr-manager-helper.c +++ b/scsi/pr-manager-helper.c @@ -28,9 +28,8 @@ #define TYPE_PR_MANAGER_HELPER "pr-manager-helper" =20 typedef struct PRManagerHelper PRManagerHelper; -#define PR_MANAGER_HELPER(obj) \ - OBJECT_CHECK(PRManagerHelper, (obj), \ - TYPE_PR_MANAGER_HELPER) +DECLARE_INSTANCE_CHECKER(PRManagerHelper, PR_MANAGER_HELPER, + TYPE_PR_MANAGER_HELPER) =20 struct PRManagerHelper { /* */ diff --git a/target/i386/sev.c b/target/i386/sev.c index d452e73c18..d976634b8f 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -32,8 +32,8 @@ =20 #define TYPE_SEV_GUEST "sev-guest" typedef struct SevGuestState SevGuestState; -#define SEV_GUEST(obj) \ - OBJECT_CHECK(SevGuestState, (obj), TYPE_SEV_GUEST) +DECLARE_INSTANCE_CHECKER(SevGuestState, SEV_GUEST, + TYPE_SEV_GUEST) =20 =20 /** diff --git a/tests/check-qom-interface.c b/tests/check-qom-interface.c index bfa9ad5d19..c99be97ed8 100644 --- a/tests/check-qom-interface.c +++ b/tests/check-qom-interface.c @@ -17,10 +17,8 @@ =20 #define TYPE_TEST_IF "test-interface" typedef struct TestIfClass TestIfClass; -#define TEST_IF_CLASS(klass) \ - OBJECT_CLASS_CHECK(TestIfClass, (klass), TYPE_TEST_IF) -#define TEST_IF_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TestIfClass, (obj), TYPE_TEST_IF) +DECLARE_CLASS_CHECKERS(TestIfClass, TEST_IF, + TYPE_TEST_IF) #define TEST_IF(obj) \ INTERFACE_CHECK(TestIf, (obj), TYPE_TEST_IF) =20 diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c index e1e0a96661..1571606c1c 100644 --- a/tests/check-qom-proplist.c +++ b/tests/check-qom-proplist.c @@ -33,8 +33,8 @@ typedef struct DummyObject DummyObject; typedef struct DummyObjectClass DummyObjectClass; =20 -#define DUMMY_OBJECT(obj) \ - OBJECT_CHECK(DummyObject, (obj), TYPE_DUMMY) +DECLARE_INSTANCE_CHECKER(DummyObject, DUMMY_OBJECT, + TYPE_DUMMY) =20 typedef enum DummyAnimal DummyAnimal; =20 @@ -196,12 +196,12 @@ typedef struct DummyBackendClass DummyBackendClass; #define TYPE_DUMMY_BUS "qemu-dummy-bus" #define TYPE_DUMMY_BACKEND "qemu-dummy-backend" =20 -#define DUMMY_DEV(obj) \ - OBJECT_CHECK(DummyDev, (obj), TYPE_DUMMY_DEV) -#define DUMMY_BUS(obj) \ - OBJECT_CHECK(DummyBus, (obj), TYPE_DUMMY_BUS) -#define DUMMY_BACKEND(obj) \ - OBJECT_CHECK(DummyBackend, (obj), TYPE_DUMMY_BACKEND) +DECLARE_INSTANCE_CHECKER(DummyDev, DUMMY_DEV, + TYPE_DUMMY_DEV) +DECLARE_INSTANCE_CHECKER(DummyBus, DUMMY_BUS, + TYPE_DUMMY_BUS) +DECLARE_INSTANCE_CHECKER(DummyBackend, DUMMY_BACKEND, + TYPE_DUMMY_BACKEND) =20 struct DummyDev { Object parent_obj; diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index c3e210a9ef..8a3c14d92c 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -32,8 +32,8 @@ =20 #define TYPE_STATIC_PROPS "static_prop_type" typedef struct MyType MyType; -#define STATIC_TYPE(obj) \ - OBJECT_CHECK(MyType, (obj), TYPE_STATIC_PROPS) +DECLARE_INSTANCE_CHECKER(MyType, STATIC_TYPE, + TYPE_STATIC_PROPS) =20 #define TYPE_SUBCLASS "static_prop_subtype" =20 @@ -128,8 +128,8 @@ static void test_static_globalprop(void) } =20 #define TYPE_DYNAMIC_PROPS "dynamic-prop-type" -#define DYNAMIC_TYPE(obj) \ - OBJECT_CHECK(MyType, (obj), TYPE_DYNAMIC_PROPS) +DECLARE_INSTANCE_CHECKER(MyType, DYNAMIC_TYPE, + TYPE_DYNAMIC_PROPS) =20 #define TYPE_UNUSED_HOTPLUG "hotplug-type" #define TYPE_UNUSED_NOHOTPLUG "nohotplug-type" diff --git a/ui/console.c b/ui/console.c index 37972cb5e0..f8d7643fe4 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1090,7 +1090,8 @@ struct VCChardev { typedef struct VCChardev VCChardev; =20 #define TYPE_CHARDEV_VC "chardev-vc" -#define VC_CHARDEV(obj) OBJECT_CHECK(VCChardev, (obj), TYPE_CHARDEV_VC) +DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV, + TYPE_CHARDEV_VC) =20 static int vc_chr_write(Chardev *chr, const uint8_t *buf, int len) { diff --git a/ui/gtk.c b/ui/gtk.c index 558c63dc22..d28d7545d3 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -179,7 +179,8 @@ struct VCChardev { typedef struct VCChardev VCChardev; =20 #define TYPE_CHARDEV_VC "chardev-vc" -#define VC_CHARDEV(obj) OBJECT_CHECK(VCChardev, (obj), TYPE_CHARDEV_VC) +DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV, + TYPE_CHARDEV_VC) =20 bool gtk_use_gl_area; =20 diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 477f6cd70e..67d52afbea 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -22,12 +22,8 @@ #define TYPE_INPUT_BARRIER "input-barrier" typedef struct InputBarrier InputBarrier; typedef struct InputBarrierClass InputBarrierClass; -#define INPUT_BARRIER(obj) \ - OBJECT_CHECK(InputBarrier, (obj), TYPE_INPUT_BARRIER) -#define INPUT_BARRIER_GET_CLASS(obj) \ - OBJECT_GET_CLASS(InputBarrierClass, (obj), TYPE_INPUT_BARRIER) -#define INPUT_BARRIER_CLASS(klass) \ - OBJECT_CLASS_CHECK(InputBarrierClass, (klass), TYPE_INPUT_BARRIER) +DECLARE_OBJ_CHECKERS(InputBarrier, InputBarrierClass, + INPUT_BARRIER, TYPE_INPUT_BARRIER) =20 =20 #define MAX_HELLO_LENGTH 1024 diff --git a/ui/input-linux.c b/ui/input-linux.c index 1b35c044e6..bfdbd38c86 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -33,12 +33,8 @@ static bool linux_is_button(unsigned int lnx) #define TYPE_INPUT_LINUX "input-linux" typedef struct InputLinux InputLinux; typedef struct InputLinuxClass InputLinuxClass; -#define INPUT_LINUX(obj) \ - OBJECT_CHECK(InputLinux, (obj), TYPE_INPUT_LINUX) -#define INPUT_LINUX_GET_CLASS(obj) \ - OBJECT_GET_CLASS(InputLinuxClass, (obj), TYPE_INPUT_LINUX) -#define INPUT_LINUX_CLASS(klass) \ - OBJECT_CLASS_CHECK(InputLinuxClass, (klass), TYPE_INPUT_LINUX) +DECLARE_OBJ_CHECKERS(InputLinux, InputLinuxClass, + INPUT_LINUX, TYPE_INPUT_LINUX) =20 =20 struct InputLinux { diff --git a/ui/spice-app.c b/ui/spice-app.c index d68a35c3b1..93e105c6ee 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -47,7 +47,8 @@ struct VCChardev { typedef struct VCChardev VCChardev; =20 #define TYPE_CHARDEV_VC "chardev-vc" -#define VC_CHARDEV(obj) OBJECT_CHECK(VCChardev, (obj), TYPE_CHARDEV_VC) +DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV, + TYPE_CHARDEV_VC) =20 static ChardevBackend * chr_spice_backend_new(void) --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167118; cv=none; d=zohomail.com; s=zohoarc; b=e8CFN+sZ8YFdqUOxIm1PvgKggSAmGVNZdMX72CoPd7y2cpA+LhgKYyC+ZhQ8laC1wvnMjFjOLalHJffMawEFbqFMGj5/mYHNnfYQC+WKHEzaD2j0VQ46oTAMpReIb+iP6Rj3J28OFkRKDE1UJyAZIUeRgTp9skw0lV5jJ8oKYew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167118; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EVOFLhGS1ayfqgVDrW1HUrqH3Kic36OYN3ARbCi2xqQ=; b=FIUv1By5nz8IpxUG74f1RnzeW3KckEu/gNUeBxq6tkBp+aSsvcxxoUEJJJYCdpb8PHLab5MAS+E8EKWPD3c2HDgH9yMDOrL4Diax7onKkDyRthh3DspDdGM2s7adAoRktB8CT6FqoVwE8/MZJKPAHbbyUpUWx4+5e+3A/hN1T6U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167118300220.9625078776579; Thu, 3 Sep 2020 14:05:18 -0700 (PDT) Received: from localhost ([::1]:52914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwQ1-00025l-8c for importer@patchew.org; Thu, 03 Sep 2020 17:05:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEN-0000gV-9V for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEK-0006aB-9y for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:14 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-6E9Ik9oGOUSwdVkPtwAe6A-1; Thu, 03 Sep 2020 16:53:08 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A464618BA2AD; Thu, 3 Sep 2020 20:53:07 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E0531002D57; Thu, 3 Sep 2020 20:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EVOFLhGS1ayfqgVDrW1HUrqH3Kic36OYN3ARbCi2xqQ=; b=XMSNI/P/1xAgOqj0+cpunMMbAuQURjFkWvjxpvsOot2Vp4a0FuDp4GKUWzSo+hy1KN1b79 6JRxN0yzwulNaL94OsEP8e6YHsZNhfESmk6pOC8LtzxVvCy/EKc3THRbN2m2kqACr30TV8 sRgF478jW4YundeB7/PxmVZ/c4WSKw8= X-MC-Unique: 6E9Ik9oGOUSwdVkPtwAe6A-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 10/27] Use DECLARE_*CHECKER* when possible (--force mode) Date: Thu, 3 Sep 2020 16:52:30 -0400 Message-Id: <20200903205247.1667472-11-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Separate run of the TypeCheckMacro converter using the --force flag, for the cases where typedefs weren't found in the same header nor in typedefs.h. Generated initially using: $ ./scripts/codeconverter/converter.py --force -i \ --pattern=3DTypeCheckMacro $(git grep -l '' -- '*.[ch]') Then each case was manually reviewed, and a comment was added indicating what's unusual about those type checking macros/functions. Despite not following the usual pattern, the changes in this patch were found to be safe. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-15-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/intc/arm_gic.h | 9 +++------ include/hw/intc/arm_gicv3.h | 8 +++----- include/hw/ppc/xics_spapr.h | 4 +++- include/hw/virtio/virtio-mmio.h | 9 +++------ hw/intc/apic.c | 5 +++-- hw/intc/arm_gic_kvm.c | 9 +++------ hw/intc/arm_gicv3_its_kvm.c | 8 +++----- hw/intc/arm_gicv3_kvm.c | 9 +++------ hw/sd/allwinner-sdhost.c | 5 +++-- hw/sd/bcm2835_sdhost.c | 5 +++-- hw/sd/pxa2xx_mmci.c | 4 +++- hw/sd/sdhci.c | 4 +++- 12 files changed, 36 insertions(+), 43 deletions(-) diff --git a/include/hw/intc/arm_gic.h b/include/hw/intc/arm_gic.h index 704ef2b751..116ccbb5a9 100644 --- a/include/hw/intc/arm_gic.h +++ b/include/hw/intc/arm_gic.h @@ -74,12 +74,9 @@ =20 #define TYPE_ARM_GIC "arm_gic" typedef struct ARMGICClass ARMGICClass; -#define ARM_GIC(obj) \ - OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC) -#define ARM_GIC_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMGICClass, (klass), TYPE_ARM_GIC) -#define ARM_GIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMGICClass, (obj), TYPE_ARM_GIC) +/* This is reusing the GICState typedef from TYPE_ARM_GIC_COMMON */ +DECLARE_OBJ_CHECKERS(GICState, ARMGICClass, + ARM_GIC, TYPE_ARM_GIC) =20 struct ARMGICClass { /*< private >*/ diff --git a/include/hw/intc/arm_gicv3.h b/include/hw/intc/arm_gicv3.h index 58e9131a33..a81a6ae7ec 100644 --- a/include/hw/intc/arm_gicv3.h +++ b/include/hw/intc/arm_gicv3.h @@ -17,11 +17,9 @@ =20 #define TYPE_ARM_GICV3 "arm-gicv3" typedef struct ARMGICv3Class ARMGICv3Class; -#define ARM_GICV3(obj) OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3) -#define ARM_GICV3_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMGICv3Class, (klass), TYPE_ARM_GICV3) -#define ARM_GICV3_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMGICv3Class, (obj), TYPE_ARM_GICV3) +/* This is reusing the GICState typedef from TYPE_ARM_GICV3_COMMON */ +DECLARE_OBJ_CHECKERS(GICv3State, ARMGICv3Class, + ARM_GICV3, TYPE_ARM_GICV3) =20 struct ARMGICv3Class { /*< private >*/ diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h index 09e428de4e..0b8182e40b 100644 --- a/include/hw/ppc/xics_spapr.h +++ b/include/hw/ppc/xics_spapr.h @@ -31,7 +31,9 @@ #include "qom/object.h" =20 #define TYPE_ICS_SPAPR "ics-spapr" -#define ICS_SPAPR(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS_SPAPR) +/* This is reusing the ICSState typedef from TYPE_ICS */ +DECLARE_INSTANCE_CHECKER(ICSState, ICS_SPAPR, + TYPE_ICS_SPAPR) =20 int xics_kvm_connect(SpaprInterruptController *intc, uint32_t nr_servers, Error **errp); diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmi= o.h index dca651fd14..6a1c2c20d4 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -28,12 +28,9 @@ /* QOM macros */ /* virtio-mmio-bus */ #define TYPE_VIRTIO_MMIO_BUS "virtio-mmio-bus" -#define VIRTIO_MMIO_BUS(obj) \ - OBJECT_CHECK(VirtioBusState, (obj), TYPE_VIRTIO_MMIO_BUS) -#define VIRTIO_MMIO_BUS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(VirtioBusClass, (obj), TYPE_VIRTIO_MMIO_BUS) -#define VIRTIO_MMIO_BUS_CLASS(klass) \ - OBJECT_CLASS_CHECK(VirtioBusClass, (klass), TYPE_VIRTIO_MMIO_BUS) +/* This is reusing the VirtioBusState typedef from TYPE_VIRTIO_BUS */ +DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass, + VIRTIO_MMIO_BUS, TYPE_VIRTIO_MMIO_BUS) =20 /* virtio-mmio */ #define TYPE_VIRTIO_MMIO "virtio-mmio" diff --git a/hw/intc/apic.c b/hw/intc/apic.c index e055bb3af2..b6a05e5439 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -40,8 +40,9 @@ static APICCommonState *local_apics[MAX_APICS + 1]; =20 #define TYPE_APIC "apic" -#define APIC(obj) \ - OBJECT_CHECK(APICCommonState, (obj), TYPE_APIC) +/*This is reusing the APICCommonState typedef from APIC_COMMON */ +DECLARE_INSTANCE_CHECKER(APICCommonState, APIC, + TYPE_APIC) =20 static void apic_set_irq(APICCommonState *s, int vector_num, int trigger_m= ode); static void apic_update_irq(APICCommonState *s); diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index 6e5a2b8fe0..9494185cf4 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -33,12 +33,9 @@ =20 #define TYPE_KVM_ARM_GIC "kvm-arm-gic" typedef struct KVMARMGICClass KVMARMGICClass; -#define KVM_ARM_GIC(obj) \ - OBJECT_CHECK(GICState, (obj), TYPE_KVM_ARM_GIC) -#define KVM_ARM_GIC_CLASS(klass) \ - OBJECT_CLASS_CHECK(KVMARMGICClass, (klass), TYPE_KVM_ARM_GIC) -#define KVM_ARM_GIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(KVMARMGICClass, (obj), TYPE_KVM_ARM_GIC) +/* This is reusing the GICState typedef from ARM_GIC_COMMON */ +DECLARE_OBJ_CHECKERS(GICState, KVMARMGICClass, + KVM_ARM_GIC, TYPE_KVM_ARM_GIC) =20 struct KVMARMGICClass { ARMGICCommonClass parent_class; diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index 631adc34b6..4ee9875ecc 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -31,11 +31,9 @@ =20 #define TYPE_KVM_ARM_ITS "arm-its-kvm" typedef struct KVMARMITSClass KVMARMITSClass; -#define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_I= TS) -#define KVM_ARM_ITS_CLASS(klass) \ - OBJECT_CLASS_CHECK(KVMARMITSClass, (klass), TYPE_KVM_ARM_ITS) -#define KVM_ARM_ITS_GET_CLASS(obj) \ - OBJECT_GET_CLASS(KVMARMITSClass, (obj), TYPE_KVM_ARM_ITS) +/* This is reusing the GICv3ITSState typedef from ARM_GICV3_ITS_COMMON */ +DECLARE_OBJ_CHECKERS(GICv3ITSState, KVMARMITSClass, + KVM_ARM_ITS, TYPE_KVM_ARM_ITS) =20 struct KVMARMITSClass { GICv3ITSCommonClass parent_class; diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 5733936334..187eb054e0 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -43,12 +43,9 @@ =20 #define TYPE_KVM_ARM_GICV3 "kvm-arm-gicv3" typedef struct KVMARMGICv3Class KVMARMGICv3Class; -#define KVM_ARM_GICV3(obj) \ - OBJECT_CHECK(GICv3State, (obj), TYPE_KVM_ARM_GICV3) -#define KVM_ARM_GICV3_CLASS(klass) \ - OBJECT_CLASS_CHECK(KVMARMGICv3Class, (klass), TYPE_KVM_ARM_GICV3) -#define KVM_ARM_GICV3_GET_CLASS(obj) \ - OBJECT_GET_CLASS(KVMARMGICv3Class, (obj), TYPE_KVM_ARM_GICV3) +/* This is reusing the GICv3State typedef from ARM_GICV3_ITS_COMMON */ +DECLARE_OBJ_CHECKERS(GICv3State, KVMARMGICv3Class, + KVM_ARM_GICV3, TYPE_KVM_ARM_GICV3) =20 #define KVM_DEV_ARM_VGIC_SYSREG(op0, op1, crn, crm, op2) \ (ARM64_SYS_REG_SHIFT_MASK(op0, OP0) | \ diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c index e0cc5847f3..bea6d97ef8 100644 --- a/hw/sd/allwinner-sdhost.c +++ b/hw/sd/allwinner-sdhost.c @@ -32,8 +32,9 @@ #include "qom/object.h" =20 #define TYPE_AW_SDHOST_BUS "allwinner-sdhost-bus" -#define AW_SDHOST_BUS(obj) \ - OBJECT_CHECK(SDBus, (obj), TYPE_AW_SDHOST_BUS) +/* This is reusing the SDBus typedef from SD_BUS */ +DECLARE_INSTANCE_CHECKER(SDBus, AW_SDHOST_BUS, + TYPE_AW_SDHOST_BUS) =20 /* SD Host register offsets */ enum { diff --git a/hw/sd/bcm2835_sdhost.c b/hw/sd/bcm2835_sdhost.c index 743abccbae..50f5fdb88b 100644 --- a/hw/sd/bcm2835_sdhost.c +++ b/hw/sd/bcm2835_sdhost.c @@ -22,8 +22,9 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_SDHOST_BUS "bcm2835-sdhost-bus" -#define BCM2835_SDHOST_BUS(obj) \ - OBJECT_CHECK(SDBus, (obj), TYPE_BCM2835_SDHOST_BUS) +/* This is reusing the SDBus typedef from SD_BUS */ +DECLARE_INSTANCE_CHECKER(SDBus, BCM2835_SDHOST_BUS, + TYPE_BCM2835_SDHOST_BUS) =20 #define SDCMD 0x00 /* Command to SD card - 16 R/W */ #define SDARG 0x04 /* Argument to SD card - 32 R/W */ diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 757a6a3c63..3dd2fc7a83 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -24,7 +24,9 @@ #include "qom/object.h" =20 #define TYPE_PXA2XX_MMCI_BUS "pxa2xx-mmci-bus" -#define PXA2XX_MMCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_PXA2XX_MMCI_B= US) +/* This is reusing the SDBus typedef from SD_BUS */ +DECLARE_INSTANCE_CHECKER(SDBus, PXA2XX_MMCI_BUS, + TYPE_PXA2XX_MMCI_BUS) =20 struct PXA2xxMMCIState { SysBusDevice parent_obj; diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 63772bfab6..6900213083 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -40,7 +40,9 @@ #include "qom/object.h" =20 #define TYPE_SDHCI_BUS "sdhci-bus" -#define SDHCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SDHCI_BUS) +/* This is reusing the SDBus typedef from SD_BUS */ +DECLARE_INSTANCE_CHECKER(SDBus, SDHCI_BUS, + TYPE_SDHCI_BUS) =20 #define MASKED_WRITE(reg, mask, val) (reg =3D (reg & (mask)) | (val)) =20 --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166951; cv=none; d=zohomail.com; s=zohoarc; b=eYnS6WkhtIKMzQBymMM68BNNeLKthmiI1Sx/OegZC5Iilk2FlAwC/dSe0cLZoW5NdaNJ1C6wnZRPA4BRFPe1F1PnuEfUAArcGrN3h50gxpbV1OvJnCM0NBS1nxE/jLSHC27mrMMkvsHQtLeELAA7dRjpbKjS8JYKctQ7m0ib+oU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166951; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N9UDqCIS8QBp3Ik3g8pO9cSWhctSfRW/zV6gUj+qvx0=; b=KH0NvpJNf8YETd6o7pvQqRviZbw3ql42cp/3sqapYFLao60XU9g7lDMG6AUEW+/VIeYE74u+zXLImJAzhDXwmaz+/TMbW2xiBZAMSmYsMb4k6MabAisuqf/y2cCUt64cBu7EFwZ4oOYxuw0FjpHKzI38vhp+wJecL4mUTCtRPzY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166951132680.0618445815439; Thu, 3 Sep 2020 14:02:31 -0700 (PDT) Received: from localhost ([::1]:43264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwNK-0006P9-8o for importer@patchew.org; Thu, 03 Sep 2020 17:02:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwET-0000uN-PN for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEN-0006aO-6k for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-laOufLEWPrG_vohKGqivRw-1; Thu, 03 Sep 2020 16:53:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4B6010BBEC3; Thu, 3 Sep 2020 20:53:08 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7745581190; Thu, 3 Sep 2020 20:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N9UDqCIS8QBp3Ik3g8pO9cSWhctSfRW/zV6gUj+qvx0=; b=CMZ/US0PIP94s8X3wn0hAvsndaYtJ2RbCXC7gNSy7q2A4DHRr0PKN++obFGvUU7APaWHS2 wDoVY6H8rjRBKnGZBHK8r6jc4muNEcfZCysJIdhdYzEtJtkSdSmkj/n961uvmcOZ4eMn25 yrMYA1cTPex06uH41WMGsgyq+5O4IFk= X-MC-Unique: laOufLEWPrG_vohKGqivRw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 11/27] Use OBJECT_DECLARE_TYPE where possible Date: Thu, 3 Sep 2020 16:52:31 -0400 Message-Id: <20200903205247.1667472-12-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Replace DECLARE_OBJ_CHECKERS with OBJECT_DECLARE_TYPE where the typedefs can be safely removed. Generated running: $ ./scripts/codeconverter/converter.py -i \ --pattern=3DDeclareObjCheckers $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20200831210740.126168-16-ehabkost@redhat.com> Message-Id: <20200831210740.126168-17-ehabkost@redhat.com> Message-Id: <20200831210740.126168-18-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/audio/intel-hda.h | 6 ++---- hw/display/virtio-vga.h | 6 ++---- include/authz/base.h | 6 ++---- include/authz/list.h | 6 ++---- include/authz/listfile.h | 6 ++---- include/authz/pamacct.h | 6 ++---- include/authz/simple.h | 6 ++---- include/crypto/secret_common.h | 6 ++---- include/crypto/secret_keyring.h | 6 ++---- include/hw/arm/armsse.h | 6 ++---- include/hw/hyperv/vmbus.h | 6 ++---- include/hw/i2c/i2c.h | 6 ++---- include/hw/i2c/smbus_slave.h | 6 ++---- include/hw/ipack/ipack.h | 6 ++---- include/hw/ipmi/ipmi.h | 6 ++---- include/hw/mem/pc-dimm.h | 6 ++---- include/hw/ppc/pnv.h | 6 ++---- include/hw/ppc/pnv_core.h | 6 ++---- include/hw/ppc/pnv_homer.h | 6 ++---- include/hw/ppc/pnv_occ.h | 6 ++---- include/hw/ppc/pnv_psi.h | 6 ++---- include/hw/ppc/pnv_xive.h | 6 ++---- include/hw/ppc/spapr_cpu_core.h | 6 ++---- include/hw/ppc/spapr_drc.h | 6 ++---- include/hw/ppc/spapr_vio.h | 6 ++---- include/hw/ppc/spapr_xive.h | 6 ++---- include/hw/ppc/xics.h | 6 ++---- include/hw/ppc/xive.h | 6 ++---- include/hw/s390x/event-facility.h | 6 ++---- include/hw/s390x/s390_flic.h | 6 ++---- include/hw/s390x/sclp.h | 6 ++---- include/hw/sd/sd.h | 6 ++---- include/hw/ssi/ssi.h | 6 ++---- include/hw/sysbus.h | 6 ++---- include/hw/virtio/virtio-gpu.h | 6 ++---- include/hw/virtio/virtio-input.h | 6 ++---- include/hw/virtio/virtio-mem.h | 6 ++---- include/hw/virtio/virtio-pmem.h | 6 ++---- include/hw/virtio/virtio-serial.h | 6 ++---- include/hw/xen/xen-bus.h | 6 ++---- include/io/channel.h | 6 ++---- include/io/dns-resolver.h | 6 ++---- include/io/net-listener.h | 6 ++---- include/scsi/pr-manager.h | 6 ++---- include/sysemu/cryptodev.h | 6 ++---- include/sysemu/hostmem.h | 6 ++---- include/sysemu/rng.h | 6 ++---- include/sysemu/tpm_backend.h | 6 ++---- include/sysemu/vhost-user-backend.h | 6 ++---- target/alpha/cpu-qom.h | 6 ++---- target/arm/cpu-qom.h | 6 ++---- target/avr/cpu-qom.h | 6 ++---- target/cris/cpu-qom.h | 6 ++---- target/hppa/cpu-qom.h | 6 ++---- target/i386/cpu-qom.h | 6 ++---- target/lm32/cpu-qom.h | 6 ++---- target/m68k/cpu-qom.h | 6 ++---- target/microblaze/cpu-qom.h | 6 ++---- target/mips/cpu-qom.h | 6 ++---- target/moxie/cpu.h | 6 ++---- target/nios2/cpu.h | 6 ++---- target/openrisc/cpu.h | 6 ++---- target/ppc/cpu-qom.h | 6 ++---- target/riscv/cpu.h | 6 ++---- target/rx/cpu-qom.h | 6 ++---- target/s390x/cpu-qom.h | 6 ++---- target/sh4/cpu-qom.h | 6 ++---- target/sparc/cpu-qom.h | 6 ++---- target/tilegx/cpu.h | 6 ++---- target/tricore/cpu-qom.h | 6 ++---- target/unicore32/cpu-qom.h | 6 ++---- target/xtensa/cpu-qom.h | 6 ++---- backends/dbus-vmstate.c | 6 ++---- ui/input-barrier.c | 6 ++---- ui/input-linux.c | 6 ++---- 75 files changed, 150 insertions(+), 300 deletions(-) diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index 813a7a357d..f5cce18fa3 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -8,10 +8,8 @@ /* hda bus */ =20 #define TYPE_HDA_CODEC_DEVICE "hda-codec" -typedef struct HDACodecDevice HDACodecDevice; -typedef struct HDACodecDeviceClass HDACodecDeviceClass; -DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass, - HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE) +OBJECT_DECLARE_TYPE(HDACodecDevice, HDACodecDeviceClass, + hda_codec_device, HDA_CODEC_DEVICE) =20 #define TYPE_HDA_BUS "HDA" typedef struct HDACodecBus HDACodecBus; diff --git a/hw/display/virtio-vga.h b/hw/display/virtio-vga.h index 19f8af7356..5c5671c9c1 100644 --- a/hw/display/virtio-vga.h +++ b/hw/display/virtio-vga.h @@ -9,10 +9,8 @@ * virtio-vga-base: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base" -typedef struct VirtIOVGABase VirtIOVGABase; -typedef struct VirtIOVGABaseClass VirtIOVGABaseClass; -DECLARE_OBJ_CHECKERS(VirtIOVGABase, VirtIOVGABaseClass, - VIRTIO_VGA_BASE, TYPE_VIRTIO_VGA_BASE) +OBJECT_DECLARE_TYPE(VirtIOVGABase, VirtIOVGABaseClass, + virtio_vga_base, VIRTIO_VGA_BASE) =20 struct VirtIOVGABase { VirtIOPCIProxy parent_obj; diff --git a/include/authz/base.h b/include/authz/base.h index 8d8cf9fa5a..06b5e29f6f 100644 --- a/include/authz/base.h +++ b/include/authz/base.h @@ -27,10 +27,8 @@ =20 #define TYPE_QAUTHZ "authz" =20 -typedef struct QAuthZ QAuthZ; -typedef struct QAuthZClass QAuthZClass; -DECLARE_OBJ_CHECKERS(QAuthZ, QAuthZClass, - QAUTHZ, TYPE_QAUTHZ) +OBJECT_DECLARE_TYPE(QAuthZ, QAuthZClass, + qauthz, QAUTHZ) =20 =20 /** diff --git a/include/authz/list.h b/include/authz/list.h index 93d16876bc..e4e1040472 100644 --- a/include/authz/list.h +++ b/include/authz/list.h @@ -27,10 +27,8 @@ =20 #define TYPE_QAUTHZ_LIST "authz-list" =20 -typedef struct QAuthZList QAuthZList; -typedef struct QAuthZListClass QAuthZListClass; -DECLARE_OBJ_CHECKERS(QAuthZList, QAuthZListClass, - QAUTHZ_LIST, TYPE_QAUTHZ_LIST) +OBJECT_DECLARE_TYPE(QAuthZList, QAuthZListClass, + qauthz_list, QAUTHZ_LIST) =20 =20 =20 diff --git a/include/authz/listfile.h b/include/authz/listfile.h index 2e4a629b6d..89c5eafbfa 100644 --- a/include/authz/listfile.h +++ b/include/authz/listfile.h @@ -27,10 +27,8 @@ =20 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file" =20 -typedef struct QAuthZListFile QAuthZListFile; -typedef struct QAuthZListFileClass QAuthZListFileClass; -DECLARE_OBJ_CHECKERS(QAuthZListFile, QAuthZListFileClass, - QAUTHZ_LIST_FILE, TYPE_QAUTHZ_LIST_FILE) +OBJECT_DECLARE_TYPE(QAuthZListFile, QAuthZListFileClass, + qauthz_list_file, QAUTHZ_LIST_FILE) =20 =20 =20 diff --git a/include/authz/pamacct.h b/include/authz/pamacct.h index 98454ddc25..44bb5ff28d 100644 --- a/include/authz/pamacct.h +++ b/include/authz/pamacct.h @@ -27,10 +27,8 @@ =20 #define TYPE_QAUTHZ_PAM "authz-pam" =20 -typedef struct QAuthZPAM QAuthZPAM; -typedef struct QAuthZPAMClass QAuthZPAMClass; -DECLARE_OBJ_CHECKERS(QAuthZPAM, QAuthZPAMClass, - QAUTHZ_PAM, TYPE_QAUTHZ_PAM) +OBJECT_DECLARE_TYPE(QAuthZPAM, QAuthZPAMClass, + qauthz_pam, QAUTHZ_PAM) =20 =20 =20 diff --git a/include/authz/simple.h b/include/authz/simple.h index 7a896fb94b..ba4a5ec5ea 100644 --- a/include/authz/simple.h +++ b/include/authz/simple.h @@ -26,10 +26,8 @@ =20 #define TYPE_QAUTHZ_SIMPLE "authz-simple" =20 -typedef struct QAuthZSimple QAuthZSimple; -typedef struct QAuthZSimpleClass QAuthZSimpleClass; -DECLARE_OBJ_CHECKERS(QAuthZSimple, QAuthZSimpleClass, - QAUTHZ_SIMPLE, TYPE_QAUTHZ_SIMPLE) +OBJECT_DECLARE_TYPE(QAuthZSimple, QAuthZSimpleClass, + qauthz_simple, QAUTHZ_SIMPLE) =20 =20 =20 diff --git a/include/crypto/secret_common.h b/include/crypto/secret_common.h index dd3310ea5f..daf00c3b2a 100644 --- a/include/crypto/secret_common.h +++ b/include/crypto/secret_common.h @@ -25,10 +25,8 @@ #include "qom/object.h" =20 #define TYPE_QCRYPTO_SECRET_COMMON "secret_common" -typedef struct QCryptoSecretCommon QCryptoSecretCommon; -typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass; -DECLARE_OBJ_CHECKERS(QCryptoSecretCommon, QCryptoSecretCommonClass, - QCRYPTO_SECRET_COMMON, TYPE_QCRYPTO_SECRET_COMMON) +OBJECT_DECLARE_TYPE(QCryptoSecretCommon, QCryptoSecretCommonClass, + qcrypto_secret_common, QCRYPTO_SECRET_COMMON) =20 =20 struct QCryptoSecretCommon { diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyrin= g.h index 9875f4cbf3..cc2c7397db 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -26,10 +26,8 @@ #include "crypto/secret_common.h" =20 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" -typedef struct QCryptoSecretKeyring QCryptoSecretKeyring; -typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass; -DECLARE_OBJ_CHECKERS(QCryptoSecretKeyring, QCryptoSecretKeyringClass, - QCRYPTO_SECRET_KEYRING, TYPE_QCRYPTO_SECRET_KEYRING) +OBJECT_DECLARE_TYPE(QCryptoSecretKeyring, QCryptoSecretKeyringClass, + qcrypto_secret_keyring, QCRYPTO_SECRET_KEYRING) =20 =20 struct QCryptoSecretKeyring { diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index 452cbb5793..b844ef6bc0 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -108,10 +108,8 @@ #include "qom/object.h" =20 #define TYPE_ARM_SSE "arm-sse" -typedef struct ARMSSE ARMSSE; -typedef struct ARMSSEClass ARMSSEClass; -DECLARE_OBJ_CHECKERS(ARMSSE, ARMSSEClass, - ARM_SSE, TYPE_ARM_SSE) +OBJECT_DECLARE_TYPE(ARMSSE, ARMSSEClass, + arm_sse, ARM_SSE) =20 /* * These type names are for specific IoTKit subsystems; other than diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h index 0fe3d3b47c..00ad8798c1 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -20,10 +20,8 @@ =20 #define TYPE_VMBUS_DEVICE "vmbus-dev" =20 -typedef struct VMBusDevice VMBusDevice; -typedef struct VMBusDeviceClass VMBusDeviceClass; -DECLARE_OBJ_CHECKERS(VMBusDevice, VMBusDeviceClass, - VMBUS_DEVICE, TYPE_VMBUS_DEVICE) +OBJECT_DECLARE_TYPE(VMBusDevice, VMBusDeviceClass, + vmbus_device, VMBUS_DEVICE) =20 #define TYPE_VMBUS "vmbus" typedef struct VMBus VMBus; diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 2074f7c971..5b8eef62c6 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -16,12 +16,10 @@ enum i2c_event { I2C_NACK /* Masker NACKed a receive byte. */ }; =20 -typedef struct I2CSlave I2CSlave; =20 #define TYPE_I2C_SLAVE "i2c-slave" -typedef struct I2CSlaveClass I2CSlaveClass; -DECLARE_OBJ_CHECKERS(I2CSlave, I2CSlaveClass, - I2C_SLAVE, TYPE_I2C_SLAVE) +OBJECT_DECLARE_TYPE(I2CSlave, I2CSlaveClass, + i2c_slave, I2C_SLAVE) =20 struct I2CSlaveClass { DeviceClass parent_class; diff --git a/include/hw/i2c/smbus_slave.h b/include/hw/i2c/smbus_slave.h index 8d16e4bcd9..cb9cb372f9 100644 --- a/include/hw/i2c/smbus_slave.h +++ b/include/hw/i2c/smbus_slave.h @@ -29,10 +29,8 @@ #include "qom/object.h" =20 #define TYPE_SMBUS_DEVICE "smbus-device" -typedef struct SMBusDevice SMBusDevice; -typedef struct SMBusDeviceClass SMBusDeviceClass; -DECLARE_OBJ_CHECKERS(SMBusDevice, SMBusDeviceClass, - SMBUS_DEVICE, TYPE_SMBUS_DEVICE) +OBJECT_DECLARE_TYPE(SMBusDevice, SMBusDeviceClass, + smbus_device, SMBUS_DEVICE) =20 =20 struct SMBusDeviceClass { diff --git a/include/hw/ipack/ipack.h b/include/hw/ipack/ipack.h index a2304c1b3e..a59a487853 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -30,12 +30,10 @@ struct IPackBus { qemu_irq_handler set_irq; }; =20 -typedef struct IPackDevice IPackDevice; -typedef struct IPackDeviceClass IPackDeviceClass; =20 #define TYPE_IPACK_DEVICE "ipack-device" -DECLARE_OBJ_CHECKERS(IPackDevice, IPackDeviceClass, - IPACK_DEVICE, TYPE_IPACK_DEVICE) +OBJECT_DECLARE_TYPE(IPackDevice, IPackDeviceClass, + ipack_device, IPACK_DEVICE) =20 struct IPackDeviceClass { /*< private >*/ diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index d2ed0a9fc4..9915b146f7 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -175,10 +175,8 @@ struct IPMIInterfaceClass { * Define a BMC simulator (or perhaps a connection to a real BMC) */ #define TYPE_IPMI_BMC "ipmi-bmc" -typedef struct IPMIBmc IPMIBmc; -typedef struct IPMIBmcClass IPMIBmcClass; -DECLARE_OBJ_CHECKERS(IPMIBmc, IPMIBmcClass, - IPMI_BMC, TYPE_IPMI_BMC) +OBJECT_DECLARE_TYPE(IPMIBmc, IPMIBmcClass, + ipmi_bmc, IPMI_BMC) =20 struct IPMIBmc { DeviceState parent; diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 86e3010243..1d570defc9 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -21,10 +21,8 @@ #include "qom/object.h" =20 #define TYPE_PC_DIMM "pc-dimm" -typedef struct PCDIMMDevice PCDIMMDevice; -typedef struct PCDIMMDeviceClass PCDIMMDeviceClass; -DECLARE_OBJ_CHECKERS(PCDIMMDevice, PCDIMMDeviceClass, - PC_DIMM, TYPE_PC_DIMM) +OBJECT_DECLARE_TYPE(PCDIMMDevice, PCDIMMDeviceClass, + pc_dimm, PC_DIMM) =20 #define PC_DIMM_ADDR_PROP "addr" #define PC_DIMM_SLOT_PROP "slot" diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index f3bacb6a5c..b4b2b24d80 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -35,10 +35,8 @@ #include "qom/object.h" =20 #define TYPE_PNV_CHIP "pnv-chip" -typedef struct PnvChip PnvChip; -typedef struct PnvChipClass PnvChipClass; -DECLARE_OBJ_CHECKERS(PnvChip, PnvChipClass, - PNV_CHIP, TYPE_PNV_CHIP) +OBJECT_DECLARE_TYPE(PnvChip, PnvChipClass, + pnv_chip, PNV_CHIP) =20 struct PnvChip { /*< private >*/ diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index fd17a236e3..5cb22c2fa9 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -25,10 +25,8 @@ #include "qom/object.h" =20 #define TYPE_PNV_CORE "powernv-cpu-core" -typedef struct PnvCore PnvCore; -typedef struct PnvCoreClass PnvCoreClass; -DECLARE_OBJ_CHECKERS(PnvCore, PnvCoreClass, - PNV_CORE, TYPE_PNV_CORE) +OBJECT_DECLARE_TYPE(PnvCore, PnvCoreClass, + pnv_core, PNV_CORE) =20 typedef struct PnvChip PnvChip; =20 diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h index 7aadcab03c..0978812713 100644 --- a/include/hw/ppc/pnv_homer.h +++ b/include/hw/ppc/pnv_homer.h @@ -24,10 +24,8 @@ #include "qom/object.h" =20 #define TYPE_PNV_HOMER "pnv-homer" -typedef struct PnvHomer PnvHomer; -typedef struct PnvHomerClass PnvHomerClass; -DECLARE_OBJ_CHECKERS(PnvHomer, PnvHomerClass, - PNV_HOMER, TYPE_PNV_HOMER) +OBJECT_DECLARE_TYPE(PnvHomer, PnvHomerClass, + pnv_homer, PNV_HOMER) #define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8" DECLARE_INSTANCE_CHECKER(PnvHomer, PNV8_HOMER, TYPE_PNV8_HOMER) diff --git a/include/hw/ppc/pnv_occ.h b/include/hw/ppc/pnv_occ.h index 4fcfb32417..b79e3440be 100644 --- a/include/hw/ppc/pnv_occ.h +++ b/include/hw/ppc/pnv_occ.h @@ -24,10 +24,8 @@ #include "qom/object.h" =20 #define TYPE_PNV_OCC "pnv-occ" -typedef struct PnvOCC PnvOCC; -typedef struct PnvOCCClass PnvOCCClass; -DECLARE_OBJ_CHECKERS(PnvOCC, PnvOCCClass, - PNV_OCC, TYPE_PNV_OCC) +OBJECT_DECLARE_TYPE(PnvOCC, PnvOCCClass, + pnv_occ, PNV_OCC) #define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8" DECLARE_INSTANCE_CHECKER(PnvOCC, PNV8_OCC, TYPE_PNV8_OCC) diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index a33195df17..0034db44c3 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -26,10 +26,8 @@ #include "qom/object.h" =20 #define TYPE_PNV_PSI "pnv-psi" -typedef struct PnvPsi PnvPsi; -typedef struct PnvPsiClass PnvPsiClass; -DECLARE_OBJ_CHECKERS(PnvPsi, PnvPsiClass, - PNV_PSI, TYPE_PNV_PSI) +OBJECT_DECLARE_TYPE(PnvPsi, PnvPsiClass, + pnv_psi, PNV_PSI) =20 #define PSIHB_XSCOM_MAX 0x20 =20 diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index a014e2a726..29d5debd1c 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -16,10 +16,8 @@ struct PnvChip; =20 #define TYPE_PNV_XIVE "pnv-xive" -typedef struct PnvXive PnvXive; -typedef struct PnvXiveClass PnvXiveClass; -DECLARE_OBJ_CHECKERS(PnvXive, PnvXiveClass, - PNV_XIVE, TYPE_PNV_XIVE) +OBJECT_DECLARE_TYPE(PnvXive, PnvXiveClass, + pnv_xive, PNV_XIVE) =20 #define XIVE_BLOCK_MAX 16 =20 diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_cor= e.h index fba6a01050..4022917168 100644 --- a/include/hw/ppc/spapr_cpu_core.h +++ b/include/hw/ppc/spapr_cpu_core.h @@ -16,10 +16,8 @@ #include "qom/object.h" =20 #define TYPE_SPAPR_CPU_CORE "spapr-cpu-core" -typedef struct SpaprCpuCore SpaprCpuCore; -typedef struct SpaprCpuCoreClass SpaprCpuCoreClass; -DECLARE_OBJ_CHECKERS(SpaprCpuCore, SpaprCpuCoreClass, - SPAPR_CPU_CORE, TYPE_SPAPR_CPU_CORE) +OBJECT_DECLARE_TYPE(SpaprCpuCore, SpaprCpuCoreClass, + spapr_cpu_core, SPAPR_CPU_CORE) =20 #define SPAPR_CPU_CORE_TYPE_NAME(model) model "-" TYPE_SPAPR_CPU_CORE =20 diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 2236aea66a..6daafa8106 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -20,10 +20,8 @@ #include "qapi/error.h" =20 #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector" -typedef struct SpaprDrc SpaprDrc; -typedef struct SpaprDrcClass SpaprDrcClass; -DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass, - SPAPR_DR_CONNECTOR, TYPE_SPAPR_DR_CONNECTOR) +OBJECT_DECLARE_TYPE(SpaprDrc, SpaprDrcClass, + spapr_dr_connector, SPAPR_DR_CONNECTOR) =20 #define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" typedef struct SpaprDrcPhysical SpaprDrcPhysical; diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index e289028634..6c40da72ff 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -28,10 +28,8 @@ #include "qom/object.h" =20 #define TYPE_VIO_SPAPR_DEVICE "vio-spapr-device" -typedef struct SpaprVioDevice SpaprVioDevice; -typedef struct SpaprVioDeviceClass SpaprVioDeviceClass; -DECLARE_OBJ_CHECKERS(SpaprVioDevice, SpaprVioDeviceClass, - VIO_SPAPR_DEVICE, TYPE_VIO_SPAPR_DEVICE) +OBJECT_DECLARE_TYPE(SpaprVioDevice, SpaprVioDeviceClass, + vio_spapr_device, VIO_SPAPR_DEVICE) =20 #define TYPE_SPAPR_VIO_BUS "spapr-vio-bus" typedef struct SpaprVioBus SpaprVioBus; diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index feb6630783..afe8ec7197 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -15,10 +15,8 @@ #include "qom/object.h" =20 #define TYPE_SPAPR_XIVE "spapr-xive" -typedef struct SpaprXive SpaprXive; -typedef struct SpaprXiveClass SpaprXiveClass; -DECLARE_OBJ_CHECKERS(SpaprXive, SpaprXiveClass, - SPAPR_XIVE, TYPE_SPAPR_XIVE) +OBJECT_DECLARE_TYPE(SpaprXive, SpaprXiveClass, + spapr_xive, SPAPR_XIVE) =20 struct SpaprXive { XiveRouter parent; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index bcb584b90d..c5a3cdcadc 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -41,8 +41,6 @@ * (the kernel implementation supports more but we don't exploit * that yet) */ -typedef struct ICPStateClass ICPStateClass; -typedef struct ICPState ICPState; typedef struct PnvICPState PnvICPState; typedef struct ICSStateClass ICSStateClass; typedef struct ICSState ICSState; @@ -50,8 +48,8 @@ typedef struct ICSIRQState ICSIRQState; typedef struct XICSFabric XICSFabric; =20 #define TYPE_ICP "icp" -DECLARE_OBJ_CHECKERS(ICPState, ICPStateClass, - ICP, TYPE_ICP) +OBJECT_DECLARE_TYPE(ICPState, ICPStateClass, + icp, ICP) =20 #define TYPE_PNV_ICP "pnv-icp" DECLARE_INSTANCE_CHECKER(PnvICPState, PNV_ICP, diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 48595ab641..482fafccfd 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -345,12 +345,10 @@ struct XiveRouter { =20 XiveFabric *xfb; }; -typedef struct XiveRouter XiveRouter; =20 #define TYPE_XIVE_ROUTER "xive-router" -typedef struct XiveRouterClass XiveRouterClass; -DECLARE_OBJ_CHECKERS(XiveRouter, XiveRouterClass, - XIVE_ROUTER, TYPE_XIVE_ROUTER) +OBJECT_DECLARE_TYPE(XiveRouter, XiveRouterClass, + xive_router, XIVE_ROUTER) =20 struct XiveRouterClass { SysBusDeviceClass parent; diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index eccf6e924b..051c1c6576 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -42,10 +42,8 @@ #define SCLP_SELECTIVE_READ 0x01 =20 #define TYPE_SCLP_EVENT "s390-sclp-event-type" -typedef struct SCLPEvent SCLPEvent; -typedef struct SCLPEventClass SCLPEventClass; -DECLARE_OBJ_CHECKERS(SCLPEvent, SCLPEventClass, - SCLP_EVENT, TYPE_SCLP_EVENT) +OBJECT_DECLARE_TYPE(SCLPEvent, SCLPEventClass, + sclp_event, SCLP_EVENT) =20 #define TYPE_SCLP_CPU_HOTPLUG "sclp-cpu-hotplug" #define TYPE_SCLP_QUIESCE "sclpquiesce" diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index a6a123598d..4b718c8ebf 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -39,10 +39,8 @@ extern const VMStateDescription vmstate_adapter_routes; VMSTATE_STRUCT(_f, _s, 1, vmstate_adapter_routes, AdapterRoutes) =20 #define TYPE_S390_FLIC_COMMON "s390-flic" -typedef struct S390FLICState S390FLICState; -typedef struct S390FLICStateClass S390FLICStateClass; -DECLARE_OBJ_CHECKERS(S390FLICState, S390FLICStateClass, - S390_FLIC_COMMON, TYPE_S390_FLIC_COMMON) +OBJECT_DECLARE_TYPE(S390FLICState, S390FLICStateClass, + s390_flic_common, S390_FLIC_COMMON) =20 struct S390FLICState { SysBusDevice parent_obj; diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index 5038a45612..e9f0f7e67c 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -182,10 +182,8 @@ typedef struct SCCB { } QEMU_PACKED SCCB; =20 #define TYPE_SCLP "sclp" -typedef struct SCLPDevice SCLPDevice; -typedef struct SCLPDeviceClass SCLPDeviceClass; -DECLARE_OBJ_CHECKERS(SCLPDevice, SCLPDeviceClass, - SCLP, TYPE_SCLP) +OBJECT_DECLARE_TYPE(SCLPDevice, SCLPDeviceClass, + sclp, SCLP) =20 struct SCLPEventFacility; =20 diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 31ccbeab0e..54f97a07cd 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -90,7 +90,6 @@ typedef struct { } SDRequest; =20 typedef struct SDState SDState; -typedef struct SDBus SDBus; =20 #define TYPE_SD_CARD "sd-card" typedef struct SDCardClass SDCardClass; @@ -130,9 +129,8 @@ struct SDCardClass { }; =20 #define TYPE_SD_BUS "sd-bus" -typedef struct SDBusClass SDBusClass; -DECLARE_OBJ_CHECKERS(SDBus, SDBusClass, - SD_BUS, TYPE_SD_BUS) +OBJECT_DECLARE_TYPE(SDBus, SDBusClass, + sd_bus, SD_BUS) =20 struct SDBus { BusState qbus; diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index b9286989fc..4fe1d85136 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -14,13 +14,11 @@ #include "hw/qdev-core.h" #include "qom/object.h" =20 -typedef struct SSISlave SSISlave; -typedef struct SSISlaveClass SSISlaveClass; typedef enum SSICSMode SSICSMode; =20 #define TYPE_SSI_SLAVE "ssi-slave" -DECLARE_OBJ_CHECKERS(SSISlave, SSISlaveClass, - SSI_SLAVE, TYPE_SSI_SLAVE) +OBJECT_DECLARE_TYPE(SSISlave, SSISlaveClass, + ssi_slave, SSI_SLAVE) =20 #define SSI_GPIO_CS "ssi-gpio-cs" =20 diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 77e21bba18..28a9b0f634 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -14,12 +14,10 @@ DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS, TYPE_SYSTEM_BUS) =20 -typedef struct SysBusDevice SysBusDevice; =20 #define TYPE_SYS_BUS_DEVICE "sys-bus-device" -typedef struct SysBusDeviceClass SysBusDeviceClass; -DECLARE_OBJ_CHECKERS(SysBusDevice, SysBusDeviceClass, - SYS_BUS_DEVICE, TYPE_SYS_BUS_DEVICE) +OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass, + sys_bus_device, SYS_BUS_DEVICE) =20 /** * SysBusDeviceClass: diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 72f8689e2e..f334b78085 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -25,10 +25,8 @@ #include "qom/object.h" =20 #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base" -typedef struct VirtIOGPUBase VirtIOGPUBase; -typedef struct VirtIOGPUBaseClass VirtIOGPUBaseClass; -DECLARE_OBJ_CHECKERS(VirtIOGPUBase, VirtIOGPUBaseClass, - VIRTIO_GPU_BASE, TYPE_VIRTIO_GPU_BASE) +OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, + virtio_gpu_base, VIRTIO_GPU_BASE) =20 #define TYPE_VIRTIO_GPU "virtio-gpu-device" typedef struct VirtIOGPU VirtIOGPU; diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-in= put.h index c54aa6aa72..5eb9e7745e 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -19,10 +19,8 @@ typedef struct virtio_input_event virtio_input_event; /* qemu internals */ =20 #define TYPE_VIRTIO_INPUT "virtio-input-device" -typedef struct VirtIOInput VirtIOInput; -typedef struct VirtIOInputClass VirtIOInputClass; -DECLARE_OBJ_CHECKERS(VirtIOInput, VirtIOInputClass, - VIRTIO_INPUT, TYPE_VIRTIO_INPUT) +OBJECT_DECLARE_TYPE(VirtIOInput, VirtIOInputClass, + virtio_input, VIRTIO_INPUT) #define VIRTIO_INPUT_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT) =20 diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h index 5f0b81a967..dfc72e14b1 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -21,10 +21,8 @@ =20 #define TYPE_VIRTIO_MEM "virtio-mem" =20 -typedef struct VirtIOMEM VirtIOMEM; -typedef struct VirtIOMEMClass VirtIOMEMClass; -DECLARE_OBJ_CHECKERS(VirtIOMEM, VirtIOMEMClass, - VIRTIO_MEM, TYPE_VIRTIO_MEM) +OBJECT_DECLARE_TYPE(VirtIOMEM, VirtIOMEMClass, + virtio_mem, VIRTIO_MEM) =20 #define VIRTIO_MEM_MEMDEV_PROP "memdev" #define VIRTIO_MEM_NODE_PROP "node" diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pme= m.h index 6c15abad70..56df9a03ce 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -20,10 +20,8 @@ =20 #define TYPE_VIRTIO_PMEM "virtio-pmem" =20 -typedef struct VirtIOPMEM VirtIOPMEM; -typedef struct VirtIOPMEMClass VirtIOPMEMClass; -DECLARE_OBJ_CHECKERS(VirtIOPMEM, VirtIOPMEMClass, - VIRTIO_PMEM, TYPE_VIRTIO_PMEM) +OBJECT_DECLARE_TYPE(VirtIOPMEM, VirtIOPMEMClass, + virtio_pmem, VIRTIO_PMEM) =20 #define VIRTIO_PMEM_ADDR_PROP "memaddr" #define VIRTIO_PMEM_MEMDEV_PROP "memdev" diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-s= erial.h index bbc76d5032..0b7f963611 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -26,10 +26,8 @@ struct virtio_serial_conf { }; =20 #define TYPE_VIRTIO_SERIAL_PORT "virtio-serial-port" -typedef struct VirtIOSerialPort VirtIOSerialPort; -typedef struct VirtIOSerialPortClass VirtIOSerialPortClass; -DECLARE_OBJ_CHECKERS(VirtIOSerialPort, VirtIOSerialPortClass, - VIRTIO_SERIAL_PORT, TYPE_VIRTIO_SERIAL_PORT) +OBJECT_DECLARE_TYPE(VirtIOSerialPort, VirtIOSerialPortClass, + virtio_serial_port, VIRTIO_SERIAL_PORT) =20 typedef struct VirtIOSerial VirtIOSerial; =20 diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 35fec7c905..e0e67505b8 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -71,17 +71,15 @@ struct XenBus { XenWatch *backend_watch; QLIST_HEAD(, XenDevice) inactive_devices; }; -typedef struct XenBus XenBus; =20 struct XenBusClass { /*< private >*/ BusClass parent_class; }; -typedef struct XenBusClass XenBusClass; =20 #define TYPE_XEN_BUS "xen-bus" -DECLARE_OBJ_CHECKERS(XenBus, XenBusClass, - XEN_BUS, TYPE_XEN_BUS) +OBJECT_DECLARE_TYPE(XenBus, XenBusClass, + xen_bus, XEN_BUS) =20 void xen_bus_init(void); =20 diff --git a/include/io/channel.h b/include/io/channel.h index 3ebdc7954f..245479548a 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -26,10 +26,8 @@ #include "block/aio.h" =20 #define TYPE_QIO_CHANNEL "qio-channel" -typedef struct QIOChannel QIOChannel; -typedef struct QIOChannelClass QIOChannelClass; -DECLARE_OBJ_CHECKERS(QIOChannel, QIOChannelClass, - QIO_CHANNEL, TYPE_QIO_CHANNEL) +OBJECT_DECLARE_TYPE(QIOChannel, QIOChannelClass, + qio_channel, QIO_CHANNEL) =20 =20 #define QIO_CHANNEL_ERR_BLOCK -2 diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h index 96a3186b6b..8ae4857e05 100644 --- a/include/io/dns-resolver.h +++ b/include/io/dns-resolver.h @@ -26,10 +26,8 @@ #include "io/task.h" =20 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver" -typedef struct QIODNSResolver QIODNSResolver; -typedef struct QIODNSResolverClass QIODNSResolverClass; -DECLARE_OBJ_CHECKERS(QIODNSResolver, QIODNSResolverClass, - QIO_DNS_RESOLVER, TYPE_QIO_DNS_RESOLVER) +OBJECT_DECLARE_TYPE(QIODNSResolver, QIODNSResolverClass, + qio_dns_resolver, QIO_DNS_RESOLVER) =20 =20 /** diff --git a/include/io/net-listener.h b/include/io/net-listener.h index 93367db291..4f0847ff19 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -25,10 +25,8 @@ #include "qom/object.h" =20 #define TYPE_QIO_NET_LISTENER "qio-net-listener" -typedef struct QIONetListener QIONetListener; -typedef struct QIONetListenerClass QIONetListenerClass; -DECLARE_OBJ_CHECKERS(QIONetListener, QIONetListenerClass, - QIO_NET_LISTENER, TYPE_QIO_NET_LISTENER) +OBJECT_DECLARE_TYPE(QIONetListener, QIONetListenerClass, + qio_net_listener, QIO_NET_LISTENER) =20 =20 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener, diff --git a/include/scsi/pr-manager.h b/include/scsi/pr-manager.h index f801fe9533..26bd134531 100644 --- a/include/scsi/pr-manager.h +++ b/include/scsi/pr-manager.h @@ -9,10 +9,8 @@ =20 #define TYPE_PR_MANAGER "pr-manager" =20 -typedef struct PRManager PRManager; -typedef struct PRManagerClass PRManagerClass; -DECLARE_OBJ_CHECKERS(PRManager, PRManagerClass, - PR_MANAGER, TYPE_PR_MANAGER) +OBJECT_DECLARE_TYPE(PRManager, PRManagerClass, + pr_manager, PR_MANAGER) =20 struct sg_io_hdr; =20 diff --git a/include/sysemu/cryptodev.h b/include/sysemu/cryptodev.h index 65c017cf81..06726f7014 100644 --- a/include/sysemu/cryptodev.h +++ b/include/sysemu/cryptodev.h @@ -37,10 +37,8 @@ =20 #define TYPE_CRYPTODEV_BACKEND "cryptodev-backend" =20 -typedef struct CryptoDevBackend CryptoDevBackend; -typedef struct CryptoDevBackendClass CryptoDevBackendClass; -DECLARE_OBJ_CHECKERS(CryptoDevBackend, CryptoDevBackendClass, - CRYPTODEV_BACKEND, TYPE_CRYPTODEV_BACKEND) +OBJECT_DECLARE_TYPE(CryptoDevBackend, CryptoDevBackendClass, + cryptodev_backend, CRYPTODEV_BACKEND) =20 =20 #define MAX_CRYPTO_QUEUE_NUM 64 diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 1e6078f872..e5b7a152d3 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -20,10 +20,8 @@ #include "qemu/bitmap.h" =20 #define TYPE_MEMORY_BACKEND "memory-backend" -typedef struct HostMemoryBackend HostMemoryBackend; -typedef struct HostMemoryBackendClass HostMemoryBackendClass; -DECLARE_OBJ_CHECKERS(HostMemoryBackend, HostMemoryBackendClass, - MEMORY_BACKEND, TYPE_MEMORY_BACKEND) +OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackendClass, + memory_backend, MEMORY_BACKEND) =20 /* hostmem-ram.c */ /** diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index f8fc948109..cee45a4787 100644 --- a/include/sysemu/rng.h +++ b/include/sysemu/rng.h @@ -17,10 +17,8 @@ #include "qom/object.h" =20 #define TYPE_RNG_BACKEND "rng-backend" -typedef struct RngBackend RngBackend; -typedef struct RngBackendClass RngBackendClass; -DECLARE_OBJ_CHECKERS(RngBackend, RngBackendClass, - RNG_BACKEND, TYPE_RNG_BACKEND) +OBJECT_DECLARE_TYPE(RngBackend, RngBackendClass, + rng_backend, RNG_BACKEND) =20 #define TYPE_RNG_BUILTIN "rng-builtin" =20 diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index e038b79d34..7e8a014031 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -19,10 +19,8 @@ #include "qapi/error.h" =20 #define TYPE_TPM_BACKEND "tpm-backend" -typedef struct TPMBackend TPMBackend; -typedef struct TPMBackendClass TPMBackendClass; -DECLARE_OBJ_CHECKERS(TPMBackend, TPMBackendClass, - TPM_BACKEND, TYPE_TPM_BACKEND) +OBJECT_DECLARE_TYPE(TPMBackend, TPMBackendClass, + tpm_backend, TPM_BACKEND) =20 =20 typedef struct TPMBackendCmd { diff --git a/include/sysemu/vhost-user-backend.h b/include/sysemu/vhost-use= r-backend.h index e4c85e33c0..76ca06cf40 100644 --- a/include/sysemu/vhost-user-backend.h +++ b/include/sysemu/vhost-user-backend.h @@ -22,10 +22,8 @@ #include "io/channel.h" =20 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend" -typedef struct VhostUserBackend VhostUserBackend; -typedef struct VhostUserBackendClass VhostUserBackendClass; -DECLARE_OBJ_CHECKERS(VhostUserBackend, VhostUserBackendClass, - VHOST_USER_BACKEND, TYPE_VHOST_USER_BACKEND) +OBJECT_DECLARE_TYPE(VhostUserBackend, VhostUserBackendClass, + vhost_user_backend, VHOST_USER_BACKEND) =20 =20 struct VhostUserBackendClass { diff --git a/target/alpha/cpu-qom.h b/target/alpha/cpu-qom.h index 45350318c9..568fe3fb77 100644 --- a/target/alpha/cpu-qom.h +++ b/target/alpha/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_ALPHA_CPU "alpha-cpu" =20 -typedef struct AlphaCPU AlphaCPU; -typedef struct AlphaCPUClass AlphaCPUClass; -DECLARE_OBJ_CHECKERS(AlphaCPU, AlphaCPUClass, - ALPHA_CPU, TYPE_ALPHA_CPU) +OBJECT_DECLARE_TYPE(AlphaCPU, AlphaCPUClass, + alpha_cpu, ALPHA_CPU) =20 /** * AlphaCPUClass: diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index 92d58f84fe..94bbbd4473 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -27,10 +27,8 @@ struct arm_boot_info; =20 #define TYPE_ARM_CPU "arm-cpu" =20 -typedef struct ARMCPU ARMCPU; -typedef struct ARMCPUClass ARMCPUClass; -DECLARE_OBJ_CHECKERS(ARMCPU, ARMCPUClass, - ARM_CPU, TYPE_ARM_CPU) +OBJECT_DECLARE_TYPE(ARMCPU, ARMCPUClass, + arm_cpu, ARM_CPU) =20 #define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU =20 diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h index 1bbfbb2087..49d63faad2 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -26,10 +26,8 @@ =20 #define TYPE_AVR_CPU "avr-cpu" =20 -typedef struct AVRCPU AVRCPU; -typedef struct AVRCPUClass AVRCPUClass; -DECLARE_OBJ_CHECKERS(AVRCPU, AVRCPUClass, - AVR_CPU, TYPE_AVR_CPU) +OBJECT_DECLARE_TYPE(AVRCPU, AVRCPUClass, + avr_cpu, AVR_CPU) =20 /** * AVRCPUClass: diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index eced6ef7c9..2b0328113c 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_CRIS_CPU "cris-cpu" =20 -typedef struct CRISCPU CRISCPU; -typedef struct CRISCPUClass CRISCPUClass; -DECLARE_OBJ_CHECKERS(CRISCPU, CRISCPUClass, - CRIS_CPU, TYPE_CRIS_CPU) +OBJECT_DECLARE_TYPE(CRISCPU, CRISCPUClass, + cris_cpu, CRIS_CPU) =20 /** * CRISCPUClass: diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index 5c5aa0c053..58158f374b 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_HPPA_CPU "hppa-cpu" =20 -typedef struct HPPACPU HPPACPU; -typedef struct HPPACPUClass HPPACPUClass; -DECLARE_OBJ_CHECKERS(HPPACPU, HPPACPUClass, - HPPA_CPU, TYPE_HPPA_CPU) +OBJECT_DECLARE_TYPE(HPPACPU, HPPACPUClass, + hppa_cpu, HPPA_CPU) =20 /** * HPPACPUClass: diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index 05b52ba74c..0505472e86 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -30,10 +30,8 @@ #define TYPE_X86_CPU "i386-cpu" #endif =20 -typedef struct X86CPU X86CPU; -typedef struct X86CPUClass X86CPUClass; -DECLARE_OBJ_CHECKERS(X86CPU, X86CPUClass, - X86_CPU, TYPE_X86_CPU) +OBJECT_DECLARE_TYPE(X86CPU, X86CPUClass, + x86_cpu, X86_CPU) =20 typedef struct X86CPUModel X86CPUModel; =20 diff --git a/target/lm32/cpu-qom.h b/target/lm32/cpu-qom.h index 9bf2f82ffe..e9eb495bf0 100644 --- a/target/lm32/cpu-qom.h +++ b/target/lm32/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_LM32_CPU "lm32-cpu" =20 -typedef struct LM32CPU LM32CPU; -typedef struct LM32CPUClass LM32CPUClass; -DECLARE_OBJ_CHECKERS(LM32CPU, LM32CPUClass, - LM32_CPU, TYPE_LM32_CPU) +OBJECT_DECLARE_TYPE(LM32CPU, LM32CPUClass, + lm32_cpu, LM32_CPU) =20 /** * LM32CPUClass: diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index 241a3b19af..a10429cf67 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_M68K_CPU "m68k-cpu" =20 -typedef struct M68kCPU M68kCPU; -typedef struct M68kCPUClass M68kCPUClass; -DECLARE_OBJ_CHECKERS(M68kCPU, M68kCPUClass, - M68K_CPU, TYPE_M68K_CPU) +OBJECT_DECLARE_TYPE(M68kCPU, M68kCPUClass, + m68k_cpu, M68K_CPU) =20 /* * M68kCPUClass: diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index 73c2237f98..82734b9b2b 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_MICROBLAZE_CPU "microblaze-cpu" =20 -typedef struct MicroBlazeCPU MicroBlazeCPU; -typedef struct MicroBlazeCPUClass MicroBlazeCPUClass; -DECLARE_OBJ_CHECKERS(MicroBlazeCPU, MicroBlazeCPUClass, - MICROBLAZE_CPU, TYPE_MICROBLAZE_CPU) +OBJECT_DECLARE_TYPE(MicroBlazeCPU, MicroBlazeCPUClass, + microblaze_cpu, MICROBLAZE_CPU) =20 /** * MicroBlazeCPUClass: diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index 82f45a828c..93fbbdca1b 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -29,10 +29,8 @@ #define TYPE_MIPS_CPU "mips-cpu" #endif =20 -typedef struct MIPSCPU MIPSCPU; -typedef struct MIPSCPUClass MIPSCPUClass; -DECLARE_OBJ_CHECKERS(MIPSCPU, MIPSCPUClass, - MIPS_CPU, TYPE_MIPS_CPU) +OBJECT_DECLARE_TYPE(MIPSCPU, MIPSCPUClass, + mips_cpu, MIPS_CPU) =20 /** * MIPSCPUClass: diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index a9832a2d85..d58761ccb1 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -51,10 +51,8 @@ typedef struct CPUMoxieState { =20 #define TYPE_MOXIE_CPU "moxie-cpu" =20 -typedef struct MoxieCPU MoxieCPU; -typedef struct MoxieCPUClass MoxieCPUClass; -DECLARE_OBJ_CHECKERS(MoxieCPU, MoxieCPUClass, - MOXIE_CPU, TYPE_MOXIE_CPU) +OBJECT_DECLARE_TYPE(MoxieCPU, MoxieCPUClass, + moxie_cpu, MOXIE_CPU) =20 /** * MoxieCPUClass: diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 0b91a3634b..1fa0fdaa35 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -32,10 +32,8 @@ typedef struct CPUNios2State CPUNios2State; =20 #define TYPE_NIOS2_CPU "nios2-cpu" =20 -typedef struct Nios2CPU Nios2CPU; -typedef struct Nios2CPUClass Nios2CPUClass; -DECLARE_OBJ_CHECKERS(Nios2CPU, Nios2CPUClass, - NIOS2_CPU, TYPE_NIOS2_CPU) +OBJECT_DECLARE_TYPE(Nios2CPU, Nios2CPUClass, + nios2_cpu, NIOS2_CPU) =20 /** * Nios2CPUClass: diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 5e6d8a40d6..d0a8ee657a 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -29,10 +29,8 @@ struct OpenRISCCPU; =20 #define TYPE_OPENRISC_CPU "or1k-cpu" =20 -typedef struct OpenRISCCPU OpenRISCCPU; -typedef struct OpenRISCCPUClass OpenRISCCPUClass; -DECLARE_OBJ_CHECKERS(OpenRISCCPU, OpenRISCCPUClass, - OPENRISC_CPU, TYPE_OPENRISC_CPU) +OBJECT_DECLARE_TYPE(OpenRISCCPU, OpenRISCCPUClass, + openrisc_cpu, OPENRISC_CPU) =20 /** * OpenRISCCPUClass: diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index f7e600c7b3..5cf806a3a6 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -29,10 +29,8 @@ #define TYPE_POWERPC_CPU "powerpc-cpu" #endif =20 -typedef struct PowerPCCPU PowerPCCPU; -typedef struct PowerPCCPUClass PowerPCCPUClass; -DECLARE_OBJ_CHECKERS(PowerPCCPU, PowerPCCPUClass, - POWERPC_CPU, TYPE_POWERPC_CPU) +OBJECT_DECLARE_TYPE(PowerPCCPU, PowerPCCPUClass, + powerpc_cpu, POWERPC_CPU) =20 typedef struct CPUPPCState CPUPPCState; typedef struct ppc_tb_t ppc_tb_t; diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 04ccb78738..ca75fc761e 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -232,10 +232,8 @@ struct CPURISCVState { QEMUTimer *timer; /* Internal timer */ }; =20 -typedef struct RISCVCPU RISCVCPU; -typedef struct RISCVCPUClass RISCVCPUClass; -DECLARE_OBJ_CHECKERS(RISCVCPU, RISCVCPUClass, - RISCV_CPU, TYPE_RISCV_CPU) +OBJECT_DECLARE_TYPE(RISCVCPU, RISCVCPUClass, + riscv_cpu, RISCV_CPU) =20 /** * RISCVCPUClass: diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index 05f5773ab1..6c5321078d 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -26,10 +26,8 @@ =20 #define TYPE_RX62N_CPU RX_CPU_TYPE_NAME("rx62n") =20 -typedef struct RXCPU RXCPU; -typedef struct RXCPUClass RXCPUClass; -DECLARE_OBJ_CHECKERS(RXCPU, RXCPUClass, - RX_CPU, TYPE_RX_CPU) +OBJECT_DECLARE_TYPE(RXCPU, RXCPUClass, + rx_cpu, RX_CPU) =20 /* * RXCPUClass: diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 5f0dccdac1..e2b2513711 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -25,10 +25,8 @@ =20 #define TYPE_S390_CPU "s390x-cpu" =20 -typedef struct S390CPU S390CPU; -typedef struct S390CPUClass S390CPUClass; -DECLARE_OBJ_CHECKERS(S390CPU, S390CPUClass, - S390_CPU, TYPE_S390_CPU) +OBJECT_DECLARE_TYPE(S390CPU, S390CPUClass, + s390_cpu, S390_CPU) =20 typedef struct S390CPUModel S390CPUModel; typedef struct S390CPUDef S390CPUDef; diff --git a/target/sh4/cpu-qom.h b/target/sh4/cpu-qom.h index b04b2bb4bf..595814b8cb 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -29,10 +29,8 @@ #define TYPE_SH7751R_CPU SUPERH_CPU_TYPE_NAME("sh7751r") #define TYPE_SH7785_CPU SUPERH_CPU_TYPE_NAME("sh7785") =20 -typedef struct SuperHCPU SuperHCPU; -typedef struct SuperHCPUClass SuperHCPUClass; -DECLARE_OBJ_CHECKERS(SuperHCPU, SuperHCPUClass, - SUPERH_CPU, TYPE_SUPERH_CPU) +OBJECT_DECLARE_TYPE(SuperHCPU, SuperHCPUClass, + superh_cpu, SUPERH_CPU) =20 /** * SuperHCPUClass: diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index 42cb631d45..5d7fb727bc 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -29,10 +29,8 @@ #define TYPE_SPARC_CPU "sparc-cpu" #endif =20 -typedef struct SPARCCPU SPARCCPU; -typedef struct SPARCCPUClass SPARCCPUClass; -DECLARE_OBJ_CHECKERS(SPARCCPU, SPARCCPUClass, - SPARC_CPU, TYPE_SPARC_CPU) +OBJECT_DECLARE_TYPE(SPARCCPU, SPARCCPUClass, + sparc_cpu, SPARC_CPU) =20 typedef struct sparc_def_t sparc_def_t; /** diff --git a/target/tilegx/cpu.h b/target/tilegx/cpu.h index d4cf70dc15..d251ff80b8 100644 --- a/target/tilegx/cpu.h +++ b/target/tilegx/cpu.h @@ -99,10 +99,8 @@ typedef struct CPUTLGState { =20 #define TYPE_TILEGX_CPU "tilegx-cpu" =20 -typedef struct TileGXCPU TileGXCPU; -typedef struct TileGXCPUClass TileGXCPUClass; -DECLARE_OBJ_CHECKERS(TileGXCPU, TileGXCPUClass, - TILEGX_CPU, TYPE_TILEGX_CPU) +OBJECT_DECLARE_TYPE(TileGXCPU, TileGXCPUClass, + tilegx_cpu, TILEGX_CPU) =20 /** * TileGXCPUClass: diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index 1988c26093..9e588c4c34 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -24,10 +24,8 @@ =20 #define TYPE_TRICORE_CPU "tricore-cpu" =20 -typedef struct TriCoreCPU TriCoreCPU; -typedef struct TriCoreCPUClass TriCoreCPUClass; -DECLARE_OBJ_CHECKERS(TriCoreCPU, TriCoreCPUClass, - TRICORE_CPU, TYPE_TRICORE_CPU) +OBJECT_DECLARE_TYPE(TriCoreCPU, TriCoreCPUClass, + tricore_cpu, TRICORE_CPU) =20 struct TriCoreCPUClass { /*< private >*/ diff --git a/target/unicore32/cpu-qom.h b/target/unicore32/cpu-qom.h index 5b67ac532d..c914273058 100644 --- a/target/unicore32/cpu-qom.h +++ b/target/unicore32/cpu-qom.h @@ -16,10 +16,8 @@ =20 #define TYPE_UNICORE32_CPU "unicore32-cpu" =20 -typedef struct UniCore32CPU UniCore32CPU; -typedef struct UniCore32CPUClass UniCore32CPUClass; -DECLARE_OBJ_CHECKERS(UniCore32CPU, UniCore32CPUClass, - UNICORE32_CPU, TYPE_UNICORE32_CPU) +OBJECT_DECLARE_TYPE(UniCore32CPU, UniCore32CPUClass, + unicore32_cpu, UNICORE32_CPU) =20 /** * UniCore32CPUClass: diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index ef13262b42..299ce3e63c 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -34,10 +34,8 @@ =20 #define TYPE_XTENSA_CPU "xtensa-cpu" =20 -typedef struct XtensaCPU XtensaCPU; -typedef struct XtensaCPUClass XtensaCPUClass; -DECLARE_OBJ_CHECKERS(XtensaCPU, XtensaCPUClass, - XTENSA_CPU, TYPE_XTENSA_CPU) +OBJECT_DECLARE_TYPE(XtensaCPU, XtensaCPUClass, + xtensa_cpu, XTENSA_CPU) =20 typedef struct XtensaConfig XtensaConfig; =20 diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index bfbd4f09f1..0ca9d52ae5 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -21,12 +21,10 @@ #include "trace.h" #include "qom/object.h" =20 -typedef struct DBusVMState DBusVMState; -typedef struct DBusVMStateClass DBusVMStateClass; =20 #define TYPE_DBUS_VMSTATE "dbus-vmstate" -DECLARE_OBJ_CHECKERS(DBusVMState, DBusVMStateClass, - DBUS_VMSTATE, TYPE_DBUS_VMSTATE) +OBJECT_DECLARE_TYPE(DBusVMState, DBusVMStateClass, + dbus_vmstate, DBUS_VMSTATE) =20 struct DBusVMStateClass { ObjectClass parent_class; diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 67d52afbea..c7a8dc19a7 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -20,10 +20,8 @@ #include "input-barrier.h" =20 #define TYPE_INPUT_BARRIER "input-barrier" -typedef struct InputBarrier InputBarrier; -typedef struct InputBarrierClass InputBarrierClass; -DECLARE_OBJ_CHECKERS(InputBarrier, InputBarrierClass, - INPUT_BARRIER, TYPE_INPUT_BARRIER) +OBJECT_DECLARE_TYPE(InputBarrier, InputBarrierClass, + input_barrier, INPUT_BARRIER) =20 =20 #define MAX_HELLO_LENGTH 1024 diff --git a/ui/input-linux.c b/ui/input-linux.c index bfdbd38c86..a95269cc25 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -31,10 +31,8 @@ static bool linux_is_button(unsigned int lnx) } =20 #define TYPE_INPUT_LINUX "input-linux" -typedef struct InputLinux InputLinux; -typedef struct InputLinuxClass InputLinuxClass; -DECLARE_OBJ_CHECKERS(InputLinux, InputLinuxClass, - INPUT_LINUX, TYPE_INPUT_LINUX) +OBJECT_DECLARE_TYPE(InputLinux, InputLinuxClass, + input_linux, INPUT_LINUX) =20 =20 struct InputLinux { --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166562; cv=none; d=zohomail.com; s=zohoarc; b=f/uSS7lrL89LWwrbbS3HxAGdeuFhahq4lBY8q3UGSZswnSNKthEd91/H0Z/1N1i1OccLTDIKiKHJ1Y7WIiIFzdIDj6QGHQ6JkFM9PZl/LuEkHPaILDMGCMj7C/flWBdFagEBnYTqLS0XoNL0xthRdO6LjMNihr6LPSH+sd51+ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166562; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5tuYsEn7fRAhBlpic8/P0vcDXHQRkx4XR6wS5S1U8z0=; b=oIVtNAtI6zgUCroO/8xc6VnnFvIXOr8BC/UHqaBElnqaa2CMZiw4VStIKFqb3IQqAijz5fKO9tOghfVrtySvzsuPRyzlX1qj+81QBY0t731aSnTOXCxI6WQlZOP8M21ByxWIbznTkEnbZsidX6tTWentuetuAoXA5GPtNI8Ixrk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166561985227.0226710259218; Thu, 3 Sep 2020 13:56:01 -0700 (PDT) Received: from localhost ([::1]:50808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwH3-0005bs-61 for importer@patchew.org; Thu, 03 Sep 2020 16:56:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEO-0000ji-Lu for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEL-0006aG-W2 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-Wu27j3YpPdGaSmdfCQTocg-1; Thu, 03 Sep 2020 16:53:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F06E010BBEC6; Thu, 3 Sep 2020 20:53:09 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id B00181002D57; Thu, 3 Sep 2020 20:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5tuYsEn7fRAhBlpic8/P0vcDXHQRkx4XR6wS5S1U8z0=; b=FAPdkblIzQ9qQExgvI23GMmB8AclBip/H/VH2sp/Mf876DYENlbsW1AwRhjUgLj2ukZfbe yXRpxb8gRS6q8J6tmVV4hwRcC3wUuGQIxDqSI4dYbRMgOp9q4vgkqg7uuk6364A4Fjgfbh GUt6TuCWRBqGi4kgWpIPYB7Zj2ac8Lo= X-MC-Unique: Wu27j3YpPdGaSmdfCQTocg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 12/27] Use OBJECT_DECLARE_SIMPLE_TYPE when possible Date: Thu, 3 Sep 2020 16:52:32 -0400 Message-Id: <20200903205247.1667472-13-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=3DObjectDeclareType $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-19-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/authz/list.h | 7 ++----- include/authz/listfile.h | 7 ++----- include/authz/pamacct.h | 7 ++----- include/authz/simple.h | 7 ++----- include/crypto/secret_keyring.h | 7 ++----- include/io/dns-resolver.h | 7 ++----- include/io/net-listener.h | 7 ++----- include/sysemu/vhost-user-backend.h | 7 ++----- backends/dbus-vmstate.c | 7 ++----- ui/input-barrier.c | 7 ++----- ui/input-linux.c | 7 ++----- 11 files changed, 22 insertions(+), 55 deletions(-) diff --git a/include/authz/list.h b/include/authz/list.h index e4e1040472..5676bb375c 100644 --- a/include/authz/list.h +++ b/include/authz/list.h @@ -27,8 +27,8 @@ =20 #define TYPE_QAUTHZ_LIST "authz-list" =20 -OBJECT_DECLARE_TYPE(QAuthZList, QAuthZListClass, - qauthz_list, QAUTHZ_LIST) +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZList, qauthz_list, + QAUTHZ_LIST, QAuthZClass) =20 =20 =20 @@ -68,9 +68,6 @@ struct QAuthZList { }; =20 =20 -struct QAuthZListClass { - QAuthZClass parent_class; -}; =20 =20 QAuthZList *qauthz_list_new(const char *id, diff --git a/include/authz/listfile.h b/include/authz/listfile.h index 89c5eafbfa..b491227bbe 100644 --- a/include/authz/listfile.h +++ b/include/authz/listfile.h @@ -27,8 +27,8 @@ =20 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file" =20 -OBJECT_DECLARE_TYPE(QAuthZListFile, QAuthZListFileClass, - qauthz_list_file, QAUTHZ_LIST_FILE) +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZListFile, qauthz_list_file, + QAUTHZ_LIST_FILE, QAuthZClass) =20 =20 =20 @@ -87,9 +87,6 @@ struct QAuthZListFile { }; =20 =20 -struct QAuthZListFileClass { - QAuthZClass parent_class; -}; =20 =20 QAuthZListFile *qauthz_list_file_new(const char *id, diff --git a/include/authz/pamacct.h b/include/authz/pamacct.h index 44bb5ff28d..7804853ddf 100644 --- a/include/authz/pamacct.h +++ b/include/authz/pamacct.h @@ -27,8 +27,8 @@ =20 #define TYPE_QAUTHZ_PAM "authz-pam" =20 -OBJECT_DECLARE_TYPE(QAuthZPAM, QAuthZPAMClass, - qauthz_pam, QAUTHZ_PAM) +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZPAM, qauthz_pam, + QAUTHZ_PAM, QAuthZClass) =20 =20 =20 @@ -79,9 +79,6 @@ struct QAuthZPAM { }; =20 =20 -struct QAuthZPAMClass { - QAuthZClass parent_class; -}; =20 =20 QAuthZPAM *qauthz_pam_new(const char *id, diff --git a/include/authz/simple.h b/include/authz/simple.h index ba4a5ec5ea..346fcb0c6c 100644 --- a/include/authz/simple.h +++ b/include/authz/simple.h @@ -26,8 +26,8 @@ =20 #define TYPE_QAUTHZ_SIMPLE "authz-simple" =20 -OBJECT_DECLARE_TYPE(QAuthZSimple, QAuthZSimpleClass, - qauthz_simple, QAUTHZ_SIMPLE) +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZSimple, qauthz_simple, + QAUTHZ_SIMPLE, QAuthZClass) =20 =20 =20 @@ -62,9 +62,6 @@ struct QAuthZSimple { }; =20 =20 -struct QAuthZSimpleClass { - QAuthZClass parent_class; -}; =20 =20 QAuthZSimple *qauthz_simple_new(const char *id, diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyrin= g.h index cc2c7397db..73d2a8f501 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -26,8 +26,8 @@ #include "crypto/secret_common.h" =20 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" -OBJECT_DECLARE_TYPE(QCryptoSecretKeyring, QCryptoSecretKeyringClass, - qcrypto_secret_keyring, QCRYPTO_SECRET_KEYRING) +OBJECT_DECLARE_SIMPLE_TYPE(QCryptoSecretKeyring, qcrypto_secret_keyring, + QCRYPTO_SECRET_KEYRING, QCryptoSecretCommonClas= s) =20 =20 struct QCryptoSecretKeyring { @@ -36,8 +36,5 @@ struct QCryptoSecretKeyring { }; =20 =20 -struct QCryptoSecretKeyringClass { - QCryptoSecretCommonClass parent; -}; =20 #endif /* QCRYPTO_SECRET_KEYRING_H */ diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h index 8ae4857e05..e248fba5bd 100644 --- a/include/io/dns-resolver.h +++ b/include/io/dns-resolver.h @@ -26,8 +26,8 @@ #include "io/task.h" =20 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver" -OBJECT_DECLARE_TYPE(QIODNSResolver, QIODNSResolverClass, - qio_dns_resolver, QIO_DNS_RESOLVER) +OBJECT_DECLARE_SIMPLE_TYPE(QIODNSResolver, qio_dns_resolver, + QIO_DNS_RESOLVER, ObjectClass) =20 =20 /** @@ -133,9 +133,6 @@ struct QIODNSResolver { Object parent; }; =20 -struct QIODNSResolverClass { - ObjectClass parent; -}; =20 =20 /** diff --git a/include/io/net-listener.h b/include/io/net-listener.h index 4f0847ff19..60fad29ff4 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -25,8 +25,8 @@ #include "qom/object.h" =20 #define TYPE_QIO_NET_LISTENER "qio-net-listener" -OBJECT_DECLARE_TYPE(QIONetListener, QIONetListenerClass, - qio_net_listener, QIO_NET_LISTENER) +OBJECT_DECLARE_SIMPLE_TYPE(QIONetListener, qio_net_listener, + QIO_NET_LISTENER, ObjectClass) =20 =20 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener, @@ -58,9 +58,6 @@ struct QIONetListener { GDestroyNotify io_notify; }; =20 -struct QIONetListenerClass { - ObjectClass parent; -}; =20 =20 /** diff --git a/include/sysemu/vhost-user-backend.h b/include/sysemu/vhost-use= r-backend.h index 76ca06cf40..23205edeb8 100644 --- a/include/sysemu/vhost-user-backend.h +++ b/include/sysemu/vhost-user-backend.h @@ -22,13 +22,10 @@ #include "io/channel.h" =20 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend" -OBJECT_DECLARE_TYPE(VhostUserBackend, VhostUserBackendClass, - vhost_user_backend, VHOST_USER_BACKEND) +OBJECT_DECLARE_SIMPLE_TYPE(VhostUserBackend, vhost_user_backend, + VHOST_USER_BACKEND, ObjectClass) =20 =20 -struct VhostUserBackendClass { - ObjectClass parent_class; -}; =20 struct VhostUserBackend { /* private */ diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index 0ca9d52ae5..a13461edea 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -23,12 +23,9 @@ =20 =20 #define TYPE_DBUS_VMSTATE "dbus-vmstate" -OBJECT_DECLARE_TYPE(DBusVMState, DBusVMStateClass, - dbus_vmstate, DBUS_VMSTATE) +OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, dbus_vmstate, + DBUS_VMSTATE, ObjectClass) =20 -struct DBusVMStateClass { - ObjectClass parent_class; -}; =20 struct DBusVMState { Object parent; diff --git a/ui/input-barrier.c b/ui/input-barrier.c index c7a8dc19a7..87543a3399 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -20,8 +20,8 @@ #include "input-barrier.h" =20 #define TYPE_INPUT_BARRIER "input-barrier" -OBJECT_DECLARE_TYPE(InputBarrier, InputBarrierClass, - input_barrier, INPUT_BARRIER) +OBJECT_DECLARE_SIMPLE_TYPE(InputBarrier, input_barrier, + INPUT_BARRIER, ObjectClass) =20 =20 #define MAX_HELLO_LENGTH 1024 @@ -44,9 +44,6 @@ struct InputBarrier { char buffer[MAX_HELLO_LENGTH]; }; =20 -struct InputBarrierClass { - ObjectClass parent_class; -}; =20 static const char *cmd_names[] =3D { [barrierCmdCNoop] =3D "CNOP", diff --git a/ui/input-linux.c b/ui/input-linux.c index a95269cc25..5d501c8360 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -31,8 +31,8 @@ static bool linux_is_button(unsigned int lnx) } =20 #define TYPE_INPUT_LINUX "input-linux" -OBJECT_DECLARE_TYPE(InputLinux, InputLinuxClass, - input_linux, INPUT_LINUX) +OBJECT_DECLARE_SIMPLE_TYPE(InputLinux, input_linux, + INPUT_LINUX, ObjectClass) =20 =20 struct InputLinux { @@ -65,9 +65,6 @@ struct InputLinux { QTAILQ_ENTRY(InputLinux) next; }; =20 -struct InputLinuxClass { - ObjectClass parent_class; -}; =20 static QTAILQ_HEAD(, InputLinux) inputs =3D QTAILQ_HEAD_INITIALIZER(inputs= ); =20 --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166510; cv=none; d=zohomail.com; s=zohoarc; b=gI/Yc6RxSfZmhgcaQ/Fk459V7Lhpk1p18dnkak5ucf3l5ieM5JGs59G8O2PyWfdL/4L9jMGa5SDufBXqmf9jPOJM1dXxrF6H01wZp1k9XG0PW3MMPqt6laTUJh9c3BSNo2RwAFqvzXmxGMmzY4ogdGfPvyXy7/HIGEXeopqVfHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166510; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Nb8mpTvZmTkS6y/ISrXiSevEP0+uOT4kbcfpJ6munpM=; b=cs9wTqadGtVWGUHVcBOkHmkC6V4Qcsaw2519K/knxBUdhVg/qvz8L6s57qMaJlTovER7oerEye4HiVOBTapF4pZ7Oa6QqZX50XwbjnZUKm+5jkpstLtJFp20iSx47kDsI20Pj4JxLXEQC+Ei5oSAJPXwar5TvEDqblxRFVqzjKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166510051945.7386742459657; Thu, 3 Sep 2020 13:55:10 -0700 (PDT) Received: from localhost ([::1]:46598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwGD-0003x8-7v for importer@patchew.org; Thu, 03 Sep 2020 16:55:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwER-0000oQ-GL for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:19 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:37681 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEQ-0006ad-1g for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:19 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-X9YbLSNhPCO2QthDmgnJqQ-1; Thu, 03 Sep 2020 16:53:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3164110BBEC4; Thu, 3 Sep 2020 20:53:12 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF66927CCF; Thu, 3 Sep 2020 20:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nb8mpTvZmTkS6y/ISrXiSevEP0+uOT4kbcfpJ6munpM=; b=EO6gu7Q+ACJZS6D8lUI5GN4R/f5Zfse2Y9WFqeFIb6Kmez+bECBbO1wAUJKZKEwd2IWI/r mrh+Df3EeW4tjsuRDG3joiiEAvgAg+vQ2sA0DteWJky+uD9PKNatVKHPDWCtt7sLiug2MX X0Af355fqSED7eBYA0JGXODZOO4ave0= X-MC-Unique: X9YbLSNhPCO2QthDmgnJqQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 13/27] gpex: Fix type checking function name Date: Thu, 3 Sep 2020 16:52:33 -0400 Message-Id: <20200903205247.1667472-14-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This looks like a copy/paste mistake: the instance type checking macro for TYPE_GPEX_ROOT_DEVICE was named MCH_PCI_DEVICE. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/pci-host/gpex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index e8432eced8..2f4e852eee 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -32,7 +32,7 @@ DECLARE_INSTANCE_CHECKER(GPEXHost, GPEX_HOST, =20 #define TYPE_GPEX_ROOT_DEVICE "gpex-root" typedef struct GPEXRootState GPEXRootState; -DECLARE_INSTANCE_CHECKER(GPEXRootState, MCH_PCI_DEVICE, +DECLARE_INSTANCE_CHECKER(GPEXRootState, GPEX_ROOT_DEVICE, TYPE_GPEX_ROOT_DEVICE) =20 #define GPEX_NUM_IRQS 4 --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167314; cv=none; d=zohomail.com; s=zohoarc; b=j6y/1V0f5jqwxTBd6YzU4szhM1waYXFsdRgLrOPaCZgg7DunW/Irm4rprKmJLr02PXewJDRjsf133kFtny6K1RBd/LMm1djVgsmw2p9+xSjTgiYlAiPY6m+r5Ydi1HKEVQPvrwyz2Wy8Ln+8qf0ze513BjQhyDcHHfIgAm9ghLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167314; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CpxU6WwTB6BniTPYnZWiXJQQGyMweXHDA3E7PcnBOHg=; b=GNFbogQGlOac1lXBYBDBTfqtIhBzctl6GBnPNY00mNJKcsghpfEBi8F0gSgyjFDaX0bTkIUdcx+AutRM0t5EOv/04V0KayDjekHS/atb57ge95SNw53O8AN3gTPiBvuqqito9Cl1/4erH7zItZfKo8ZOURxAt0cW9b7OJkhhTDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167314530569.6493016637271; Thu, 3 Sep 2020 14:08:34 -0700 (PDT) Received: from localhost ([::1]:37932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwTB-00082X-OO for importer@patchew.org; Thu, 03 Sep 2020 17:08:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEU-0000w5-Fs for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEQ-0006ag-Aj for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-N8dnJBmPMyyYHdSd3vu8bA-1; Thu, 03 Sep 2020 16:53:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4348C18BA290; Thu, 3 Sep 2020 20:53:13 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA1CF6CE4F; Thu, 3 Sep 2020 20:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CpxU6WwTB6BniTPYnZWiXJQQGyMweXHDA3E7PcnBOHg=; b=cK818xQqVxEzwCKDismKrnfCjSojvdt9um/5aw1SbMO0XZIh89t29tfMLfj/gMnzIdU60D hNu22x2HQuJQcy/m5l8TkaxnupGhf4j0ft1pBX3pLubFwXVcZHhQD533ZcocSVuiGc6Eki eyNimn3Rx4/Anf6+PdIaksaDZZRXsA8= X-MC-Unique: N8dnJBmPMyyYHdSd3vu8bA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 14/27] chardev: Rename TYPE_CHARDEV_* to TYPE_*_CHARDEV Date: Thu, 3 Sep 2020 16:52:34 -0400 Message-Id: <20200903205247.1667472-15-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:47:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This will make the TYPE_* constants consistent with the name of most type checking macros we have today. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- chardev/chardev-internal.h | 4 ++-- include/chardev/char-fd.h | 4 ++-- include/chardev/char-win-stdio.h | 2 +- include/chardev/char-win.h | 4 ++-- include/chardev/char.h | 30 +++++++++++++++--------------- include/chardev/spice.h | 8 ++++---- chardev/baum.c | 6 +++--- chardev/char-console.c | 4 ++-- chardev/char-fd.c | 2 +- chardev/char-file.c | 6 +++--- chardev/char-mux.c | 2 +- chardev/char-null.c | 2 +- chardev/char-parallel.c | 4 ++-- chardev/char-pipe.c | 6 +++--- chardev/char-pty.c | 4 ++-- chardev/char-ringbuf.c | 8 ++++---- chardev/char-serial.c | 6 +++--- chardev/char-socket.c | 4 ++-- chardev/char-stdio.c | 6 +++--- chardev/char-udp.c | 4 ++-- chardev/char-win-stdio.c | 4 ++-- chardev/char-win.c | 2 +- chardev/char.c | 2 +- chardev/msmouse.c | 6 +++--- chardev/spice.c | 10 +++++----- chardev/testdev.c | 6 +++--- chardev/wctablet.c | 6 +++--- gdbstub.c | 6 +++--- hw/display/vhost-user-gpu.c | 2 +- tests/test-char.c | 4 ++-- ui/console.c | 8 ++++---- ui/gtk.c | 6 +++--- ui/spice-app.c | 10 +++++----- 33 files changed, 94 insertions(+), 94 deletions(-) diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h index aba0240759..832dc10a95 100644 --- a/chardev/chardev-internal.h +++ b/chardev/chardev-internal.h @@ -55,9 +55,9 @@ struct MuxChardev { typedef struct MuxChardev MuxChardev; =20 DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV, - TYPE_CHARDEV_MUX) + TYPE_MUX_CHARDEV) #define CHARDEV_IS_MUX(chr) \ - object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX) + object_dynamic_cast(OBJECT(chr), TYPE_MUX_CHARDEV) =20 void mux_set_focus(Chardev *chr, int focus); void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event); diff --git a/include/chardev/char-fd.h b/include/chardev/char-fd.h index 9de0e440de..14c664fc83 100644 --- a/include/chardev/char-fd.h +++ b/include/chardev/char-fd.h @@ -36,10 +36,10 @@ struct FDChardev { }; typedef struct FDChardev FDChardev; =20 -#define TYPE_CHARDEV_FD "chardev-fd" +#define TYPE_FD_CHARDEV "chardev-fd" =20 DECLARE_INSTANCE_CHECKER(FDChardev, FD_CHARDEV, - TYPE_CHARDEV_FD) + TYPE_FD_CHARDEV) =20 void qemu_chr_open_fd(Chardev *chr, int fd_in, int fd_out); int qmp_chardev_open_file_source(char *src, int flags, Error **errp); diff --git a/include/chardev/char-win-stdio.h b/include/chardev/char-win-st= dio.h index d7314f734d..139dfbe92f 100644 --- a/include/chardev/char-win-stdio.h +++ b/include/chardev/char-win-stdio.h @@ -24,6 +24,6 @@ #ifndef CHAR_WIN_STDIO_H #define CHAR_WIN_STDIO_H =20 -#define TYPE_CHARDEV_WIN_STDIO "chardev-win-stdio" +#define TYPE_WIN_STDIO_CHARDEV "chardev-win-stdio" =20 #endif /* CHAR_WIN_STDIO_H */ diff --git a/include/chardev/char-win.h b/include/chardev/char-win.h index 485521469c..a1745ba267 100644 --- a/include/chardev/char-win.h +++ b/include/chardev/char-win.h @@ -43,9 +43,9 @@ typedef struct WinChardev WinChardev; #define NSENDBUF 2048 #define NRECVBUF 2048 =20 -#define TYPE_CHARDEV_WIN "chardev-win" +#define TYPE_WIN_CHARDEV "chardev-win" DECLARE_INSTANCE_CHECKER(WinChardev, WIN_CHARDEV, - TYPE_CHARDEV_WIN) + TYPE_WIN_CHARDEV) =20 void win_chr_set_file(Chardev *chr, HANDLE file, bool keep_open); int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp); diff --git a/include/chardev/char.h b/include/chardev/char.h index 5874de57ea..0f358a4eee 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -230,24 +230,24 @@ typedef struct ChardevClass ChardevClass; DECLARE_OBJ_CHECKERS(Chardev, ChardevClass, CHARDEV, TYPE_CHARDEV) =20 -#define TYPE_CHARDEV_NULL "chardev-null" -#define TYPE_CHARDEV_MUX "chardev-mux" -#define TYPE_CHARDEV_RINGBUF "chardev-ringbuf" -#define TYPE_CHARDEV_PTY "chardev-pty" -#define TYPE_CHARDEV_CONSOLE "chardev-console" -#define TYPE_CHARDEV_STDIO "chardev-stdio" -#define TYPE_CHARDEV_PIPE "chardev-pipe" -#define TYPE_CHARDEV_MEMORY "chardev-memory" -#define TYPE_CHARDEV_PARALLEL "chardev-parallel" -#define TYPE_CHARDEV_FILE "chardev-file" -#define TYPE_CHARDEV_SERIAL "chardev-serial" -#define TYPE_CHARDEV_SOCKET "chardev-socket" -#define TYPE_CHARDEV_UDP "chardev-udp" +#define TYPE_NULL_CHARDEV "chardev-null" +#define TYPE_MUX_CHARDEV "chardev-mux" +#define TYPE_RINGBUF_CHARDEV "chardev-ringbuf" +#define TYPE_PTY_CHARDEV "chardev-pty" +#define TYPE_CONSOLE_CHARDEV "chardev-console" +#define TYPE_STDIO_CHARDEV "chardev-stdio" +#define TYPE_PIPE_CHARDEV "chardev-pipe" +#define TYPE_MEMORY_CHARDEV "chardev-memory" +#define TYPE_PARALLEL_CHARDEV "chardev-parallel" +#define TYPE_FILE_CHARDEV "chardev-file" +#define TYPE_SERIAL_CHARDEV "chardev-serial" +#define TYPE_SOCKET_CHARDEV "chardev-socket" +#define TYPE_UDP_CHARDEV "chardev-udp" =20 #define CHARDEV_IS_RINGBUF(chr) \ - object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_RINGBUF) + object_dynamic_cast(OBJECT(chr), TYPE_RINGBUF_CHARDEV) #define CHARDEV_IS_PTY(chr) \ - object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_PTY) + object_dynamic_cast(OBJECT(chr), TYPE_PTY_CHARDEV) =20 struct ChardevClass { ObjectClass parent_class; diff --git a/include/chardev/spice.h b/include/chardev/spice.h index 99f26aedde..302573b582 100644 --- a/include/chardev/spice.h +++ b/include/chardev/spice.h @@ -17,12 +17,12 @@ struct SpiceChardev { }; typedef struct SpiceChardev SpiceChardev; =20 -#define TYPE_CHARDEV_SPICE "chardev-spice" -#define TYPE_CHARDEV_SPICEVMC "chardev-spicevmc" -#define TYPE_CHARDEV_SPICEPORT "chardev-spiceport" +#define TYPE_SPICE_CHARDEV "chardev-spice" +#define TYPE_SPICEVMC_CHARDEV "chardev-spicevmc" +#define TYPE_SPICEPORT_CHARDEV "chardev-spiceport" =20 DECLARE_INSTANCE_CHECKER(SpiceChardev, SPICE_CHARDEV, - TYPE_CHARDEV_SPICE) + TYPE_SPICE_CHARDEV) =20 void qemu_chr_open_spice_port(Chardev *chr, ChardevBackend *backend, bool *be_opened, Error **errp); diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc..d6c9f698c1 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -104,9 +104,9 @@ struct BaumChardev { }; typedef struct BaumChardev BaumChardev; =20 -#define TYPE_CHARDEV_BRAILLE "chardev-braille" +#define TYPE_BRAILLE_CHARDEV "chardev-braille" DECLARE_INSTANCE_CHECKER(BaumChardev, BAUM_CHARDEV, - TYPE_CHARDEV_BRAILLE) + TYPE_BRAILLE_CHARDEV) =20 /* Let's assume NABCC by default */ enum way { @@ -674,7 +674,7 @@ static void char_braille_class_init(ObjectClass *oc, vo= id *data) } =20 static const TypeInfo char_braille_type_info =3D { - .name =3D TYPE_CHARDEV_BRAILLE, + .name =3D TYPE_BRAILLE_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(BaumChardev), .instance_finalize =3D char_braille_finalize, diff --git a/chardev/char-console.c b/chardev/char-console.c index 6c4ce5dbce..5d175389fd 100644 --- a/chardev/char-console.c +++ b/chardev/char-console.c @@ -42,8 +42,8 @@ static void char_console_class_init(ObjectClass *oc, void= *data) } =20 static const TypeInfo char_console_type_info =3D { - .name =3D TYPE_CHARDEV_CONSOLE, - .parent =3D TYPE_CHARDEV_WIN, + .name =3D TYPE_CONSOLE_CHARDEV, + .parent =3D TYPE_WIN_CHARDEV, .class_init =3D char_console_class_init, }; =20 diff --git a/chardev/char-fd.c b/chardev/char-fd.c index c2d8101106..031fe2a2d6 100644 --- a/chardev/char-fd.c +++ b/chardev/char-fd.c @@ -154,7 +154,7 @@ static void char_fd_class_init(ObjectClass *oc, void *d= ata) } =20 static const TypeInfo char_fd_type_info =3D { - .name =3D TYPE_CHARDEV_FD, + .name =3D TYPE_FD_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(FDChardev), .instance_finalize =3D char_fd_finalize, diff --git a/chardev/char-file.c b/chardev/char-file.c index 2fd80707e5..fc53bdb4aa 100644 --- a/chardev/char-file.c +++ b/chardev/char-file.c @@ -124,11 +124,11 @@ static void char_file_class_init(ObjectClass *oc, voi= d *data) } =20 static const TypeInfo char_file_type_info =3D { - .name =3D TYPE_CHARDEV_FILE, + .name =3D TYPE_FILE_CHARDEV, #ifdef _WIN32 - .parent =3D TYPE_CHARDEV_WIN, + .parent =3D TYPE_WIN_CHARDEV, #else - .parent =3D TYPE_CHARDEV_FD, + .parent =3D TYPE_FD_CHARDEV, #endif .class_init =3D char_file_class_init, }; diff --git a/chardev/char-mux.c b/chardev/char-mux.c index 6f980bb836..8930b4d5e8 100644 --- a/chardev/char-mux.c +++ b/chardev/char-mux.c @@ -388,7 +388,7 @@ static void char_mux_class_init(ObjectClass *oc, void *= data) } =20 static const TypeInfo char_mux_type_info =3D { - .name =3D TYPE_CHARDEV_MUX, + .name =3D TYPE_MUX_CHARDEV, .parent =3D TYPE_CHARDEV, .class_init =3D char_mux_class_init, .instance_size =3D sizeof(MuxChardev), diff --git a/chardev/char-null.c b/chardev/char-null.c index 1c6a2900f9..fcddd33452 100644 --- a/chardev/char-null.c +++ b/chardev/char-null.c @@ -42,7 +42,7 @@ static void char_null_class_init(ObjectClass *oc, void *d= ata) } =20 static const TypeInfo char_null_type_info =3D { - .name =3D TYPE_CHARDEV_NULL, + .name =3D TYPE_NULL_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(Chardev), .class_init =3D char_null_class_init, diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c index 66e4589b2b..289c1b002c 100644 --- a/chardev/char-parallel.c +++ b/chardev/char-parallel.c @@ -58,7 +58,7 @@ struct ParallelChardev { typedef struct ParallelChardev ParallelChardev; =20 DECLARE_INSTANCE_CHECKER(ParallelChardev, PARALLEL_CHARDEV, - TYPE_CHARDEV_PARALLEL) + TYPE_PARALLEL_CHARDEV) =20 static int pp_hw_mode(ParallelChardev *s, uint16_t mode) { @@ -303,7 +303,7 @@ static void char_parallel_finalize(Object *obj) } =20 static const TypeInfo char_parallel_type_info =3D { - .name =3D TYPE_CHARDEV_PARALLEL, + .name =3D TYPE_PARALLEL_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(ParallelChardev), .instance_finalize =3D char_parallel_finalize, diff --git a/chardev/char-pipe.c b/chardev/char-pipe.c index fd12c9e63b..7458433256 100644 --- a/chardev/char-pipe.c +++ b/chardev/char-pipe.c @@ -179,11 +179,11 @@ static void char_pipe_class_init(ObjectClass *oc, voi= d *data) } =20 static const TypeInfo char_pipe_type_info =3D { - .name =3D TYPE_CHARDEV_PIPE, + .name =3D TYPE_PIPE_CHARDEV, #ifdef _WIN32 - .parent =3D TYPE_CHARDEV_WIN, + .parent =3D TYPE_WIN_CHARDEV, #else - .parent =3D TYPE_CHARDEV_FD, + .parent =3D TYPE_FD_CHARDEV, #endif .class_init =3D char_pipe_class_init, }; diff --git a/chardev/char-pty.c b/chardev/char-pty.c index a2d1e7c985..9cf77596d2 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -46,7 +46,7 @@ struct PtyChardev { typedef struct PtyChardev PtyChardev; =20 DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV, - TYPE_CHARDEV_PTY) + TYPE_PTY_CHARDEV) =20 static void pty_chr_state(Chardev *chr, int connected); =20 @@ -240,7 +240,7 @@ static void char_pty_class_init(ObjectClass *oc, void *= data) } =20 static const TypeInfo char_pty_type_info =3D { - .name =3D TYPE_CHARDEV_PTY, + .name =3D TYPE_PTY_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(PtyChardev), .instance_finalize =3D char_pty_finalize, diff --git a/chardev/char-ringbuf.c b/chardev/char-ringbuf.c index d40d21d3cf..edeb7daeae 100644 --- a/chardev/char-ringbuf.c +++ b/chardev/char-ringbuf.c @@ -43,7 +43,7 @@ struct RingBufChardev { typedef struct RingBufChardev RingBufChardev; =20 DECLARE_INSTANCE_CHECKER(RingBufChardev, RINGBUF_CHARDEV, - TYPE_CHARDEV_RINGBUF) + TYPE_RINGBUF_CHARDEV) =20 static size_t ringbuf_count(const Chardev *chr) { @@ -233,7 +233,7 @@ static void char_ringbuf_class_init(ObjectClass *oc, vo= id *data) } =20 static const TypeInfo char_ringbuf_type_info =3D { - .name =3D TYPE_CHARDEV_RINGBUF, + .name =3D TYPE_RINGBUF_CHARDEV, .parent =3D TYPE_CHARDEV, .class_init =3D char_ringbuf_class_init, .instance_size =3D sizeof(RingBufChardev), @@ -242,8 +242,8 @@ static const TypeInfo char_ringbuf_type_info =3D { =20 /* Bug-compatibility: */ static const TypeInfo char_memory_type_info =3D { - .name =3D TYPE_CHARDEV_MEMORY, - .parent =3D TYPE_CHARDEV_RINGBUF, + .name =3D TYPE_MEMORY_CHARDEV, + .parent =3D TYPE_RINGBUF_CHARDEV, }; =20 static void register_types(void) diff --git a/chardev/char-serial.c b/chardev/char-serial.c index 7c3d84ae24..381107bd89 100644 --- a/chardev/char-serial.c +++ b/chardev/char-serial.c @@ -308,11 +308,11 @@ static void char_serial_class_init(ObjectClass *oc, v= oid *data) =20 =20 static const TypeInfo char_serial_type_info =3D { - .name =3D TYPE_CHARDEV_SERIAL, + .name =3D TYPE_SERIAL_CHARDEV, #ifdef _WIN32 - .parent =3D TYPE_CHARDEV_WIN, + .parent =3D TYPE_WIN_CHARDEV, #else - .parent =3D TYPE_CHARDEV_FD, + .parent =3D TYPE_FD_CHARDEV, #endif .class_init =3D char_serial_class_init, }; diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 95e45812d5..bb5ddc586c 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -89,7 +89,7 @@ struct SocketChardev { typedef struct SocketChardev SocketChardev; =20 DECLARE_INSTANCE_CHECKER(SocketChardev, SOCKET_CHARDEV, - TYPE_CHARDEV_SOCKET) + TYPE_SOCKET_CHARDEV) =20 static gboolean socket_reconnect_timeout(gpointer opaque); static void tcp_chr_telnet_init(Chardev *chr); @@ -1506,7 +1506,7 @@ static void char_socket_class_init(ObjectClass *oc, v= oid *data) } =20 static const TypeInfo char_socket_type_info =3D { - .name =3D TYPE_CHARDEV_SOCKET, + .name =3D TYPE_SOCKET_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(SocketChardev), .instance_finalize =3D char_socket_finalize, diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c index 82eaebc1db..fb28eaeb87 100644 --- a/chardev/char-stdio.c +++ b/chardev/char-stdio.c @@ -150,11 +150,11 @@ static void char_stdio_finalize(Object *obj) } =20 static const TypeInfo char_stdio_type_info =3D { - .name =3D TYPE_CHARDEV_STDIO, + .name =3D TYPE_STDIO_CHARDEV, #ifdef _WIN32 - .parent =3D TYPE_CHARDEV_WIN_STDIO, + .parent =3D TYPE_WIN_STDIO_CHARDEV, #else - .parent =3D TYPE_CHARDEV_FD, + .parent =3D TYPE_FD_CHARDEV, #endif .instance_finalize =3D char_stdio_finalize, .class_init =3D char_stdio_class_init, diff --git a/chardev/char-udp.c b/chardev/char-udp.c index 16b5dbce58..6d7b9d2805 100644 --- a/chardev/char-udp.c +++ b/chardev/char-udp.c @@ -46,7 +46,7 @@ struct UdpChardev { typedef struct UdpChardev UdpChardev; =20 DECLARE_INSTANCE_CHECKER(UdpChardev, UDP_CHARDEV, - TYPE_CHARDEV_UDP) + TYPE_UDP_CHARDEV) =20 /* Called with chr_write_lock held. */ static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len) @@ -231,7 +231,7 @@ static void char_udp_class_init(ObjectClass *oc, void *= data) } =20 static const TypeInfo char_udp_type_info =3D { - .name =3D TYPE_CHARDEV_UDP, + .name =3D TYPE_UDP_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(UdpChardev), .instance_finalize =3D char_udp_finalize, diff --git a/chardev/char-win-stdio.c b/chardev/char-win-stdio.c index a4771ab82e..f333b8cedc 100644 --- a/chardev/char-win-stdio.c +++ b/chardev/char-win-stdio.c @@ -41,7 +41,7 @@ struct WinStdioChardev { typedef struct WinStdioChardev WinStdioChardev; =20 DECLARE_INSTANCE_CHECKER(WinStdioChardev, WIN_STDIO_CHARDEV, - TYPE_CHARDEV_WIN_STDIO) + TYPE_WIN_STDIO_CHARDEV) =20 static void win_stdio_wait_func(void *opaque) { @@ -255,7 +255,7 @@ static void char_win_stdio_class_init(ObjectClass *oc, = void *data) } =20 static const TypeInfo char_win_stdio_type_info =3D { - .name =3D TYPE_CHARDEV_WIN_STDIO, + .name =3D TYPE_WIN_STDIO_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(WinStdioChardev), .instance_finalize =3D char_win_stdio_finalize, diff --git a/chardev/char-win.c b/chardev/char-win.c index d4fb44c4dc..69dcf48873 100644 --- a/chardev/char-win.c +++ b/chardev/char-win.c @@ -228,7 +228,7 @@ static void char_win_class_init(ObjectClass *oc, void *= data) } =20 static const TypeInfo char_win_type_info =3D { - .name =3D TYPE_CHARDEV_WIN, + .name =3D TYPE_WIN_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(WinChardev), .instance_finalize =3D char_win_finalize, diff --git a/chardev/char.c b/chardev/char.c index 77e7ec814f..afebdc345e 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -674,7 +674,7 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainCo= ntext *context, backend->type =3D CHARDEV_BACKEND_KIND_MUX; backend->u.mux.data =3D g_new0(ChardevMux, 1); backend->u.mux.data->chardev =3D g_strdup(bid); - mux =3D qemu_chardev_new(id, TYPE_CHARDEV_MUX, backend, context, e= rrp); + mux =3D qemu_chardev_new(id, TYPE_MUX_CHARDEV, backend, context, e= rrp); if (mux =3D=3D NULL) { object_unparent(OBJECT(chr)); chr =3D NULL; diff --git a/chardev/msmouse.c b/chardev/msmouse.c index eb9231dcdb..4033ca714d 100644 --- a/chardev/msmouse.c +++ b/chardev/msmouse.c @@ -44,9 +44,9 @@ struct MouseChardev { }; typedef struct MouseChardev MouseChardev; =20 -#define TYPE_CHARDEV_MSMOUSE "chardev-msmouse" +#define TYPE_MSMOUSE_CHARDEV "chardev-msmouse" DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV, - TYPE_CHARDEV_MSMOUSE) + TYPE_MSMOUSE_CHARDEV) =20 static void msmouse_chr_accept_input(Chardev *chr) { @@ -178,7 +178,7 @@ static void char_msmouse_class_init(ObjectClass *oc, vo= id *data) } =20 static const TypeInfo char_msmouse_type_info =3D { - .name =3D TYPE_CHARDEV_MSMOUSE, + .name =3D TYPE_MSMOUSE_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(MouseChardev), .instance_finalize =3D char_msmouse_finalize, diff --git a/chardev/spice.c b/chardev/spice.c index bf7ea1e294..7423001b71 100644 --- a/chardev/spice.c +++ b/chardev/spice.c @@ -376,7 +376,7 @@ static void char_spice_class_init(ObjectClass *oc, void= *data) } =20 static const TypeInfo char_spice_type_info =3D { - .name =3D TYPE_CHARDEV_SPICE, + .name =3D TYPE_SPICE_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(SpiceChardev), .instance_finalize =3D char_spice_finalize, @@ -394,8 +394,8 @@ static void char_spicevmc_class_init(ObjectClass *oc, v= oid *data) } =20 static const TypeInfo char_spicevmc_type_info =3D { - .name =3D TYPE_CHARDEV_SPICEVMC, - .parent =3D TYPE_CHARDEV_SPICE, + .name =3D TYPE_SPICEVMC_CHARDEV, + .parent =3D TYPE_SPICE_CHARDEV, .class_init =3D char_spicevmc_class_init, }; =20 @@ -409,8 +409,8 @@ static void char_spiceport_class_init(ObjectClass *oc, = void *data) } =20 static const TypeInfo char_spiceport_type_info =3D { - .name =3D TYPE_CHARDEV_SPICEPORT, - .parent =3D TYPE_CHARDEV_SPICE, + .name =3D TYPE_SPICEPORT_CHARDEV, + .parent =3D TYPE_SPICE_CHARDEV, .class_init =3D char_spiceport_class_init, }; =20 diff --git a/chardev/testdev.c b/chardev/testdev.c index a92caca3c3..5ef9a59817 100644 --- a/chardev/testdev.c +++ b/chardev/testdev.c @@ -39,9 +39,9 @@ struct TestdevChardev { }; typedef struct TestdevChardev TestdevChardev; =20 -#define TYPE_CHARDEV_TESTDEV "chardev-testdev" +#define TYPE_TESTDEV_CHARDEV "chardev-testdev" DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV, - TYPE_CHARDEV_TESTDEV) + TYPE_TESTDEV_CHARDEV) =20 /* Try to interpret a whole incoming packet */ static int testdev_eat_packet(TestdevChardev *testdev) @@ -118,7 +118,7 @@ static void char_testdev_class_init(ObjectClass *oc, vo= id *data) } =20 static const TypeInfo char_testdev_type_info =3D { - .name =3D TYPE_CHARDEV_TESTDEV, + .name =3D TYPE_TESTDEV_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(TestdevChardev), .class_init =3D char_testdev_class_init, diff --git a/chardev/wctablet.c b/chardev/wctablet.c index 95e005f5a5..2cc018efb3 100644 --- a/chardev/wctablet.c +++ b/chardev/wctablet.c @@ -85,9 +85,9 @@ struct TabletChardev { }; typedef struct TabletChardev TabletChardev; =20 -#define TYPE_CHARDEV_WCTABLET "chardev-wctablet" +#define TYPE_WCTABLET_CHARDEV "chardev-wctablet" DECLARE_INSTANCE_CHECKER(TabletChardev, WCTABLET_CHARDEV, - TYPE_CHARDEV_WCTABLET) + TYPE_WCTABLET_CHARDEV) =20 =20 static void wctablet_chr_accept_input(Chardev *chr); @@ -352,7 +352,7 @@ static void wctablet_chr_class_init(ObjectClass *oc, vo= id *data) } =20 static const TypeInfo wctablet_type_info =3D { - .name =3D TYPE_CHARDEV_WCTABLET, + .name =3D TYPE_WCTABLET_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(TabletChardev), .instance_finalize =3D wctablet_chr_finalize, diff --git a/gdbstub.c b/gdbstub.c index 9dfb6e4142..7afdcf0f37 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -3301,10 +3301,10 @@ static void char_gdb_class_init(ObjectClass *oc, vo= id *data) cc->chr_write =3D gdb_monitor_write; } =20 -#define TYPE_CHARDEV_GDB "chardev-gdb" +#define TYPE_GDB_CHARDEV "chardev-gdb" =20 static const TypeInfo char_gdb_type_info =3D { - .name =3D TYPE_CHARDEV_GDB, + .name =3D TYPE_GDB_CHARDEV, .parent =3D TYPE_CHARDEV, .class_init =3D char_gdb_class_init, }; @@ -3409,7 +3409,7 @@ int gdbserver_start(const char *device) qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL); =20 /* Initialize a monitor terminal for gdb */ - mon_chr =3D qemu_chardev_new(NULL, TYPE_CHARDEV_GDB, + mon_chr =3D qemu_chardev_new(NULL, TYPE_GDB_CHARDEV, NULL, NULL, &error_abort); monitor_init_hmp(mon_chr, false, &error_abort); } else { diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 51f1747c4a..f656fb38a7 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -388,7 +388,7 @@ vhost_user_gpu_do_set_socket(VhostUserGPU *g, Error **e= rrp) return false; } =20 - chr =3D CHARDEV(object_new(TYPE_CHARDEV_SOCKET)); + chr =3D CHARDEV(object_new(TYPE_SOCKET_CHARDEV)); if (!chr || qemu_chr_add_client(chr, sv[0]) =3D=3D -1) { error_setg(errp, "Failed to make socket chardev"); goto err; diff --git a/tests/test-char.c b/tests/test-char.c index d35cc839bc..2b2135ec77 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -1232,7 +1232,7 @@ static void char_file_fifo_test(void) ret =3D write(fd, "fifo-in", 8); g_assert_cmpint(ret, =3D=3D, 8); =20 - chr =3D qemu_chardev_new("label-file", TYPE_CHARDEV_FILE, &backend, + chr =3D qemu_chardev_new("label-file", TYPE_FILE_CHARDEV, &backend, NULL, &error_abort); =20 qemu_chr_fe_init(&be, chr, &error_abort); @@ -1286,7 +1286,7 @@ static void char_file_test_internal(Chardev *ext_chr,= const char *filepath) } else { out =3D g_build_filename(tmp_path, "out", NULL); file.out =3D out; - chr =3D qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, + chr =3D qemu_chardev_new(NULL, TYPE_FILE_CHARDEV, &backend, NULL, &error_abort); } ret =3D qemu_chr_write_all(chr, (uint8_t *)"hello!", 6); diff --git a/ui/console.c b/ui/console.c index f8d7643fe4..965f01e804 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1089,9 +1089,9 @@ struct VCChardev { }; typedef struct VCChardev VCChardev; =20 -#define TYPE_CHARDEV_VC "chardev-vc" +#define TYPE_VC_CHARDEV "chardev-vc" DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV, - TYPE_CHARDEV_VC) + TYPE_VC_CHARDEV) =20 static int vc_chr_write(Chardev *chr, const uint8_t *buf, int len) { @@ -2403,7 +2403,7 @@ static void char_vc_class_init(ObjectClass *oc, void = *data) } =20 static const TypeInfo char_vc_type_info =3D { - .name =3D TYPE_CHARDEV_VC, + .name =3D TYPE_VC_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(VCChardev), .class_init =3D char_vc_class_init, @@ -2412,7 +2412,7 @@ static const TypeInfo char_vc_type_info =3D { void qemu_console_early_init(void) { /* set the default vc driver */ - if (!object_class_by_name(TYPE_CHARDEV_VC)) { + if (!object_class_by_name(TYPE_VC_CHARDEV)) { type_register(&char_vc_type_info); } } diff --git a/ui/gtk.c b/ui/gtk.c index d28d7545d3..ecaa9527fc 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -178,9 +178,9 @@ struct VCChardev { }; typedef struct VCChardev VCChardev; =20 -#define TYPE_CHARDEV_VC "chardev-vc" +#define TYPE_VC_CHARDEV "chardev-vc" DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV, - TYPE_CHARDEV_VC) + TYPE_VC_CHARDEV) =20 bool gtk_use_gl_area; =20 @@ -1717,7 +1717,7 @@ static void char_gd_vc_class_init(ObjectClass *oc, vo= id *data) } =20 static const TypeInfo char_gd_vc_type_info =3D { - .name =3D TYPE_CHARDEV_VC, + .name =3D TYPE_VC_CHARDEV, .parent =3D TYPE_CHARDEV, .instance_size =3D sizeof(VCChardev), .class_init =3D char_gd_vc_class_init, diff --git a/ui/spice-app.c b/ui/spice-app.c index 93e105c6ee..e69dc21c78 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -46,9 +46,9 @@ struct VCChardev { }; typedef struct VCChardev VCChardev; =20 -#define TYPE_CHARDEV_VC "chardev-vc" +#define TYPE_VC_CHARDEV "chardev-vc" DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV, - TYPE_CHARDEV_VC) + TYPE_VC_CHARDEV) =20 static ChardevBackend * chr_spice_backend_new(void) @@ -99,8 +99,8 @@ static void char_vc_class_init(ObjectClass *oc, void *dat= a) } =20 static const TypeInfo char_vc_type_info =3D { - .name =3D TYPE_CHARDEV_VC, - .parent =3D TYPE_CHARDEV_SPICEPORT, + .name =3D TYPE_VC_CHARDEV, + .parent =3D TYPE_SPICEPORT_CHARDEV, .instance_size =3D sizeof(VCChardev), .class_init =3D char_vc_class_init, }; @@ -166,7 +166,7 @@ static void spice_app_display_early_init(DisplayOptions= *opts) display_opengl =3D opts->has_gl; #endif be->u.spiceport.data->fqdn =3D g_strdup("org.qemu.monitor.qmp.0"); - qemu_chardev_new("org.qemu.monitor.qmp", TYPE_CHARDEV_SPICEPORT, + qemu_chardev_new("org.qemu.monitor.qmp", TYPE_SPICEPORT_CHARDEV, be, NULL, &error_abort); qopts =3D qemu_opts_create(qemu_find_opts("mon"), NULL, 0, &error_fatal); --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167573; cv=none; d=zohomail.com; s=zohoarc; b=fmU0MD4AJJUWhm7J5bHe+hUORjQIBgTdwx/QSA8ojBb3+nG6p+w70E46ig9egztqv4bszdfAqTacWANvX2occvld8jS9A+r99gRLqPF/bM/zYq9+XHa0XJcpvoJIBJgld2JsykaAKxhxC8kFu2JcdClPPZiWKkwVaGLSdDYyN1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F3sKMxahOjYTwSinktMwxAbRSsAgIiqhInGAWsm1MF0=; b=POA2xO3Nc4kGNKTaoorl26rR2SjjG76FtOVjA2SYwc52nQStX5u6UhLk+wBJbyF08owHmngT5zF3Yo9PZHOrdrRiE3J/sdd8K6sdn2S8wXqzL48RlZhWZWnZ2zn7nkrkCuKq3I4UopAFBAagTW47h++0oiv3Keldt2Nky0gO4WQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159916757306753.17352350982844; Thu, 3 Sep 2020 14:12:53 -0700 (PDT) Received: from localhost ([::1]:51058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwXM-0005Aj-8a for importer@patchew.org; Thu, 03 Sep 2020 17:12:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEj-00018w-31 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:45335 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEb-0006bz-JH for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-Hj42jdj_OaSM61UhGHXF2g-1; Thu, 03 Sep 2020 16:53:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB35A18BA282; Thu, 3 Sep 2020 20:53:14 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F6AD81190; Thu, 3 Sep 2020 20:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F3sKMxahOjYTwSinktMwxAbRSsAgIiqhInGAWsm1MF0=; b=e//evoK0ry8RImKlquUNZwz6AkRL0MqJr76mNg1ViT7JUj3xjR5JEIDBoHx0KQKj6OelS4 FnpofOM3A26PPq4Zt99fjD5YpWVkalazA3CjJ6QvJR3CiOTorOKKX28schjJYPunTFkNoS GRAATgw5Wye16NW5g0cbPFPBJQNOd0U= X-MC-Unique: Hj42jdj_OaSM61UhGHXF2g-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 15/27] ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE Date: Thu, 3 Sep 2020 16:52:35 -0400 Message-Id: <20200903205247.1667472-16-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:58:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This will make the type name constant consistent with the name of the type checking macro. Signed-off-by: Eduardo Habkost Reviewed-by: Thomas Huth Message-Id: <20200902224311.1321159-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/s390x/ap-device.h | 4 ++-- hw/s390x/ap-device.c | 2 +- hw/vfio/ap.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h index fb250a20f3..e502745de5 100644 --- a/include/hw/s390x/ap-device.h +++ b/include/hw/s390x/ap-device.h @@ -14,7 +14,7 @@ #include "hw/qdev-core.h" #include "qom/object.h" =20 -#define AP_DEVICE_TYPE "ap-device" +#define TYPE_AP_DEVICE "ap-device" =20 struct APDevice { DeviceState parent_obj; @@ -22,6 +22,6 @@ struct APDevice { typedef struct APDevice APDevice; =20 DECLARE_INSTANCE_CHECKER(APDevice, AP_DEVICE, - AP_DEVICE_TYPE) + TYPE_AP_DEVICE) =20 #endif /* HW_S390X_AP_DEVICE_H */ diff --git a/hw/s390x/ap-device.c b/hw/s390x/ap-device.c index fc0b41e937..237d1f19c5 100644 --- a/hw/s390x/ap-device.c +++ b/hw/s390x/ap-device.c @@ -21,7 +21,7 @@ static void ap_class_init(ObjectClass *klass, void *data) } =20 static const TypeInfo ap_device_info =3D { - .name =3D AP_DEVICE_TYPE, + .name =3D TYPE_AP_DEVICE, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(APDevice), .class_size =3D sizeof(DeviceClass), diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index f399ec0a31..68ed059b39 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -177,7 +177,7 @@ static void vfio_ap_class_init(ObjectClass *klass, void= *data) =20 static const TypeInfo vfio_ap_info =3D { .name =3D VFIO_AP_DEVICE_TYPE, - .parent =3D AP_DEVICE_TYPE, + .parent =3D TYPE_AP_DEVICE, .instance_size =3D sizeof(VFIOAPDevice), .class_init =3D vfio_ap_class_init, }; --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166633; cv=none; d=zohomail.com; s=zohoarc; b=fbjakZw3QqIDkyu3fTEEeUckSwjk/39/vR0BO+UGOcWTHTECjqvkfVYl82QidaFKfivwqZgN+AenQKOcYZdjyRTKQAAj4ZSG6d7kzXBICdy9UMEge8TqoDBHSco7SmgwqKqmkMM0f2mcVgU0WlTSH/UueN/jOf6gBjT40bqGLqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166633; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=l3+rjCng41Ul0hAk/KtTt47/0GlS9R28kPcYZE4pXD0=; b=knu4Lcfkfc0gpB5lHtSDCDRnXvlK5SoOii5Na69JZyntEoUXIykV4vUgjq9j9XTpFyfonfGBLCVgZo6+qzNHAu7BSRRwvs6LinJPgFD/ckzn2GZPCON95qpT6YNOBaHXmWz2r9PJCTVxkPtVJGceg1CtHAEIcs0QX/LggD9Kjjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166633497467.9914426704738; Thu, 3 Sep 2020 13:57:13 -0700 (PDT) Received: from localhost ([::1]:54526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwIC-0007AN-Ov for importer@patchew.org; Thu, 03 Sep 2020 16:57:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEU-0000wX-Jd for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:22 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30048 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwES-0006av-Rn for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-5Qvd7RcfPpiI0RTmnDB9vA-1; Thu, 03 Sep 2020 16:53:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2B8518BA291; Thu, 3 Sep 2020 20:53:16 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 397E15D9EF; Thu, 3 Sep 2020 20:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l3+rjCng41Ul0hAk/KtTt47/0GlS9R28kPcYZE4pXD0=; b=JwUhmoUCBrZDr0bSesAB7Tl8aL1ltEloxFXX7fb4rcIJGOPPH+WRMRrjZevDdOaniIAgjn LTPn6FubA/xoWxERUeig7u4zFaWNH3N0NmiMbtzChEh/9z2NhwDpb9WyNjCAeANRHrH1f9 qIz4dyzVrVOw59jrveImdvpnGq0C9HI= X-MC-Unique: 5Qvd7RcfPpiI0RTmnDB9vA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 16/27] dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV Date: Thu, 3 Sep 2020 16:52:36 -0400 Message-Id: <20200903205247.1667472-17-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:58:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This will make the type name constant consistent with the name of the type checking macro. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-7-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/usb/dev-smartcard-reader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 432508c478..59b2248f34 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -60,10 +60,10 @@ do { \ #define D_MORE_INFO 3 #define D_VERBOSE 4 =20 -#define CCID_DEV_NAME "usb-ccid" +#define TYPE_USB_CCID_DEV "usb-ccid" typedef struct USBCCIDState USBCCIDState; DECLARE_INSTANCE_CHECKER(USBCCIDState, USB_CCID_DEV, - CCID_DEV_NAME) + TYPE_USB_CCID_DEV) /* * The two options for variable sized buffers: * make them constant size, for large enough constant, @@ -1462,7 +1462,7 @@ static void ccid_class_initfn(ObjectClass *klass, voi= d *data) } =20 static const TypeInfo ccid_info =3D { - .name =3D CCID_DEV_NAME, + .name =3D TYPE_USB_CCID_DEV, .parent =3D TYPE_USB_DEVICE, .instance_size =3D sizeof(USBCCIDState), .class_init =3D ccid_class_initfn, @@ -1495,7 +1495,7 @@ static void ccid_register_types(void) type_register_static(&ccid_bus_info); type_register_static(&ccid_card_type_info); type_register_static(&ccid_info); - usb_legacy_register(CCID_DEV_NAME, "ccid", NULL); + usb_legacy_register(TYPE_USB_CCID_DEV, "ccid", NULL); } =20 type_init(ccid_register_types) --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166820; cv=none; d=zohomail.com; s=zohoarc; b=gS2h+GZKW/xs8Gf38vXpudW6pqQbNFoOt/c2LQ0rx/7TBOD8qGEJyaEmhUPXIENUW9of18ck8wsWsNHcjON0eK63Sf2eiVV0CPNywJorJYOg3eciC9UcgN1PotroTVZoKKXf0TiYWPO7PPhzFp0FhUS8w9ONn7nX2dxbs9S4bl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166820; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y+oHo64EvoiaTMi66DVtt06upr/08pRVnAZcNgeussI=; b=SaspDBu9n9jAfW4KSTsPcAWLoS3NMlzvOyLYazbjJypNV4VEOAsaUO0QslE6pVmAtyDEJCBrbmA9HCJEorL4W8PEgC+dow0gOfyaNdNAHrmY1bwknkn4t2F71mcVXLg/61T+yafSu9G5R1QpqyETcn6GTNyBDnJXmUxHXYNwBGg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166820574677.4718330727115; Thu, 3 Sep 2020 14:00:20 -0700 (PDT) Received: from localhost ([::1]:37222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwLD-00039x-Ob for importer@patchew.org; Thu, 03 Sep 2020 17:00:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEa-00013k-1g for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEW-0006bZ-0e for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:27 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-i9LarM1ANwS-7I3_Dpq8Jw-1; Thu, 03 Sep 2020 16:53:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D868D10BBED0; Thu, 3 Sep 2020 20:53:17 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id A23C52D07D; Thu, 3 Sep 2020 20:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y+oHo64EvoiaTMi66DVtt06upr/08pRVnAZcNgeussI=; b=JgQViCzQTPSx/mej0g+j/HW8qWFNZobBg/Menu7ZVkTk2sY1OJNVXHld+2PcA0w4Ivj70H lH0mTX9DvcvwRO5LskWzng41qB1/FYVzO7Zo7R9iWEdw+j9Kd1Epw9KUg3wv6QQUvG2c1U Kp1IgJ0IgRJ83ickpuV0Z5ta7Rr0bic= X-MC-Unique: i9LarM1ANwS-7I3_Dpq8Jw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 17/27] vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE Date: Thu, 3 Sep 2020 16:52:37 -0400 Message-Id: <20200903205247.1667472-18-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:47:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This will make the type name constant consistent with the name of the type checking macro. Signed-off-by: Eduardo Habkost Reviewed-by: Thomas Huth Message-Id: <20200902224311.1321159-9-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/vfio/ap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 68ed059b39..582c091a24 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -30,7 +30,7 @@ #include "exec/address-spaces.h" #include "qom/object.h" =20 -#define VFIO_AP_DEVICE_TYPE "vfio-ap" +#define TYPE_VFIO_AP_DEVICE "vfio-ap" =20 struct VFIOAPDevice { APDevice apdev; @@ -39,7 +39,7 @@ struct VFIOAPDevice { typedef struct VFIOAPDevice VFIOAPDevice; =20 DECLARE_INSTANCE_CHECKER(VFIOAPDevice, VFIO_AP_DEVICE, - VFIO_AP_DEVICE_TYPE) + TYPE_VFIO_AP_DEVICE) =20 static void vfio_ap_compute_needs_reset(VFIODevice *vdev) { @@ -72,7 +72,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev,= Error **errp) =20 if (!group_path) { error_setg(errp, "%s: no iommu_group found for %s: %s", - VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->mes= sage); + TYPE_VFIO_AP_DEVICE, vapdev->vdev.sysfsdev, gerror->mes= sage); g_error_free(gerror); return NULL; } @@ -176,7 +176,7 @@ static void vfio_ap_class_init(ObjectClass *klass, void= *data) } =20 static const TypeInfo vfio_ap_info =3D { - .name =3D VFIO_AP_DEVICE_TYPE, + .name =3D TYPE_VFIO_AP_DEVICE, .parent =3D TYPE_AP_DEVICE, .instance_size =3D sizeof(VFIOAPDevice), .class_init =3D vfio_ap_class_init, --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166716; cv=none; d=zohomail.com; s=zohoarc; b=b17SwDi9fHxyj+ZfllYxsHLbJf14nhlMVtZZsq1O2xhB62jNdiyFjD+EEEJV0+eI4lBHYwtK5FeeF7fRd0bTx/IUemZdjF1WEdNX2qNKFY1s3G2fc6xXwdYqIbtXqLZFriuCBnfEqiXiElyA6dcW6Gve441q3gGddF2xxbOhqRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=STycltGk/N79qHEc2F8EjCKOe0jyH7lhTX7lgq0Xm6w=; b=SWEV3CD2Ng1rc077a5LzrLyEyrLGPZ0mGY+uUxz69r1J/j1iOf5hvd+HfQJoPxaH8nmo7GRR7YAM5F4he34Bz7DRMNPY6lorskyFvmPwGPxi0OCa5ArB0io0p0btT9+AkRv4GAdoZusPn0KbMGxngQaIQtSjgnAC2jYpB0WGDio= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599166716954690.7016425471273; Thu, 3 Sep 2020 13:58:36 -0700 (PDT) Received: from localhost ([::1]:60286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwJY-000138-5A for importer@patchew.org; Thu, 03 Sep 2020 16:58:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEW-00010m-9p for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEU-0006bC-Fd for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:23 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-drxr-OJ-NKq0_ULs0-3WAA-1; Thu, 03 Sep 2020 16:53:19 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2A5418BA292; Thu, 3 Sep 2020 20:53:18 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E6526CE4E; Thu, 3 Sep 2020 20:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=STycltGk/N79qHEc2F8EjCKOe0jyH7lhTX7lgq0Xm6w=; b=Z25tsNXUvVEpaWTBAPGCeK2jPu9aP5K1T95FnZKxdehyeNc0w531cAAQb2Jbw1T0O0+vDi HaZhOtSnPjWDfUnc0PNQM3G9DWIs6kJeMGl3bOdSQcbMNB56puwnBBA+wxYf3KoIlcNID1 vEHBIxtT7LigEaQzh5579HxWBLgF0CU= X-MC-Unique: drxr-OJ-NKq0_ULs0-3WAA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 18/27] vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID Date: Thu, 3 Sep 2020 16:52:38 -0400 Message-Id: <20200903205247.1667472-19-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This will make the type name constant consistent with the name of the type checking macro. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/acpi/vmgenid.h | 6 +++--- hw/acpi/vmgenid.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index 86cd1da605..aff574df5f 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -6,7 +6,7 @@ #include "qemu/uuid.h" #include "qom/object.h" =20 -#define VMGENID_DEVICE "vmgenid" +#define TYPE_VMGENID "vmgenid" #define VMGENID_GUID "guid" #define VMGENID_GUID_FW_CFG_FILE "etc/vmgenid_guid" #define VMGENID_ADDR_FW_CFG_FILE "etc/vmgenid_addr" @@ -18,7 +18,7 @@ =20 typedef struct VmGenIdState VmGenIdState; DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID, - VMGENID_DEVICE) + TYPE_VMGENID) =20 struct VmGenIdState { DeviceClass parent_obj; @@ -29,7 +29,7 @@ struct VmGenIdState { /* returns NULL unless there is exactly one device */ static inline Object *find_vmgenid_dev(void) { - return object_resolve_path_type("", VMGENID_DEVICE, NULL); + return object_resolve_path_type("", TYPE_VMGENID, NULL); } =20 void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *gui= d, diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 2df7623d74..53db6af75d 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -198,7 +198,7 @@ static void vmgenid_realize(DeviceState *dev, Error **e= rrp) =20 if (!bios_linker_loader_can_write_pointer()) { error_setg(errp, "%s requires DMA write support in fw_cfg, " - "which this machine type does not provide", VMGENID_DEV= ICE); + "which this machine type does not provide", TYPE_VMGENI= D); return; } =20 @@ -206,7 +206,7 @@ static void vmgenid_realize(DeviceState *dev, Error **e= rrp) * device. Check if there are several. */ if (!find_vmgenid_dev()) { - error_setg(errp, "at most one %s device is permitted", VMGENID_DEV= ICE); + error_setg(errp, "at most one %s device is permitted", TYPE_VMGENI= D); return; } =20 @@ -232,7 +232,7 @@ static void vmgenid_device_class_init(ObjectClass *klas= s, void *data) } =20 static const TypeInfo vmgenid_device_info =3D { - .name =3D VMGENID_DEVICE, + .name =3D TYPE_VMGENID, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(VmGenIdState), .class_init =3D vmgenid_device_class_init, --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167451; cv=none; d=zohomail.com; s=zohoarc; b=Pingj3kkEK6cfegflWEoUbWm+Cljm9gDIRwC5em88awqV6pEar0dKinTnen6XWFBqzpZ2ztR3T+3oXqghOttBtpVt8tE6hFEtDWLKsj7zbyRiAfNQ3Kmt/IS6GQIlGXp7uA2XfwxSBMWDSsf9Iwnp6qPaiLfmom+lY1IUbyt08k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167451; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Zqa6aaKmwm6Igb+aD9Zq+/iOUndIFn2SdOJEhdzGFFY=; b=NL3GmZzyRIojd49qmdGZkzXo4rtWfmyzfBmhpdr0gbHk+LjlC7VjtMqIY7QzjRnUb77ab0xdz7BXWRb3h6vvn8ZirDYG6QHl0yX+ou8NLwR7n8qe+fo5e0B5xoyFiQsGHR/NN2d6aFVgWEOdGQ0Y4MVAMseKnUXOMqxqPuvGabQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167451225475.08731776946945; Thu, 3 Sep 2020 14:10:51 -0700 (PDT) Received: from localhost ([::1]:44654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwVN-0002W8-WD for importer@patchew.org; Thu, 03 Sep 2020 17:10:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEZ-000131-Ls for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEV-0006bQ-Cj for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-vsYtSVjvOCurm16WUs9gJA-1; Thu, 03 Sep 2020 16:53:20 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B266181F00A; Thu, 3 Sep 2020 20:53:19 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 811CA5C1C2; Thu, 3 Sep 2020 20:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zqa6aaKmwm6Igb+aD9Zq+/iOUndIFn2SdOJEhdzGFFY=; b=BbGyt8FaS+KPUiNpn5CtHwCT6fQe17h16HZY/jKyWTLgrkpabUfh9jUmUAK/a64szyOZmh uxvGYydvzOINTq8JtlmiFWBit3Esf66dAB8K+LQOCKWH08dgLV51xhHEm8NixONRXB5p1N ZnNwy2EhO7suWnU2W3AFqyGAhq2LcXM= X-MC-Unique: vsYtSVjvOCurm16WUs9gJA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 19/27] ahci: Rename ICH_AHCI to ICH9_AHCI Date: Thu, 3 Sep 2020 16:52:39 -0400 Message-Id: <20200903205247.1667472-20-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-33-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/ide/ahci.h | 2 +- hw/ide/ahci.c | 4 ++-- hw/ide/ich.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index 4cf6813d80..da3cddcc65 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -54,7 +54,7 @@ typedef struct AHCIState { typedef struct AHCIPCIState AHCIPCIState; =20 #define TYPE_ICH9_AHCI "ich9-ahci" -DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH_AHCI, +DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH9_AHCI, TYPE_ICH9_AHCI) =20 int32_t ahci_get_num_ports(PCIDevice *dev); diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index b696c6291a..ee1d47ff75 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1819,7 +1819,7 @@ type_init(sysbus_ahci_register_types) =20 int32_t ahci_get_num_ports(PCIDevice *dev) { - AHCIPCIState *d =3D ICH_AHCI(dev); + AHCIPCIState *d =3D ICH9_AHCI(dev); AHCIState *ahci =3D &d->ahci; =20 return ahci->ports; @@ -1827,7 +1827,7 @@ int32_t ahci_get_num_ports(PCIDevice *dev) =20 void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd) { - AHCIPCIState *d =3D ICH_AHCI(dev); + AHCIPCIState *d =3D ICH9_AHCI(dev); AHCIState *ahci =3D &d->ahci; int i; =20 diff --git a/hw/ide/ich.c b/hw/ide/ich.c index eff3188fff..51cd2f38b7 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -91,14 +91,14 @@ static const VMStateDescription vmstate_ich9_ahci =3D { =20 static void pci_ich9_reset(DeviceState *dev) { - AHCIPCIState *d =3D ICH_AHCI(dev); + AHCIPCIState *d =3D ICH9_AHCI(dev); =20 ahci_reset(&d->ahci); } =20 static void pci_ich9_ahci_init(Object *obj) { - struct AHCIPCIState *d =3D ICH_AHCI(obj); + struct AHCIPCIState *d =3D ICH9_AHCI(obj); =20 ahci_init(&d->ahci, DEVICE(obj)); } @@ -108,7 +108,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error= **errp) struct AHCIPCIState *d; int sata_cap_offset; uint8_t *sata_cap; - d =3D ICH_AHCI(dev); + d =3D ICH9_AHCI(dev); int ret; =20 ahci_realize(&d->ahci, DEVICE(dev), pci_get_address_space(dev), 6); @@ -154,7 +154,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error= **errp) static void pci_ich9_uninit(PCIDevice *dev) { struct AHCIPCIState *d; - d =3D ICH_AHCI(dev); + d =3D ICH9_AHCI(dev); =20 msi_uninit(dev); ahci_uninit(&d->ahci); --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167110; cv=none; d=zohomail.com; s=zohoarc; b=E3mGDEJtYxxfX1nQTW9ZPB4Sn9A7UqKlxa1zN+bpkDzxN/bkF5qF9+nyd7gkgqkl1On7omCC4WsX/IcwmuRBVIDDFUaYTfOxZnD7zs+epNiveb1Ln/20zxTApPcYIXJ1R12IG/uH6EfHQzGuOtJGqSWmveBRlTzpSQrrmvIBEgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167110; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9JDcdp36qEP+Z2H5QkxPZy0yO16i/GQnnjh6VeLYAz8=; b=BdTqyAVlR/cSwAGQWfrIp9Fd/z/j9UT7CZAzvSMeaJFuPvnKMo72oOQvpaj4OPArtv9yEwJoM466Bm5N3NGq3Sw+PChvGzkwzZ/lu+I0YIL7wgZOvH9mbXp6DJ18WNvxnXjFW7YBi0SOwQt9224LsWRDefWP9tZgyio/RdwRDfY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167110639504.8042305774619; Thu, 3 Sep 2020 14:05:10 -0700 (PDT) Received: from localhost ([::1]:52068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwPs-0001l2-RX for importer@patchew.org; Thu, 03 Sep 2020 17:05:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEc-000172-Og for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEY-0006bi-2x for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:29 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-105-xEaHi62FOHuz9KFIJeCnSA-1; Thu, 03 Sep 2020 16:53:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C912A1017DCB; Thu, 3 Sep 2020 20:53:20 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BCCF756A6; Thu, 3 Sep 2020 20:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9JDcdp36qEP+Z2H5QkxPZy0yO16i/GQnnjh6VeLYAz8=; b=iUBe6z4PnvdHQoXIUcSohRjneohNfLXqygGzEwsoKtYIsPiS6iFEsWKwRVtCLooT42/836 DXVDmEGYAeTgkcwAj63o5wdQgaiCyjc12SgcBlQnWywzxZWtRxsXT0Lc7spwcjL0b2NcO4 pALraZ4GHJbBswOzi8yGQR5I1pO4yCI= X-MC-Unique: xEaHi62FOHuz9KFIJeCnSA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 20/27] esp: Rename ESP_STATE to ESP Date: Thu, 3 Sep 2020 16:52:40 -0400 Message-Id: <20200903205247.1667472-21-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:47:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Herv=C3=A9 Poussineau Message-Id: <20200902224311.1321159-40-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/scsi/esp.h | 2 +- hw/dma/sparc32_dma.c | 2 +- hw/m68k/q800.c | 2 +- hw/mips/jazz.c | 2 +- hw/scsi/esp.c | 6 +++--- hw/sparc/sun4m.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index f281625dd5..20800dbf5b 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -67,7 +67,7 @@ struct ESPState { =20 #define TYPE_ESP "esp" typedef struct SysBusESPState SysBusESPState; -DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP_STATE, +DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP, TYPE_ESP) =20 struct SysBusESPState { diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index bcd1626fbd..d20a5bc065 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -303,7 +303,7 @@ static void sparc32_espdma_device_realize(DeviceState *= dev, Error **errp) =20 d =3D qdev_new(TYPE_ESP); object_property_add_child(OBJECT(dev), "esp", OBJECT(d)); - sysbus =3D ESP_STATE(d); + sysbus =3D ESP(d); esp =3D &sysbus->esp; esp->dma_memory_read =3D espdma_memory_read; esp->dma_memory_write =3D espdma_memory_write; diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 1ca482ad81..ce4b47c3e3 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -290,7 +290,7 @@ static void q800_init(MachineState *machine) /* SCSI */ =20 dev =3D qdev_new(TYPE_ESP); - sysbus_esp =3D ESP_STATE(dev); + sysbus_esp =3D ESP(dev); esp =3D &sysbus_esp->esp; esp->dma_memory_read =3D NULL; esp->dma_memory_write =3D NULL; diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 82a6e3220e..47723093b6 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -309,7 +309,7 @@ static void mips_jazz_init(MachineState *machine, =20 /* SCSI adapter */ dev =3D qdev_new(TYPE_ESP); - sysbus_esp =3D ESP_STATE(dev); + sysbus_esp =3D ESP(dev); esp =3D &sysbus_esp->esp; esp->dma_memory_read =3D rc4030_dma_read; esp->dma_memory_write =3D rc4030_dma_write; diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 405f8b7cbc..b84e0fe33e 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -929,7 +929,7 @@ static const struct SCSIBusInfo esp_scsi_info =3D { =20 static void sysbus_esp_gpio_demux(void *opaque, int irq, int level) { - SysBusESPState *sysbus =3D ESP_STATE(opaque); + SysBusESPState *sysbus =3D ESP(opaque); ESPState *s =3D &sysbus->esp; =20 switch (irq) { @@ -945,7 +945,7 @@ static void sysbus_esp_gpio_demux(void *opaque, int irq= , int level) static void sysbus_esp_realize(DeviceState *dev, Error **errp) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - SysBusESPState *sysbus =3D ESP_STATE(dev); + SysBusESPState *sysbus =3D ESP(dev); ESPState *s =3D &sysbus->esp; =20 sysbus_init_irq(sbd, &s->irq); @@ -967,7 +967,7 @@ static void sysbus_esp_realize(DeviceState *dev, Error = **errp) =20 static void sysbus_esp_hard_reset(DeviceState *dev) { - SysBusESPState *sysbus =3D ESP_STATE(dev); + SysBusESPState *sysbus =3D ESP(dev); esp_hard_reset(&sysbus->esp); } =20 diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 5ed922d436..6f63cc96a4 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -345,7 +345,7 @@ static void *sparc32_dma_init(hwaddr dma_base, OBJECT(dma), "espdma")); sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq); =20 - esp =3D ESP_STATE(object_resolve_path_component(OBJECT(espdma), "esp")= ); + esp =3D ESP(object_resolve_path_component(OBJECT(espdma), "esp")); sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base); scsi_bus_legacy_handle_cmdline(&esp->esp.bus); =20 --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167224; cv=none; d=zohomail.com; s=zohoarc; b=id5OHxB7ZzRmKLjKk1IX8CT0cydaGgEj+KuGtoT7aiwF+A5WwWeszFtqTPCV0e7wfrC9aXLfcix/P9EA6y8LcmhbNbGIf9DjIE+QpWeapwD0LDSjH+dUN1LmPbm+um0oVQE/NcnfQ5I6Plosq0ncfcGNKS+2E6CoOz6kn5EHnaI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167224; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/K3E4AQB9Wyo8p40roP4rTMm1MIlAuiE6H9hhreumsE=; b=EEwaSGyaVHzuJcZQqudRs25/kFt94539GnmJFmAKqB9wPIvVANqwrngKKdKoPL4MJ8GhdM3w+qxPQM6rFRFx8aoMa4RpQc8HG4KwsfX13do6w+gm8mxEbXGa4FR54qsiQ13KBJ99E2qG/H0A0umHnkLY7MII7jxBfkABEjkLRrE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167224899192.07870099527668; Thu, 3 Sep 2020 14:07:04 -0700 (PDT) Received: from localhost ([::1]:59978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwRk-0005F2-4t for importer@patchew.org; Thu, 03 Sep 2020 17:07:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEd-00017t-Kp for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54375 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEZ-0006bo-Jl for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-9m83jws1O8auwL5RJqi3ng-1; Thu, 03 Sep 2020 16:53:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A70A610BBEC7; Thu, 3 Sep 2020 20:53:21 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76CA46716C; Thu, 3 Sep 2020 20:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/K3E4AQB9Wyo8p40roP4rTMm1MIlAuiE6H9hhreumsE=; b=bAxU2ucEkivyyjBEjpxl2I1HHFZPWbpKIAi8V4zcakLnA6sF8LBi1hgqYzF0uv+Ivxymjq jY7L05q9GtLkclGxd6r91MaTjJiBHgUtKXP+XnA4617HWl7lDtFHFgpw/0lNLLyCG2oXaS jjgjqPxopTdarbqkhg3gddT9qabsdec= X-MC-Unique: 9m83jws1O8auwL5RJqi3ng-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 21/27] filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER Date: Thu, 3 Sep 2020 16:52:41 -0400 Message-Id: <20200903205247.1667472-22-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 00:24:51 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Zhang Chen Message-Id: <20200902224311.1321159-41-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- net/filter-rewriter.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index 113e293207..44f6021dd8 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -25,7 +25,7 @@ =20 #define TYPE_FILTER_REWRITER "filter-rewriter" typedef struct RewriterState RewriterState; -DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_COLO_REWRITER, +DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_REWRITER, TYPE_FILTER_REWRITER) =20 #define FAILOVER_MODE_ON true @@ -47,7 +47,7 @@ static void filter_rewriter_failover_mode(RewriterState *= s) =20 static void filter_rewriter_flush(NetFilterState *nf) { - RewriterState *s =3D FILTER_COLO_REWRITER(nf); + RewriterState *s =3D FILTER_REWRITER(nf); =20 if (!qemu_net_queue_flush(s->incoming_queue)) { /* Unable to empty the queue, purge remaining packets */ @@ -252,7 +252,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState= *nf, int iovcnt, NetPacketSent *sent_cb) { - RewriterState *s =3D FILTER_COLO_REWRITER(nf); + RewriterState *s =3D FILTER_REWRITER(nf); Connection *conn; ConnectionKey key; Packet *pkt; @@ -350,7 +350,7 @@ static gboolean offset_is_nonzero(gpointer key, static void colo_rewriter_handle_event(NetFilterState *nf, int event, Error **errp) { - RewriterState *rs =3D FILTER_COLO_REWRITER(nf); + RewriterState *rs =3D FILTER_REWRITER(nf); =20 switch (event) { case COLO_EVENT_CHECKPOINT: @@ -370,7 +370,7 @@ static void colo_rewriter_handle_event(NetFilterState *= nf, int event, =20 static void colo_rewriter_cleanup(NetFilterState *nf) { - RewriterState *s =3D FILTER_COLO_REWRITER(nf); + RewriterState *s =3D FILTER_REWRITER(nf); =20 /* flush packets */ if (s->incoming_queue) { @@ -381,7 +381,7 @@ static void colo_rewriter_cleanup(NetFilterState *nf) =20 static void colo_rewriter_setup(NetFilterState *nf, Error **errp) { - RewriterState *s =3D FILTER_COLO_REWRITER(nf); + RewriterState *s =3D FILTER_REWRITER(nf); =20 s->connection_track_table =3D g_hash_table_new_full(connection_key_has= h, connection_key_equal, @@ -392,7 +392,7 @@ static void colo_rewriter_setup(NetFilterState *nf, Err= or **errp) =20 static bool filter_rewriter_get_vnet_hdr(Object *obj, Error **errp) { - RewriterState *s =3D FILTER_COLO_REWRITER(obj); + RewriterState *s =3D FILTER_REWRITER(obj); =20 return s->vnet_hdr; } @@ -401,14 +401,14 @@ static void filter_rewriter_set_vnet_hdr(Object *obj, bool value, Error **errp) { - RewriterState *s =3D FILTER_COLO_REWRITER(obj); + RewriterState *s =3D FILTER_REWRITER(obj); =20 s->vnet_hdr =3D value; } =20 static void filter_rewriter_init(Object *obj) { - RewriterState *s =3D FILTER_COLO_REWRITER(obj); + RewriterState *s =3D FILTER_REWRITER(obj); =20 s->vnet_hdr =3D false; s->failover_mode =3D FAILOVER_MODE_OFF; --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599166989; cv=none; d=zohomail.com; s=zohoarc; b=mXhQsBX7+3C3aKmrYzijH+EiJMAYzIcSN99MoZBoFNCFS0XLHJD8W4CT92CywPnSNLSZsAsEANpM6N2ZGkoshmMqvMGB31IRUkf3feSN/HC6S+faILKAsYPAvtU+2ucMZomyRIG0WMQjH17lUWWP0x/BtDJW+BNGN2PBTu2WJt0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599166989; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T4dBx0MZfsfJpNpI7a/vbxtuu/0AO++J414wc1ABxzM=; b=MjMbGbCAKbBKzXzjAMJq/hDwzISDU9lmrFEnj9V/GWedekjAx8QjQs5H86Uh1ygwF8aDtwOdiU0F3nCRfRlyXKFB9sLnXgLlUWdk7byLTMjp3yMv8Bt3YBWb76OmKF57gDPLLNO1VON2SmxCVxzOjUkZuxhVsm3qMq1MO1BwF0E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15991669894921006.205406864552; Thu, 3 Sep 2020 14:03:09 -0700 (PDT) Received: from localhost ([::1]:45210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwNw-0007Cq-J3 for importer@patchew.org; Thu, 03 Sep 2020 17:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEd-00017u-NN for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEZ-0006bm-E4 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-yXYrPUGQOPyI1pZpJrPTMQ-1; Thu, 03 Sep 2020 16:53:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A4A381019640; Thu, 3 Sep 2020 20:53:22 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DC625D9CC; Thu, 3 Sep 2020 20:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T4dBx0MZfsfJpNpI7a/vbxtuu/0AO++J414wc1ABxzM=; b=LhJOKoGhzwdEN8wrD4fKOY741Q2043G4DJBewTYWCyl4huC5eb+06A84UWweWAMEsh7Bys MUmFkiZW1eaTLpO32xM6qyhxRWlecs765QR+BB9qCityuceiWGiYkrzQ+SLHfnj5W02jfS bfKS6mRuh6Uri+tR0T1xnWHdRJz8U3s= X-MC-Unique: yXYrPUGQOPyI1pZpJrPTMQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 22/27] rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC Date: Thu, 3 Sep 2020 16:52:42 -0400 Message-Id: <20200903205247.1667472-23-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Herv=C3=A9 Poussineau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-48-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/ppc/rs6000_mc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index 56e96010b8..8611ffa96d 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -30,7 +30,7 @@ =20 #define TYPE_RS6000MC "rs6000-mc" typedef struct RS6000MCState RS6000MCState; -DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC_DEVICE, +DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC, TYPE_RS6000MC) =20 struct RS6000MCState { @@ -143,7 +143,7 @@ static const MemoryRegionPortio rs6000mc_port_list[] = =3D { =20 static void rs6000mc_realize(DeviceState *dev, Error **errp) { - RS6000MCState *s =3D RS6000MC_DEVICE(dev); + RS6000MCState *s =3D RS6000MC(dev); int socket =3D 0; unsigned int ram_size =3D s->ram_size / MiB; Error *local_err =3D NULL; --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167247; cv=none; d=zohomail.com; s=zohoarc; b=V/18jIqDJ+eRxSZOPvGzed1Yi9QHk78wNSFFO8/5EAMPmXj4f76D9ybUWLRUrsXB2FomMVPO3WJq7c60sxfZPMYktNku+URGkeNRK18T/h8uFRtlvPizLfFaEDe94QGI9cOE9GUOhdrF0S+N938RlBTgwPqSDe0Ae0zcuHiGZU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167247; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oFZO6p04Xo1cCQTwbHus+a7/KxGBO0PW+N9S1mCxOuY=; b=nOod+TBROMDUd2BlyqtyaK8crsjsfPM/CuwBCv+hsbLUHX63mcPneWxU1IDPr0N2xWEdmGmGhIEnujYc4R0VUBEriU+RlNpnPYF/boqhK8FEwB7XRReOnuzTAUtbcVaWNRP77wyL3e4bopCplYBVzGdgkqRN3KQv0+dh43oEG7Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167247353850.9998949586512; Thu, 3 Sep 2020 14:07:27 -0700 (PDT) Received: from localhost ([::1]:33010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwS6-0005v3-KC for importer@patchew.org; Thu, 03 Sep 2020 17:07:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEh-00018c-8K for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:36 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:22769 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEZ-0006bu-O0 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:33 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-_6trVGtCPKS0yf-t0hgKVg-1; Thu, 03 Sep 2020 16:53:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9851B10BBEC4; Thu, 3 Sep 2020 20:53:23 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62E695C1C2; Thu, 3 Sep 2020 20:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oFZO6p04Xo1cCQTwbHus+a7/KxGBO0PW+N9S1mCxOuY=; b=cmyAgXY3N5Cuv2KANXdmSL1iHGBBWUiFmDp5M8g1AWNu/SZUyOLc3csAOtO9Xeyr0G1VYH OeYMi6Zf1ytpXni9c98UyB8igoWDZ0trjgLFTr2QP2okVUb288GvXdgckqroV90jiFCPne nyjzLSnLbhJKOchpRTggqXPm8dCjHtU= X-MC-Unique: _6trVGtCPKS0yf-t0hgKVg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 23/27] sabre: Rename SABRE_DEVICE to SABRE Date: Thu, 3 Sep 2020 16:52:43 -0400 Message-Id: <20200903205247.1667472-24-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-49-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/pci-host/sabre.h | 2 +- hw/pci-host/sabre.c | 8 ++++---- hw/sparc64/sun4u.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/pci-host/sabre.h b/include/hw/pci-host/sabre.h index 597bf70d69..7a76de4b9e 100644 --- a/include/hw/pci-host/sabre.h +++ b/include/hw/pci-host/sabre.h @@ -51,7 +51,7 @@ struct SabreState { typedef struct SabreState SabreState; =20 #define TYPE_SABRE "sabre" -DECLARE_INSTANCE_CHECKER(SabreState, SABRE_DEVICE, +DECLARE_INSTANCE_CHECKER(SabreState, SABRE, TYPE_SABRE) =20 #endif diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index 0cc68585f8..5ac6283623 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -338,7 +338,7 @@ static void pci_sabre_set_irq(void *opaque, int irq_num= , int level) =20 static void sabre_reset(DeviceState *d) { - SabreState *s =3D SABRE_DEVICE(d); + SabreState *s =3D SABRE(d); PCIDevice *pci_dev; unsigned int i; uint16_t cmd; @@ -376,7 +376,7 @@ static const MemoryRegionOps pci_config_ops =3D { =20 static void sabre_realize(DeviceState *dev, Error **errp) { - SabreState *s =3D SABRE_DEVICE(dev); + SabreState *s =3D SABRE(dev); PCIHostState *phb =3D PCI_HOST_BRIDGE(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(s); PCIDevice *pci_dev; @@ -421,7 +421,7 @@ static void sabre_realize(DeviceState *dev, Error **err= p) =20 static void sabre_init(Object *obj) { - SabreState *s =3D SABRE_DEVICE(obj); + SabreState *s =3D SABRE(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); unsigned int i; =20 @@ -502,7 +502,7 @@ static const TypeInfo sabre_pci_info =3D { =20 static char *sabre_ofw_unit_address(const SysBusDevice *dev) { - SabreState *s =3D SABRE_DEVICE(dev); + SabreState *s =3D SABRE(dev); =20 return g_strdup_printf("%x,%x", (uint32_t)((s->special_base >> 32) & 0xffffffff), diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 67985414e2..b4aabfc076 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -585,7 +585,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, prom_init(hwdef->prom_addr, bios_name); =20 /* Init sabre (PCI host bridge) */ - sabre =3D SABRE_DEVICE(qdev_new(TYPE_SABRE)); + sabre =3D SABRE(qdev_new(TYPE_SABRE)); qdev_prop_set_uint64(DEVICE(sabre), "special-base", PBM_SPECIAL_BASE); qdev_prop_set_uint64(DEVICE(sabre), "mem-base", PBM_MEM_BASE); object_property_set_link(OBJECT(sabre), "iommu", OBJECT(iommu), --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167124; cv=none; d=zohomail.com; s=zohoarc; b=OGXATjAOVhZhfUkmn7hlP7J3os+hKi/JCWFqUwQEgBs/Sym63ozFUMW0vKpVkJnXiuc6iTjw6XC0mEEgLJl/KN3ITjCJCy39Q04VzYt6Gm7sZy1fcXf2fWAoF1RuKPkb27t/Su0GQ6RtoeDaiEcU8NQY48kZd4dbHJBPT8HGu68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167124; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=42Ag7hd76ygahys0qEi4reckXYsa9ZqB7olqHI6x2pg=; b=enAr+mGFdRAVG5DmBmBxyL6jwi0HCsUUndxP8VdeuDW9hXP350CtN2GtsRmLe18tSUVHL2AvZGa8v8uou9AWVwZVpdIpsZzIA+7DBE2q9TEB/Kf7NZFF9jaQhOvdExi/zME0Gq0IDVf9KAl1sUUEfxDor6USwcXQPzNO57b7HwM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167124162994.1331104825479; Thu, 3 Sep 2020 14:05:24 -0700 (PDT) Received: from localhost ([::1]:53518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwQ7-0002Kl-Cx for importer@patchew.org; Thu, 03 Sep 2020 17:05:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEe-000180-GL for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:33 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:42378 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEb-0006c1-JB for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-njQejQJlNWm8HH3ASOMQbA-1; Thu, 03 Sep 2020 16:53:25 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 898B9CF984; Thu, 3 Sep 2020 20:53:24 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 514D28118A; Thu, 3 Sep 2020 20:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=42Ag7hd76ygahys0qEi4reckXYsa9ZqB7olqHI6x2pg=; b=JOt/0ofhrfwpidLIPP+omB/ALKfEnoe7igvAnGkOmdki/gnoMphuzPubDMDTwsoM1Z6vb2 yKrOnRsYhf8tlNE1vwtNoiadtktJXO4eR+GPTTaiOgXKzjSDwIgrkyZuoV1XKFZmFBFpB+ y/SJPjCwQBVbBH4mOFGRmRbZUca9hFg= X-MC-Unique: njQejQJlNWm8HH3ASOMQbA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 24/27] usb: Rename USB_SERIAL_DEV to USB_SERIAL Date: Thu, 3 Sep 2020 16:52:44 -0400 Message-Id: <20200903205247.1667472-25-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:28:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-54-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/usb/dev-serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 1a58851d4b..1a038a222e 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -113,7 +113,7 @@ struct USBSerialState { typedef struct USBSerialState USBSerialState; =20 #define TYPE_USB_SERIAL "usb-serial-dev" -DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL_DEV, +DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL, TYPE_USB_SERIAL) =20 enum { @@ -517,7 +517,7 @@ static void usb_serial_event(void *opaque, QEMUChrEvent= event) =20 static void usb_serial_realize(USBDevice *dev, Error **errp) { - USBSerialState *s =3D USB_SERIAL_DEV(dev); + USBSerialState *s =3D USB_SERIAL(dev); Error *local_err =3D NULL; =20 usb_desc_create_serial(dev); --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167885; cv=none; d=zohomail.com; s=zohoarc; b=CBun1fIA0obI5XPoXLsbc0SEsIr1od3S9Mu7Mteupe4FCNnlHQT9Np8lkydn7nylImNea24K+N2oyoyDx/VMP60uT7GT7kMd5h34G/9wsmlyBznisln0ddA9S4r5OVBoWJqdUhwwdWbG3ong8lzdwA9dCtbFMm2bAjX5XJXxEFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167885; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9d3w3vq3xDiGR0tvfJkqLbBaoO9YQl9D9kE2nTayO1o=; b=V0LTTW3PZNPPttqyy2NQeJyTwIBvVoc4//ZV0LC2+7/DTYb1m2qCcqv2LxKd4L/WTlkturMrGBNAmMfhQDB+h6vI6+iad/6B/J+NSXkQmbTNMDEScOf0jqIx34D1V0UYKDEhpow7xG5ldkIZHYDLiUkuWxuynJH3fJlmdw8BcNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159916788537351.26541448655996; Thu, 3 Sep 2020 14:18:05 -0700 (PDT) Received: from localhost ([::1]:42060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwcO-0004av-Gl for importer@patchew.org; Thu, 03 Sep 2020 17:18:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEm-00019b-9h for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEg-0006dl-W4 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:39 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-5dFFosv0Ob-pFREjY1941w-1; Thu, 03 Sep 2020 16:53:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6266F81CBF1; Thu, 3 Sep 2020 20:53:28 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 548385C1C2; Thu, 3 Sep 2020 20:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9d3w3vq3xDiGR0tvfJkqLbBaoO9YQl9D9kE2nTayO1o=; b=bkt1z+27yaQ8/smTjtQ9tF9q+/0hLLRs7wKtpnBWX1m+61HfaLBl1OoHMhr4uQQnSfBO6f cTArvv3lhEwrJom1AIvq1Cd+lgPXxLPllJm8XktzUab244ovTVnTOhSKLlQ0L1TNPRgPOS m4opdD9roAUKZYcdIUoy1F1EMKAIrY0= X-MC-Unique: 5dFFosv0Ob-pFREjY1941w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 25/27] vfio: Rename PCI_VFIO to VFIO_PCI Date: Thu, 3 Sep 2020 16:52:45 -0400 Message-Id: <20200903205247.1667472-26-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Auger Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Make the type checking macro name consistent with the TYPE_* constant. Signed-off-by: Eduardo Habkost Reviewed-by: Eric Auger Message-Id: <20200902224311.1321159-56-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/vfio/pci.h | 2 +- hw/vfio/pci.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 846d60e56c..5e53d5b863 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -116,7 +116,7 @@ typedef struct VFIOMSIXInfo { =20 #define TYPE_VFIO_PCI "vfio-pci" typedef struct VFIOPCIDevice VFIOPCIDevice; -DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, PCI_VFIO, +DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, VFIO_PCI, TYPE_VFIO_PCI) =20 struct VFIOPCIDevice { diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 3611dcd38b..0d83eb0e47 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -230,7 +230,7 @@ static void vfio_intx_update(VFIOPCIDevice *vdev, PCIIN= TxRoute *route) =20 static void vfio_intx_routing_notifier(PCIDevice *pdev) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); PCIINTxRoute route; =20 if (vdev->interrupt !=3D VFIO_INT_INTx) { @@ -456,7 +456,7 @@ static void vfio_update_kvm_msi_virq(VFIOMSIVector *vec= tor, MSIMessage msg, static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr, MSIMessage *msg, IOHandler *handler) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); VFIOMSIVector *vector; int ret; =20 @@ -541,7 +541,7 @@ static int vfio_msix_vector_use(PCIDevice *pdev, =20 static void vfio_msix_vector_release(PCIDevice *pdev, unsigned int nr) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); VFIOMSIVector *vector =3D &vdev->msi_vectors[nr]; =20 trace_vfio_msix_vector_release(vdev->vbasedev.name, nr); @@ -1048,7 +1048,7 @@ static const MemoryRegionOps vfio_vga_ops =3D { */ static void vfio_sub_page_bar_update_mapping(PCIDevice *pdev, int bar) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); VFIORegion *region =3D &vdev->bars[bar].region; MemoryRegion *mmap_mr, *region_mr, *base_mr; PCIIORegion *r; @@ -1094,7 +1094,7 @@ static void vfio_sub_page_bar_update_mapping(PCIDevic= e *pdev, int bar) */ uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32_t addr, int len) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); uint32_t emu_bits =3D 0, emu_val =3D 0, phys_val =3D 0, val; =20 memcpy(&emu_bits, vdev->emulated_config_bits + addr, len); @@ -1127,7 +1127,7 @@ uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32= _t addr, int len) void vfio_pci_write_config(PCIDevice *pdev, uint32_t addr, uint32_t val, int len) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); uint32_t val_le =3D cpu_to_le32(val); =20 trace_vfio_pci_write_config(vdev->vbasedev.name, addr, val, len); @@ -2701,7 +2701,7 @@ static void vfio_unregister_req_notifier(VFIOPCIDevic= e *vdev) =20 static void vfio_realize(PCIDevice *pdev, Error **errp) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); VFIODevice *vbasedev_iter; VFIOGroup *group; char *tmp, *subsys, group_path[PATH_MAX], *group_name; @@ -3033,7 +3033,7 @@ error: =20 static void vfio_instance_finalize(Object *obj) { - VFIOPCIDevice *vdev =3D PCI_VFIO(obj); + VFIOPCIDevice *vdev =3D VFIO_PCI(obj); VFIOGroup *group =3D vdev->vbasedev.group; =20 vfio_display_finalize(vdev); @@ -3057,7 +3057,7 @@ static void vfio_instance_finalize(Object *obj) =20 static void vfio_exitfn(PCIDevice *pdev) { - VFIOPCIDevice *vdev =3D PCI_VFIO(pdev); + VFIOPCIDevice *vdev =3D VFIO_PCI(pdev); =20 vfio_unregister_req_notifier(vdev); vfio_unregister_err_notifier(vdev); @@ -3075,7 +3075,7 @@ static void vfio_exitfn(PCIDevice *pdev) =20 static void vfio_pci_reset(DeviceState *dev) { - VFIOPCIDevice *vdev =3D PCI_VFIO(dev); + VFIOPCIDevice *vdev =3D VFIO_PCI(dev); =20 trace_vfio_pci_reset(vdev->vbasedev.name); =20 @@ -3115,7 +3115,7 @@ post_reset: static void vfio_instance_init(Object *obj) { PCIDevice *pci_dev =3D PCI_DEVICE(obj); - VFIOPCIDevice *vdev =3D PCI_VFIO(obj); + VFIOPCIDevice *vdev =3D VFIO_PCI(obj); =20 device_add_bootindex_property(obj, &vdev->bootindex, "bootindex", NULL, --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167326; cv=none; d=zohomail.com; s=zohoarc; b=UiS2sGufn6rGUegbz9IDbcJRt3p4pncAUTQHrhFBXbHNwA5w1z8jjYrDrUcdHochyTMmDMSocJMIeo/lqvwuotEeOQ3gQF4LaDm4uOHAk2DZ6x/LYyLjXnx40jtEF8kp1xCGhDlPLslCM9emeL6i7Lu7HgvbTGtvhLK+3uUFd4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167326; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TPqznILZvUu9q1JPhNI3wAUpCRCItkymnaT8Sy8vjHU=; b=LRStoNdCJPlPU7gW3K118MUPD7Iedh2QzNpHwaetLS8hHObs1ZJsDEN2kHIrBecUMfeXj5OlT4sIingDaCCEaekYpxBAAT2M71yRGc6Di/Aodr7Q8An6x7V4sqKjhLcILh+zRqN6MhfJffPTdGXy2WfAyPGRM9QS7PtijHdFP1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167326709530.0087479346158; Thu, 3 Sep 2020 14:08:46 -0700 (PDT) Received: from localhost ([::1]:39114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwTN-00005y-Tm for importer@patchew.org; Thu, 03 Sep 2020 17:08:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEj-00018x-4j for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27832 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEf-0006df-66 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-85q2VTAMMP-X0XqX_5kteA-1; Thu, 03 Sep 2020 16:53:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65E8412CCED; Thu, 3 Sep 2020 20:53:29 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C1CD672C6; Thu, 3 Sep 2020 20:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TPqznILZvUu9q1JPhNI3wAUpCRCItkymnaT8Sy8vjHU=; b=QZnCWn70Ty4Qn1IHpgCw3BAX/+F0EiD5bw63nvYSX/93ky3LzgdHeFOmPZtgi3ALz+dM4S CLeWrHORKt3cwF66UL4XznLmZga3fSaH/j9RkLawXbDV5AHFE/UgmQGCtIATBmsxTlZIv/ g5TMLhlAMsv4ZAoaOB8ISDOZSMtI/98= X-MC-Unique: 85q2VTAMMP-X0XqX_5kteA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 26/27] pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312 Date: Thu, 3 Sep 2020 16:52:46 -0400 Message-Id: <20200903205247.1667472-27-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 00:24:51 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This will make the type name constant consistent with the name of the type checking macro. Signed-off-by: Eduardo Habkost Reviewed-by: Herv=C3=A9 Poussineau Message-Id: <20200902224311.1321159-21-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/isa/pc87312.h | 4 ++-- hw/isa/pc87312.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index a65168a157..da8dc5ddf5 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -29,10 +29,10 @@ #include "qom/object.h" =20 =20 -#define TYPE_PC87312_SUPERIO "pc87312" +#define TYPE_PC87312 "pc87312" typedef struct PC87312State PC87312State; DECLARE_INSTANCE_CHECKER(PC87312State, PC87312, - TYPE_PC87312_SUPERIO) + TYPE_PC87312) =20 struct PC87312State { /*< private >*/ diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index 0cacbbc91b..8d7b8d3db2 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -371,7 +371,7 @@ static void pc87312_class_init(ObjectClass *klass, void= *data) } =20 static const TypeInfo pc87312_type_info =3D { - .name =3D TYPE_PC87312_SUPERIO, + .name =3D TYPE_PC87312, .parent =3D TYPE_ISA_SUPERIO, .instance_size =3D sizeof(PC87312State), .instance_init =3D pc87312_initfn, --=20 2.26.2 From nobody Wed May 1 05:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599167761; cv=none; d=zohomail.com; s=zohoarc; b=MfxaknrtXgF7M2j9dETliiVTn/ZT/EBmJ6dyStEYfJtNeCQbYwGWEDOLmJQInCqpGsKu1GdSsuzPVKISvsTaVJQMDIQy4683K7SpZJQLnfjQ3dWHdguwlLzZ8vSWgPCkaeZhhCXj1v/Dh6wCfBMWdccNg97yZm+qRtjtgqfbUFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599167761; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oszayQ0VGZ94gc4rNIdB3VO4jFeqqjzbkxRkmz3dAZs=; b=CzfBD4KeILGKetdhf0mGDhm8pIme3zLt2PDv0Dh0IY0f99bm9G2Ab92jAa7Q7pNq6WoRzM8hSGpUlz5myg1B3nQOdTtH0AGA94TA6w59ZempF/ROljN2kfwGoPnRQUu8+gP4AZQDNspfZXS+roHTlacZW6D9Du0XDPd7N67mtmc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599167761255642.3308386383408; Thu, 3 Sep 2020 14:16:01 -0700 (PDT) Received: from localhost ([::1]:33728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwaO-0001Gh-0L for importer@patchew.org; Thu, 03 Sep 2020 17:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwEk-00019V-U6 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDwEh-0006dr-7v for qemu-devel@nongnu.org; Thu, 03 Sep 2020 16:53:38 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-PpbvYs9PMES-N1HmfHlUvg-1; Thu, 03 Sep 2020 16:53:31 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F1D110BBEC2; Thu, 3 Sep 2020 20:53:30 +0000 (UTC) Received: from localhost (ovpn-66-226.rdu2.redhat.com [10.10.66.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 245AB7EECF; Thu, 3 Sep 2020 20:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599166413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oszayQ0VGZ94gc4rNIdB3VO4jFeqqjzbkxRkmz3dAZs=; b=CGPFkAmMrIkrmkATO+8cTc/5zSnVPTidVghVSFOulzDNfysI0UVdf70KMxX/OSRUeL7QvJ U36PX3VPVjXeaf95vh630xqnPHqdpyaXNtLsMFC+SpsoPHvpamUTwHvTdxVwVTyIpC/8EG 89uj6bEXkcg15bAQTkPyY5td5DQqpzk= X-MC-Unique: PpbvYs9PMES-N1HmfHlUvg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 27/27] tusb6010: Rename TUSB to TUSB6010 Date: Thu, 3 Sep 2020 16:52:47 -0400 Message-Id: <20200903205247.1667472-28-ehabkost@redhat.com> In-Reply-To: <20200903205247.1667472-1-ehabkost@redhat.com> References: <20200903205247.1667472-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:47:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Make type checking function name consistent with the TYPE_TUSB6010 constant and QOM type name ("tusb6010"). Suggested-by: Philippe Mathieu-Daud=C3=A9 Suggested-by: "Daniel P. Berrang=C3=A9" Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200903180128.1523959-9-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/usb/tusb6010.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index 2bee3ae59f..dd20996d13 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -32,7 +32,7 @@ =20 #define TYPE_TUSB6010 "tusb6010" typedef struct TUSBState TUSBState; -DECLARE_INSTANCE_CHECKER(TUSBState, TUSB, +DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010, TYPE_TUSB6010) =20 struct TUSBState { @@ -779,7 +779,7 @@ static void tusb6010_irq(void *opaque, int source, int = level) =20 static void tusb6010_reset(DeviceState *dev) { - TUSBState *s =3D TUSB(dev); + TUSBState *s =3D TUSB6010(dev); int i; =20 s->test_reset =3D TUSB_PROD_TEST_RESET_VAL; @@ -815,7 +815,7 @@ static void tusb6010_reset(DeviceState *dev) =20 static void tusb6010_realize(DeviceState *dev, Error **errp) { - TUSBState *s =3D TUSB(dev); + TUSBState *s =3D TUSB6010(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 s->otg_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s); --=20 2.26.2