From nobody Sat May 4 16:38:13 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=1600465787; cv=none; d=zohomail.com; s=zohoarc; b=Oo0uqEKa/WFNoK/YMr0aepqoHSMCcIExZRkkeVO788jybYbObunCvMC+CjshYsFip1xN5LArFrUrT5dgw62dL7xf8sfedUcNFOsLtgkoHYd1h0Gx/udpMDQZNgxpdRngcztecG2SpF++thSLPO8LNDpRwBKYZgGJVFB01ZBng6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600465787; 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=sloVRPETwUCBYkORpAu5wQoBRshr64vcAyJgldtMwJI=; b=d1cTp4CP2C8E4e62eLlikEBTKF+oK2kKqaUpl+xvVc89i3Yd0SLChgTFv3BI+r9TYwn9pfmsLpn67RxEupKmIiv3rFAbd3PTLYj3HY2wmZyduEQ4dtvW848sQiszFR3R/S3AI7nKRuR0UEbAfAYAeMrZFZDBOZGpLx6SiNoMbJE= 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 1600465787115937.8567913191157; Fri, 18 Sep 2020 14:49:47 -0700 (PDT) Received: from localhost ([::1]:32838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJOGH-0003rG-Kz for importer@patchew.org; Fri, 18 Sep 2020 17:49:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNI2-0002bl-MC for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNHu-0006FM-8j for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47: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-103-1H13snLzPxWc0m2G2rYCag-1; Fri, 18 Sep 2020 16:47: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 B0F031084C94; Fri, 18 Sep 2020 20:47:16 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 726785DEC1; Fri, 18 Sep 2020 20:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462041; 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=sloVRPETwUCBYkORpAu5wQoBRshr64vcAyJgldtMwJI=; b=VY3d0j4Skl5MH/xjL+VOjK3kHXW8giatAtOZjrkH48ZDti6kelXOWrERlcW7wOlIY8cp1n i3dM5/vHRI6hb7v/HmaWMObtPRrQrET1U/8exDdUQ24QHcUHMfbOiZnH7j6A/n+HJgL5P8 VhirQYA4JAjkOUzdiYUZKr2BuKFPDYU= X-MC-Unique: 1H13snLzPxWc0m2G2rYCag-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 01/17] sifive_e: Rename memmap enum constants Date: Fri, 18 Sep 2020 16:46:58 -0400 Message-Id: <20200918204714.27276-2-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 01:32:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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 , Alistair Francis , =?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" Some of the enum constant names conflict with a QOM type check macro (SIFIVE_E_PRCI). This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE(). Rename all the constants to SIFIVE_E_DEV_*, to avoid conflicts. Signed-off-by: Eduardo Habkost Reviewed-by: Alistair Francis Message-Id: <20200911173447.165713-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/riscv/sifive_e.h | 38 ++++++++--------- hw/riscv/sifive_e.c | 82 ++++++++++++++++++------------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h index b1400843c2..83604da805 100644 --- a/include/hw/riscv/sifive_e.h +++ b/include/hw/riscv/sifive_e.h @@ -53,25 +53,25 @@ typedef struct SiFiveEState { OBJECT_CHECK(SiFiveEState, (obj), TYPE_RISCV_E_MACHINE) =20 enum { - SIFIVE_E_DEBUG, - SIFIVE_E_MROM, - SIFIVE_E_OTP, - SIFIVE_E_CLINT, - SIFIVE_E_PLIC, - SIFIVE_E_AON, - SIFIVE_E_PRCI, - SIFIVE_E_OTP_CTRL, - SIFIVE_E_GPIO0, - SIFIVE_E_UART0, - SIFIVE_E_QSPI0, - SIFIVE_E_PWM0, - SIFIVE_E_UART1, - SIFIVE_E_QSPI1, - SIFIVE_E_PWM1, - SIFIVE_E_QSPI2, - SIFIVE_E_PWM2, - SIFIVE_E_XIP, - SIFIVE_E_DTIM + SIFIVE_E_DEV_DEBUG, + SIFIVE_E_DEV_MROM, + SIFIVE_E_DEV_OTP, + SIFIVE_E_DEV_CLINT, + SIFIVE_E_DEV_PLIC, + SIFIVE_E_DEV_AON, + SIFIVE_E_DEV_PRCI, + SIFIVE_E_DEV_OTP_CTRL, + SIFIVE_E_DEV_GPIO0, + SIFIVE_E_DEV_UART0, + SIFIVE_E_DEV_QSPI0, + SIFIVE_E_DEV_PWM0, + SIFIVE_E_DEV_UART1, + SIFIVE_E_DEV_QSPI1, + SIFIVE_E_DEV_PWM1, + SIFIVE_E_DEV_QSPI2, + SIFIVE_E_DEV_PWM2, + SIFIVE_E_DEV_XIP, + SIFIVE_E_DEV_DTIM }; =20 enum { diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index 40bbf530d4..759059cd7b 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -54,25 +54,25 @@ static const struct MemmapEntry { hwaddr base; hwaddr size; } sifive_e_memmap[] =3D { - [SIFIVE_E_DEBUG] =3D { 0x0, 0x1000 }, - [SIFIVE_E_MROM] =3D { 0x1000, 0x2000 }, - [SIFIVE_E_OTP] =3D { 0x20000, 0x2000 }, - [SIFIVE_E_CLINT] =3D { 0x2000000, 0x10000 }, - [SIFIVE_E_PLIC] =3D { 0xc000000, 0x4000000 }, - [SIFIVE_E_AON] =3D { 0x10000000, 0x8000 }, - [SIFIVE_E_PRCI] =3D { 0x10008000, 0x8000 }, - [SIFIVE_E_OTP_CTRL] =3D { 0x10010000, 0x1000 }, - [SIFIVE_E_GPIO0] =3D { 0x10012000, 0x1000 }, - [SIFIVE_E_UART0] =3D { 0x10013000, 0x1000 }, - [SIFIVE_E_QSPI0] =3D { 0x10014000, 0x1000 }, - [SIFIVE_E_PWM0] =3D { 0x10015000, 0x1000 }, - [SIFIVE_E_UART1] =3D { 0x10023000, 0x1000 }, - [SIFIVE_E_QSPI1] =3D { 0x10024000, 0x1000 }, - [SIFIVE_E_PWM1] =3D { 0x10025000, 0x1000 }, - [SIFIVE_E_QSPI2] =3D { 0x10034000, 0x1000 }, - [SIFIVE_E_PWM2] =3D { 0x10035000, 0x1000 }, - [SIFIVE_E_XIP] =3D { 0x20000000, 0x20000000 }, - [SIFIVE_E_DTIM] =3D { 0x80000000, 0x4000 } + [SIFIVE_E_DEV_DEBUG] =3D { 0x0, 0x1000 }, + [SIFIVE_E_DEV_MROM] =3D { 0x1000, 0x2000 }, + [SIFIVE_E_DEV_OTP] =3D { 0x20000, 0x2000 }, + [SIFIVE_E_DEV_CLINT] =3D { 0x2000000, 0x10000 }, + [SIFIVE_E_DEV_PLIC] =3D { 0xc000000, 0x4000000 }, + [SIFIVE_E_DEV_AON] =3D { 0x10000000, 0x8000 }, + [SIFIVE_E_DEV_PRCI] =3D { 0x10008000, 0x8000 }, + [SIFIVE_E_DEV_OTP_CTRL] =3D { 0x10010000, 0x1000 }, + [SIFIVE_E_DEV_GPIO0] =3D { 0x10012000, 0x1000 }, + [SIFIVE_E_DEV_UART0] =3D { 0x10013000, 0x1000 }, + [SIFIVE_E_DEV_QSPI0] =3D { 0x10014000, 0x1000 }, + [SIFIVE_E_DEV_PWM0] =3D { 0x10015000, 0x1000 }, + [SIFIVE_E_DEV_UART1] =3D { 0x10023000, 0x1000 }, + [SIFIVE_E_DEV_QSPI1] =3D { 0x10024000, 0x1000 }, + [SIFIVE_E_DEV_PWM1] =3D { 0x10025000, 0x1000 }, + [SIFIVE_E_DEV_QSPI2] =3D { 0x10034000, 0x1000 }, + [SIFIVE_E_DEV_PWM2] =3D { 0x10035000, 0x1000 }, + [SIFIVE_E_DEV_XIP] =3D { 0x20000000, 0x20000000 }, + [SIFIVE_E_DEV_DTIM] =3D { 0x80000000, 0x4000 } }; =20 static void sifive_e_machine_init(MachineState *machine) @@ -90,9 +90,9 @@ static void sifive_e_machine_init(MachineState *machine) =20 /* Data Tightly Integrated Memory */ memory_region_init_ram(main_mem, NULL, "riscv.sifive.e.ram", - memmap[SIFIVE_E_DTIM].size, &error_fatal); + memmap[SIFIVE_E_DEV_DTIM].size, &error_fatal); memory_region_add_subregion(sys_mem, - memmap[SIFIVE_E_DTIM].base, main_mem); + memmap[SIFIVE_E_DEV_DTIM].base, main_mem); =20 /* Mask ROM reset vector */ uint32_t reset_vec[4]; @@ -111,7 +111,7 @@ static void sifive_e_machine_init(MachineState *machine) reset_vec[i] =3D cpu_to_le32(reset_vec[i]); } rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec), - memmap[SIFIVE_E_MROM].base, &address_space_memor= y); + memmap[SIFIVE_E_DEV_MROM].base, &address_space_m= emory); =20 if (machine->kernel_filename) { riscv_load_kernel(machine->kernel_filename, NULL); @@ -195,12 +195,12 @@ static void sifive_e_soc_realize(DeviceState *dev, Er= ror **errp) =20 /* Mask ROM */ memory_region_init_rom(&s->mask_rom, OBJECT(dev), "riscv.sifive.e.mrom= ", - memmap[SIFIVE_E_MROM].size, &error_fatal); + memmap[SIFIVE_E_DEV_MROM].size, &error_fatal); memory_region_add_subregion(sys_mem, - memmap[SIFIVE_E_MROM].base, &s->mask_rom); + memmap[SIFIVE_E_DEV_MROM].base, &s->mask_rom); =20 /* MMIO */ - s->plic =3D sifive_plic_create(memmap[SIFIVE_E_PLIC].base, + s->plic =3D sifive_plic_create(memmap[SIFIVE_E_DEV_PLIC].base, (char *)SIFIVE_E_PLIC_HART_CONFIG, 0, SIFIVE_E_PLIC_NUM_SOURCES, SIFIVE_E_PLIC_NUM_PRIORITIES, @@ -210,14 +210,14 @@ static void sifive_e_soc_realize(DeviceState *dev, Er= ror **errp) SIFIVE_E_PLIC_ENABLE_STRIDE, SIFIVE_E_PLIC_CONTEXT_BASE, SIFIVE_E_PLIC_CONTEXT_STRIDE, - memmap[SIFIVE_E_PLIC].size); - sifive_clint_create(memmap[SIFIVE_E_CLINT].base, - memmap[SIFIVE_E_CLINT].size, 0, ms->smp.cpus, + memmap[SIFIVE_E_DEV_PLIC].size); + sifive_clint_create(memmap[SIFIVE_E_DEV_CLINT].base, + memmap[SIFIVE_E_DEV_CLINT].size, 0, ms->smp.cpus, SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, SIFIVE_CLINT_TIMEBASE_FREQ, false); create_unimplemented_device("riscv.sifive.e.aon", - memmap[SIFIVE_E_AON].base, memmap[SIFIVE_E_AON].size); - sifive_e_prci_create(memmap[SIFIVE_E_PRCI].base); + memmap[SIFIVE_E_DEV_AON].base, memmap[SIFIVE_E_DEV_AON].size); + sifive_e_prci_create(memmap[SIFIVE_E_DEV_PRCI].base); =20 /* GPIO */ =20 @@ -226,7 +226,7 @@ static void sifive_e_soc_realize(DeviceState *dev, Erro= r **errp) } =20 /* Map GPIO registers */ - sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_E_GPIO0].ba= se); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_E_DEV_GPIO0= ].base); =20 /* Pass all GPIOs to the SOC layer so they are available to the board = */ qdev_pass_gpios(DEVICE(&s->gpio), dev, NULL); @@ -238,27 +238,27 @@ static void sifive_e_soc_realize(DeviceState *dev, Er= ror **errp) SIFIVE_E_GPIO0_IRQ0 + i)); } =20 - sifive_uart_create(sys_mem, memmap[SIFIVE_E_UART0].base, + sifive_uart_create(sys_mem, memmap[SIFIVE_E_DEV_UART0].base, serial_hd(0), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_E_UART0_IRQ= )); create_unimplemented_device("riscv.sifive.e.qspi0", - memmap[SIFIVE_E_QSPI0].base, memmap[SIFIVE_E_QSPI0].size); + memmap[SIFIVE_E_DEV_QSPI0].base, memmap[SIFIVE_E_DEV_QSPI0].size); create_unimplemented_device("riscv.sifive.e.pwm0", - memmap[SIFIVE_E_PWM0].base, memmap[SIFIVE_E_PWM0].size); - sifive_uart_create(sys_mem, memmap[SIFIVE_E_UART1].base, + memmap[SIFIVE_E_DEV_PWM0].base, memmap[SIFIVE_E_DEV_PWM0].size); + sifive_uart_create(sys_mem, memmap[SIFIVE_E_DEV_UART1].base, serial_hd(1), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_E_UART1_IRQ= )); create_unimplemented_device("riscv.sifive.e.qspi1", - memmap[SIFIVE_E_QSPI1].base, memmap[SIFIVE_E_QSPI1].size); + memmap[SIFIVE_E_DEV_QSPI1].base, memmap[SIFIVE_E_DEV_QSPI1].size); create_unimplemented_device("riscv.sifive.e.pwm1", - memmap[SIFIVE_E_PWM1].base, memmap[SIFIVE_E_PWM1].size); + memmap[SIFIVE_E_DEV_PWM1].base, memmap[SIFIVE_E_DEV_PWM1].size); create_unimplemented_device("riscv.sifive.e.qspi2", - memmap[SIFIVE_E_QSPI2].base, memmap[SIFIVE_E_QSPI2].size); + memmap[SIFIVE_E_DEV_QSPI2].base, memmap[SIFIVE_E_DEV_QSPI2].size); create_unimplemented_device("riscv.sifive.e.pwm2", - memmap[SIFIVE_E_PWM2].base, memmap[SIFIVE_E_PWM2].size); + memmap[SIFIVE_E_DEV_PWM2].base, memmap[SIFIVE_E_DEV_PWM2].size); =20 /* Flash memory */ memory_region_init_rom(&s->xip_mem, OBJECT(dev), "riscv.sifive.e.xip", - memmap[SIFIVE_E_XIP].size, &error_fatal); - memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base, + memmap[SIFIVE_E_DEV_XIP].size, &error_fatal); + memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_DEV_XIP].base, &s->xip_mem); } =20 --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463472; cv=none; d=zohomail.com; s=zohoarc; b=GWUMCzvzJAzY6JteK92DXlhBL8h4TFChazTj+jmHuZydY0os2mPKbm9Q1fvWkhkofrpMDwF2IpngbKgxrQGugz7ThWxbbpe0+36jdITd6yhH/JoaeQ2GD9JjhyACC8QlrFXV2yDoX4PjFMlZEe99iyIVIeH7bXine9QInJwQBwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463472; 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=F3ZXeSdPwWe8vuLk27/Fp2SwU3ySJ4ixwwio6s3cfu4=; b=M9VkASZn0vZTJfU+JZIu6QKi38YnFfU4LASPY5R8MSoO/el9nMEBsoIExvg7JUAi8m7tWKhFgwyL99RC2uUWoddLEy833NdGSuUvXwROB+cWRnzWng3aIwekKOuSW+MLD81OTiGyIVJuFraHbtViF60i7SVyza3RBU2LY1zSeZs= 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 1600463472684322.5915696727751; Fri, 18 Sep 2020 14:11:12 -0700 (PDT) Received: from localhost ([::1]:33042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNex-0002vw-0J for importer@patchew.org; Fri, 18 Sep 2020 17:11:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNI6-0002cj-9v for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:35 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:51420 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 1kJNHv-0006Ff-BE for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47: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-259-0JTIWFKDOkyXcqDxvTeCTA-1; Fri, 18 Sep 2020 16:47:20 -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 D6D0510074D3; Fri, 18 Sep 2020 20:47:17 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87AD778823; Fri, 18 Sep 2020 20:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462042; 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=F3ZXeSdPwWe8vuLk27/Fp2SwU3ySJ4ixwwio6s3cfu4=; b=V/eVF1DTNEtuAD7BtkUUex35TIG0LYhFEkLpNlNKg1+RYGbwPZAUOmYeBsJo+uA0/wmhwv 5pgRG3fcHmwjuds9qCSx+gF3botnhEaJb0bH03pxHmsjz+ZxVtCceBXuWjUNJsUmMjG/FM rkFItp0IXvMaiJZTSo1tdDTRBHmK9pg= X-MC-Unique: 0JTIWFKDOkyXcqDxvTeCTA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 02/17] sifive_u: Rename memmap enum constants Date: Fri, 18 Sep 2020 16:46:59 -0400 Message-Id: <20200918204714.27276-3-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 03:47:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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=unavailable 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 , Alistair Francis , =?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" Some of the enum constant names conflict with the QOM type check macros (SIFIVE_U_OTP, SIFIVE_U_PRCI). This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE(). Rename all the constants to SIFIVE_U_DEV_*, to avoid conflicts. Signed-off-by: Eduardo Habkost Reviewed-by: Alistair Francis Message-Id: <20200911173447.165713-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/riscv/sifive_u.h | 34 ++++---- hw/riscv/sifive_u.c | 156 ++++++++++++++++++------------------ 2 files changed, 95 insertions(+), 95 deletions(-) diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index fe5c580845..22e7e6efa1 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -70,23 +70,23 @@ typedef struct SiFiveUState { } SiFiveUState; =20 enum { - SIFIVE_U_DEBUG, - SIFIVE_U_MROM, - SIFIVE_U_CLINT, - SIFIVE_U_L2CC, - SIFIVE_U_PDMA, - SIFIVE_U_L2LIM, - SIFIVE_U_PLIC, - SIFIVE_U_PRCI, - SIFIVE_U_UART0, - SIFIVE_U_UART1, - SIFIVE_U_GPIO, - SIFIVE_U_OTP, - SIFIVE_U_DMC, - SIFIVE_U_FLASH0, - SIFIVE_U_DRAM, - SIFIVE_U_GEM, - SIFIVE_U_GEM_MGMT + SIFIVE_U_DEV_DEBUG, + SIFIVE_U_DEV_MROM, + SIFIVE_U_DEV_CLINT, + SIFIVE_U_DEV_L2CC, + SIFIVE_U_DEV_PDMA, + SIFIVE_U_DEV_L2LIM, + SIFIVE_U_DEV_PLIC, + SIFIVE_U_DEV_PRCI, + SIFIVE_U_DEV_UART0, + SIFIVE_U_DEV_UART1, + SIFIVE_U_DEV_GPIO, + SIFIVE_U_DEV_OTP, + SIFIVE_U_DEV_DMC, + SIFIVE_U_DEV_FLASH0, + SIFIVE_U_DEV_DRAM, + SIFIVE_U_DEV_GEM, + SIFIVE_U_DEV_GEM_MGMT }; =20 enum { diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 4f12a93188..a97637fb33 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -70,23 +70,23 @@ static const struct MemmapEntry { hwaddr base; hwaddr size; } sifive_u_memmap[] =3D { - [SIFIVE_U_DEBUG] =3D { 0x0, 0x100 }, - [SIFIVE_U_MROM] =3D { 0x1000, 0xf000 }, - [SIFIVE_U_CLINT] =3D { 0x2000000, 0x10000 }, - [SIFIVE_U_L2CC] =3D { 0x2010000, 0x1000 }, - [SIFIVE_U_PDMA] =3D { 0x3000000, 0x100000 }, - [SIFIVE_U_L2LIM] =3D { 0x8000000, 0x2000000 }, - [SIFIVE_U_PLIC] =3D { 0xc000000, 0x4000000 }, - [SIFIVE_U_PRCI] =3D { 0x10000000, 0x1000 }, - [SIFIVE_U_UART0] =3D { 0x10010000, 0x1000 }, - [SIFIVE_U_UART1] =3D { 0x10011000, 0x1000 }, - [SIFIVE_U_GPIO] =3D { 0x10060000, 0x1000 }, - [SIFIVE_U_OTP] =3D { 0x10070000, 0x1000 }, - [SIFIVE_U_GEM] =3D { 0x10090000, 0x2000 }, - [SIFIVE_U_GEM_MGMT] =3D { 0x100a0000, 0x1000 }, - [SIFIVE_U_DMC] =3D { 0x100b0000, 0x10000 }, - [SIFIVE_U_FLASH0] =3D { 0x20000000, 0x10000000 }, - [SIFIVE_U_DRAM] =3D { 0x80000000, 0x0 }, + [SIFIVE_U_DEV_DEBUG] =3D { 0x0, 0x100 }, + [SIFIVE_U_DEV_MROM] =3D { 0x1000, 0xf000 }, + [SIFIVE_U_DEV_CLINT] =3D { 0x2000000, 0x10000 }, + [SIFIVE_U_DEV_L2CC] =3D { 0x2010000, 0x1000 }, + [SIFIVE_U_DEV_PDMA] =3D { 0x3000000, 0x100000 }, + [SIFIVE_U_DEV_L2LIM] =3D { 0x8000000, 0x2000000 }, + [SIFIVE_U_DEV_PLIC] =3D { 0xc000000, 0x4000000 }, + [SIFIVE_U_DEV_PRCI] =3D { 0x10000000, 0x1000 }, + [SIFIVE_U_DEV_UART0] =3D { 0x10010000, 0x1000 }, + [SIFIVE_U_DEV_UART1] =3D { 0x10011000, 0x1000 }, + [SIFIVE_U_DEV_GPIO] =3D { 0x10060000, 0x1000 }, + [SIFIVE_U_DEV_OTP] =3D { 0x10070000, 0x1000 }, + [SIFIVE_U_DEV_GEM] =3D { 0x10090000, 0x2000 }, + [SIFIVE_U_DEV_GEM_MGMT] =3D { 0x100a0000, 0x1000 }, + [SIFIVE_U_DEV_DMC] =3D { 0x100b0000, 0x10000 }, + [SIFIVE_U_DEV_FLASH0] =3D { 0x20000000, 0x10000000 }, + [SIFIVE_U_DEV_DRAM] =3D { 0x80000000, 0x0 }, }; =20 #define OTP_SERIAL 1 @@ -145,10 +145,10 @@ static void create_fdt(SiFiveUState *s, const struct = MemmapEntry *memmap, g_free(nodename); =20 nodename =3D g_strdup_printf("/memory@%lx", - (long)memmap[SIFIVE_U_DRAM].base); + (long)memmap[SIFIVE_U_DEV_DRAM].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cells(fdt, nodename, "reg", - memmap[SIFIVE_U_DRAM].base >> 32, memmap[SIFIVE_U_DRAM].base, + memmap[SIFIVE_U_DEV_DRAM].base >> 32, memmap[SIFIVE_U_DEV_DRAM].ba= se, mem_size >> 32, mem_size); qemu_fdt_setprop_string(fdt, nodename, "device_type", "memory"); g_free(nodename); @@ -203,39 +203,39 @@ static void create_fdt(SiFiveUState *s, const struct = MemmapEntry *memmap, g_free(nodename); } nodename =3D g_strdup_printf("/soc/clint@%lx", - (long)memmap[SIFIVE_U_CLINT].base); + (long)memmap[SIFIVE_U_DEV_CLINT].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_string(fdt, nodename, "compatible", "riscv,clint0"); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_CLINT].base, - 0x0, memmap[SIFIVE_U_CLINT].size); + 0x0, memmap[SIFIVE_U_DEV_CLINT].base, + 0x0, memmap[SIFIVE_U_DEV_CLINT].size); qemu_fdt_setprop(fdt, nodename, "interrupts-extended", cells, ms->smp.cpus * sizeof(uint32_t) * 4); g_free(cells); g_free(nodename); =20 nodename =3D g_strdup_printf("/soc/otp@%lx", - (long)memmap[SIFIVE_U_OTP].base); + (long)memmap[SIFIVE_U_DEV_OTP].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cell(fdt, nodename, "fuse-count", SIFIVE_U_OTP_REG_SI= ZE); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_OTP].base, - 0x0, memmap[SIFIVE_U_OTP].size); + 0x0, memmap[SIFIVE_U_DEV_OTP].base, + 0x0, memmap[SIFIVE_U_DEV_OTP].size); qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,fu540-c000-otp"); g_free(nodename); =20 prci_phandle =3D phandle++; nodename =3D g_strdup_printf("/soc/clock-controller@%lx", - (long)memmap[SIFIVE_U_PRCI].base); + (long)memmap[SIFIVE_U_DEV_PRCI].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cell(fdt, nodename, "phandle", prci_phandle); qemu_fdt_setprop_cell(fdt, nodename, "#clock-cells", 0x1); qemu_fdt_setprop_cells(fdt, nodename, "clocks", hfclk_phandle, rtcclk_phandle); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_PRCI].base, - 0x0, memmap[SIFIVE_U_PRCI].size); + 0x0, memmap[SIFIVE_U_DEV_PRCI].base, + 0x0, memmap[SIFIVE_U_DEV_PRCI].size); qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,fu540-c000-prci"); g_free(nodename); @@ -259,7 +259,7 @@ static void create_fdt(SiFiveUState *s, const struct Me= mmapEntry *memmap, g_free(nodename); } nodename =3D g_strdup_printf("/soc/interrupt-controller@%lx", - (long)memmap[SIFIVE_U_PLIC].base); + (long)memmap[SIFIVE_U_DEV_PLIC].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cell(fdt, nodename, "#interrupt-cells", 1); qemu_fdt_setprop_string(fdt, nodename, "compatible", "riscv,plic0"); @@ -267,8 +267,8 @@ static void create_fdt(SiFiveUState *s, const struct Me= mmapEntry *memmap, qemu_fdt_setprop(fdt, nodename, "interrupts-extended", cells, (ms->smp.cpus * 4 - 2) * sizeof(uint32_t)); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_PLIC].base, - 0x0, memmap[SIFIVE_U_PLIC].size); + 0x0, memmap[SIFIVE_U_DEV_PLIC].base, + 0x0, memmap[SIFIVE_U_DEV_PLIC].size); qemu_fdt_setprop_cell(fdt, nodename, "riscv,ndev", 0x35); qemu_fdt_setprop_cell(fdt, nodename, "phandle", plic_phandle); plic_phandle =3D qemu_fdt_get_phandle(fdt, nodename); @@ -277,7 +277,7 @@ static void create_fdt(SiFiveUState *s, const struct Me= mmapEntry *memmap, =20 gpio_phandle =3D phandle++; nodename =3D g_strdup_printf("/soc/gpio@%lx", - (long)memmap[SIFIVE_U_GPIO].base); + (long)memmap[SIFIVE_U_DEV_GPIO].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cell(fdt, nodename, "phandle", gpio_phandle); qemu_fdt_setprop_cells(fdt, nodename, "clocks", @@ -287,8 +287,8 @@ static void create_fdt(SiFiveUState *s, const struct Me= mmapEntry *memmap, qemu_fdt_setprop_cell(fdt, nodename, "#gpio-cells", 2); qemu_fdt_setprop(fdt, nodename, "gpio-controller", NULL, 0); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_GPIO].base, - 0x0, memmap[SIFIVE_U_GPIO].size); + 0x0, memmap[SIFIVE_U_DEV_GPIO].base, + 0x0, memmap[SIFIVE_U_DEV_GPIO].size); qemu_fdt_setprop_cells(fdt, nodename, "interrupts", SIFIVE_U_GPIO_IRQ0, SIFIVE_U_GPIO_IRQ1, SIFIVE_U_GPIO_IRQ2, SIFIVE_U_GPIO_IRQ3, SIFIVE_U_GPIO_IRQ4, SIFIVE_U_GPIO_IRQ5, SIFIVE_U_GPIO_IRQ6, @@ -306,7 +306,7 @@ static void create_fdt(SiFiveUState *s, const struct Me= mmapEntry *memmap, g_free(nodename); =20 nodename =3D g_strdup_printf("/soc/dma@%lx", - (long)memmap[SIFIVE_U_PDMA].base); + (long)memmap[SIFIVE_U_DEV_PDMA].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cell(fdt, nodename, "#dma-cells", 1); qemu_fdt_setprop_cells(fdt, nodename, "interrupts", @@ -315,18 +315,18 @@ static void create_fdt(SiFiveUState *s, const struct = MemmapEntry *memmap, SIFIVE_U_PDMA_IRQ6, SIFIVE_U_PDMA_IRQ7); qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_PDMA].base, - 0x0, memmap[SIFIVE_U_PDMA].size); + 0x0, memmap[SIFIVE_U_DEV_PDMA].base, + 0x0, memmap[SIFIVE_U_DEV_PDMA].size); qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,fu540-c000-pdma"); g_free(nodename); =20 nodename =3D g_strdup_printf("/soc/cache-controller@%lx", - (long)memmap[SIFIVE_U_L2CC].base); + (long)memmap[SIFIVE_U_DEV_L2CC].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_L2CC].base, - 0x0, memmap[SIFIVE_U_L2CC].size); + 0x0, memmap[SIFIVE_U_DEV_L2CC].base, + 0x0, memmap[SIFIVE_U_DEV_L2CC].size); qemu_fdt_setprop_cells(fdt, nodename, "interrupts", SIFIVE_U_L2CC_IRQ0, SIFIVE_U_L2CC_IRQ1, SIFIVE_U_L2CC_IRQ2); qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle); @@ -341,15 +341,15 @@ static void create_fdt(SiFiveUState *s, const struct = MemmapEntry *memmap, =20 phy_phandle =3D phandle++; nodename =3D g_strdup_printf("/soc/ethernet@%lx", - (long)memmap[SIFIVE_U_GEM].base); + (long)memmap[SIFIVE_U_DEV_GEM].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,fu540-c000-gem"); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_GEM].base, - 0x0, memmap[SIFIVE_U_GEM].size, - 0x0, memmap[SIFIVE_U_GEM_MGMT].base, - 0x0, memmap[SIFIVE_U_GEM_MGMT].size); + 0x0, memmap[SIFIVE_U_DEV_GEM].base, + 0x0, memmap[SIFIVE_U_DEV_GEM].size, + 0x0, memmap[SIFIVE_U_DEV_GEM_MGMT].base, + 0x0, memmap[SIFIVE_U_DEV_GEM_MGMT].size); qemu_fdt_setprop_string(fdt, nodename, "reg-names", "control"); qemu_fdt_setprop_string(fdt, nodename, "phy-mode", "gmii"); qemu_fdt_setprop_cell(fdt, nodename, "phy-handle", phy_phandle); @@ -370,19 +370,19 @@ static void create_fdt(SiFiveUState *s, const struct = MemmapEntry *memmap, g_free(nodename); =20 nodename =3D g_strdup_printf("/soc/ethernet@%lx/ethernet-phy@0", - (long)memmap[SIFIVE_U_GEM].base); + (long)memmap[SIFIVE_U_DEV_GEM].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_cell(fdt, nodename, "phandle", phy_phandle); qemu_fdt_setprop_cell(fdt, nodename, "reg", 0x0); g_free(nodename); =20 nodename =3D g_strdup_printf("/soc/serial@%lx", - (long)memmap[SIFIVE_U_UART0].base); + (long)memmap[SIFIVE_U_DEV_UART0].base); qemu_fdt_add_subnode(fdt, nodename); qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,uart0"); qemu_fdt_setprop_cells(fdt, nodename, "reg", - 0x0, memmap[SIFIVE_U_UART0].base, - 0x0, memmap[SIFIVE_U_UART0].size); + 0x0, memmap[SIFIVE_U_DEV_UART0].base, + 0x0, memmap[SIFIVE_U_DEV_UART0].size); qemu_fdt_setprop_cells(fdt, nodename, "clocks", prci_phandle, PRCI_CLK_TLCLK); qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle); @@ -414,7 +414,7 @@ static void sifive_u_machine_init(MachineState *machine) MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *main_mem =3D g_new(MemoryRegion, 1); MemoryRegion *flash0 =3D g_new(MemoryRegion, 1); - target_ulong start_addr =3D memmap[SIFIVE_U_DRAM].base; + target_ulong start_addr =3D memmap[SIFIVE_U_DEV_DRAM].base; uint32_t start_addr_hi32 =3D 0x00000000; int i; uint32_t fdt_load_addr; @@ -429,13 +429,13 @@ static void sifive_u_machine_init(MachineState *machi= ne) /* register RAM */ memory_region_init_ram(main_mem, NULL, "riscv.sifive.u.ram", machine->ram_size, &error_fatal); - memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DRAM].base, + memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_DRAM].b= ase, main_mem); =20 /* register QSPI0 Flash */ memory_region_init_ram(flash0, NULL, "riscv.sifive.u.flash0", - memmap[SIFIVE_U_FLASH0].size, &error_fatal); - memory_region_add_subregion(system_memory, memmap[SIFIVE_U_FLASH0].bas= e, + memmap[SIFIVE_U_DEV_FLASH0].size, &error_fatal); + memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_FLASH0]= .base, flash0); =20 /* register gpio-restart */ @@ -461,14 +461,14 @@ static void sifive_u_machine_init(MachineState *machi= ne) =20 switch (s->msel) { case MSEL_MEMMAP_QSPI0_FLASH: - start_addr =3D memmap[SIFIVE_U_FLASH0].base; + start_addr =3D memmap[SIFIVE_U_DEV_FLASH0].base; break; case MSEL_L2LIM_QSPI0_FLASH: case MSEL_L2LIM_QSPI2_SD: - start_addr =3D memmap[SIFIVE_U_L2LIM].base; + start_addr =3D memmap[SIFIVE_U_DEV_L2LIM].base; break; default: - start_addr =3D memmap[SIFIVE_U_DRAM].base; + start_addr =3D memmap[SIFIVE_U_DEV_DRAM].base; break; } =20 @@ -496,7 +496,7 @@ static void sifive_u_machine_init(MachineState *machine) } =20 /* Compute the fdt load address in dram */ - fdt_load_addr =3D riscv_load_fdt(memmap[SIFIVE_U_DRAM].base, + fdt_load_addr =3D riscv_load_fdt(memmap[SIFIVE_U_DEV_DRAM].base, machine->ram_size, s->fdt); #if defined(TARGET_RISCV64) start_addr_hi32 =3D start_addr >> 32; @@ -528,10 +528,10 @@ static void sifive_u_machine_init(MachineState *machi= ne) reset_vec[i] =3D cpu_to_le32(reset_vec[i]); } rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec), - memmap[SIFIVE_U_MROM].base, &address_space_memor= y); + memmap[SIFIVE_U_DEV_MROM].base, &address_space_m= emory); =20 - riscv_rom_copy_firmware_info(memmap[SIFIVE_U_MROM].base, - memmap[SIFIVE_U_MROM].size, + riscv_rom_copy_firmware_info(memmap[SIFIVE_U_DEV_MROM].base, + memmap[SIFIVE_U_DEV_MROM].size, sizeof(reset_vec), kernel_entry); } =20 @@ -674,8 +674,8 @@ static void sifive_u_soc_realize(DeviceState *dev, Erro= r **errp) =20 /* boot rom */ memory_region_init_rom(mask_rom, OBJECT(dev), "riscv.sifive.u.mrom", - memmap[SIFIVE_U_MROM].size, &error_fatal); - memory_region_add_subregion(system_memory, memmap[SIFIVE_U_MROM].base, + memmap[SIFIVE_U_DEV_MROM].size, &error_fatal); + memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_MROM].b= ase, mask_rom); =20 /* @@ -688,8 +688,8 @@ static void sifive_u_soc_realize(DeviceState *dev, Erro= r **errp) * too generous to misbehaving guests. */ memory_region_init_ram(l2lim_mem, NULL, "riscv.sifive.u.l2lim", - memmap[SIFIVE_U_L2LIM].size, &error_fatal); - memory_region_add_subregion(system_memory, memmap[SIFIVE_U_L2LIM].base, + memmap[SIFIVE_U_DEV_L2LIM].size, &error_fatal); + memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_L2LIM].= base, l2lim_mem); =20 /* create PLIC hart topology configuration string */ @@ -707,7 +707,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Erro= r **errp) } =20 /* MMIO */ - s->plic =3D sifive_plic_create(memmap[SIFIVE_U_PLIC].base, + s->plic =3D sifive_plic_create(memmap[SIFIVE_U_DEV_PLIC].base, plic_hart_config, 0, SIFIVE_U_PLIC_NUM_SOURCES, SIFIVE_U_PLIC_NUM_PRIORITIES, @@ -717,27 +717,27 @@ static void sifive_u_soc_realize(DeviceState *dev, Er= ror **errp) SIFIVE_U_PLIC_ENABLE_STRIDE, SIFIVE_U_PLIC_CONTEXT_BASE, SIFIVE_U_PLIC_CONTEXT_STRIDE, - memmap[SIFIVE_U_PLIC].size); + memmap[SIFIVE_U_DEV_PLIC].size); g_free(plic_hart_config); - sifive_uart_create(system_memory, memmap[SIFIVE_U_UART0].base, + sifive_uart_create(system_memory, memmap[SIFIVE_U_DEV_UART0].base, serial_hd(0), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_UART0_IRQ= )); - sifive_uart_create(system_memory, memmap[SIFIVE_U_UART1].base, + sifive_uart_create(system_memory, memmap[SIFIVE_U_DEV_UART1].base, serial_hd(1), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_UART1_IRQ= )); - sifive_clint_create(memmap[SIFIVE_U_CLINT].base, - memmap[SIFIVE_U_CLINT].size, 0, ms->smp.cpus, + sifive_clint_create(memmap[SIFIVE_U_DEV_CLINT].base, + memmap[SIFIVE_U_DEV_CLINT].size, 0, ms->smp.cpus, SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, SIFIVE_CLINT_TIMEBASE_FREQ, false); =20 if (!sysbus_realize(SYS_BUS_DEVICE(&s->prci), errp)) { return; } - sysbus_mmio_map(SYS_BUS_DEVICE(&s->prci), 0, memmap[SIFIVE_U_PRCI].bas= e); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->prci), 0, memmap[SIFIVE_U_DEV_PRCI]= .base); =20 qdev_prop_set_uint32(DEVICE(&s->gpio), "ngpio", 16); if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) { return; } - sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_U_GPIO].bas= e); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_U_DEV_GPIO]= .base); =20 /* Pass all GPIOs to the SOC layer so they are available to the board = */ qdev_pass_gpios(DEVICE(&s->gpio), dev, NULL); @@ -751,7 +751,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Erro= r **errp) =20 /* PDMA */ sysbus_realize(SYS_BUS_DEVICE(&s->dma), errp); - sysbus_mmio_map(SYS_BUS_DEVICE(&s->dma), 0, memmap[SIFIVE_U_PDMA].base= ); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->dma), 0, memmap[SIFIVE_U_DEV_PDMA].= base); =20 /* Connect PDMA interrupts to the PLIC */ for (i =3D 0; i < SIFIVE_PDMA_IRQS; i++) { @@ -764,7 +764,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Erro= r **errp) if (!sysbus_realize(SYS_BUS_DEVICE(&s->otp), errp)) { return; } - sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_OTP].base); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_DEV_OTP].b= ase); =20 /* FIXME use qdev NIC properties instead of nd_table[] */ if (nd->used) { @@ -776,18 +776,18 @@ static void sifive_u_soc_realize(DeviceState *dev, Er= ror **errp) if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem), errp)) { return; } - sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem), 0, memmap[SIFIVE_U_GEM].base); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem), 0, memmap[SIFIVE_U_DEV_GEM].b= ase); sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem), 0, qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_GEM_IRQ)= ); =20 create_unimplemented_device("riscv.sifive.u.gem-mgmt", - memmap[SIFIVE_U_GEM_MGMT].base, memmap[SIFIVE_U_GEM_MGMT].size); + memmap[SIFIVE_U_DEV_GEM_MGMT].base, memmap[SIFIVE_U_DEV_GEM_MGMT].= size); =20 create_unimplemented_device("riscv.sifive.u.dmc", - memmap[SIFIVE_U_DMC].base, memmap[SIFIVE_U_DMC].size); + memmap[SIFIVE_U_DEV_DMC].base, memmap[SIFIVE_U_DEV_DMC].size); =20 create_unimplemented_device("riscv.sifive.u.l2cc", - memmap[SIFIVE_U_L2CC].base, memmap[SIFIVE_U_L2CC].size); + memmap[SIFIVE_U_DEV_L2CC].base, memmap[SIFIVE_U_DEV_L2CC].size); } =20 static Property sifive_u_soc_props[] =3D { --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600462907; cv=none; d=zohomail.com; s=zohoarc; b=HOGNkgrysaB/PrQsMs4WP+aXV+LDwSjimO/2P6tv4HdGe9g6zOJohNpYDoGpXJe26ZwRbVqK5NHYMRvx+76dNVTZjz+vtSchJTfifyXzEgZEm/vl1BILxpzF7p/5/aMsDXCFABCwCJcS44dSc+A2VkfqWxVtC1bQRg/56g1t0FE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600462907; 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=u4VsQlbRFe7gSlcn7swxt6vr6RZN1WLwF/0IcfEatK8=; b=Era6seZzqoWdUFr0fsELyxs0AC0EWuvq6WBl+WThIYvEwLeSABkFUTlR3fVbrNKFABy01qPI8bEEwjF1h1m2k/uGg33tT+4NfK7Iv7Cy/Fbqln/VmYQm21hyMeR5insUI0kx60T0nIlCNJ2o9spGoaZjnvB2jd5YeD1TIXOZOA4= 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 1600462907047996.4157382128291; Fri, 18 Sep 2020 14:01:47 -0700 (PDT) Received: from localhost ([::1]:42596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNVp-0002vN-S2 for importer@patchew.org; Fri, 18 Sep 2020 17:01:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIG-0002eE-8t for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:44 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:48111 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 1kJNHw-0006Fl-0C for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:43 -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-98-3X40T3VbNVmxBYTO-7Ufng-1; Fri, 18 Sep 2020 16:47: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 D80B41084CB1; Fri, 18 Sep 2020 20:47:18 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0A0C60C07; Fri, 18 Sep 2020 20:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462042; 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=u4VsQlbRFe7gSlcn7swxt6vr6RZN1WLwF/0IcfEatK8=; b=NVYOtulyjMzxtTnaxzt685U0b1CJeAMflmYFI/VZ2JWPbHmCsvscoy8H+Yy/wTG4gKRdrT pejNN04sH8dstOv4mETDbUC03TZHdO5ewffC5WpVrYs4ls28wIYhieusVBXoMxqIIgX5cW vmQAr5Ul3LcPi1vQBhH8D8rc2AGm1H4= X-MC-Unique: 3X40T3VbNVmxBYTO-7Ufng-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 03/17] sifive: Move QOM typedefs and add missing includes Date: Fri, 18 Sep 2020 16:47:00 -0400 Message-Id: <20200918204714.27276-4-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 16:47:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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?= 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 Signed-off-by: Eduardo Habkost Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/intc/sifive_plic.h | 6 ++++-- include/hw/char/sifive_uart.h | 6 ++++-- include/hw/gpio/sifive_gpio.h | 6 ++++-- include/hw/misc/sifive_e_prci.h | 6 ++++-- include/hw/misc/sifive_test.h | 6 ++++-- include/hw/misc/sifive_u_otp.h | 6 ++++-- include/hw/misc/sifive_u_prci.h | 6 ++++-- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/hw/intc/sifive_plic.h b/hw/intc/sifive_plic.h index ace76d0f1b..aa6ae13c3a 100644 --- a/hw/intc/sifive_plic.h +++ b/hw/intc/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/char/sifive_uart.h b/include/hw/char/sifive_uart.h index 65668825a3..2bb72ac80b 100644 --- a/include/hw/char/sifive_uart.h +++ b/include/hw/char/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/gpio/sifive_gpio.h b/include/hw/gpio/sifive_gpio.h index cf12fcfd62..af991fa44e 100644 --- a/include/hw/gpio/sifive_gpio.h +++ b/include/hw/gpio/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/misc/sifive_e_prci.h b/include/hw/misc/sifive_e_prc= i.h index 698b0b451c..de1e502eea 100644 --- a/include/hw/misc/sifive_e_prci.h +++ b/include/hw/misc/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/misc/sifive_test.h b/include/hw/misc/sifive_test.h index 1ec416ac1b..dc54b7af0c 100644 --- a/include/hw/misc/sifive_test.h +++ b/include/hw/misc/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/misc/sifive_u_otp.h b/include/hw/misc/sifive_u_otp.h index 639297564a..4572534f50 100644 --- a/include/hw/misc/sifive_u_otp.h +++ b/include/hw/misc/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/misc/sifive_u_prci.h b/include/hw/misc/sifive_u_prc= i.h index 0a531fdadc..83eab43686 100644 --- a/include/hw/misc/sifive_u_prci.h +++ b/include/hw/misc/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. --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600462618; cv=none; d=zohomail.com; s=zohoarc; b=mHAKeauk0OVA3LA5VAFngcrrI3TCyCm65k6Z5VlhKooFE9R4ewFsAUCVwpV9C4q3Co4F0G9vBvQd4eYlnOQE1LRjukxMlW6+0r6fPdU+PG7Bapg5Bw5CpbAFVxiyG4AA/ePqxvZStZzZo7USFpFgmgTL85nNySONHBJ8LaLDSD0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600462618; 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=dMkREXu3O51Oc94RWLTL6PmoyQuNR6EO5v7agZ1eleg=; b=auFQmOrDFM8eDSzbBt45RcJU05HRYYHYFJVXOiNEiDbkB6XpWy56nSxt8fB/0BhxmL5swlXVTqOXVcJc1mxHWtlruoddKTHv7ikFg2Hb8p3BOh++WCxaEET+9yfnYjWqjGB3oopI9VWjKus9L2vJyvBG+8VXDXd7YVYVqVsJ2OE= 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 1600462618334985.3587550237822; Fri, 18 Sep 2020 13:56:58 -0700 (PDT) Received: from localhost ([::1]:34622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNR9-0007MD-2Z for importer@patchew.org; Fri, 18 Sep 2020 16:56:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNI7-0002ck-Ny for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNHv-0006Fy-TJ for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:34 -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-150-TWD-VXMUP5W33Ubsy2xSJA-1; Fri, 18 Sep 2020 16:47:20 -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 DFE36800C78; Fri, 18 Sep 2020 20:47:19 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FDAE7881F; Fri, 18 Sep 2020 20:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462043; 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=dMkREXu3O51Oc94RWLTL6PmoyQuNR6EO5v7agZ1eleg=; b=eC3fVDMIpQF50YikuyKNFzj8h6iuDU7dkULtPtL/EHgAYqePjT3U+YxK3r3EWZHdeUWbkH 5Z0us+wZZM8JgTk3PqrAJTnWP4FEiVayKDCdY1i7QNGNqP8ayVySGFXilSKg4cYlhVVjG3 A2iW0KkPKCY7JnY8czrUoEgrw9uuuUI= X-MC-Unique: TWD-VXMUP5W33Ubsy2xSJA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 04/17] sifive: Use DECLARE_*CHECKER* macros Date: Fri, 18 Sep 2020 16:47:01 -0400 Message-Id: <20200918204714.27276-5-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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=unavailable 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) $ ./scripts/codeconverter/converter.py -i \ --pattern=3DTypeCheckMacro $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/intc/sifive_plic.h | 4 ++-- include/hw/char/sifive_uart.h | 4 ++-- include/hw/gpio/sifive_gpio.h | 3 ++- include/hw/misc/sifive_e_prci.h | 4 ++-- include/hw/misc/sifive_test.h | 4 ++-- include/hw/misc/sifive_u_otp.h | 4 ++-- include/hw/misc/sifive_u_prci.h | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/intc/sifive_plic.h b/hw/intc/sifive_plic.h index aa6ae13c3a..b75b1f145d 100644 --- a/hw/intc/sifive_plic.h +++ b/hw/intc/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/char/sifive_uart.h b/include/hw/char/sifive_uart.h index 2bb72ac80b..3e962be659 100644 --- a/include/hw/char/sifive_uart.h +++ b/include/hw/char/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/gpio/sifive_gpio.h b/include/hw/gpio/sifive_gpio.h index af991fa44e..fc53785c9d 100644 --- a/include/hw/gpio/sifive_gpio.h +++ b/include/hw/gpio/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/misc/sifive_e_prci.h b/include/hw/misc/sifive_e_prc= i.h index de1e502eea..262ca16181 100644 --- a/include/hw/misc/sifive_e_prci.h +++ b/include/hw/misc/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/misc/sifive_test.h b/include/hw/misc/sifive_test.h index dc54b7af0c..88a38d00c5 100644 --- a/include/hw/misc/sifive_test.h +++ b/include/hw/misc/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/misc/sifive_u_otp.h b/include/hw/misc/sifive_u_otp.h index 4572534f50..82c9176c8f 100644 --- a/include/hw/misc/sifive_u_otp.h +++ b/include/hw/misc/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/misc/sifive_u_prci.h b/include/hw/misc/sifive_u_prc= i.h index 83eab43686..d9ebf40b7f 100644 --- a/include/hw/misc/sifive_u_prci.h +++ b/include/hw/misc/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 >*/ --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463146; cv=none; d=zohomail.com; s=zohoarc; b=M8ovvTCUgX5OGEuO9EsKPu9hQA88FJzmmgn560TGWQpHuGLM+3VrMPn3m5diTWJUF2qqVK97+PCv+BTA/vctgDCt6UP7LeYaXXMCJkboFMx6Fi2A01OaQ6x2X1SU6MXn7FnI1kp7v0Yi36TxIXVA2eRn5KvZ64bP6sI8nV7BsZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463146; 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=9KeAM8wXiEEVs/M60d1RRo6aMCL0tz60D/qLQb7q9fU=; b=RoegZK9khqbr77n7ctP68Y8btkx5czHwZjSo5Nge/ms0Y3BUDGmJWytNZKfU0txR7tE6anXpktAAjymPah9zCVRzztJOzeiokLeToHmo9h1vNIIEGFP+BacgsiK+O8tYTMGIfav3/3y3GY/iadNC3QrbCLD6D2cBHXTPN3pRbGY= 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 1600463146263178.3673606015857; Fri, 18 Sep 2020 14:05:46 -0700 (PDT) Received: from localhost ([::1]:47460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNZg-0005Vq-Kb for importer@patchew.org; Fri, 18 Sep 2020 17:05:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNI8-0002d3-AB for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNHx-0006Gm-6l for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47: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-403-DqvHvO6iNxyKHOpjgUGlxQ-1; Fri, 18 Sep 2020 16:47:22 -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 ECBC31882FD2; Fri, 18 Sep 2020 20:47:20 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5E3868D60; Fri, 18 Sep 2020 20:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462044; 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=9KeAM8wXiEEVs/M60d1RRo6aMCL0tz60D/qLQb7q9fU=; b=DacWIMUFDPBYI1JYmcT5AzGqCeIKcn5wZ5czH4PybYnbsql8w/9FBi3F/uoy/TbR4l5wEx fuw4Cgdz8svGLKcT+MIUhG/HP0EOnOppiCEzR1JLbrBsnlj0j9iavo3UL53iYzUh6zKGTS 5DKQ2fmHUwmMm7Ruoz0NcO0k9O6tEeY= X-MC-Unique: DqvHvO6iNxyKHOpjgUGlxQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 05/17] qom: Correct object_class_dynamic_cast_assert() documentation Date: Fri, 18 Sep 2020 16:47:02 -0400 Message-Id: <20200918204714.27276-6-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 01:32:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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" object_class_dynamic_cast_assert() is not used by INTERFACE_CHECK, remove misleading mention of that function in the documentation. Message-Id: <20200916193101.511600-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qom/object.h b/include/qom/object.h index 056f67ab3b..6c0d424b51 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1257,7 +1257,7 @@ type_init(do_qemu_init_ ## type_array) * of this function. The only difference in behavior is that this function * asserts instead of returning #NULL on failure if QOM cast debugging is * enabled. This function is not meant to be called directly, but only th= rough - * the wrapper macros OBJECT_CLASS_CHECK and INTERFACE_CHECK. + * the wrapper macro OBJECT_CLASS_CHECK. */ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *klass, const char *typename, --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463611; cv=none; d=zohomail.com; s=zohoarc; b=Z8A5eHVqKHsB5yQCiZZnqdSAPraDNt2aM+46+eye6QrmwTVbvLWUVm+YLKevJUbzf4hpLhd1sZGb4GgCPQbltn0jxJkczl9tFsuF7r8Bxdmt8hfTdXU0MJ21Xzjt+/4zR2G5dRSVqnUGM54EjsrFyZdJE95SaQfw0ZLn/XZBSIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463611; 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=hqTzKYgwmlGjAC297r5Hip0PrRg3SR35cK0Rp9DJFjw=; b=ELkmf9SR0MhKQIUIpqFiCdy4jzdCUB3AKdfP6LdmxFnmCrZuVHxL5qe6MGtfJjMxUMXWbfC68aA5xTVP0f7foxHY73fRRSqhgSN1XTwk+NjKryPnKz2aRy8V4NHXgYGbvIHM080IZp7O40C7Sd2JObFQvZKVDkvLiDvQ86qxvO4= 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 1600463611067325.96629239073934; Fri, 18 Sep 2020 14:13:31 -0700 (PDT) Received: from localhost ([::1]:39910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNhB-0005ov-O7 for importer@patchew.org; Fri, 18 Sep 2020 17:13:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIE-0002dp-85 for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:43 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:38062 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 1kJNI2-0006Hb-5e for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:41 -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-547-GU5tHh1YOuSb3KN8ydRoiA-1; Fri, 18 Sep 2020 16:47:23 -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 0888F81CB07; Fri, 18 Sep 2020 20:47:22 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE631610F3; Fri, 18 Sep 2020 20:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462047; 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=hqTzKYgwmlGjAC297r5Hip0PrRg3SR35cK0Rp9DJFjw=; b=ZQW6Rf90bQyTSCQ8EmCTlzdLfxq6CCiipaa4NTyufHjGpOiivtzzyHmmbba9YtEQ6UWVAz bCO5c8Z/39wGbbpvegv/IEtBiU8pR7vf06hYuBA6j6ScsQlUFPKcT+zK8hljSJpDIq/ZnV eJIIXz/Xa8tXdRGQCdVwlsP1rU49r1Y= X-MC-Unique: GU5tHh1YOuSb3KN8ydRoiA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 06/17] qom: Clean up object_property_get_enum()'s error value Date: Fri, 18 Sep 2020 16:47:03 -0400 Message-Id: <20200918204714.27276-7-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 03:47:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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?= , Markus Armbruster , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Markus Armbruster object_property_get_enum() is the only object_property_FOO() that is documented to return an undefined value on error. It does no such thing, actually: it returns 0 on some errors, and -1 on others. Needlessly complicated. Always return -1 on error, and adjust the contract. Signed-off-by: Markus Armbruster Reviewed-by: Greg Kurz Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20200917125540.597786-2-armbru@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 6 +++--- qom/object.c | 6 +++--- tests/check-qom-proplist.c | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 6c0d424b51..494827b4d1 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1687,9 +1687,9 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * @typename: the name of the enum data type * @errp: returns an error if this function fails * - * Returns: the value of the property, converted to an integer, or - * undefined if an error occurs (including when the property value is not - * an enum). + * Returns: the value of the property, converted to an integer (which + * can't be negative), or -1 on error (including when the property + * value is not an enum). */ int object_property_get_enum(Object *obj, const char *name, const char *typename, Error **errp); diff --git a/qom/object.c b/qom/object.c index 387efb25eb..cecad35b99 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1564,21 +1564,21 @@ int object_property_get_enum(Object *obj, const cha= r *name, EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { - return 0; + return -1; } =20 if (!g_str_equal(prop->type, typename)) { error_setg(errp, "Property %s on %s is not '%s' enum type", name, object_class_get_name( object_get_class(obj)), typename); - return 0; + return -1; } =20 enumprop =3D prop->opaque; =20 str =3D object_property_get_str(obj, name, errp); if (!str) { - return 0; + return -1; } =20 ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c index 1571606c1c..1b76581980 100644 --- a/tests/check-qom-proplist.c +++ b/tests/check-qom-proplist.c @@ -491,6 +491,7 @@ static void test_dummy_getenum(void) "av", "BadAnimal", &err); + g_assert(val =3D=3D -1); error_free_or_abort(&err); =20 /* A non-enum property name */ @@ -498,6 +499,7 @@ static void test_dummy_getenum(void) "iv", "DummyAnimal", &err); + g_assert(val =3D=3D -1); error_free_or_abort(&err); =20 object_unparent(OBJECT(dobj)); --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600462762; cv=none; d=zohomail.com; s=zohoarc; b=dOejx1ZVqYOFJ9l3gFStKYgXv+Oemt24dc3BzkjM4v5v5o/IKno76N74UFdnksc7P6z1rr1F925oQo+FacagiBVAVn3L6orI71AEIJ62ygTtCyvgaxAXAe6rztRZRAuF9b8BjfIcB9HlljyzaYnPGOeMfM58wbTGuiP6+uFJdkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600462762; 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=HviHr4FunOqEL8xT9/OsOQVp4aiu61kBo5y3Tq38Pn4=; b=MiIKdXkjlIQalthjYM2j0ALh4V4Ev+O4uSnWZSv0yjgpHw8bHMiZJwHqvOM7YrUsmRVmO4j6EqXzpVwPR7nwLZxANzZikBAtk1r6GBj5kyDrjQ5Y8kQC9eIpUqZEaburE5tcdL1ALzCw0Y497FXj3KOyjmkVJfTJ8uchlKXs6T4= 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 1600462762848662.4122890825033; Fri, 18 Sep 2020 13:59:22 -0700 (PDT) Received: from localhost ([::1]:38528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNTV-0000f5-HX for importer@patchew.org; Fri, 18 Sep 2020 16:59:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIG-0002eA-8p for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:26978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNI2-0006Hi-5e for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:43 -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-480-Sg7VU-CkN6KHCs2BL0TeMA-1; Fri, 18 Sep 2020 16:47:24 -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 F372F800C78; Fri, 18 Sep 2020 20:47:22 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8ECE55778; Fri, 18 Sep 2020 20:47:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462047; 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=HviHr4FunOqEL8xT9/OsOQVp4aiu61kBo5y3Tq38Pn4=; b=DbBsngHvgmXj6Tr9dpHX7eblcSqgiOBbDdV39I4I42yy0eGMYY6po8GApgyMCoHMMPSncT 4/UgmDe5NjBdxwFFHYr6KCdkew/geQwXHA2uqO2ClCR3qNe0X1joOFNT+wKMkAOvxRLfud suQn0OPoLvbQFEXSXdCnBmvxU03G9RM= X-MC-Unique: Sg7VU-CkN6KHCs2BL0TeMA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 07/17] qom: Correct error values in two contracts Date: Fri, 18 Sep 2020 16:47:04 -0400 Message-Id: <20200918204714.27276-8-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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=unavailable 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?= , Markus Armbruster , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Markus Armbruster object_property_get_bool()'s contract claims it returns NULL on error. Pasto; it returns false. object_property_get_int()'s contract claims it returns "negative". It actually returns -1. All the other object_property_get_FOO() contracts specify the exact error value, so do the same here. Signed-off-by: Markus Armbruster Reviewed-by: Greg Kurz Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20200917125540.597786-3-armbru@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 494827b4d1..32524d72cc 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1624,7 +1624,7 @@ bool object_property_set_bool(Object *obj, const char= *name, * @name: the name of the property * @errp: returns an error if this function fails * - * Returns: the value of the property, converted to a boolean, or NULL if + * Returns: the value of the property, converted to a boolean, or false if * an error occurs (including when the property value is not a bool). */ bool object_property_get_bool(Object *obj, const char *name, @@ -1649,7 +1649,7 @@ bool object_property_set_int(Object *obj, const char = *name, * @name: the name of the property * @errp: returns an error if this function fails * - * Returns: the value of the property, converted to an integer, or negativ= e if + * Returns: the value of the property, converted to an integer, or -1 if * an error occurs (including when the property value is not an integer). */ int64_t object_property_get_int(Object *obj, const char *name, --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600466040; cv=none; d=zohomail.com; s=zohoarc; b=ZXqj7ngECts5hAzgfXxOPV5sLrSUoy9lcqKqkKxkjB3hlWkHaJc+U/sNP+HuBdvNzyaPciv5LjMXcWAxbkISDGADVTQc6yK+nl4pYGPhrZrsp1N93dDHExHQvOMT6tHSQAaAGIJizxyqfHVOb1xrHx6PxJQ0t0tMEUafScFpJqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600466040; 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=fLrIDApUcgOCvc/oGCOA8twHr0W5cXxAQ0f1YfYRYiQ=; b=n2fFUTo9+Ld/n2WC+fWQ2MRp3T3XYSX2EkTd0xOVhCRGYJpzjzdlXdkUY9B91MJRJT+i36SDL4bkvBeuDf68UX+ZG/FumaOjTY9067i8PknkDbPzUXSC6eSe6UY0uKKWbbHlDF+IpD8rp3ItfEKIbd6cib+no0mHp2MXIIABt50= 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 1600466040230415.592900311074; Fri, 18 Sep 2020 14:54:00 -0700 (PDT) Received: from localhost ([::1]:37084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJOKM-0005nx-R1 for importer@patchew.org; Fri, 18 Sep 2020 17:53:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIG-0002e8-5k for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNI2-0006Hf-5d for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:41 -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-125-Z9VTgYuUOom0GmmcSmLdGQ-1; Fri, 18 Sep 2020 16:47:25 -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 106A184639B; Fri, 18 Sep 2020 20:47:24 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCC0468D64; Fri, 18 Sep 2020 20:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462047; 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=fLrIDApUcgOCvc/oGCOA8twHr0W5cXxAQ0f1YfYRYiQ=; b=ifm5ce0AWw8KMkhct/35h5ZKvl8+lcOo3LdTDjMjc5LwJMnIRa86rprSYwuTr16e8BJlXU jHjQFl3Gsi/d5ZAkd7gTfx2jFv7fG1RyHYqQds/KA3QxTImiwHD/hY+hlAszCJ0OGYmHlU ttR8iHETImkpGmKs6o7OlppQ8FcsMjQ= X-MC-Unique: Z9VTgYuUOom0GmmcSmLdGQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 08/17] qom: Allow objects to be allocated with increased alignment Date: Fri, 18 Sep 2020 16:47:05 -0400 Message-Id: <20200918204714.27276-9-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 01:32:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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 , Richard Henderson , =?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" From: Richard Henderson It turns out that some hosts have a default malloc alignment less than that required for vectors. We assume that, with compiler annotation on CPUArchState, that we can properly align the vector portion of the guest state. Fix the alignment of the allocation by using qemu_memalloc when required. Signed-off-by: Richard Henderson Message-Id: <20200916004638.2444147-3-richard.henderson@linaro.org> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 5 +++++ qom/object.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 32524d72cc..405a2c67b0 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -691,6 +691,7 @@ struct Object .parent =3D TYPE_##PARENT_MODULE_OBJ_NAME, \ .name =3D TYPE_##MODULE_OBJ_NAME, \ .instance_size =3D sizeof(ModuleObjName), \ + .instance_align =3D __alignof__(ModuleObjName), \ .instance_init =3D module_obj_name##_init, \ .instance_finalize =3D module_obj_name##_finalize, \ .class_size =3D sizeof(ModuleObjName##Class), \ @@ -770,6 +771,9 @@ struct Object * @instance_size: The size of the object (derivative of #Object). If * @instance_size is 0, then the size of the object will be the size of = the * parent object. + * @instance_align: The required alignment of the object. If @instance_al= ign + * is 0, then normal malloc alignment is sufficient; if non-zero, then we + * must use qemu_memalign for allocation. * @instance_init: This function is called to initialize an object. The p= arent * class will have already been initialized so the type is only responsi= ble * for initializing its own members. @@ -807,6 +811,7 @@ struct TypeInfo const char *parent; =20 size_t instance_size; + size_t instance_align; void (*instance_init)(Object *obj); void (*instance_post_init)(Object *obj); void (*instance_finalize)(Object *obj); diff --git a/qom/object.c b/qom/object.c index cecad35b99..a91a6a515a 100644 --- a/qom/object.c +++ b/qom/object.c @@ -50,6 +50,7 @@ struct TypeImpl size_t class_size; =20 size_t instance_size; + size_t instance_align; =20 void (*class_init)(ObjectClass *klass, void *data); void (*class_base_init)(ObjectClass *klass, void *data); @@ -114,6 +115,7 @@ static TypeImpl *type_new(const TypeInfo *info) =20 ti->class_size =3D info->class_size; ti->instance_size =3D info->instance_size; + ti->instance_align =3D info->instance_align; =20 ti->class_init =3D info->class_init; ti->class_base_init =3D info->class_base_init; @@ -688,16 +690,44 @@ static void object_finalize(void *data) } } =20 +/* Find the minimum alignment guaranteed by the system malloc. */ +#if __STDC_VERSION__ >=3D 201112L +typddef max_align_t qemu_max_align_t; +#else +typedef union { + long l; + void *p; + double d; + long double ld; +} qemu_max_align_t; +#endif + static Object *object_new_with_type(Type type) { Object *obj; + size_t size, align; + void (*obj_free)(void *); =20 g_assert(type !=3D NULL); type_initialize(type); =20 - obj =3D g_malloc(type->instance_size); - object_initialize_with_type(obj, type->instance_size, type); - obj->free =3D g_free; + size =3D type->instance_size; + align =3D type->instance_align; + + /* + * Do not use qemu_memalign unless required. Depending on the + * implementation, extra alignment implies extra overhead. + */ + if (likely(align <=3D __alignof__(qemu_max_align_t))) { + obj =3D g_malloc(size); + obj_free =3D g_free; + } else { + obj =3D qemu_memalign(align, size); + obj_free =3D qemu_vfree; + } + + object_initialize_with_type(obj, size, type); + obj->free =3D obj_free; =20 return obj; } --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463272; cv=none; d=zohomail.com; s=zohoarc; b=BnOGY36tQCtTt4UYQuUzjIXoiP4m/pmjlJ5O6a9WZAoRjItH/vSRh+Zp9Xw7giKRYfkIXj8oPSLcR9eN9nvIa2Cv6L5xOvAsbCpiVt6hFRmiYvilq88tA0rCqBMn0wkbc02QbELKXkKuGNjbBtUvXVOkWJ6uIijMFkBX4V3NrNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463272; 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=VaMsWBrwFYi2YdYdMYFrrZ5X3XjkdwxMSElMTPqymfc=; b=ORxQvUsaJImR1vXP8fMgvrKfBd10UaVk6MxmYY48Rax1V0PVg7cxGx78mWhULGtI+OWRGI9WjWOeXqKIG+Ro6IQhaoDLSnkRXgTDWDB/6+bX/MgnVcxw88/H7k4xnm29AffCkOKBwSR8R6eQrKns8O9Rx1IwCg/LFZCHGMdwDuQ= 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 1600463272180127.4366328907978; Fri, 18 Sep 2020 14:07:52 -0700 (PDT) Received: from localhost ([::1]:53038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNbi-0007wF-Tm for importer@patchew.org; Fri, 18 Sep 2020 17:07:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNII-0002gx-2T for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNI2-0006Ht-60 for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:45 -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-593-CjAYE1MJNiScByyYYBxPCQ-1; Fri, 18 Sep 2020 16:47:26 -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 01E37873016; Fri, 18 Sep 2020 20:47:25 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id C37227881E; Fri, 18 Sep 2020 20:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462048; 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=VaMsWBrwFYi2YdYdMYFrrZ5X3XjkdwxMSElMTPqymfc=; b=QoC25T+aE0A+pP34amYykrSMnYZx8MdXSRcFwPFuqnUPhy2FbQbqdN60TzhgcfrH7hG3jh 4eyad02I8l5tCeFZePy5hvamUgX+rp+23bVJc03U2rFCR69w5hcGqbMA9O1E6zmfZtFeW1 AUS/g4qR6RNw+l+qW1pIR06CHvMmrkU= X-MC-Unique: CjAYE1MJNiScByyYYBxPCQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 09/17] target/arm: Set instance_align on CPUARM TypeInfo Date: Fri, 18 Sep 2020 16:47:06 -0400 Message-Id: <20200918204714.27276-10-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 01:32:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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 , Richard Henderson , =?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" From: Richard Henderson Fix alignment of CPUARMState.vfp.zregs. Signed-off-by: Richard Henderson Message-Id: <20200916004638.2444147-4-richard.henderson@linaro.org> Signed-off-by: Eduardo Habkost --- target/arm/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 7b5ea65fab..a7643deab4 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2290,6 +2290,7 @@ void arm_cpu_register(const ARMCPUInfo *info) TypeInfo type_info =3D { .parent =3D TYPE_ARM_CPU, .instance_size =3D sizeof(ARMCPU), + .instance_align =3D __alignof__(ARMCPU), .instance_init =3D arm_cpu_instance_init, .class_size =3D sizeof(ARMCPUClass), .class_init =3D info->class_init ?: cpu_register_class_init, @@ -2305,6 +2306,7 @@ static const TypeInfo arm_cpu_type_info =3D { .name =3D TYPE_ARM_CPU, .parent =3D TYPE_CPU, .instance_size =3D sizeof(ARMCPU), + .instance_align =3D __alignof__(ARMCPU), .instance_init =3D arm_cpu_initfn, .instance_finalize =3D arm_cpu_finalizefn, .abstract =3D true, --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463272; cv=none; d=zohomail.com; s=zohoarc; b=GfK+Rju+jqskL77HSgr2B81j32m9dOnFinkDMP0s1rvRzj82lZvyAoqViv8V/5LzUn2tZk8kwEdDq8U8C7u7Re/c+8SCpEfmnsc3lF8lAxn/HGwtm42yIZ/SximggI4JZHN+/iR6IMqooyjgsrEck0pUjyFIF3xRN5d9bZJUM9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463272; 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=yldcnY4aWcVFPppdh4LG4wtGDDsB8bzuisIy+OR1aPU=; b=F0lNT743j7i+m/0RpkDO2vTg7xtdUDtCVcVPR2M9aXtAZmo7Pkn2n6peIw1lqUDEq9qx5UP91ak/MZ7y3q0fk43Epl490i6hHED2dC02HleuiZo2qJNj7GzkXH6TFXnliD1fOZbLKctpll5D0iYDBAfH5rAt1NwsQ0gEw93saN0= 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 1600463272429774.6648549973828; Fri, 18 Sep 2020 14:07:52 -0700 (PDT) Received: from localhost ([::1]:53062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNbj-0007wz-4P for importer@patchew.org; Fri, 18 Sep 2020 17:07:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIG-0002f5-Rf for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:44 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:21280 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 1kJNI2-0006Hy-9h for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:44 -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-516-2U6ReEBqNRSIFrYjz5GEeQ-1; Fri, 18 Sep 2020 16:47:27 -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 3483B100831D; Fri, 18 Sep 2020 20:47:26 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3C6568D64; Fri, 18 Sep 2020 20:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462049; 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=yldcnY4aWcVFPppdh4LG4wtGDDsB8bzuisIy+OR1aPU=; b=ZCETUcbdWPvoIyoXwdD4j683EsJHwXqFgUta5V7x/UVV8rMkFYZEOnBv1uv1NAlUBThXwI DsxKU8nIBugFTRN3g0Y75gmJrYEX4TZCbnGg8/mwUuFKLBrmddy3KvoiaNzEfN8Pgu0Z0E boFQ1pnCsT2xSK135qodrZXjaoujQis= X-MC-Unique: 2U6ReEBqNRSIFrYjz5GEeQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 10/17] target/ppc: Set instance_align on PowerPCCPU TypeInfo Date: Fri, 18 Sep 2020 16:47:07 -0400 Message-Id: <20200918204714.27276-11-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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.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/18 16:47:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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 , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , David Gibson 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" From: Richard Henderson Fix alignment of CPUPPCState.vsr. Signed-off-by: Richard Henderson Acked-by: David Gibson Message-Id: <20200916004638.2444147-5-richard.henderson@linaro.org> Signed-off-by: Eduardo Habkost --- target/ppc/translate_init.c.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.= inc index 230a062d29..accb4f2fae 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10960,6 +10960,7 @@ static const TypeInfo ppc_cpu_type_info =3D { .name =3D TYPE_POWERPC_CPU, .parent =3D TYPE_CPU, .instance_size =3D sizeof(PowerPCCPU), + .instance_align =3D __alignof__(PowerPCCPU), .instance_init =3D ppc_cpu_instance_init, .instance_finalize =3D ppc_cpu_instance_finalize, .abstract =3D true, --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600466163; cv=none; d=zohomail.com; s=zohoarc; b=f/Ij9UoAGeCdzScsLfYNLGZKCVBPRTfOw1uxdNBpfR3e+eJYbTBw50XUHP87yY6uP3zTI60MLUNZASSTReeVh3ZmZasDRtuGThomgqUowHfdSCFL8SxIgGhhuBhAgQD4btyP8Zdcp/d2Q5FHrQ+CV0AUHc5AQVU/OnB5zf/l/FQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600466163; 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=HDMnwdJM25beIbtVDwSGodkG2zy0DVXY9fIwspw21EM=; b=iXLURBQuxFBRJU+GUmmmYq9T28OsuuZbNNI4aMgT0zPdln1KToJobu0LIXvBBbR7lGjyA7To9FZLUP5WGAGPSS3M5DOhXQ4JxBT+7gcWlRo2rj73Z/hpQ3EQmn4XkIKzogKMrf4RFC/oldZYgBPny5oNLX9obgnzXVAwPgbiNFQ= 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 1600466163218250.13933653968888; Fri, 18 Sep 2020 14:56:03 -0700 (PDT) Received: from localhost ([::1]:39600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJOML-0006w3-Qy for importer@patchew.org; Fri, 18 Sep 2020 17:56:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIH-0002fn-B6 for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNI6-0006JU-71 for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:45 -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-235-OFTYs5BdOVyLFg2_RiIgpA-1; Fri, 18 Sep 2020 16:47:28 -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 2CC19800C78; Fri, 18 Sep 2020 20:47:27 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED77B7B7A0; Fri, 18 Sep 2020 20:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462052; 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=HDMnwdJM25beIbtVDwSGodkG2zy0DVXY9fIwspw21EM=; b=NOiABoYj5GB6zxddf5wf0it60/hnp+pDoxnWbRPX4WteU+J+5LTKgNowiY1klkZpAgtyn5 s/tQ3fJZb16RexZzmp2zgWGIaw+08NiJ7izLqgryySGgdNhNY7PGcinz7jZS8+zlGmGWqO eeuo4HbqUP3BpEBGk5uL7v01KQFL+qU= X-MC-Unique: OFTYs5BdOVyLFg2_RiIgpA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 11/17] target/riscv: Set instance_align on RISCVCPU TypeInfo Date: Fri, 18 Sep 2020 16:47:08 -0400 Message-Id: <20200918204714.27276-12-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 01:32:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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 , Alistair Francis , Richard Henderson , =?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" From: Richard Henderson Fix alignment of CPURISCVState.vreg. Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Message-Id: <20200916004638.2444147-6-richard.henderson@linaro.org> Signed-off-by: Eduardo Habkost --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 57c006df5d..0bbfd7f457 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -628,6 +628,7 @@ static const TypeInfo riscv_cpu_type_infos[] =3D { .name =3D TYPE_RISCV_CPU, .parent =3D TYPE_CPU, .instance_size =3D sizeof(RISCVCPU), + .instance_align =3D __alignof__(RISCVCPU), .instance_init =3D riscv_cpu_init, .abstract =3D true, .class_size =3D sizeof(RISCVCPUClass), --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463146; cv=none; d=zohomail.com; s=zohoarc; b=MeoAeslKJK6uY08zp28Z48FgodjCuH3Y+gSVKsm2i1ZMPKEuCrbOM+P2wG8nL66qnk3yoga6EtJ36cqZJnlD1fFrojUnNw7mNItQy9roBdTPF3wHj7dmUsbV9EQjnL1HvwnzN9UsMeR1tUO3Tfrv+ggsxSrUnC6KUQ9SF5qd7BY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463146; 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=3IuX4v1+c8sM0zT9JSAUEYHuPfZyPNDb50DY3cgGfrI=; b=ELxxsUH4rhNuBE/59b9fvDJ3zrPhTFDVYpvZoO19I+Y1VlNljcjh8ao1plWXPij0x4rpJjDNXOsNMAOj0DdUBmd100LmS23L93y1LFlncdYLcYlN/we+8JaDjH6LviFjX2Dnp/xaPUQ0cyGkTyl6WkMk3bcGrOVWtrmlmM9qRF0= 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 16004631462551011.0997263616181; Fri, 18 Sep 2020 14:05:46 -0700 (PDT) Received: from localhost ([::1]:47466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNZg-0005Vu-Lb for importer@patchew.org; Fri, 18 Sep 2020 17:05:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIH-0002ge-TA for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNI6-0006JQ-1W for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:45 -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-570-P4rjjXXWPoaATgpV5KSQZw-1; Fri, 18 Sep 2020 16:47:29 -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 48465188C159; Fri, 18 Sep 2020 20:47:28 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B7FE78818; Fri, 18 Sep 2020 20:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462051; 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=3IuX4v1+c8sM0zT9JSAUEYHuPfZyPNDb50DY3cgGfrI=; b=Y4TpArUro2FbHFUwdZ9efGem5WaDGII5x5wHEB3zq2U9m23F+5R/c0wnrehat2Gin1zxcb qhNNVFliEUVVvMNm7v4S07V1Lv0wHUqK6LQOn5VNL2K6gllLGauGBuuEspJQPkGdOW4eX/ JGAPgKUj0bQPq2kTBsa7uNecdhRMcto= X-MC-Unique: P4rjjXXWPoaATgpV5KSQZw-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 12/17] target/s390x: Set instance_align on S390CPU TypeInfo Date: Fri, 18 Sep 2020 16:47:09 -0400 Message-Id: <20200918204714.27276-13-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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 , Richard Henderson , =?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" From: Richard Henderson Fix alignment of CPUS390XState.vregs. Signed-off-by: Richard Henderson Message-Id: <20200916004638.2444147-7-richard.henderson@linaro.org> Signed-off-by: Eduardo Habkost --- target/s390x/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 749cd548f0..e350edc9f5 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -517,6 +517,7 @@ static const TypeInfo s390_cpu_type_info =3D { .name =3D TYPE_S390_CPU, .parent =3D TYPE_CPU, .instance_size =3D sizeof(S390CPU), + .instance_align =3D __alignof__(S390CPU), .instance_init =3D s390_cpu_initfn, .instance_finalize =3D s390_cpu_finalize, .abstract =3D true, --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463820; cv=none; d=zohomail.com; s=zohoarc; b=ZgkcKpDPJ2wNWDRgV964Y5tKfLtvzmoKY0LQO35vlOrG8yDz5e7p/P/NKKMpMZHRdT+cmxSi+z5kmoGxmbFr7rhJaSCFt1rKzMP8oTs664f+ysmMSMXIjVmOXiu0Z7eW4rPwODfn4bcRzosjxcHehO9XR87xLpKnUIUcqUOBC30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463820; 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=PKJL4oTrE7z0Mpieiwxl18ICPhqKcwdVBP7xcKeiZXg=; b=Pm7bMrneOiAy0BMWN7IC9Naa6vM/cbr2EhYazezShV5sh85caSMilhGRVlL4Q7XI3wHTir0Bx3v76iMO7BI2clk3sQ0/uEnA4FIYFcGRRydP2iXokTIBWT15BHzdEl3ULsxuxWdwwOlbarAsE1NewN42Zfuieu7oqCMTuqvOCkg= 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 1600463820168118.13396278764355; Fri, 18 Sep 2020 14:17:00 -0700 (PDT) Received: from localhost ([::1]:47008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNkX-0000RO-Vf for importer@patchew.org; Fri, 18 Sep 2020 17:16:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIN-0002nk-J5 for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNIJ-0006LE-3d for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:51 -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-590-HMAelNe7MlqGpwnZWgoKDg-1; Fri, 18 Sep 2020 16:47:30 -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 A4A881891EA7; Fri, 18 Sep 2020 20:47:29 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17C8778824; Fri, 18 Sep 2020 20:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462066; 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=PKJL4oTrE7z0Mpieiwxl18ICPhqKcwdVBP7xcKeiZXg=; b=RhbrSi4vlJRXCXBYHOCy1kME4cmqgN1SPreV3EvePbr/1B3bbvjKfnL1e6pQGObHs7cr5h wBXa8Oq3HlsTRsTQKK6DokO7JYA9K/997kM8DzPvZjZsuF7w2zEU9GGtzuE4VFnLsEPPE/ cQzbbS9t/EPOyulBBQffiWdgBPtC/GA= X-MC-Unique: HMAelNe7MlqGpwnZWgoKDg-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 13/17] scripts/codeconverter: Update to latest version Date: Fri, 18 Sep 2020 16:47:10 -0400 Message-Id: <20200918204714.27276-14-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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" I'm not documenting every single change in the codeconverter script because most of that code will be deleted once we finish the QOM code conversion. This patch updates the script to the latest version that was used to perform changes in the QOM code. Signed-off-by: Eduardo Habkost Message-Id: <20200916182519.415636-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- .../codeconverter/codeconverter/patching.py | 193 +++-- .../codeconverter/codeconverter/qom_macros.py | 327 ++++++-- .../codeconverter/qom_type_info.py | 741 +++++++++++++++--- .../codeconverter/test_patching.py | 3 +- .../codeconverter/test_regexps.py | 26 +- scripts/codeconverter/converter.py | 12 +- 6 files changed, 1057 insertions(+), 245 deletions(-) diff --git a/scripts/codeconverter/codeconverter/patching.py b/scripts/code= converter/codeconverter/patching.py index 627a1a1b04..9e92505d39 100644 --- a/scripts/codeconverter/codeconverter/patching.py +++ b/scripts/codeconverter/codeconverter/patching.py @@ -5,7 +5,7 @@ # # 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 typing import IO, Match, NamedTuple, Optional, Literal, Iterable, Typ= e, Dict, List, Any, TypeVar, NewType, Tuple, Union from pathlib import Path from itertools import chain from tempfile import NamedTemporaryFile @@ -47,7 +47,7 @@ class FileMatch: =20 def __init__(self, f: 'FileInfo', m: Match) -> None: self.file: 'FileInfo' =3D f - self.match: Match =3D m + self.match: Match[str] =3D m =20 @property def name(self) -> str: @@ -68,8 +68,13 @@ class FileMatch: def line_col(self) -> LineAndColumn: return self.file.line_col(self.start()) =20 - def group(self, *args): - return self.match.group(*args) + def group(self, group: Union[int, str]) -> str: + return self.match.group(group) + + def getgroup(self, group: str) -> Optional[str]: + if group not in self.match.groupdict(): + return None + return self.match.group(group) =20 def log(self, level, fmt, *args) -> None: pos =3D self.line_col() @@ -163,18 +168,51 @@ class FileMatch: raise NotImplementedError() =20 @classmethod - def find_matches(klass, content: str) -> Iterable[Match]: - """Generate match objects for class + def finditer(klass, content: str, pos=3D0, endpos=3D-1) -> Iterable[Ma= tch]: + """Helper for re.finditer()""" + if endpos >=3D 0: + content =3D content[:endpos] + return klass.compiled_re().finditer(content, pos) =20 - Might be reimplemented by subclasses if they - intend to look for matches using a different method. - """ - return klass.compiled_re().finditer(content) + @classmethod + def domatch(klass, content: str, pos=3D0, endpos=3D-1) -> Optional[Mat= ch]: + """Helper for re.match()""" + if endpos >=3D 0: + content =3D content[:endpos] + return klass.compiled_re().match(content, pos) + + def group_finditer(self, klass: Type['FileMatch'], group: Union[str, i= nt]) -> Iterable['FileMatch']: + assert self.file.original_content + return (klass(self.file, m) + for m in klass.finditer(self.file.original_content, + self.match.start(group), + self.match.end(group))) + + def try_group_match(self, klass: Type['FileMatch'], group: Union[str, = int]) -> Optional['FileMatch']: + assert self.file.original_content + m =3D klass.domatch(self.file.original_content, + self.match.start(group), + self.match.end(group)) + if not m: + return None + else: + return klass(self.file, m) + + def group_match(self, group: Union[str, int]) -> 'FileMatch': + m =3D self.try_group_match(FullMatch, group) + assert m + return m =20 @property def allfiles(self) -> 'FileList': return self.file.allfiles =20 +class FullMatch(FileMatch): + """Regexp that will match all contents of string + Useful when used with group_match() + """ + regexp =3D r'(?s).*' # (?s) is re.DOTALL + def all_subclasses(c: Type[FileMatch]) -> Iterable[Type[FileMatch]]: for sc in c.__subclasses__(): yield sc @@ -201,7 +239,15 @@ def apply_patches(s: str, patches: Iterable[Patch]) ->= str: """ r =3D StringIO() last =3D 0 - for p in sorted(patches): + def patch_sort_key(item: Tuple[int, Patch]) -> Tuple[int, int, int]: + """Patches are sorted by byte position, + patches at the same byte position are applied in the order + they were generated. + """ + i,p =3D item + return (p.start, p.end, i) + + for i,p in sorted(enumerate(patches), key=3Dpatch_sort_key): DBG("Applying patch at position %d (%s) - %d (%s): %r", p.start, line_col(s, p.start), p.end, line_col(s, p.end), @@ -220,26 +266,35 @@ class RegexpScanner: self.match_index: Dict[Type[Any], List[FileMatch]] =3D {} self.match_name_index: Dict[Tuple[Type[Any], str, str], Optional[F= ileMatch]] =3D {} =20 - def _find_matches(self, klass: Type[Any]) -> Iterable[FileMatch]: + def _matches_of_type(self, klass: Type[Any]) -> Iterable[FileMatch]: raise NotImplementedError() =20 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 + self.match_index[t] =3D list(self._matches_of_type(t)) + return self.match_index[t] # type: ignore =20 - def find_match(self, t: Type[T], name: str, group: str=3D'name') -> Op= tional[T]: + def find_matches(self, t: Type[T], name: str, group: str=3D'name') -> = List[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 + r: List[T] =3D [] for m in self.matches_of_type(t): assert isinstance(m, FileMatch) - if m.group(group) =3D=3D name: - r =3D m # type: ignore + if m.getgroup(group) =3D=3D name: + r.append(m) # type: ignore self.match_name_index[indexkey] =3D r # type: ignore return r =20 + def find_match(self, t: Type[T], name: str, group: str=3D'name') -> Op= tional[T]: + l =3D self.find_matches(t, name, group) + if not l: + return None + if len(l) > 1: + logger.warn("multiple matches found for %r (%s=3D%r)", t, grou= p, name) + return None + return l[0] + def reset_index(self) -> None: self.match_index.clear() self.match_name_index.clear() @@ -258,18 +313,22 @@ class FileInfo(RegexpScanner): def __repr__(self) -> str: return f'' =20 + def filename_matches(self, name: str) -> bool: + nameparts =3D Path(name).parts + return self.filename.parts[-len(nameparts):] =3D=3D nameparts + 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) =20 - def _find_matches(self, klass: Type[Any]) -> List[FileMatch]: + def _matches_of_type(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)] + matches =3D [klass(self, m) for m in klass.finditer(self.original_= content)] DBG('%s: %d matches found for %s: %s', self.filename, len(matches), klass.__name__,' '.join(names(matches))) return matches @@ -277,7 +336,7 @@ class FileInfo(RegexpScanner): 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: + if m.getgroup(group) =3D=3D name: return m # type: ignore return None =20 @@ -299,7 +358,16 @@ class FileInfo(RegexpScanner): return (m for l in lists for m in l) =20 - def scan_for_matches(self, class_names: Optional[List[str]]=3DNone) ->= None: + def gen_patches(self, matches: List[FileMatch]) -> None: + for m in matches: + DBG("Generating patches for %r", m) + 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 scan_for_matches(self, class_names: Optional[List[str]]=3DNone) ->= Iterable[FileMatch]: DBG("class names: %r", class_names) class_dict =3D match_class_dict() if class_names is None: @@ -309,40 +377,9 @@ class FileInfo(RegexpScanner): 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) + DBG('%d matches found for %s: %s', + len(matches), cn, ' '.join(names(matches))) + yield from matches =20 def apply_patches(self) -> None: """Replace self.original_content after applying patches from self.= patches""" @@ -384,14 +421,46 @@ class FileList(RegexpScanner): def __iter__(self): return iter(self.files) =20 - def _find_matches(self, klass: Type[Any]) -> Iterable[FileMatch]: - return chain(*(f._find_matches(klass) for f in self.files)) + def _matches_of_type(self, klass: Type[Any]) -> Iterable[FileMatch]: + return chain(*(f._matches_of_type(klass) for f in self.files)) =20 - def find_file(self, name) -> Optional[FileInfo]: + def find_file(self, name: str) -> 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: + if f.filename_matches(name): return f else: - return None \ No newline at end of file + return None + + def one_pass(self, class_names: List[str]) -> int: + total_patches =3D 0 + for f in self.files: + INFO("Scanning file %s", f.filename) + matches =3D list(f.scan_for_matches(class_names)) + INFO("Generating patches for file %s", f.filename) + f.gen_patches(matches) + total_patches +=3D len(f.patches) + if total_patches: + for f in self.files: + try: + f.apply_patches() + except PatchingError: + logger.exception("%s: failed to patch file", f.filenam= e) + return total_patches + + def patch_content(self, max_passes, class_names: List[str]) -> 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 + INFO("Running pass: %d", passes) + count =3D self.one_pass(class_names) + DBG("patch content: pass %d: %d patches generated", passes, co= unt) + total_patches +=3D count + DBG("%d patches applied total in %d passes", total_patches, passes) diff --git a/scripts/codeconverter/codeconverter/qom_macros.py b/scripts/co= deconverter/codeconverter/qom_macros.py index 68a33d5c6f..2d2f2055a3 100644 --- a/scripts/codeconverter/codeconverter/qom_macros.py +++ b/scripts/codeconverter/codeconverter/qom_macros.py @@ -23,16 +23,24 @@ WARN =3D logger.warning =20 RE_CONSTANT =3D OR(RE_STRING, RE_NUMBER) =20 -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' +class DefineDirective(FileMatch): + """Match any #define directive""" + regexp =3D S(r'^[ \t]*#[ \t]*define', CPP_SPACE, NAMED('name', RE_IDEN= TIFIER), r'\b') + +class ExpressionDefine(FileMatch): + """Simple #define preprocessor directive for an expression""" regexp =3D S(r'^[ \t]*#[ \t]*define', CPP_SPACE, NAMED('name', RE_IDEN= TIFIER), - CPP_SPACE, NAMED('value', RE_CONSTANT), r'[ \t]*\n') + CPP_SPACE, NAMED('value', RE_EXPRESSION), r'[ \t]*\n') =20 def provided_identifiers(self) -> Iterable[RequiredIdentifier]: yield RequiredIdentifier('constant', self.group('name')) =20 +class ConstantDefine(ExpressionDefine): + """Simple #define preprocessor directive for a number or string consta= nt""" + regexp =3D S(r'^[ \t]*#[ \t]*define', CPP_SPACE, NAMED('name', RE_IDEN= TIFIER), + CPP_SPACE, NAMED('value', RE_CONSTANT), r'[ \t]*\n') + + class TypeIdentifiers(NamedTuple): """Type names found in type declarations""" # TYPE_MYDEVICE @@ -236,13 +244,12 @@ 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 =20 @property def checker(self) -> CheckerMacroName: """Name of checker macro being used""" - return self.group('checker') + return self.group('checker') # type: ignore =20 @property def typedefname(self) -> Optional[str]: @@ -330,6 +337,8 @@ class TypeCheckMacro(FileMatch): instancetype=3Dinstancetype, uppercase=3Dup= percase) =20 def gen_patches(self) -> Iterable[Patch]: + # the implementation is a bit tricky because we need to group + # macros dealing with the same type into a single declaration if self.type_identifiers is None: self.warn("couldn't extract type information from macro %s", s= elf.name) return @@ -426,10 +435,61 @@ class TypeCheckMacro(FileMatch): yield self.prepend("/* FIXME: %s */\n" % (issue)) yield self.append(new_decl) =20 -class DeclareInstanceChecker(FileMatch): - """DECLARE_INSTANCE_CHECKER use - Will be replaced with DECLARE_OBJ_CHECKERS if possible +class InterfaceCheckMacro(FileMatch): + """Type checking macro using INTERFACE_CHECK + Will be replaced by DECLARE_INTERFACE_CHECKER """ + regexp =3D S(RE_MACRO_DEFINE, + 'INTERFACE_CHECK', + r'\s*\(\s*', OR(NAMED('instancetype', RE_IDENTIFIER), RE_TY= PE, name=3D'c_type'), + r'\s*,', CPP_SPACE, + OPTIONAL_PARS(RE_IDENTIFIER), r',', CPP_SPACE, + NAMED('qom_typename', RE_IDENTIFIER), r'\s*\)\n') + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + yield RequiredIdentifier('type', self.group('instancetype')) + yield RequiredIdentifier('constant', self.group('qom_typename')) + + def gen_patches(self) -> Iterable[Patch]: + if self.file.filename_matches('qom/object.h'): + self.debug("skipping object.h") + return + + typename =3D self.group('qom_typename') + uppercase =3D self.name + instancetype =3D self.group('instancetype') + c =3D f"DECLARE_INTERFACE_CHECKER({instancetype}, {uppercase},\n"+\ + f" {typename})\n" + yield self.make_patch(c) + + +class TypeDeclaration(FileMatch): + """Parent class to all type declarations""" + @property + def instancetype(self) -> Optional[str]: + return self.getgroup('instancetype') + + @property + def classtype(self) -> Optional[str]: + return self.getgroup('classtype') + + @property + def typename(self) -> Optional[str]: + return self.getgroup('typename') + +class TypeCheckerDeclaration(TypeDeclaration): + """Parent class to all type checker declarations""" + @property + def typename(self) -> str: + return self.group('typename') + + @property + def uppercase(self) -> str: + return self.group('uppercase') + +class DeclareInstanceChecker(TypeCheckerDeclaration): + """DECLARE_INSTANCE_CHECKER use""" #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 @@ -445,8 +505,45 @@ class DeclareInstanceChecker(FileMatch): yield RequiredIdentifier('constant', self.group('typename')) yield RequiredIdentifier('type', self.group('instancetype')) =20 -class DeclareClassCheckers(FileMatch): - """DECLARE_INSTANCE_CHECKER use""" +class DeclareInterfaceChecker(TypeCheckerDeclaration): + """DECLARE_INTERFACE_CHECKER use""" + regexp =3D S(r'^[ \t]*DECLARE_INTERFACE_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 DeclareInstanceType(TypeDeclaration): + """DECLARE_INSTANCE_TYPE use""" + regexp =3D S(r'^[ \t]*DECLARE_INSTANCE_TYPE\s*\(\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('instancetype', RE_TYPE), SP, + r'\)[ \t]*;?[ \t]*\n') + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + yield RequiredIdentifier('type', self.group('instancetype')) + +class DeclareClassType(TypeDeclaration): + """DECLARE_CLASS_TYPE use""" + regexp =3D S(r'^[ \t]*DECLARE_CLASS_TYPE\s*\(\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('classtype', RE_TYPE), SP, + r'\)[ \t]*;?[ \t]*\n') + + def required_identifiers(self) -> Iterable[RequiredIdentifier]: + yield RequiredIdentifier('include', '"qom/object.h"') + yield RequiredIdentifier('type', self.group('classtype')) + + + +class DeclareClassCheckers(TypeCheckerDeclaration): + """DECLARE_CLASS_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*', @@ -458,10 +555,8 @@ class DeclareClassCheckers(FileMatch): yield RequiredIdentifier('constant', self.group('typename')) yield RequiredIdentifier('type', self.group('classtype')) =20 -class DeclareObjCheckers(FileMatch): - """DECLARE_OBJ_CHECKERS use - Will be replaced with OBJECT_DECLARE_TYPE if possible - """ +class DeclareObjCheckers(TypeCheckerDeclaration): + """DECLARE_OBJ_CHECKERS use""" #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*', @@ -476,44 +571,121 @@ class DeclareObjCheckers(FileMatch): yield RequiredIdentifier('type', self.group('classtype')) yield RequiredIdentifier('type', self.group('instancetype')) =20 - 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) +class TypeDeclarationFixup(FileMatch): + """Common base class for code that will look at a set of type declarat= ions""" + regexp =3D RE_FILE_BEGIN + def gen_patches(self) -> Iterable[Patch]: + if self.file.filename_matches('qom/object.h'): + self.debug("skipping object.h") return =20 - if self.group('typename') !=3D 'TYPE_'+self.group('uppercase'): - self.warn("type %s mismatch with uppercase name %s", ids.typen= ame, ids.uppercase) - return + # group checkers by uppercase name: + decl_types: List[Type[TypeDeclaration]] =3D [DeclareInstanceChecke= r, DeclareInstanceType, + DeclareClassCheckers, D= eclareClassType, + DeclareObjCheckers] + checker_dict: Dict[str, List[TypeDeclaration]] =3D {} + for t in decl_types: + for m in self.file.matches_of_type(t): + checker_dict.setdefault(m.group('uppercase'), []).append(m) + self.debug("checker_dict: %r", checker_dict) + for uppercase,checkers in checker_dict.items(): + fields =3D ('instancetype', 'classtype', 'uppercase', 'typenam= e') + fvalues =3D dict((field, set(getattr(m, field) for m in checke= rs + if getattr(m, field, None) is not N= one)) + for field in fields) + for field,values in fvalues.items(): + if len(values) > 1: + for c in checkers: + c.warn("%s mismatch (%s)", field, ' '.join(values)) + return =20 - 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() + field_dict =3D dict((f, v.pop() if v else None) for f,v in fva= lues.items()) + yield from self.gen_patches_for_type(uppercase, checkers, fiel= d_dict) + + def find_conflicts(self, uppercase: str, checkers: List[TypeDeclaratio= n]) -> bool: + """Look for conflicting declarations that would make it unsafe to = add new ones""" + conflicting: List[FileMatch] =3D [] + # conflicts in the same file: + conflicting.extend(chain(self.file.find_matches(DefineDirective, u= ppercase), + self.file.find_matches(DeclareInterfaceCh= ecker, uppercase, 'uppercase'), + self.file.find_matches(DeclareClassType, = uppercase, 'uppercase'), + self.file.find_matches(DeclareInstanceTyp= e, uppercase, 'uppercase'))) + + # conflicts in another file: + conflicting.extend(o for o in chain(self.allfiles.find_matches(Dec= lareInstanceChecker, uppercase, 'uppercase'), + self.allfiles.find_matches(Dec= lareClassCheckers, uppercase, 'uppercase'), + self.allfiles.find_matches(Dec= lareInterfaceChecker, uppercase, 'uppercase'), + self.allfiles.find_matches(Def= ineDirective, uppercase)) + if o is not None and o.file !=3D self.file + # if both are .c files, there's no conflict= at all: + and not (o.file.filename.suffix =3D=3D '.c'= and + self.file.filename.suffix =3D=3D '.= c')) + + if conflicting: + for c in checkers: + c.warn("skipping due to conflicting %s macro", uppercase) + for o in conflicting: + if o is None: + continue + o.warn("conflicting %s macro is here", uppercase) + return True =20 - 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) + return False + + def gen_patches_for_type(self, uppercase: str, + checkers: List[TypeDeclaration], + fields: Dict[str, Optional[str]]) -> Iterable= [Patch]: + """Should be reimplemented by subclasses""" + return + yield + +class DeclareVoidTypes(TypeDeclarationFixup): + """Add DECLARE_*_TYPE(..., void) when there's no declared type""" + regexp =3D RE_FILE_BEGIN + def gen_patches_for_type(self, uppercase: str, + checkers: List[TypeDeclaration], + fields: Dict[str, Optional[str]]) -> Iterable= [Patch]: + if self.find_conflicts(uppercase, checkers): + return + + #_,last_checker =3D max((m.start(), m) for m in checkers) + _,first_checker =3D min((m.start(), m) for m in checkers) + + if not any(m.instancetype for m in checkers): + yield first_checker.prepend(f'DECLARE_INSTANCE_TYPE({uppercase= }, void)\n') + if not any(m.classtype for m in checkers): + yield first_checker.prepend(f'DECLARE_CLASS_TYPE({uppercase}, = void)\n') + + #if not all(len(v) =3D=3D 1 for v in fvalues.values()): + # return + # + #final_values =3D dict((field, values.pop()) + # for field,values in fvalues.items()) + #s =3D (f"DECLARE_OBJ_CHECKERS({final_values['instancetype']}, {fi= nal_values['classtype']},\n"+ + # f" {final_values['uppercase']}, {fina= l_values['typename']})\n") + #for c in checkers: + # yield c.make_removal_patch() + #yield last_checker.append(s) + + +class AddDeclareTypeName(TypeDeclarationFixup): + """Add DECLARE_TYPE_NAME declarations if necessary""" + def gen_patches_for_type(self, uppercase: str, + checkers: List[TypeDeclaration], + fields: Dict[str, Optional[str]]) -> Iterable= [Patch]: + typename =3D fields.get('typename') + if typename is None: + self.warn("typename unavailable") + return + if typename =3D=3D f'TYPE_{uppercase}': + self.info("already using TYPE_%s as type name", uppercase) + return + if self.file.find_match(DeclareTypeName, uppercase, 'uppercase'): + self.info("type name for %s already declared", uppercase) + return + _,first_checker =3D min((m.start(), m) for m in checkers) + s =3D f'DECLARE_TYPE_NAME({uppercase}, {typename})\n' + yield first_checker.prepend(s) =20 class TrivialClassStruct(FileMatch): """Trivial class struct""" @@ -527,14 +699,13 @@ class DeclareTypeName(FileMatch): OR(RE_IDENTIFIER, RE_STRING, RE_MACRO_CONCAT, RE_FUN_CALL, = name=3D'typename'), r'\s*\);?[ \t]*\n') =20 -class ObjectDeclareType(FileMatch): +class ObjectDeclareType(TypeCheckerDeclaration): """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') =20 @@ -549,14 +720,42 @@ class ObjectDeclareType(FileMatch): " %(uppercase)s, %(parent_struc= t)s)\n" % d) yield self.make_patch(c) =20 -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 +class ObjectDeclareSimpleType(TypeCheckerDeclaration): + """OBJECT_DECLARE_SIMPLE_TYPE usage""" + regexp =3D S(r'^[ \t]*OBJECT_DECLARE_SIMPLE_TYPE\s*\(', + NAMED('instancetype', RE_TYPE), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), SP, + r'\)[ \t]*;?[ \t]*\n') + +class OldStyleObjectDeclareSimpleType(TypeCheckerDeclaration): + """OBJECT_DECLARE_SIMPLE_TYPE usage (old API)""" + regexp =3D S(r'^[ \t]*OBJECT_DECLARE_SIMPLE_TYPE\s*\(', + NAMED('instancetype', RE_TYPE), r'\s*,\s*', + NAMED('lowercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('parent_classtype', RE_TYPE), SP, + r'\)[ \t]*;?[ \t]*\n') + + @property + def classtype(self) -> Optional[str]: + instancetype =3D self.instancetype + assert instancetype + return f"{instancetype}Class" + +def find_typename_uppercase(files: FileList, typename: str) -> Optional[st= r]: + """Try to find what's the right MODULE_OBJ_NAME for a given type name"= "" + decl =3D files.find_match(DeclareTypeName, name=3Dtypename, group=3D't= ypename') + if decl: + return decl.group('uppercase') + if typename.startswith('TYPE_'): + return typename[len('TYPE_'):] return None =20 +def find_type_checkers(files:FileList, name:str, group:str=3D'uppercase') = -> Iterable[TypeCheckerDeclaration]: + """Find usage of DECLARE*CHECKER macro""" + c: Type[TypeCheckerDeclaration] + for c in (DeclareInstanceChecker, DeclareClassCheckers, DeclareObjChec= kers, ObjectDeclareType, ObjectDeclareSimpleType): + yield from files.find_matches(c, name=3Dname, group=3Dgroup) =20 class Include(FileMatch): """#include directive""" @@ -586,9 +785,13 @@ class MoveSymbols(FileMatch): regexp =3D RE_FILE_BEGIN =20 def gen_patches(self) -> Iterator[Patch]: + if self.file.filename_matches('qom/object.h'): + self.debug("skipping object.h") + return + index: Dict[RequiredIdentifier, SymbolUserList] =3D {} definition_classes =3D [SimpleTypedefMatch, FullStructTypedefMatch= , ConstantDefine, Include] - user_classes =3D [TypeCheckMacro, DeclareObjCheckers, DeclareInsta= nceChecker, DeclareClassCheckers] + user_classes =3D [TypeCheckMacro, DeclareObjCheckers, DeclareInsta= nceChecker, DeclareClassCheckers, InterfaceCheckMacro] =20 # first we scan for all symbol definitions and usage: for dc in definition_classes: @@ -650,3 +853,9 @@ class MoveSymbols(FileMatch): 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) =20 + +class EmptyPreprocessorConditional(FileMatch): + """Delete empty preprocessor conditionals""" + regexp =3D r'^[ \t]*#(if|ifdef)[ \t].*\n+[ \t]*#endif[ \t]*\n' + def gen_patches(self) -> Iterable[Patch]: + yield self.make_removal_patch() diff --git a/scripts/codeconverter/codeconverter/qom_type_info.py b/scripts= /codeconverter/codeconverter/qom_type_info.py index fc02058739..255cb59923 100644 --- a/scripts/codeconverter/codeconverter/qom_type_info.py +++ b/scripts/codeconverter/codeconverter/qom_type_info.py @@ -24,11 +24,6 @@ RE_TI_FIELDS =3D M(RE_TI_FIELD_INIT) =20 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')) =20 ParsedArray =3D List[str] ParsedInitializerValue =3D Union[str, ParsedArray] @@ -36,26 +31,55 @@ 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) + +class ArrayItem(FileMatch): + regexp =3D RE_ARRAY_ITEM + +class ArrayInitializer(FileMatch): + regexp =3D RE_ARRAY + + def parsed(self) -> ParsedArray: + #DBG('parse_array: %r', m.group(0)) + return [m.group('arrayitem') for m in self.group_finditer(ArrayIte= m, 'arrayitems')] + +class FieldInitializer(FileMatch): + regexp =3D RE_TI_FIELD_INIT + + @property + def raw(self) -> str: + return self.group('value') + + @property + def parsed(self) -> ParsedInitializerValue: + parsed: ParsedInitializerValue =3D self.raw + #DBG("parse_initializer_value: %r", s) + array =3D self.try_group_match(ArrayInitializer, 'value') + if array: + assert isinstance(array, ArrayInitializer) + return array.parsed() + return parsed + +TypeInfoInitializers =3D Dict[str, FieldInitializer] + +class TypeDefinition(FileMatch): + """ + Common base class for type definitions (TypeInfo variables or OBJECT_D= EFINE* macros) """ - regexp =3D RE_TYPEINFO_DEF + @property + def instancetype(self) -> Optional[str]: + return self.group('instancetype') + + @property + def classtype(self) -> Optional[str]: + return self.group('classtype') + + @property + def uppercase(self) -> Optional[str]: + return self.group('uppercase') + + @property + def parent_uppercase(self) -> str: + return self.group('parent_uppercase') =20 @property def initializers(self) -> Optional[TypeInfoInitializers]: @@ -65,14 +89,26 @@ class TypeInfoVar(FileMatch): 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 + d =3D dict((fm.group('field'), fm) + for fm in self.group_finditer(FieldInitializer, 'fields'= )) + self._initializers =3D d # type: ignore + return self._initializers + + +class TypeInfoVar(TypeDefinition): + """TypeInfo variable declaration with initializer""" + regexp =3D S(NAMED('begin', RE_TYPEINFO_START), + M(NAMED('fields', RE_TI_FIELDS), + NAMED('endcomments', SP, RE_COMMENTS), + NAMED('end', r'};?\n'), + n=3D'?', name=3D'fullspec')) =20 def is_static(self) -> bool: return 'static' in self.group('modifiers') =20 + def is_const(self) -> bool: + return 'const' in self.group('modifiers') + def is_full(self) -> bool: return bool(self.group('fullspec')) =20 @@ -82,8 +118,46 @@ class TypeInfoVar(FileMatch): return {} return self.initializers =20 - def get_initializer_value(self, field: str) -> InitializerValue: - return self.get_initializers().get(field, InitializerValue('', '',= None)) + def get_raw_initializer_value(self, field: str, default: str =3D '') -= > str: + initializers =3D self.get_initializers() + if field in initializers: + return initializers[field].raw + else: + return default + + @property + def typename(self) -> Optional[str]: + return self.get_raw_initializer_value('name') + + @property + def uppercase(self) -> Optional[str]: + typename =3D self.typename + if not typename: + return None + if not typename.startswith('TYPE_'): + return None + return typename[len('TYPE_'):] + + @property + def classtype(self) -> Optional[str]: + class_size =3D self.get_raw_initializer_value('class_size') + if not class_size: + return None + m =3D re.fullmatch(RE_SIZEOF, class_size) + if not m: + return None + return m.group('sizeoftype') + + @property + def instancetype(self) -> Optional[str]: + instance_size =3D self.get_raw_initializer_value('instance_size') + if not instance_size: + return None + m =3D re.fullmatch(RE_SIZEOF, instance_size) + if not m: + return None + return m.group('sizeoftype') + =20 #def extract_identifiers(self) -> Optional[TypeIdentifiers]: # """Try to extract identifiers from names being used""" @@ -116,32 +190,105 @@ class TypeInfoVar(FileMatch): # uppercase=3Duppercase, lowercase=3Dlowerca= se, # instancetype=3Dinstancetype, classtype=3Dc= lasstype) =20 - def append_field(self, field, value) -> Patch: + def append_field(self, field: str, value: str) -> 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) + fm =3D self.group_match('fields') + assert fm + return fm.append(content) =20 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) + initializers =3D self.initializers + assert initializers + value =3D initializers.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) + return value.make_patch(replacement) + + def remove_field(self, field: str) -> Iterable[Patch]: + initializers =3D self.initializers + assert initializers + if field in initializers: + yield self.patch_field(field, '') + + def remove_fields(self, *fields: str) -> Iterable[Patch]: + for f in fields: + yield from self.remove_field(f) + + def patch_field_value(self, field: str, replacement: str) -> Patch: + """Replace just the value of a field initializer""" + initializers =3D self.initializers + assert initializers + value =3D initializers.get(field) + assert value + vm =3D value.group_match('value') + assert vm + return vm.make_patch(replacement) + + +class RemoveRedundantClassSize(TypeInfoVar): + """Remove class_size when using OBJECT_DECLARE_SIMPLE_TYPE""" + def gen_patches(self) -> Iterable[Patch]: + initializers =3D self.initializers + if initializers is None: + return + if 'class_size' not in initializers: + return + + self.debug("Handling %s", self.name) + m =3D re.fullmatch(RE_SIZEOF, initializers['class_size'].raw) + if not m: + self.warn("%s class_size is not sizeof?", self.name) + return + classtype =3D m.group('sizeoftype') + if not classtype.endswith('Class'): + self.warn("%s class size type (%s) is not *Class?", self.name,= classtype) + return + self.debug("classtype is %s", classtype) + instancetype =3D classtype[:-len('Class')] + self.debug("intanceypte is %s", instancetype) + self.debug("searching for simpletype declaration using %s as Insta= nceType", instancetype) + decl =3D self.allfiles.find_match(OldStyleObjectDeclareSimpleType, + instancetype, 'instancetype') + if not decl: + self.debug("No simpletype declaration found for %s", instancet= ype) + return + self.debug("Found simple type declaration") + decl.debug("declaration is here") + yield from self.remove_field('class_size') =20 +class RemoveDeclareSimpleTypeArg(OldStyleObjectDeclareSimpleType): + """Remove class_size when using OBJECT_DECLARE_SIMPLE_TYPE""" def gen_patches(self) -> Iterable[Patch]: + c =3D (f'OBJECT_DECLARE_SIMPLE_TYPE({self.group("instancetype")}, = {self.group("lowercase")},\n' + f' {self.group("uppercase")})\n') + yield self.make_patch(c) + +class UseDeclareTypeExtended(TypeInfoVar): + """Replace TypeInfo variable with OBJECT_DEFINE_TYPE_EXTENDED""" + def gen_patches(self) -> Iterable[Patch]: + # this will just ensure the caches for find_match() and matches_fo= r_type() + # will be loaded in advance: + find_type_checkers(self.allfiles, 'xxxxxxxxxxxxxxxxx') + + if not self.is_static(): + self.info("Skipping non-static TypeInfo variable") + return + + type_info_macro =3D self.file.find_match(TypeInfoMacro, self.name) + if not type_info_macro: + self.warn("TYPE_INFO(%s) line not found", self.name) + return + 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 @@ -167,49 +314,403 @@ class TypeInfoVar(FileMatch): self.warn("class_size is set to: %r", values['class_size']= .raw) return =20 - #NOTE: this will NOT work after declarations are converted - # to OBJECT_DECLARE* + #for t in (typename, parent_typename): + # if not re.fullmatch(RE_IDENTIFIER, t): + # self.info("type name is not a macro/constant") + # if instancetype or classtype: + # self.warn("macro/constant type name is required for i= nstance/class type") + # if not self.file.force: + # return =20 # 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')) + uppercase =3D find_typename_uppercase(self.allfiles, typename) + if not uppercase: + self.info("Can't find right uppercase name for %s", typename) + if instancetype or classtype: + self.warn("Can't find right uppercase name for %s", typena= me) + self.warn("This will make type validation difficult in the= future") + return =20 - 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: + parent_uppercase =3D find_typename_uppercase(self.allfiles, parent= _typename) + if not parent_uppercase: + self.info("Can't find right uppercase name for parent type (%s= )", parent_typename) + if instancetype or classtype: + self.warn("Can't find right uppercase name for parent type= (%s)", parent_typename) + self.warn("This will make type validation difficult in the= future") return =20 + ok =3D True + + #checkers: List[TypeCheckerDeclaration] =3D list(find_type_checker= s(self.allfiles, uppercase)) + #for c in checkers: + # c.info("instance type checker declaration (%s) is here", c.gr= oup('uppercase')) + #if not checkers: + # self.info("No type checkers declared for %s", uppercase) + # if instancetype or classtype: + # self.warn("Can't find where type checkers for %s (%s) are= declared. We will need them to validate sizes of %s", + # typename, uppercase, self.name) + + if not instancetype: + instancetype =3D 'void' + if not classtype: + classtype =3D 'void' + + #checker_instancetypes =3D set(c.instancetype for c in checkers + # if c.instancetype is not None) + #if len(checker_instancetypes) > 1: + # self.warn("ambiguous set of type checkers") + # for c in checkers: + # c.warn("instancetype is %s here", c.instancetype) + # ok =3D False + #elif len(checker_instancetypes) =3D=3D 1: + # checker_instancetype =3D checker_instancetypes.pop() + # DBG("checker instance type: %r", checker_instancetype) + # if instancetype !=3D checker_instancetype: + # self.warn("type at instance_size is %r. Should instance_= size be set to sizeof(%s) ?", + # instancetype, checker_instancetype) + # ok =3D False + #else: + # if instancetype !=3D 'void': + # self.warn("instance type checker for %s (%s) not found", = typename, instancetype) + # ok =3D False + + #checker_classtypes =3D set(c.classtype for c in checkers + # if c.classtype is not None) + #if len(checker_classtypes) > 1: + # self.warn("ambiguous set of type checkers") + # for c in checkers: + # c.warn("classtype is %s here", c.classtype) + # ok =3D False + #elif len(checker_classtypes) =3D=3D 1: + # checker_classtype =3D checker_classtypes.pop() + # DBG("checker class type: %r", checker_classtype) + # if classtype !=3D checker_classtype: + # self.warn("type at class_size is %r. Should class_size b= e set to sizeof(%s) ?", + # classtype, checker_classtype) + # ok =3D False + #else: + # if classtype !=3D 'void': + # self.warn("class type checker for %s (%s) not found", typ= ename, classtype) + # ok =3D False + + #if not ok: + # for c in checkers: + # c.warn("Type checker declaration for %s (%s) is here", + # typename, type(c).__name__) + # return + #if parent_decl is None: # self.warn("Can't find where parent type %s is declared", pare= nt_typename) =20 + #yield self.prepend(f'DECLARE_TYPE_NAME({uppercase}, {typename})\n= ') + #if not instancetype: + # yield self.prepend(f'DECLARE_INSTANCE_TYPE({uppercase}, void)= \n') + #if not classtype: + # yield self.prepend(f'DECLARE_CLASS_TYPE({uppercase}, void)\n') self.info("%s can be patched!", self.name) - return - yield + replaced_fields =3D ['name', 'parent', 'instance_size', 'class_siz= e'] + begin =3D self.group_match('begin') + newbegin =3D f'OBJECT_DEFINE_TYPE_EXTENDED({self.name},\n' + newbegin +=3D f' {instancetype}, {class= type},\n' + newbegin +=3D f' {uppercase}, {parent_u= ppercase}' + if set(values.keys()) - set(replaced_fields): + newbegin +=3D ',\n' + yield begin.make_patch(newbegin) + yield from self.remove_fields(*replaced_fields) + end =3D self.group_match('end') + yield end.make_patch(')\n') + yield type_info_macro.make_removal_patch() + +class ObjectDefineTypeExtended(TypeDefinition): + """OBJECT_DEFINE_TYPE_EXTENDED usage""" + regexp =3D S(r'^[ \t]*OBJECT_DEFINE_TYPE_EXTENDED\s*\(\s*', + NAMED('name', RE_IDENTIFIER), r'\s*,\s*', + NAMED('instancetype', RE_IDENTIFIER), r'\s*,\s*', + NAMED('classtype', RE_IDENTIFIER), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('parent_uppercase', RE_IDENTIFIER), + M(r',\s*\n', + NAMED('fields', RE_TI_FIELDS), + n=3D'?'), + r'\s*\);?\n?') + +class ObjectDefineType(TypeDefinition): + """OBJECT_DEFINE_TYPE usage""" + regexp =3D S(r'^[ \t]*OBJECT_DEFINE_TYPE\s*\(\s*', + NAMED('lowercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('uppercase', RE_IDENTIFIER), r'\s*,\s*', + NAMED('parent_uppercase', RE_IDENTIFIER), + M(r',\s*\n', + NAMED('fields', RE_TI_FIELDS), + n=3D'?'), + r'\s*\);?\n?') + +def find_type_definitions(files: FileList, uppercase: str) -> Iterable[Typ= eDefinition]: + types: List[Type[TypeDefinition]] =3D [TypeInfoVar, ObjectDefineType, = ObjectDefineTypeExtended] + for t in types: + for m in files.matches_of_type(t): + m.debug("uppercase: %s", m.uppercase) + yield from (m for t in types + for m in files.matches_of_type(t) + if m.uppercase =3D=3D uppercase) + +class AddDeclareVoidClassType(TypeDeclarationFixup): + """Will add DECLARE_CLASS_TYPE(..., void) if possible""" + def gen_patches_for_type(self, uppercase: str, + checkers: List[TypeDeclaration], + fields: Dict[str, Optional[str]]) -> Iterable= [Patch]: + defs =3D list(find_type_definitions(self.allfiles, uppercase)) + if len(defs) > 1: + self.warn("multiple definitions for %s", uppercase) + for d in defs: + d.warn("definition found here") + return + elif len(defs) =3D=3D 0: + self.warn("type definition for %s not found", uppercase) + return + d =3D defs[0] + if d.classtype is None: + d.info("definition for %s has classtype, skipping", uppercase) + return + class_type_checkers =3D [c for c in checkers + if c.classtype is not None] + if class_type_checkers: + for c in class_type_checkers: + c.warn("class type checker for %s is present here", upperc= ase) + return + + _,last_checker =3D max((m.start(), m) for m in checkers) + s =3D f'DECLARE_CLASS_TYPE({uppercase}, void)\n' + yield last_checker.append(s) + +class AddDeclareVoidInstanceType(FileMatch): + """Will add DECLARE_INSTANCE_TYPE(..., void) if possible""" + regexp =3D S(r'^[ \t]*#[ \t]*define', CPP_SPACE, + NAMED('name', r'TYPE_[a-zA-Z0-9_]+\b'), + CPP_SPACE, r'.*\n') + + def gen_patches(self) -> Iterable[Patch]: + assert self.name.startswith('TYPE_') + uppercase =3D self.name[len('TYPE_'):] + defs =3D list(find_type_definitions(self.allfiles, uppercase)) + if len(defs) > 1: + self.warn("multiple definitions for %s", uppercase) + for d in defs: + d.warn("definition found here") + return + elif len(defs) =3D=3D 0: + self.warn("type definition for %s not found", uppercase) + return + d =3D defs[0] + instancetype =3D d.instancetype + if instancetype is not None and instancetype !=3D 'void': + return + + instance_checkers =3D [c for c in find_type_checkers(self.allfiles= , uppercase) + if c.instancetype] + if instance_checkers: + d.warn("instance type checker for %s already declared", upperc= ase) + for c in instance_checkers: + c.warn("instance checker for %s is here", uppercase) + return + + s =3D f'DECLARE_INSTANCE_TYPE({uppercase}, void)\n' + yield self.append(s) + +class AddObjectDeclareType(DeclareObjCheckers): + """Will add OBJECT_DECLARE_TYPE(...) if possible""" + def gen_patches(self) -> Iterable[Patch]: + uppercase =3D self.uppercase + typename =3D self.group('typename') + instancetype =3D self.group('instancetype') + classtype =3D self.group('classtype') + + if typename !=3D f'TYPE_{uppercase}': + self.warn("type name mismatch: %s vs %s", typename, uppercase) + return + + typedefs =3D [(t,self.allfiles.find_matches(SimpleTypedefMatch, t)) + for t in (instancetype, classtype)] + for t,tds in typedefs: + if not tds: + self.warn("typedef %s not found", t) + return + for td in tds: + td_type =3D td.group('typedef_type') + if td_type !=3D f'struct {t}': + self.warn("typedef mismatch: %s is defined as %s", t, = td_type) + td.warn("typedef is here") + return + + # look for reuse of same struct type + other_instance_checkers =3D [c for c in find_type_checkers(self.al= lfiles, instancetype, 'instancetype') + if c.uppercase !=3D uppercase] + if other_instance_checkers: + self.warn("typedef %s is being reused", instancetype) + for ic in other_instance_checkers: + ic.warn("%s is reused here", instancetype) + if not self.file.force: + return + + decl_types: List[Type[TypeDeclaration]] =3D [DeclareClassCheckers,= DeclareObjCheckers] + class_decls =3D [m for t in decl_types + for m in self.allfiles.find_matches(t, uppercase, '= uppercase')] + + defs =3D list(find_type_definitions(self.allfiles, uppercase)) + if len(defs) > 1: + self.warn("multiple definitions for %s", uppercase) + for d in defs: + d.warn("definition found here") + if not self.file.force: + return + elif len(defs) =3D=3D 0: + self.warn("type definition for %s not found", uppercase) + if not self.file.force: + return + else: + d =3D defs[0] + if d.instancetype !=3D instancetype: + self.warn("mismatching instance type for %s (%s)", upperca= se, instancetype) + d.warn("instance type declared here (%s)", d.instancetype) + if not self.file.force: + return + if d.classtype !=3D classtype: + self.warn("mismatching class type for %s (%s)", uppercase,= classtype) + d.warn("class type declared here (%s)", d.classtype) + if not self.file.force: + return + + assert self.file.original_content + for t,tds in typedefs: + assert tds + for td in tds: + if td.file is not self.file: + continue + + # delete typedefs that are truly redundant: + # 1) defined after DECLARE_OBJ_CHECKERS + if td.start() > self.start(): + yield td.make_removal_patch() + # 2) defined before DECLARE_OBJ_CHECKERS, but unused + elif not re.search(r'\b'+t+r'\b', self.file.original_conte= nt[td.end():self.start()]): + yield td.make_removal_patch() + + c =3D (f'OBJECT_DECLARE_TYPE({instancetype}, {classtype}, {upperca= se})\n') + yield self.make_patch(c) + +class AddObjectDeclareSimpleType(DeclareInstanceChecker): + """Will add OBJECT_DECLARE_SIMPLE_TYPE(...) if possible""" + def gen_patches(self) -> Iterable[Patch]: + uppercase =3D self.uppercase + typename =3D self.group('typename') + instancetype =3D self.group('instancetype') + + if typename !=3D f'TYPE_{uppercase}': + self.warn("type name mismatch: %s vs %s", typename, uppercase) + return + + typedefs =3D [(t,self.allfiles.find_matches(SimpleTypedefMatch, t)) + for t in (instancetype,)] + for t,tds in typedefs: + if not tds: + self.warn("typedef %s not found", t) + return + for td in tds: + td_type =3D td.group('typedef_type') + if td_type !=3D f'struct {t}': + self.warn("typedef mismatch: %s is defined as %s", t, = td_type) + td.warn("typedef is here") + return + + # look for reuse of same struct type + other_instance_checkers =3D [c for c in find_type_checkers(self.al= lfiles, instancetype, 'instancetype') + if c.uppercase !=3D uppercase] + if other_instance_checkers: + self.warn("typedef %s is being reused", instancetype) + for ic in other_instance_checkers: + ic.warn("%s is reused here", instancetype) + if not self.file.force: + return + + decl_types: List[Type[TypeDeclaration]] =3D [DeclareClassCheckers,= DeclareObjCheckers] + class_decls =3D [m for t in decl_types + for m in self.allfiles.find_matches(t, uppercase, '= uppercase')] + if class_decls: + self.warn("class type declared for %s", uppercase) + for cd in class_decls: + cd.warn("class declaration found here") + return + + defs =3D list(find_type_definitions(self.allfiles, uppercase)) + if len(defs) > 1: + self.warn("multiple definitions for %s", uppercase) + for d in defs: + d.warn("definition found here") + if not self.file.force: + return + elif len(defs) =3D=3D 0: + self.warn("type definition for %s not found", uppercase) + if not self.file.force: + return + else: + d =3D defs[0] + if d.instancetype !=3D instancetype: + self.warn("mismatching instance type for %s (%s)", upperca= se, instancetype) + d.warn("instance type declared here (%s)", d.instancetype) + if not self.file.force: + return + if d.classtype: + self.warn("class type set for %s", uppercase) + d.warn("class type declared here") + if not self.file.force: + return + + assert self.file.original_content + for t,tds in typedefs: + assert tds + for td in tds: + if td.file is not self.file: + continue + + # delete typedefs that are truly redundant: + # 1) defined after DECLARE_OBJ_CHECKERS + if td.start() > self.start(): + yield td.make_removal_patch() + # 2) defined before DECLARE_OBJ_CHECKERS, but unused + elif not re.search(r'\b'+t+r'\b', self.file.original_conte= nt[td.end():self.start()]): + yield td.make_removal_patch() + + c =3D (f'OBJECT_DECLARE_SIMPLE_TYPE({instancetype}, {uppercase})\n= ') + yield self.make_patch(c) + + +class TypeInfoStringName(TypeInfoVar): + """Replace hardcoded type names with TYPE_ constant""" + 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 re.fullmatch(RE_IDENTIFIER, typename): + return + + self.warn("name %s is not an identifier", typename) + #all_defines =3D [m for m in self.allfiles.matches_of_type(Express= ionDefine)] + #self.debug("all_defines: %r", all_defines) + constants =3D [m for m in self.allfiles.matches_of_type(Expression= Define) + if m.group('value').strip() =3D=3D typename.strip()] + if not constants: + self.warn("No macro for %s found", typename) + return + if len(constants) > 1: + self.warn("I don't know which macro to use: %r", constants) + return + yield self.patch_field_value('name', constants[0].name) =20 class RedundantTypeSizes(TypeInfoVar): """Remove redundant instance_size/class_size from TypeInfo vars""" @@ -230,8 +731,8 @@ class RedundantTypeSizes(TypeInfoVar): self.debug("no need to validate %s", self.name) return =20 - instance_decl =3D find_type_declaration(self.allfiles, typename) - if instance_decl: + instance_decls =3D find_type_checkers(self.allfiles, typename) + if instance_decls: self.debug("won't touch TypeInfo var that has type checkers") return =20 @@ -240,12 +741,12 @@ class RedundantTypeSizes(TypeInfoVar): self.warn("Can't find TypeInfo for %s", parent_typename) return =20 - if 'instance_size' in values and parent.get_initializer_value('ins= tance_size').raw !=3D values['instance_size'].raw: + if 'instance_size' in values and parent.get_raw_initializer_value(= 'instance_size') !=3D values['instance_size'].raw: self.info("instance_size mismatch") parent.info("parent type declared here") return =20 - if 'class_size' in values and parent.get_initializer_value('class_= size').raw !=3D values['class_size'].raw: + if 'class_size' in values and parent.get_raw_initializer_value('cl= ass_size') !=3D values['class_size'].raw: self.info("class_size mismatch") parent.info("parent type declared here") return @@ -303,10 +804,11 @@ class RedundantTypeSizes(TypeInfoVar): # yield self.append_field('class_init', ids.lowercase+'_cla= ss_init') =20 class TypeInitMacro(FileMatch): - """type_init(...) macro use - Will be deleted if function is empty - """ + """Use of type_init(...) macro""" regexp =3D S(r'^[ \t]*type_init\s*\(\s*', NAMED('name', RE_IDENTIFIER)= , r'\s*\);?[ \t]*\n') + +class DeleteEmptyTypeInitFunc(TypeInitMacro): + """Delete empty function declared using type_init(...)""" def gen_patches(self) -> Iterable[Patch]: fn =3D self.file.find_match(StaticVoidFunction, self.name) DBG("function for %s: %s", self.name, fn) @@ -331,7 +833,7 @@ class StaticVoidFunction(FileMatch): r'#[^\n]*\n', r'\n', repeat=3D'*')), - r'}\n') + r'};?\n') =20 @property def body(self) -> str: @@ -340,34 +842,40 @@ class StaticVoidFunction(FileMatch): def has_preprocessor_directive(self) -> bool: return bool(re.search(r'^[ \t]*#', self.body, re.MULTILINE)) =20 -class TypeRegisterCall(FileMatch): +def find_containing_func(m: FileMatch) -> Optional['StaticVoidFunction']: + """Return function containing this match""" + for fn in m.file.matches_of_type(StaticVoidFunction): + if fn.contains(m): + return fn + return None + +class TypeRegisterStaticCall(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 + regexp =3D S(r'^[ \t]*', NAMED('func_name', 'type_register_static'), + r'\s*\(&\s*', NAMED('name', RE_IDENTIFIER), r'\s*\);[ \t]*\= n') =20 +class UseTypeInfo(TypeRegisterStaticCall): + """Replace type_register_static() call with TYPE_INFO declaration""" 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 + fn =3D find_containing_func(self) + if fn: + DBG("%r is inside %r", self, fn) + 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) + if not self.file.force: + return + else: + self.warn("can't identify the function where type_register_sta= tic(&%s) is called", self.name) + if not self.file.force: + return =20 #if fn.has_preprocessor_directive() and not self.file.force: # self.warn("function %s has preprocessor directives, this requ= ires --force", fn.name) # return =20 - 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) @@ -375,24 +883,51 @@ class TypeRegisterCall(FileMatch): =20 if not var.is_full(): self.warn("variable declaration %s wasn't parsed fully", var.n= ame) - return + if not self.file.force: + return =20 - if fn.contains(var): + if fn and fn.contains(var): self.warn("TypeInfo %s variable is inside a function", self.na= me) - return + if not self.file.force: + return =20 # delete type_register_static() call: yield self.make_patch('') # append TYPE_REGISTER(...) after variable declaration: yield var.append(f'TYPE_INFO({self.name})\n') =20 +class TypeRegisterCall(FileMatch): + """type_register_static() call""" + regexp =3D S(r'^[ \t]*', NAMED('func_name', 'type_register'), + r'\s*\(&\s*', NAMED('name', RE_IDENTIFIER), r'\s*\);[ \t]*\= n') + +class MakeTypeRegisterStatic(TypeRegisterCall): + """Make type_register() call static if variable is static const""" + def gen_patches(self): + 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 var.is_static() and var.is_const(): + yield self.group_match('func_name').make_patch('type_register_= static') + +class MakeTypeRegisterNotStatic(TypeRegisterStaticCall): + """Make type_register() call static if variable is static const""" + def gen_patches(self): + 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_static() or not var.is_const(): + yield self.group_match('func_name').make_patch('type_register') + 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') =20 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] + if ti.get_raw_initializer_value('name') =3D=3D name] DBG("type info vars: %r", ti) if len(ti) > 1: DBG("multiple TypeInfo vars found for %s", name) diff --git a/scripts/codeconverter/codeconverter/test_patching.py b/scripts= /codeconverter/codeconverter/test_patching.py index 5998af81c9..71dfbd47e1 100644 --- a/scripts/codeconverter/codeconverter/test_patching.py +++ b/scripts/codeconverter/codeconverter/test_patching.py @@ -31,7 +31,6 @@ def test_pattern_patching(): 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] @@ -40,7 +39,7 @@ def test_pattern_patching(): f.patches.append(p2.append('XXX')) =20 # apply all patches: - f.gen_patches() + f.gen_patches(matches) patched =3D f.get_patched_content() assert patched =3D=3D ('one line\n'+ 'this pattern will be patched: defBBBBBhij\n'+ diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/= codeconverter/codeconverter/test_regexps.py index 9b84d689a6..a445634d88 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -9,7 +9,7 @@ from .regexps import * from .qom_macros import * from .qom_type_info import * =20 -def test_res(): +def test_res() -> None: def fullmatch(regexp, s): return re.fullmatch(regexp, s, re.MULTILINE) =20 @@ -113,10 +113,10 @@ static const TypeInfo char_file_type_info =3D { * need to set up reset or vmstate, and has no realize method. */''') =20 - print(RE_TYPEINFO_DEF) + print(TypeInfoVar.regexp) test_empty =3D 'static const TypeInfo x86_base_cpu_type_info =3D {\n'+\ '};\n'; - assert fullmatch(RE_TYPEINFO_DEF, test_empty) + assert fullmatch(TypeInfoVar.regexp, test_empty) =20 test_simple =3D r''' static const TypeInfo x86_base_cpu_type_info =3D { @@ -125,7 +125,7 @@ static const TypeInfo char_file_type_info =3D { .class_init =3D x86_cpu_base_class_init, }; ''' - assert re.search(RE_TYPEINFO_DEF, test_simple, re.MULTILINE) + assert re.search(TypeInfoVar.regexp, test_simple, re.MULTILINE) =20 test_interfaces =3D r''' static const TypeInfo acpi_ged_info =3D { @@ -141,7 +141,7 @@ static const TypeInfo char_file_type_info =3D { } }; ''' - assert re.search(RE_TYPEINFO_DEF, test_interfaces, re.MULTILINE) + assert re.search(TypeInfoVar.regexp, test_interfaces, re.MULTILINE) =20 test_comments =3D r''' static const TypeInfo palm_misc_gpio_info =3D { @@ -155,7 +155,7 @@ static const TypeInfo char_file_type_info =3D { */ }; ''' - assert re.search(RE_TYPEINFO_DEF, test_comments, re.MULTILINE) + assert re.search(TypeInfoVar.regexp, test_comments, re.MULTILINE) =20 test_comments =3D r''' static const TypeInfo tpm_crb_info =3D { @@ -170,7 +170,7 @@ static const TypeInfo char_file_type_info =3D { } }; ''' - assert re.search(RE_TYPEINFO_DEF, test_comments, re.MULTILINE) + assert re.search(TypeInfoVar.regexp, test_comments, re.MULTILINE) =20 def test_struct_re(): print('---') @@ -232,8 +232,8 @@ def test_initial_includes(): =20 /* 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) + print(repr(list(m.groupdict() for m in InitialIncludes.finditer(c)))) + m =3D InitialIncludes.domatch(c) assert m print(repr(m.group(0))) assert m.group(0).endswith('#include "exec/hwaddr.h"\n') @@ -247,8 +247,8 @@ def test_initial_includes(): =20 =20 ''' - 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) + print(repr(list(m.groupdict() for m in InitialIncludes.finditer(c)))) + m =3D InitialIncludes.domatch(c) assert m print(repr(m.group(0))) assert m.group(0).endswith('#include "9p.h"\n') @@ -274,8 +274,8 @@ def test_initial_includes(): /* 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) + print(repr(list(m.groupdict() for m in InitialIncludes.finditer(c)))) + m =3D InitialIncludes.domatch(c) assert m print(repr(m.group(0))) assert m.group(0).endswith('#include "sysemu/dma.h"\n') diff --git a/scripts/codeconverter/converter.py b/scripts/codeconverter/con= verter.py index ebaf9b57ce..75cb515d93 100755 --- a/scripts/codeconverter/converter.py +++ b/scripts/codeconverter/converter.py @@ -42,7 +42,7 @@ def process_all_files(parser: argparse.ArgumentParser, ar= gs: argparse.Namespace) for t in f.matches_of_type(TypeInfoVar): assert isinstance(t, TypeInfoVar) values =3D [f.filename, t.name] + \ - [t.get_initializer_value(f).raw + [t.get_raw_initializer_value(f) for f in TI_FIELDS] DBG('values: %r', values) assert all('\t' not in v for v in values) @@ -55,18 +55,18 @@ def process_all_files(parser: argparse.ArgumentParser, = args: argparse.Namespace) parser.error("--pattern is required") =20 classes =3D [p for arg in args.patterns - for p in re.split(r'[\s,]', arg)] + for p in re.split(r'[\s,]', arg) + if p.strip()] for c in classes: - if c not in match_classes: + if c not in match_classes \ + or not match_classes[c].regexp: print("Invalid pattern name: %s" % (c), file=3Dsys.stderr) print("Valid patterns:", file=3Dsys.stderr) print(PATTERN_HELP, file=3Dsys.stderr) sys.exit(1) =20 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) + files.patch_content(max_passes=3Dargs.passes, class_names=3Dclasses) =20 for f in files: #alltypes.extend(f.type_infos) --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463419; cv=none; d=zohomail.com; s=zohoarc; b=PjAZZ8j1tMQG45a5HWGBy5UVrBmb0mj4lqbAGsULlQI/fRLwN+9lFrvStdFytuOojQBDuM/MHqbm05RtZ326l8c1wXX+fFi/x7QtI+9K7i5naVIh0H+TVDgBqTeTzDcuYt06D8tQ50+ZSMQ3TUrVm8vJW4Xf5GYVwxsqI/K3F3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463419; 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=Dq2+7u+khPzOPlDY5G6qJY6UYDq+gnrc/aJR4q4AyUY=; b=AdTXP14Lrnvud7ViNUfB+Qy4blA6QCHBoz8Z9Q4VI07d5klENyl88SR/FoSF/AY4T1HD3oIQD3AivO8y0o8hOcyMcIVVNY+fHx5DD99mm0ZclsYxzLky9AgIEtLPjM1MgjSFEF+/fT6DS8uQdcsIK5qHlfVLThq0CHQj6mYz3QQ= 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 1600463419831995.4068593501382; Fri, 18 Sep 2020 14:10:19 -0700 (PDT) Received: from localhost ([::1]:58908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNe6-0001vO-84 for importer@patchew.org; Fri, 18 Sep 2020 17:10:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIJ-0002iA-3A for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNI8-0006K3-0C for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47: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-293-7SFRL9KiPHaZPcmmMLwdKA-1; Fri, 18 Sep 2020 16:47:31 -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 DE5E3801AAD; Fri, 18 Sep 2020 20:47:30 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87D6555776; Fri, 18 Sep 2020 20:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462054; 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=Dq2+7u+khPzOPlDY5G6qJY6UYDq+gnrc/aJR4q4AyUY=; b=K3xh2g/W4jUVJN9ue0hlCyFbC9vCgA0SVaDK00YD/zgKDLv1DWuDKNiKsgaYbo6KRy3oaO fGChX2/HxWzV0mWOBGqsJO3b/3V35d/9u01yFG7dpA9BD1y0DICN2o7vQbZV68t8CHifb9 0IUbEAvPZ5xOrxXcF6R4Wdr6VjGmj7c= X-MC-Unique: 7SFRL9KiPHaZPcmmMLwdKA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 14/17] qom: Remove ParentClassType argument from OBJECT_DECLARE_SIMPLE_TYPE Date: Fri, 18 Sep 2020 16:47:11 -0400 Message-Id: <20200918204714.27276-15-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 01:32:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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) The requirement to specify the parent class type makes the macro harder to use and easy to misuse (silent bugs can be introduced if the wrong struct type is specified). Simplify the macro by just not declaring any class struct, allowing us to remove the class_size field from the TypeInfo variables for those types. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200916182519.415636-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/authz/list.h | 2 +- include/authz/listfile.h | 2 +- include/authz/pamacct.h | 2 +- include/authz/simple.h | 2 +- include/crypto/secret_keyring.h | 2 +- include/io/dns-resolver.h | 2 +- include/io/net-listener.h | 2 +- include/qom/object.h | 16 ++++++++-------- include/sysemu/vhost-user-backend.h | 2 +- authz/list.c | 1 - authz/listfile.c | 1 - authz/pamacct.c | 1 - authz/simple.c | 1 - backends/dbus-vmstate.c | 3 +-- backends/vhost-user.c | 1 - crypto/secret_keyring.c | 1 - io/dns-resolver.c | 1 - io/net-listener.c | 1 - ui/input-barrier.c | 3 +-- ui/input-linux.c | 3 +-- 20 files changed, 19 insertions(+), 30 deletions(-) diff --git a/include/authz/list.h b/include/authz/list.h index 5676bb375c..c5eda0f1bf 100644 --- a/include/authz/list.h +++ b/include/authz/list.h @@ -28,7 +28,7 @@ #define TYPE_QAUTHZ_LIST "authz-list" =20 OBJECT_DECLARE_SIMPLE_TYPE(QAuthZList, qauthz_list, - QAUTHZ_LIST, QAuthZClass) + QAUTHZ_LIST) =20 =20 =20 diff --git a/include/authz/listfile.h b/include/authz/listfile.h index b491227bbe..83d78cfa50 100644 --- a/include/authz/listfile.h +++ b/include/authz/listfile.h @@ -28,7 +28,7 @@ #define TYPE_QAUTHZ_LIST_FILE "authz-list-file" =20 OBJECT_DECLARE_SIMPLE_TYPE(QAuthZListFile, qauthz_list_file, - QAUTHZ_LIST_FILE, QAuthZClass) + QAUTHZ_LIST_FILE) =20 =20 =20 diff --git a/include/authz/pamacct.h b/include/authz/pamacct.h index 7804853ddf..18087cee20 100644 --- a/include/authz/pamacct.h +++ b/include/authz/pamacct.h @@ -28,7 +28,7 @@ #define TYPE_QAUTHZ_PAM "authz-pam" =20 OBJECT_DECLARE_SIMPLE_TYPE(QAuthZPAM, qauthz_pam, - QAUTHZ_PAM, QAuthZClass) + QAUTHZ_PAM) =20 =20 =20 diff --git a/include/authz/simple.h b/include/authz/simple.h index 346fcb0c6c..d3ed05b36f 100644 --- a/include/authz/simple.h +++ b/include/authz/simple.h @@ -27,7 +27,7 @@ #define TYPE_QAUTHZ_SIMPLE "authz-simple" =20 OBJECT_DECLARE_SIMPLE_TYPE(QAuthZSimple, qauthz_simple, - QAUTHZ_SIMPLE, QAuthZClass) + QAUTHZ_SIMPLE) =20 =20 =20 diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyrin= g.h index 73d2a8f501..803f3fc28b 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -27,7 +27,7 @@ =20 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" OBJECT_DECLARE_SIMPLE_TYPE(QCryptoSecretKeyring, qcrypto_secret_keyring, - QCRYPTO_SECRET_KEYRING, QCryptoSecretCommonClas= s) + QCRYPTO_SECRET_KEYRING) =20 =20 struct QCryptoSecretKeyring { diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h index e248fba5bd..9d14a8d98f 100644 --- a/include/io/dns-resolver.h +++ b/include/io/dns-resolver.h @@ -27,7 +27,7 @@ =20 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver" OBJECT_DECLARE_SIMPLE_TYPE(QIODNSResolver, qio_dns_resolver, - QIO_DNS_RESOLVER, ObjectClass) + QIO_DNS_RESOLVER) =20 =20 /** diff --git a/include/io/net-listener.h b/include/io/net-listener.h index 60fad29ff4..8145962fbb 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -26,7 +26,7 @@ =20 #define TYPE_QIO_NET_LISTENER "qio-net-listener" OBJECT_DECLARE_SIMPLE_TYPE(QIONetListener, qio_net_listener, - QIO_NET_LISTENER, ObjectClass) + QIO_NET_LISTENER) =20 =20 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener, diff --git a/include/qom/object.h b/include/qom/object.h index 405a2c67b0..d5814bd11d 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -639,19 +639,19 @@ struct Object * @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 - * @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 - * manually. + * This does the same as OBJECT_DECLARE_TYPE(), but with no class struct + * declared. * * This macro should be used unless the class struct needs to have * virtual methods declared. */ -#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; }; +#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, module_obj_name, MODULE_O= BJ_NAME) \ + typedef struct InstanceType InstanceType; \ + \ + G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \ + \ + DECLARE_INSTANCE_CHECKER(InstanceType, MODULE_OBJ_NAME, TYPE_##MODULE_= OBJ_NAME) =20 =20 /** diff --git a/include/sysemu/vhost-user-backend.h b/include/sysemu/vhost-use= r-backend.h index 23205edeb8..41d5ff43bd 100644 --- a/include/sysemu/vhost-user-backend.h +++ b/include/sysemu/vhost-user-backend.h @@ -23,7 +23,7 @@ =20 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend" OBJECT_DECLARE_SIMPLE_TYPE(VhostUserBackend, vhost_user_backend, - VHOST_USER_BACKEND, ObjectClass) + VHOST_USER_BACKEND) =20 =20 =20 diff --git a/authz/list.c b/authz/list.c index 8e904bfc93..28b990931a 100644 --- a/authz/list.c +++ b/authz/list.c @@ -252,7 +252,6 @@ static const TypeInfo qauthz_list_info =3D { .name =3D TYPE_QAUTHZ_LIST, .instance_size =3D sizeof(QAuthZList), .instance_finalize =3D qauthz_list_finalize, - .class_size =3D sizeof(QAuthZListClass), .class_init =3D qauthz_list_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/authz/listfile.c b/authz/listfile.c index 666df872ad..cd6163aa40 100644 --- a/authz/listfile.c +++ b/authz/listfile.c @@ -263,7 +263,6 @@ static const TypeInfo qauthz_list_file_info =3D { .instance_init =3D qauthz_list_file_init, .instance_size =3D sizeof(QAuthZListFile), .instance_finalize =3D qauthz_list_file_finalize, - .class_size =3D sizeof(QAuthZListFileClass), .class_init =3D qauthz_list_file_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/authz/pamacct.c b/authz/pamacct.c index 3c6be43916..c91593bbd8 100644 --- a/authz/pamacct.c +++ b/authz/pamacct.c @@ -129,7 +129,6 @@ static const TypeInfo qauthz_pam_info =3D { .name =3D TYPE_QAUTHZ_PAM, .instance_size =3D sizeof(QAuthZPAM), .instance_finalize =3D qauthz_pam_finalize, - .class_size =3D sizeof(QAuthZPAMClass), .class_init =3D qauthz_pam_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/authz/simple.c b/authz/simple.c index 84954b80a5..ee061e980d 100644 --- a/authz/simple.c +++ b/authz/simple.c @@ -96,7 +96,6 @@ static const TypeInfo qauthz_simple_info =3D { .name =3D TYPE_QAUTHZ_SIMPLE, .instance_size =3D sizeof(QAuthZSimple), .instance_finalize =3D qauthz_simple_finalize, - .class_size =3D sizeof(QAuthZSimpleClass), .class_init =3D qauthz_simple_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index a13461edea..5bffbc4906 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -24,7 +24,7 @@ =20 #define TYPE_DBUS_VMSTATE "dbus-vmstate" OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, dbus_vmstate, - DBUS_VMSTATE, ObjectClass) + DBUS_VMSTATE) =20 =20 struct DBusVMState { @@ -483,7 +483,6 @@ static const TypeInfo dbus_vmstate_info =3D { .parent =3D TYPE_OBJECT, .instance_size =3D sizeof(DBusVMState), .instance_finalize =3D dbus_vmstate_finalize, - .class_size =3D sizeof(DBusVMStateClass), .class_init =3D dbus_vmstate_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/backends/vhost-user.c b/backends/vhost-user.c index 9e6e198546..ae8362d721 100644 --- a/backends/vhost-user.c +++ b/backends/vhost-user.c @@ -197,7 +197,6 @@ static const TypeInfo vhost_user_backend_info =3D { .instance_size =3D sizeof(VhostUserBackend), .instance_init =3D vhost_user_backend_init, .instance_finalize =3D vhost_user_backend_finalize, - .class_size =3D sizeof(VhostUserBackendClass), }; =20 static void register_types(void) diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index 8bfc58ebf4..10d8bc48a0 100644 --- a/crypto/secret_keyring.c +++ b/crypto/secret_keyring.c @@ -129,7 +129,6 @@ static const TypeInfo qcrypto_secret_info =3D { .parent =3D TYPE_QCRYPTO_SECRET_COMMON, .name =3D TYPE_QCRYPTO_SECRET_KEYRING, .instance_size =3D sizeof(QCryptoSecretKeyring), - .class_size =3D sizeof(QCryptoSecretKeyringClass), .class_init =3D qcrypto_secret_keyring_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/io/dns-resolver.c b/io/dns-resolver.c index 6ebe2a5650..b55d8cc3fe 100644 --- a/io/dns-resolver.c +++ b/io/dns-resolver.c @@ -267,7 +267,6 @@ static const TypeInfo qio_dns_resolver_info =3D { .parent =3D TYPE_OBJECT, .name =3D TYPE_QIO_DNS_RESOLVER, .instance_size =3D sizeof(QIODNSResolver), - .class_size =3D sizeof(QIODNSResolverClass), }; =20 =20 diff --git a/io/net-listener.c b/io/net-listener.c index 5d8a226872..46c2643d00 100644 --- a/io/net-listener.c +++ b/io/net-listener.c @@ -307,7 +307,6 @@ static const TypeInfo qio_net_listener_info =3D { .name =3D TYPE_QIO_NET_LISTENER, .instance_size =3D sizeof(QIONetListener), .instance_finalize =3D qio_net_listener_finalize, - .class_size =3D sizeof(QIONetListenerClass), }; =20 =20 diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 87543a3399..b76697be93 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -21,7 +21,7 @@ =20 #define TYPE_INPUT_BARRIER "input-barrier" OBJECT_DECLARE_SIMPLE_TYPE(InputBarrier, input_barrier, - INPUT_BARRIER, ObjectClass) + INPUT_BARRIER) =20 =20 #define MAX_HELLO_LENGTH 1024 @@ -723,7 +723,6 @@ static void input_barrier_class_init(ObjectClass *oc, v= oid *data) static const TypeInfo input_barrier_info =3D { .name =3D TYPE_INPUT_BARRIER, .parent =3D TYPE_OBJECT, - .class_size =3D sizeof(InputBarrierClass), .class_init =3D input_barrier_class_init, .instance_size =3D sizeof(InputBarrier), .instance_init =3D input_barrier_instance_init, diff --git a/ui/input-linux.c b/ui/input-linux.c index 5d501c8360..f02557b012 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -32,7 +32,7 @@ static bool linux_is_button(unsigned int lnx) =20 #define TYPE_INPUT_LINUX "input-linux" OBJECT_DECLARE_SIMPLE_TYPE(InputLinux, input_linux, - INPUT_LINUX, ObjectClass) + INPUT_LINUX) =20 =20 struct InputLinux { @@ -514,7 +514,6 @@ static void input_linux_class_init(ObjectClass *oc, voi= d *data) static const TypeInfo input_linux_info =3D { .name =3D TYPE_INPUT_LINUX, .parent =3D TYPE_OBJECT, - .class_size =3D sizeof(InputLinuxClass), .class_init =3D input_linux_class_init, .instance_size =3D sizeof(InputLinux), .instance_init =3D input_linux_instance_init, --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600466319; cv=none; d=zohomail.com; s=zohoarc; b=Bzb2zfNYmSQZI2HikUFWETccb1nBppv1QpFavsbWPnfuccVIYHtpVoZI+2Cl/SkwcwL4ALwXtHdXTbL7gdIOnbw/ynaB1wH6yiX6Hrwsv85iEyVPGCjDAptPtz2S2Jdn1zsq8dTyfVIrr1Uj70AI5+kPqQkWvMJkWN/lf4eMLVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600466319; 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=Gr0iBdt1Us0ux1iBna11GoL0D+oqbGwMXL2vaW73d54=; b=RYVJ1BziZXPu9D45Cl8F8Pln2haKsmOClk/g1GeRadWHiOLmTOPlRT0+T7Abubi/gna0WprN2T/Ji7eamZvwgvRJEl1AmhfCkESBzHFUV658mgT5SUvOU7BGfW6YR2/B14R3EfzfQbIu2ELQZIx1jRREEc5ClwgBcnlvqG9Pb8w= 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 1600466318975486.32777911678306; Fri, 18 Sep 2020 14:58:38 -0700 (PDT) Received: from localhost ([::1]:42752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJOOr-0008Jp-8h for importer@patchew.org; Fri, 18 Sep 2020 17:58:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIL-0002kv-D1 for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNID-0006KE-GQ for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:49 -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-200-qatN9zrfPB6K5agJEw5FBQ-1; Fri, 18 Sep 2020 16:47:33 -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 30D586415A; Fri, 18 Sep 2020 20:47:32 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACE135D9D5; Fri, 18 Sep 2020 20:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462055; 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=Gr0iBdt1Us0ux1iBna11GoL0D+oqbGwMXL2vaW73d54=; b=O+4pZO9R1PntPvt/bcJ/LVYn3oEQhF/5+da5h6wMv9/XiIK79QnMZmF7ApqrV5OHmeL4GO 86B2jygAgFwGJ4wZGYaSWC+iv+YHW1pQPhlJdyDZNRVMcFvY6RXJu2Q1lMqfnNmfn04Dwe RR7KGda9XZidOPiqhMWW9OKvC4bZ3Q0= X-MC-Unique: qatN9zrfPB6K5agJEw5FBQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 15/17] qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros Date: Fri, 18 Sep 2020 16:47:12 -0400 Message-Id: <20200918204714.27276-16-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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: Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paul Durrant , Cornelia Huck , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Igor Mammedov , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) One of the goals of having less boilerplate on QOM declarations is to avoid human error. Requiring an extra argument that is never used is an opportunity for mistakes. Remove the unused argument from OBJECT_DECLARE_TYPE and OBJECT_DECLARE_SIMPLE_TYPE. Coccinelle patch used to convert all users of the macros: @@ declarer name OBJECT_DECLARE_TYPE; identifier InstanceType, ClassType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_TYPE(InstanceType, ClassType, - lowercase, UPPERCASE); @@ declarer name OBJECT_DECLARE_SIMPLE_TYPE; identifier InstanceType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, - lowercase, UPPERCASE); Signed-off-by: Eduardo Habkost Reviewed-by: C=C3=A9dric Le Goater Acked-by: Cornelia Huck Acked-by: Igor Mammedov Acked-by: Paul Durrant Acked-by: Thomas Huth Message-Id: <20200916182519.415636-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/audio/intel-hda.h | 2 +- hw/display/virtio-vga.h | 2 +- include/authz/base.h | 2 +- include/authz/list.h | 2 +- include/authz/listfile.h | 2 +- include/authz/pamacct.h | 2 +- include/authz/simple.h | 2 +- include/crypto/secret_common.h | 2 +- include/crypto/secret_keyring.h | 2 +- include/hw/arm/armsse.h | 2 +- include/hw/hyperv/vmbus.h | 2 +- include/hw/i2c/i2c.h | 2 +- include/hw/i2c/smbus_slave.h | 2 +- include/hw/ipack/ipack.h | 2 +- include/hw/ipmi/ipmi.h | 2 +- include/hw/mem/pc-dimm.h | 2 +- include/hw/ppc/pnv.h | 2 +- include/hw/ppc/pnv_core.h | 2 +- include/hw/ppc/pnv_homer.h | 2 +- include/hw/ppc/pnv_occ.h | 2 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 2 +- include/hw/ppc/spapr_cpu_core.h | 2 +- include/hw/ppc/spapr_vio.h | 2 +- include/hw/ppc/xics.h | 2 +- include/hw/ppc/xive.h | 2 +- include/hw/s390x/event-facility.h | 2 +- include/hw/s390x/s390_flic.h | 2 +- include/hw/s390x/sclp.h | 2 +- include/hw/sd/sd.h | 2 +- include/hw/ssi/ssi.h | 2 +- include/hw/sysbus.h | 2 +- include/hw/virtio/virtio-gpu.h | 2 +- include/hw/virtio/virtio-input.h | 2 +- include/hw/virtio/virtio-mem.h | 2 +- include/hw/virtio/virtio-pmem.h | 2 +- include/hw/virtio/virtio-serial.h | 2 +- include/hw/xen/xen-bus.h | 2 +- include/io/channel.h | 2 +- include/io/dns-resolver.h | 2 +- include/io/net-listener.h | 2 +- include/qom/object.h | 6 ++---- include/scsi/pr-manager.h | 2 +- include/sysemu/cryptodev.h | 2 +- include/sysemu/hostmem.h | 2 +- include/sysemu/rng.h | 2 +- include/sysemu/tpm_backend.h | 2 +- include/sysemu/vhost-user-backend.h | 2 +- target/alpha/cpu-qom.h | 2 +- target/arm/cpu-qom.h | 2 +- target/avr/cpu-qom.h | 2 +- target/cris/cpu-qom.h | 2 +- target/hppa/cpu-qom.h | 2 +- target/i386/cpu-qom.h | 2 +- target/lm32/cpu-qom.h | 2 +- target/m68k/cpu-qom.h | 2 +- target/microblaze/cpu-qom.h | 2 +- target/mips/cpu-qom.h | 2 +- target/moxie/cpu.h | 2 +- target/nios2/cpu.h | 2 +- target/openrisc/cpu.h | 2 +- target/ppc/cpu-qom.h | 2 +- target/riscv/cpu.h | 2 +- target/rx/cpu-qom.h | 2 +- target/s390x/cpu-qom.h | 2 +- target/sh4/cpu-qom.h | 2 +- target/sparc/cpu-qom.h | 2 +- target/tilegx/cpu.h | 2 +- target/tricore/cpu-qom.h | 2 +- target/unicore32/cpu-qom.h | 2 +- target/xtensa/cpu-qom.h | 2 +- backends/dbus-vmstate.c | 2 +- ui/input-barrier.c | 2 +- ui/input-linux.c | 2 +- 74 files changed, 75 insertions(+), 77 deletions(-) diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index f5cce18fa3..e2372abbdc 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -9,7 +9,7 @@ =20 #define TYPE_HDA_CODEC_DEVICE "hda-codec" OBJECT_DECLARE_TYPE(HDACodecDevice, HDACodecDeviceClass, - hda_codec_device, 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 5c5671c9c1..977ad5edc2 100644 --- a/hw/display/virtio-vga.h +++ b/hw/display/virtio-vga.h @@ -10,7 +10,7 @@ */ #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base" OBJECT_DECLARE_TYPE(VirtIOVGABase, VirtIOVGABaseClass, - virtio_vga_base, 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 06b5e29f6f..eca170ee1a 100644 --- a/include/authz/base.h +++ b/include/authz/base.h @@ -28,7 +28,7 @@ #define TYPE_QAUTHZ "authz" =20 OBJECT_DECLARE_TYPE(QAuthZ, QAuthZClass, - qauthz, QAUTHZ) + QAUTHZ) =20 =20 /** diff --git a/include/authz/list.h b/include/authz/list.h index c5eda0f1bf..f73bc5c50a 100644 --- a/include/authz/list.h +++ b/include/authz/list.h @@ -27,7 +27,7 @@ =20 #define TYPE_QAUTHZ_LIST "authz-list" =20 -OBJECT_DECLARE_SIMPLE_TYPE(QAuthZList, qauthz_list, +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZList, QAUTHZ_LIST) =20 =20 diff --git a/include/authz/listfile.h b/include/authz/listfile.h index 83d78cfa50..51824f3fb2 100644 --- a/include/authz/listfile.h +++ b/include/authz/listfile.h @@ -27,7 +27,7 @@ =20 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file" =20 -OBJECT_DECLARE_SIMPLE_TYPE(QAuthZListFile, qauthz_list_file, +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZListFile, QAUTHZ_LIST_FILE) =20 =20 diff --git a/include/authz/pamacct.h b/include/authz/pamacct.h index 18087cee20..d05c18a3a4 100644 --- a/include/authz/pamacct.h +++ b/include/authz/pamacct.h @@ -27,7 +27,7 @@ =20 #define TYPE_QAUTHZ_PAM "authz-pam" =20 -OBJECT_DECLARE_SIMPLE_TYPE(QAuthZPAM, qauthz_pam, +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZPAM, QAUTHZ_PAM) =20 =20 diff --git a/include/authz/simple.h b/include/authz/simple.h index d3ed05b36f..9f5b979e13 100644 --- a/include/authz/simple.h +++ b/include/authz/simple.h @@ -26,7 +26,7 @@ =20 #define TYPE_QAUTHZ_SIMPLE "authz-simple" =20 -OBJECT_DECLARE_SIMPLE_TYPE(QAuthZSimple, qauthz_simple, +OBJECT_DECLARE_SIMPLE_TYPE(QAuthZSimple, QAUTHZ_SIMPLE) =20 =20 diff --git a/include/crypto/secret_common.h b/include/crypto/secret_common.h index daf00c3b2a..42c7ff7af6 100644 --- a/include/crypto/secret_common.h +++ b/include/crypto/secret_common.h @@ -26,7 +26,7 @@ =20 #define TYPE_QCRYPTO_SECRET_COMMON "secret_common" OBJECT_DECLARE_TYPE(QCryptoSecretCommon, QCryptoSecretCommonClass, - qcrypto_secret_common, 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 803f3fc28b..3758852cb8 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -26,7 +26,7 @@ #include "crypto/secret_common.h" =20 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" -OBJECT_DECLARE_SIMPLE_TYPE(QCryptoSecretKeyring, qcrypto_secret_keyring, +OBJECT_DECLARE_SIMPLE_TYPE(QCryptoSecretKeyring, QCRYPTO_SECRET_KEYRING) =20 =20 diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index b844ef6bc0..77f86771c3 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -109,7 +109,7 @@ =20 #define TYPE_ARM_SSE "arm-sse" OBJECT_DECLARE_TYPE(ARMSSE, ARMSSEClass, - arm_sse, 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 00ad8798c1..6e9d1c16be 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -21,7 +21,7 @@ #define TYPE_VMBUS_DEVICE "vmbus-dev" =20 OBJECT_DECLARE_TYPE(VMBusDevice, VMBusDeviceClass, - vmbus_device, 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 5b8eef62c6..17e57436ce 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -19,7 +19,7 @@ enum i2c_event { =20 #define TYPE_I2C_SLAVE "i2c-slave" OBJECT_DECLARE_TYPE(I2CSlave, I2CSlaveClass, - i2c_slave, 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 cb9cb372f9..86bfe0a79e 100644 --- a/include/hw/i2c/smbus_slave.h +++ b/include/hw/i2c/smbus_slave.h @@ -30,7 +30,7 @@ =20 #define TYPE_SMBUS_DEVICE "smbus-device" OBJECT_DECLARE_TYPE(SMBusDevice, SMBusDeviceClass, - smbus_device, SMBUS_DEVICE) + SMBUS_DEVICE) =20 =20 struct SMBusDeviceClass { diff --git a/include/hw/ipack/ipack.h b/include/hw/ipack/ipack.h index a59a487853..58c611af25 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -33,7 +33,7 @@ struct IPackBus { =20 #define TYPE_IPACK_DEVICE "ipack-device" OBJECT_DECLARE_TYPE(IPackDevice, IPackDeviceClass, - ipack_device, IPACK_DEVICE) + IPACK_DEVICE) =20 struct IPackDeviceClass { /*< private >*/ diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index 3fa5a4abd0..5290dab1d6 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -177,7 +177,7 @@ struct IPMIInterfaceClass { */ #define TYPE_IPMI_BMC "ipmi-bmc" OBJECT_DECLARE_TYPE(IPMIBmc, IPMIBmcClass, - ipmi_bmc, 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 1d570defc9..aec9527fdd 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -22,7 +22,7 @@ =20 #define TYPE_PC_DIMM "pc-dimm" OBJECT_DECLARE_TYPE(PCDIMMDevice, PCDIMMDeviceClass, - pc_dimm, 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 b4b2b24d80..dd2535ab96 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -36,7 +36,7 @@ =20 #define TYPE_PNV_CHIP "pnv-chip" OBJECT_DECLARE_TYPE(PnvChip, PnvChipClass, - pnv_chip, 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 5cb22c2fa9..fc11edee28 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -26,7 +26,7 @@ =20 #define TYPE_PNV_CORE "powernv-cpu-core" OBJECT_DECLARE_TYPE(PnvCore, PnvCoreClass, - pnv_core, 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 0978812713..7d29db8b47 100644 --- a/include/hw/ppc/pnv_homer.h +++ b/include/hw/ppc/pnv_homer.h @@ -25,7 +25,7 @@ =20 #define TYPE_PNV_HOMER "pnv-homer" OBJECT_DECLARE_TYPE(PnvHomer, PnvHomerClass, - pnv_homer, 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 b79e3440be..6219f588fd 100644 --- a/include/hw/ppc/pnv_occ.h +++ b/include/hw/ppc/pnv_occ.h @@ -25,7 +25,7 @@ =20 #define TYPE_PNV_OCC "pnv-occ" OBJECT_DECLARE_TYPE(PnvOCC, PnvOCCClass, - pnv_occ, 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 0034db44c3..a1fe25b3eb 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -27,7 +27,7 @@ =20 #define TYPE_PNV_PSI "pnv-psi" OBJECT_DECLARE_TYPE(PnvPsi, PnvPsiClass, - pnv_psi, 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 29d5debd1c..7928e27963 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -17,7 +17,7 @@ struct PnvChip; =20 #define TYPE_PNV_XIVE "pnv-xive" OBJECT_DECLARE_TYPE(PnvXive, PnvXiveClass, - pnv_xive, 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 4022917168..dab3dfc76c 100644 --- a/include/hw/ppc/spapr_cpu_core.h +++ b/include/hw/ppc/spapr_cpu_core.h @@ -17,7 +17,7 @@ =20 #define TYPE_SPAPR_CPU_CORE "spapr-cpu-core" OBJECT_DECLARE_TYPE(SpaprCpuCore, SpaprCpuCoreClass, - spapr_cpu_core, 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_vio.h b/include/hw/ppc/spapr_vio.h index 6c40da72ff..aae03ea6ab 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -29,7 +29,7 @@ =20 #define TYPE_VIO_SPAPR_DEVICE "vio-spapr-device" OBJECT_DECLARE_TYPE(SpaprVioDevice, SpaprVioDeviceClass, - vio_spapr_device, 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/xics.h b/include/hw/ppc/xics.h index c5a3cdcadc..00b80b08c2 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -49,7 +49,7 @@ typedef struct XICSFabric XICSFabric; =20 #define TYPE_ICP "icp" OBJECT_DECLARE_TYPE(ICPState, ICPStateClass, - icp, 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 482fafccfd..26771bb2b3 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -348,7 +348,7 @@ struct XiveRouter { =20 #define TYPE_XIVE_ROUTER "xive-router" OBJECT_DECLARE_TYPE(XiveRouter, XiveRouterClass, - xive_router, 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 051c1c6576..3ffd575d8f 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -43,7 +43,7 @@ =20 #define TYPE_SCLP_EVENT "s390-sclp-event-type" OBJECT_DECLARE_TYPE(SCLPEvent, SCLPEventClass, - sclp_event, 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 4b718c8ebf..648ae793a1 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -40,7 +40,7 @@ extern const VMStateDescription vmstate_adapter_routes; =20 #define TYPE_S390_FLIC_COMMON "s390-flic" OBJECT_DECLARE_TYPE(S390FLICState, S390FLICStateClass, - s390_flic_common, 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 e9f0f7e67c..cd730772f9 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -183,7 +183,7 @@ typedef struct SCCB { =20 #define TYPE_SCLP "sclp" OBJECT_DECLARE_TYPE(SCLPDevice, SCLPDeviceClass, - sclp, SCLP) + SCLP) =20 struct SCLPEventFacility; =20 diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 54f97a07cd..8dd4c363f5 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -130,7 +130,7 @@ struct SDCardClass { =20 #define TYPE_SD_BUS "sd-bus" OBJECT_DECLARE_TYPE(SDBus, SDBusClass, - sd_bus, SD_BUS) + SD_BUS) =20 struct SDBus { BusState qbus; diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index 4fe1d85136..fe3028c39d 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -18,7 +18,7 @@ typedef enum SSICSMode SSICSMode; =20 #define TYPE_SSI_SLAVE "ssi-slave" OBJECT_DECLARE_TYPE(SSISlave, SSISlaveClass, - ssi_slave, 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 28a9b0f634..3564b7b6a2 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -17,7 +17,7 @@ DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS, =20 #define TYPE_SYS_BUS_DEVICE "sys-bus-device" OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass, - sys_bus_device, 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 6b45b4799a..7ef405975a 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -26,7 +26,7 @@ =20 #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base" OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, - virtio_gpu_base, 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 5eb9e7745e..91df34b534 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -20,7 +20,7 @@ typedef struct virtio_input_event virtio_input_event; =20 #define TYPE_VIRTIO_INPUT "virtio-input-device" OBJECT_DECLARE_TYPE(VirtIOInput, VirtIOInputClass, - virtio_input, 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 dfc72e14b1..4eeb82d5dd 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -22,7 +22,7 @@ #define TYPE_VIRTIO_MEM "virtio-mem" =20 OBJECT_DECLARE_TYPE(VirtIOMEM, VirtIOMEMClass, - virtio_mem, 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 56df9a03ce..66b590821e 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -21,7 +21,7 @@ #define TYPE_VIRTIO_PMEM "virtio-pmem" =20 OBJECT_DECLARE_TYPE(VirtIOPMEM, VirtIOPMEMClass, - virtio_pmem, 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 0b7f963611..17359918f7 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -27,7 +27,7 @@ struct virtio_serial_conf { =20 #define TYPE_VIRTIO_SERIAL_PORT "virtio-serial-port" OBJECT_DECLARE_TYPE(VirtIOSerialPort, VirtIOSerialPortClass, - virtio_serial_port, 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 e0e67505b8..1924d93c6c 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -79,7 +79,7 @@ struct XenBusClass { =20 #define TYPE_XEN_BUS "xen-bus" OBJECT_DECLARE_TYPE(XenBus, XenBusClass, - xen_bus, XEN_BUS) + XEN_BUS) =20 void xen_bus_init(void); =20 diff --git a/include/io/channel.h b/include/io/channel.h index 245479548a..3c04f0edda 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -27,7 +27,7 @@ =20 #define TYPE_QIO_CHANNEL "qio-channel" OBJECT_DECLARE_TYPE(QIOChannel, QIOChannelClass, - qio_channel, 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 9d14a8d98f..01d0bd7a42 100644 --- a/include/io/dns-resolver.h +++ b/include/io/dns-resolver.h @@ -26,7 +26,7 @@ #include "io/task.h" =20 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver" -OBJECT_DECLARE_SIMPLE_TYPE(QIODNSResolver, qio_dns_resolver, +OBJECT_DECLARE_SIMPLE_TYPE(QIODNSResolver, QIO_DNS_RESOLVER) =20 =20 diff --git a/include/io/net-listener.h b/include/io/net-listener.h index 8145962fbb..ab9f291ed6 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -25,7 +25,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_NET_LISTENER "qio-net-listener" -OBJECT_DECLARE_SIMPLE_TYPE(QIONetListener, qio_net_listener, +OBJECT_DECLARE_SIMPLE_TYPE(QIONetListener, QIO_NET_LISTENER) =20 =20 diff --git a/include/qom/object.h b/include/qom/object.h index d5814bd11d..19cccd3f5f 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -614,7 +614,6 @@ struct Object * OBJECT_DECLARE_TYPE: * @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 * * This macro is typically used in a header file, and will: @@ -625,7 +624,7 @@ struct Object * * The object struct and class struct need to be declared manually. */ -#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, module_obj_name, MODU= LE_OBJ_NAME) \ +#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, MODULE_OBJ_NAME) \ typedef struct InstanceType InstanceType; \ typedef struct ClassType ClassType; \ \ @@ -637,7 +636,6 @@ struct Object /** * OBJECT_DECLARE_SIMPLE_TYPE: * @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 * * This does the same as OBJECT_DECLARE_TYPE(), but with no class struct @@ -646,7 +644,7 @@ struct Object * This macro should be used unless the class struct needs to have * virtual methods declared. */ -#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, module_obj_name, MODULE_O= BJ_NAME) \ +#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, MODULE_OBJ_NAME) \ typedef struct InstanceType InstanceType; \ \ G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \ diff --git a/include/scsi/pr-manager.h b/include/scsi/pr-manager.h index 26bd134531..e4ecbe00f6 100644 --- a/include/scsi/pr-manager.h +++ b/include/scsi/pr-manager.h @@ -10,7 +10,7 @@ #define TYPE_PR_MANAGER "pr-manager" =20 OBJECT_DECLARE_TYPE(PRManager, PRManagerClass, - pr_manager, PR_MANAGER) + PR_MANAGER) =20 struct sg_io_hdr; =20 diff --git a/include/sysemu/cryptodev.h b/include/sysemu/cryptodev.h index 06726f7014..b458aa4dae 100644 --- a/include/sysemu/cryptodev.h +++ b/include/sysemu/cryptodev.h @@ -38,7 +38,7 @@ #define TYPE_CRYPTODEV_BACKEND "cryptodev-backend" =20 OBJECT_DECLARE_TYPE(CryptoDevBackend, CryptoDevBackendClass, - cryptodev_backend, 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 e5b7a152d3..df5644723a 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -21,7 +21,7 @@ =20 #define TYPE_MEMORY_BACKEND "memory-backend" OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackendClass, - memory_backend, MEMORY_BACKEND) + MEMORY_BACKEND) =20 /* hostmem-ram.c */ /** diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index cee45a4787..e383f87d20 100644 --- a/include/sysemu/rng.h +++ b/include/sysemu/rng.h @@ -18,7 +18,7 @@ =20 #define TYPE_RNG_BACKEND "rng-backend" OBJECT_DECLARE_TYPE(RngBackend, RngBackendClass, - rng_backend, 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 7e8a014031..6f078f5f48 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -20,7 +20,7 @@ =20 #define TYPE_TPM_BACKEND "tpm-backend" OBJECT_DECLARE_TYPE(TPMBackend, TPMBackendClass, - tpm_backend, 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 41d5ff43bd..327b0b84f1 100644 --- a/include/sysemu/vhost-user-backend.h +++ b/include/sysemu/vhost-user-backend.h @@ -22,7 +22,7 @@ #include "io/channel.h" =20 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend" -OBJECT_DECLARE_SIMPLE_TYPE(VhostUserBackend, vhost_user_backend, +OBJECT_DECLARE_SIMPLE_TYPE(VhostUserBackend, VHOST_USER_BACKEND) =20 =20 diff --git a/target/alpha/cpu-qom.h b/target/alpha/cpu-qom.h index 568fe3fb77..7bb9173c57 100644 --- a/target/alpha/cpu-qom.h +++ b/target/alpha/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_ALPHA_CPU "alpha-cpu" =20 OBJECT_DECLARE_TYPE(AlphaCPU, AlphaCPUClass, - alpha_cpu, ALPHA_CPU) + ALPHA_CPU) =20 /** * AlphaCPUClass: diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index 94bbbd4473..a22bd506d0 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -28,7 +28,7 @@ struct arm_boot_info; #define TYPE_ARM_CPU "arm-cpu" =20 OBJECT_DECLARE_TYPE(ARMCPU, ARMCPUClass, - arm_cpu, 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 49d63faad2..9fa6989c18 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -27,7 +27,7 @@ #define TYPE_AVR_CPU "avr-cpu" =20 OBJECT_DECLARE_TYPE(AVRCPU, AVRCPUClass, - avr_cpu, AVR_CPU) + AVR_CPU) =20 /** * AVRCPUClass: diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index 2b0328113c..2596edc7e3 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_CRIS_CPU "cris-cpu" =20 OBJECT_DECLARE_TYPE(CRISCPU, CRISCPUClass, - cris_cpu, CRIS_CPU) + CRIS_CPU) =20 /** * CRISCPUClass: diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index 58158f374b..d424f88370 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_HPPA_CPU "hppa-cpu" =20 OBJECT_DECLARE_TYPE(HPPACPU, HPPACPUClass, - hppa_cpu, HPPA_CPU) + HPPA_CPU) =20 /** * HPPACPUClass: diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index 0505472e86..f9923cee04 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -31,7 +31,7 @@ #endif =20 OBJECT_DECLARE_TYPE(X86CPU, X86CPUClass, - x86_cpu, 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 e9eb495bf0..245b35cd1d 100644 --- a/target/lm32/cpu-qom.h +++ b/target/lm32/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_LM32_CPU "lm32-cpu" =20 OBJECT_DECLARE_TYPE(LM32CPU, LM32CPUClass, - lm32_cpu, LM32_CPU) + LM32_CPU) =20 /** * LM32CPUClass: diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index a10429cf67..1ceb160ecb 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_M68K_CPU "m68k-cpu" =20 OBJECT_DECLARE_TYPE(M68kCPU, M68kCPUClass, - m68k_cpu, M68K_CPU) + M68K_CPU) =20 /* * M68kCPUClass: diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index 82734b9b2b..e520eefb12 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_MICROBLAZE_CPU "microblaze-cpu" =20 OBJECT_DECLARE_TYPE(MicroBlazeCPU, MicroBlazeCPUClass, - microblaze_cpu, MICROBLAZE_CPU) + MICROBLAZE_CPU) =20 /** * MicroBlazeCPUClass: diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index 93fbbdca1b..826ab13019 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -30,7 +30,7 @@ #endif =20 OBJECT_DECLARE_TYPE(MIPSCPU, MIPSCPUClass, - mips_cpu, MIPS_CPU) + MIPS_CPU) =20 /** * MIPSCPUClass: diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index d58761ccb1..bd6ab66084 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -52,7 +52,7 @@ typedef struct CPUMoxieState { #define TYPE_MOXIE_CPU "moxie-cpu" =20 OBJECT_DECLARE_TYPE(MoxieCPU, MoxieCPUClass, - moxie_cpu, MOXIE_CPU) + MOXIE_CPU) =20 /** * MoxieCPUClass: diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 1fa0fdaa35..86bbe1d867 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -33,7 +33,7 @@ typedef struct CPUNios2State CPUNios2State; #define TYPE_NIOS2_CPU "nios2-cpu" =20 OBJECT_DECLARE_TYPE(Nios2CPU, Nios2CPUClass, - nios2_cpu, NIOS2_CPU) + NIOS2_CPU) =20 /** * Nios2CPUClass: diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index d0a8ee657a..bd42faf144 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -30,7 +30,7 @@ struct OpenRISCCPU; #define TYPE_OPENRISC_CPU "or1k-cpu" =20 OBJECT_DECLARE_TYPE(OpenRISCCPU, OpenRISCCPUClass, - openrisc_cpu, OPENRISC_CPU) + OPENRISC_CPU) =20 /** * OpenRISCCPUClass: diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 5cf806a3a6..5fdb96f04d 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -30,7 +30,7 @@ #endif =20 OBJECT_DECLARE_TYPE(PowerPCCPU, PowerPCCPUClass, - powerpc_cpu, 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 4c00d35ccd..de275782e6 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -234,7 +234,7 @@ struct CPURISCVState { }; =20 OBJECT_DECLARE_TYPE(RISCVCPU, RISCVCPUClass, - riscv_cpu, RISCV_CPU) + RISCV_CPU) =20 /** * RISCVCPUClass: diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index 6c5321078d..7310558e0c 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -27,7 +27,7 @@ #define TYPE_RX62N_CPU RX_CPU_TYPE_NAME("rx62n") =20 OBJECT_DECLARE_TYPE(RXCPU, RXCPUClass, - rx_cpu, RX_CPU) + RX_CPU) =20 /* * RXCPUClass: diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index e2b2513711..9f3a0d86c5 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -26,7 +26,7 @@ #define TYPE_S390_CPU "s390x-cpu" =20 OBJECT_DECLARE_TYPE(S390CPU, S390CPUClass, - s390_cpu, 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 595814b8cb..8903b4b9c7 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -30,7 +30,7 @@ #define TYPE_SH7785_CPU SUPERH_CPU_TYPE_NAME("sh7785") =20 OBJECT_DECLARE_TYPE(SuperHCPU, SuperHCPUClass, - superh_cpu, SUPERH_CPU) + SUPERH_CPU) =20 /** * SuperHCPUClass: diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index 5d7fb727bc..f33949aaee 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -30,7 +30,7 @@ #endif =20 OBJECT_DECLARE_TYPE(SPARCCPU, SPARCCPUClass, - sparc_cpu, 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 d251ff80b8..c194c1a6fd 100644 --- a/target/tilegx/cpu.h +++ b/target/tilegx/cpu.h @@ -100,7 +100,7 @@ typedef struct CPUTLGState { #define TYPE_TILEGX_CPU "tilegx-cpu" =20 OBJECT_DECLARE_TYPE(TileGXCPU, TileGXCPUClass, - tilegx_cpu, TILEGX_CPU) + TILEGX_CPU) =20 /** * TileGXCPUClass: diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index 9e588c4c34..59bfd01bbc 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -25,7 +25,7 @@ #define TYPE_TRICORE_CPU "tricore-cpu" =20 OBJECT_DECLARE_TYPE(TriCoreCPU, TriCoreCPUClass, - tricore_cpu, TRICORE_CPU) + TRICORE_CPU) =20 struct TriCoreCPUClass { /*< private >*/ diff --git a/target/unicore32/cpu-qom.h b/target/unicore32/cpu-qom.h index c914273058..43621e7479 100644 --- a/target/unicore32/cpu-qom.h +++ b/target/unicore32/cpu-qom.h @@ -17,7 +17,7 @@ #define TYPE_UNICORE32_CPU "unicore32-cpu" =20 OBJECT_DECLARE_TYPE(UniCore32CPU, UniCore32CPUClass, - unicore32_cpu, UNICORE32_CPU) + UNICORE32_CPU) =20 /** * UniCore32CPUClass: diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index 299ce3e63c..41d9859673 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -35,7 +35,7 @@ #define TYPE_XTENSA_CPU "xtensa-cpu" =20 OBJECT_DECLARE_TYPE(XtensaCPU, XtensaCPUClass, - xtensa_cpu, XTENSA_CPU) + XTENSA_CPU) =20 typedef struct XtensaConfig XtensaConfig; =20 diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index 5bffbc4906..bd050e8e9c 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -23,7 +23,7 @@ =20 =20 #define TYPE_DBUS_VMSTATE "dbus-vmstate" -OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, dbus_vmstate, +OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, DBUS_VMSTATE) =20 =20 diff --git a/ui/input-barrier.c b/ui/input-barrier.c index b76697be93..a047919fde 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -20,7 +20,7 @@ #include "input-barrier.h" =20 #define TYPE_INPUT_BARRIER "input-barrier" -OBJECT_DECLARE_SIMPLE_TYPE(InputBarrier, input_barrier, +OBJECT_DECLARE_SIMPLE_TYPE(InputBarrier, INPUT_BARRIER) =20 =20 diff --git a/ui/input-linux.c b/ui/input-linux.c index f02557b012..ab351a4187 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -31,7 +31,7 @@ static bool linux_is_button(unsigned int lnx) } =20 #define TYPE_INPUT_LINUX "input-linux" -OBJECT_DECLARE_SIMPLE_TYPE(InputLinux, input_linux, +OBJECT_DECLARE_SIMPLE_TYPE(InputLinux, INPUT_LINUX) =20 =20 --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600463656; cv=none; d=zohomail.com; s=zohoarc; b=flRVB/OV7RK2tb7V+g09bbVol7g8gn0URuk6sXbvxdqBMb3SEMBfeVbx/9rX/yMc4B9vcepo2EUpW9paM3ucUjVsF6cFBWBcWup/BatSguEGCdqz4W8lAW8ZNVafRnkyTx3l3PHHOT67WdPFNH7aOiVl3CVisUq9UOnarLGHJLY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600463656; 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=yBGYeKJNAcB0YAjhwXsZVV1nEOhIkCekg/Yt7YL+nbw=; b=h5/qP7v7ZqJuK04NblQ0+YK6Wn29idWG0IOIhdziaiVT9Ww+8zrnFnYFLp2WHNqRH+uwcSMcCXxy/Lf1r9Y2tjyrel/Ob3Iz+T9p+6whdjopvCWjGkEtN2PVb0S4NM5szEFwnn4RdTDKLil45rTc248zjtRLTh6Lm8+kNMrGmro= 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 1600463656338163.68755225348332; Fri, 18 Sep 2020 14:14:16 -0700 (PDT) Received: from localhost ([::1]:40610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNhu-00067G-Pn for importer@patchew.org; Fri, 18 Sep 2020 17:14:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIM-0002mG-BV for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNID-0006KT-UK for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:47:50 -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-390-7CvtlxzuP4ip8PHGSyqE6w-1; Fri, 18 Sep 2020 16:47:34 -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 773B464147; Fri, 18 Sep 2020 20:47:33 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id E464A10013C1; Fri, 18 Sep 2020 20:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462058; 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=yBGYeKJNAcB0YAjhwXsZVV1nEOhIkCekg/Yt7YL+nbw=; b=aHcRYOR9f1167u83WkUtmNmqE2CEDDQ6P2zVTVhtLgg4klMIovdVXdZc3WLIGtN0j3pqfd /VpL+1TZj2FLsuvJKpDFgIzCRrmRhrdt0xbEO8sPg8/sbBptk494h1ikI+gsYc4+5oAJep siSRP3dT4u/33RoXfd2scUcPU8feCq4= X-MC-Unique: 7CvtlxzuP4ip8PHGSyqE6w-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 16/17] Use OBJECT_DECLARE_TYPE when possible Date: Fri, 18 Sep 2020 16:47:13 -0400 Message-Id: <20200918204714.27276-17-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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?C=C3=A9dric=20Le=20Goater?= , Paul Durrant Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This converts existing DECLARE_OBJ_CHECKERS usage to OBJECT_DECLARE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=3DAddObjectDeclareType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost Reviewed-by: C=C3=A9dric Le Goater Acked-by: Paul Durrant Message-Id: <20200916182519.415636-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/ppc/e500.h | 5 +---- hw/s390x/ccw-device.h | 4 +--- hw/s390x/virtio-ccw.h | 5 +---- hw/usb/ccid.h | 5 +---- hw/usb/hcd-dwc2.h | 3 +-- hw/usb/hcd-ehci.h | 5 +---- hw/virtio/virtio-pci.h | 5 +---- include/chardev/char.h | 4 +--- include/hw/arm/aspeed_soc.h | 5 +---- include/hw/arm/bcm2836.h | 5 +---- include/hw/arm/smmu-common.h | 5 +---- include/hw/arm/smmuv3.h | 5 +---- include/hw/arm/virt.h | 5 +---- include/hw/boards.h | 3 +-- include/hw/display/macfb.h | 5 +---- include/hw/gpio/aspeed_gpio.h | 5 +---- include/hw/i2c/aspeed_i2c.h | 5 +---- include/hw/i386/ioapic_internal.h | 5 +---- include/hw/i386/microvm.h | 5 +---- include/hw/i386/pc.h | 4 +--- include/hw/i386/x86-iommu.h | 5 +---- include/hw/i386/x86.h | 5 +---- include/hw/ide/internal.h | 4 +--- include/hw/input/adb.h | 4 +--- include/hw/isa/i8259_internal.h | 5 +---- include/hw/isa/isa.h | 4 +--- include/hw/mem/nvdimm.h | 5 +---- include/hw/misc/aspeed_scu.h | 5 +---- include/hw/misc/aspeed_sdmc.h | 5 +---- include/hw/misc/imx_ccm.h | 5 +---- include/hw/misc/mos6522.h | 5 +---- include/hw/pci-host/pnv_phb4.h | 5 +---- include/hw/pci/pci.h | 4 +--- include/hw/pci/pci_host.h | 4 +--- include/hw/pcmcia.h | 5 +---- include/hw/ppc/spapr.h | 5 +---- include/hw/qdev-core.h | 4 +--- include/hw/rtc/allwinner-rtc.h | 5 +---- include/hw/s390x/3270-ccw.h | 5 +---- include/hw/s390x/s390-virtio-ccw.h | 5 +---- include/hw/s390x/storage-attributes.h | 5 +---- include/hw/s390x/storage-keys.h | 5 +---- include/hw/s390x/tod.h | 5 +---- include/hw/scsi/scsi.h | 4 +--- include/hw/sd/allwinner-sdhost.h | 5 +---- include/hw/sd/sd.h | 5 +---- include/hw/ssi/aspeed_smc.h | 5 +---- include/hw/ssi/xilinx_spips.h | 4 +--- include/hw/timer/aspeed_timer.h | 5 +---- include/hw/timer/i8254.h | 5 +---- include/hw/usb.h | 4 +--- include/hw/virtio/virtio.h | 4 +--- include/hw/watchdog/wdt_aspeed.h | 5 +---- include/hw/xen/xen-block.h | 4 +--- include/hw/xen/xen-bus.h | 4 +--- include/net/can_host.h | 5 +---- include/net/filter.h | 4 +--- include/ui/console.h | 4 +--- hw/arm/mps2-tz.c | 5 +---- hw/arm/mps2.c | 5 +---- hw/arm/musca.c | 5 +---- hw/arm/spitz.c | 5 +---- hw/arm/vexpress.c | 5 +---- hw/block/m25p80.c | 5 +---- hw/input/adb-kbd.c | 5 +---- hw/input/adb-mouse.c | 5 +---- hw/misc/tmp421.c | 5 +---- hw/scsi/scsi-disk.c | 5 +---- hw/scsi/vmw_pvscsi.c | 5 +---- 69 files changed, 69 insertions(+), 255 deletions(-) diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 63870751ff..1e5853b032 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -14,7 +14,6 @@ struct PPCE500MachineState { */ PlatformBusDevice *pbus_dev; }; -typedef struct PPCE500MachineState PPCE500MachineState; =20 struct PPCE500MachineClass { /*< private >*/ @@ -39,14 +38,12 @@ struct PPCE500MachineClass { hwaddr pci_mmio_bus_base; hwaddr spin_base; }; -typedef struct PPCE500MachineClass PPCE500MachineClass; =20 void ppce500_init(MachineState *machine); =20 hwaddr booke206_page_size_to_tlb(uint64_t size); =20 #define TYPE_PPCE500_MACHINE "ppce500-base-machine" -DECLARE_OBJ_CHECKERS(PPCE500MachineState, PPCE500MachineClass, - PPCE500_MACHINE, TYPE_PPCE500_MACHINE) +OBJECT_DECLARE_TYPE(PPCE500MachineState, PPCE500MachineClass, PPCE500_MACH= INE) =20 #endif diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index cf7d492084..832c78cd42 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -38,7 +38,6 @@ struct CCWDeviceClass { void (*realize)(CcwDevice *, Error **); void (*refill_ids)(CcwDevice *); }; -typedef struct CCWDeviceClass CCWDeviceClass; =20 static inline CcwDevice *to_ccw_dev_fast(DeviceState *d) { @@ -47,7 +46,6 @@ static inline CcwDevice *to_ccw_dev_fast(DeviceState *d) =20 #define TYPE_CCW_DEVICE "ccw-device" =20 -DECLARE_OBJ_CHECKERS(CcwDevice, CCWDeviceClass, - CCW_DEVICE, TYPE_CCW_DEVICE) +OBJECT_DECLARE_TYPE(CcwDevice, CCWDeviceClass, CCW_DEVICE) =20 #endif diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index cea259685d..21790608b4 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -54,10 +54,7 @@ #define CCW_CMD_SET_VIRTIO_REV 0x83 =20 #define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device" -typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass; -typedef struct VirtioCcwDevice VirtioCcwDevice; -DECLARE_OBJ_CHECKERS(VirtioCcwDevice, VirtIOCCWDeviceClass, - VIRTIO_CCW_DEVICE, TYPE_VIRTIO_CCW_DEVICE) +OBJECT_DECLARE_TYPE(VirtioCcwDevice, VirtIOCCWDeviceClass, VIRTIO_CCW_DEVI= CE) =20 typedef struct VirtioBusState VirtioCcwBusState; typedef struct VirtioBusClass VirtioCcwBusClass; diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h index ef2bb3462d..6b82a55bd4 100644 --- a/hw/usb/ccid.h +++ b/hw/usb/ccid.h @@ -13,13 +13,10 @@ #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; -DECLARE_OBJ_CHECKERS(CCIDCardState, CCIDCardClass, - CCID_CARD, TYPE_CCID_CARD) +OBJECT_DECLARE_TYPE(CCIDCardState, CCIDCardClass, 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 919e3e43b1..6998b04706 100644 --- a/hw/usb/hcd-dwc2.h +++ b/hw/usb/hcd-dwc2.h @@ -181,7 +181,6 @@ struct DWC2Class { }; =20 #define TYPE_DWC2_USB "dwc2-usb" -DECLARE_OBJ_CHECKERS(DWC2State, DWC2Class, - DWC2_USB, TYPE_DWC2_USB) +OBJECT_DECLARE_TYPE(DWC2State, DWC2Class, DWC2_USB) =20 #endif diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 1301ce0be7..199913bca5 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -350,10 +350,7 @@ 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; -DECLARE_OBJ_CHECKERS(EHCISysBusState, SysBusEHCIClass, - SYS_BUS_EHCI, TYPE_SYS_BUS_EHCI) +OBJECT_DECLARE_TYPE(EHCISysBusState, SysBusEHCIClass, SYS_BUS_EHCI) =20 struct EHCISysBusState { /*< private >*/ diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index 47b6bb4e26..06e2af12de 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -19,7 +19,6 @@ #include "hw/virtio/virtio-bus.h" #include "qom/object.h" =20 -typedef struct VirtIOPCIProxy VirtIOPCIProxy; =20 /* virtio-pci-bus */ =20 @@ -91,9 +90,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; -DECLARE_OBJ_CHECKERS(VirtIOPCIProxy, VirtioPCIClass, - VIRTIO_PCI, TYPE_VIRTIO_PCI) +OBJECT_DECLARE_TYPE(VirtIOPCIProxy, VirtioPCIClass, VIRTIO_PCI) =20 struct VirtioPCIClass { PCIDeviceClass parent_class; diff --git a/include/chardev/char.h b/include/chardev/char.h index 5874de57ea..db42f0a8c6 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -226,9 +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; -DECLARE_OBJ_CHECKERS(Chardev, ChardevClass, - CHARDEV, TYPE_CHARDEV) +OBJECT_DECLARE_TYPE(Chardev, ChardevClass, CHARDEV) =20 #define TYPE_CHARDEV_NULL "chardev-null" #define TYPE_CHARDEV_MUX "chardev-mux" diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 05c7d53df3..11cfe6e358 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -62,12 +62,9 @@ struct AspeedSoCState { AspeedSDHCIState sdhci; AspeedSDHCIState emmc; }; -typedef struct AspeedSoCState AspeedSoCState; =20 #define TYPE_ASPEED_SOC "aspeed-soc" -typedef struct AspeedSoCClass AspeedSoCClass; -DECLARE_OBJ_CHECKERS(AspeedSoCState, AspeedSoCClass, - ASPEED_SOC, TYPE_ASPEED_SOC) +OBJECT_DECLARE_TYPE(AspeedSoCState, AspeedSoCClass, ASPEED_SOC) =20 struct AspeedSoCClass { DeviceClass parent_class; diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 181d9563d0..428c15d316 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -18,10 +18,7 @@ #include "qom/object.h" =20 #define TYPE_BCM283X "bcm283x" -typedef struct BCM283XClass BCM283XClass; -typedef struct BCM283XState BCM283XState; -DECLARE_OBJ_CHECKERS(BCM283XState, BCM283XClass, - BCM283X, TYPE_BCM283X) +OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X) =20 #define BCM283X_NCPUS 4 =20 diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index 54d0872fd8..706be3c6d0 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -118,7 +118,6 @@ struct SMMUState { uint8_t bus_num; PCIBus *primary_bus; }; -typedef struct SMMUState SMMUState; =20 struct SMMUBaseClass { /* */ @@ -129,11 +128,9 @@ struct SMMUBaseClass { DeviceRealize parent_realize; =20 }; -typedef struct SMMUBaseClass SMMUBaseClass; =20 #define TYPE_ARM_SMMU "arm-smmu" -DECLARE_OBJ_CHECKERS(SMMUState, SMMUBaseClass, - ARM_SMMU, TYPE_ARM_SMMU) +OBJECT_DECLARE_TYPE(SMMUState, SMMUBaseClass, 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 2a3f6dd197..c641e60735 100644 --- a/include/hw/arm/smmuv3.h +++ b/include/hw/arm/smmuv3.h @@ -63,7 +63,6 @@ struct SMMUv3State { qemu_irq irq[4]; QemuMutex mutex; }; -typedef struct SMMUv3State SMMUv3State; =20 typedef enum { SMMU_IRQ_EVTQ, @@ -80,10 +79,8 @@ struct SMMUv3Class { DeviceRealize parent_realize; DeviceReset parent_reset; }; -typedef struct SMMUv3Class SMMUv3Class; =20 #define TYPE_ARM_SMMUV3 "arm-smmuv3" -DECLARE_OBJ_CHECKERS(SMMUv3State, SMMUv3Class, - ARM_SMMUV3, TYPE_ARM_SMMUV3) +OBJECT_DECLARE_TYPE(SMMUv3State, SMMUv3Class, ARM_SMMUV3) =20 #endif diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 392b0bd571..d018a4f297 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -128,7 +128,6 @@ struct VirtMachineClass { bool kvm_no_adjvtime; bool acpi_expose_flash; }; -typedef struct VirtMachineClass VirtMachineClass; =20 struct VirtMachineState { MachineState parent; @@ -165,13 +164,11 @@ struct VirtMachineState { DeviceState *acpi_dev; Notifier powerdown_notifier; }; -typedef struct VirtMachineState VirtMachineState; =20 #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) =20 #define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") -DECLARE_OBJ_CHECKERS(VirtMachineState, VirtMachineClass, - VIRT_MACHINE, TYPE_VIRT_MACHINE) +OBJECT_DECLARE_TYPE(VirtMachineState, VirtMachineClass, VIRT_MACHINE) =20 void virt_acpi_setup(VirtMachineState *vms); bool virt_is_acpi_enabled(VirtMachineState *vms); diff --git a/include/hw/boards.h b/include/hw/boards.h index 795910d01b..56aa1ca335 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -21,8 +21,7 @@ =20 #define TYPE_MACHINE "machine" #undef MACHINE /* BSD defines it and QEMU does not use it */ -DECLARE_OBJ_CHECKERS(MachineState, MachineClass, - MACHINE, TYPE_MACHINE) +OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE) =20 extern MachineState *current_machine; =20 diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 0960480b75..4adfaa725a 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -43,10 +43,7 @@ struct MacfbSysBusState { }; =20 #define TYPE_NUBUS_MACFB "nubus-macfb" -typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass; -typedef struct MacfbNubusState MacfbNubusState; -DECLARE_OBJ_CHECKERS(MacfbNubusState, MacfbNubusDeviceClass, - NUBUS_MACFB, TYPE_NUBUS_MACFB) +OBJECT_DECLARE_TYPE(MacfbNubusState, MacfbNubusDeviceClass, NUBUS_MACFB) =20 struct MacfbNubusDeviceClass { DeviceClass parent_class; diff --git a/include/hw/gpio/aspeed_gpio.h b/include/hw/gpio/aspeed_gpio.h index 2582e6e0dc..e1636ce7fe 100644 --- a/include/hw/gpio/aspeed_gpio.h +++ b/include/hw/gpio/aspeed_gpio.h @@ -14,10 +14,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_GPIO "aspeed.gpio" -typedef struct AspeedGPIOClass AspeedGPIOClass; -typedef struct AspeedGPIOState AspeedGPIOState; -DECLARE_OBJ_CHECKERS(AspeedGPIOState, AspeedGPIOClass, - ASPEED_GPIO, TYPE_ASPEED_GPIO) +OBJECT_DECLARE_TYPE(AspeedGPIOState, AspeedGPIOClass, ASPEED_GPIO) =20 #define ASPEED_GPIO_MAX_NR_SETS 8 #define ASPEED_REGS_PER_BANK 14 diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index 695e1c0928..565f833066 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -29,10 +29,7 @@ #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; -DECLARE_OBJ_CHECKERS(AspeedI2CState, AspeedI2CClass, - ASPEED_I2C, TYPE_ASPEED_I2C) +OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C) =20 #define ASPEED_I2C_NR_BUSSES 16 #define ASPEED_I2C_MAX_POOL_SIZE 0x800 diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_int= ernal.h index e9cc2eaf54..0ac9e2400d 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -82,12 +82,9 @@ =20 #define IOAPIC_VER_ENTRIES_SHIFT 16 =20 -typedef struct IOAPICCommonState IOAPICCommonState; =20 #define TYPE_IOAPIC_COMMON "ioapic-common" -typedef struct IOAPICCommonClass IOAPICCommonClass; -DECLARE_OBJ_CHECKERS(IOAPICCommonState, IOAPICCommonClass, - IOAPIC_COMMON, TYPE_IOAPIC_COMMON) +OBJECT_DECLARE_TYPE(IOAPICCommonState, IOAPICCommonClass, IOAPIC_COMMON) =20 struct IOAPICCommonClass { SysBusDeviceClass parent_class; diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h index be2d95af4d..3b9fd4ff17 100644 --- a/include/hw/i386/microvm.h +++ b/include/hw/i386/microvm.h @@ -50,7 +50,6 @@ struct MicrovmMachineClass { HotplugHandler *(*orig_hotplug_handler)(MachineState *machine, DeviceState *dev); }; -typedef struct MicrovmMachineClass MicrovmMachineClass; =20 struct MicrovmMachineState { X86MachineState parent; @@ -69,10 +68,8 @@ struct MicrovmMachineState { Notifier machine_done; Notifier powerdown_req; }; -typedef struct MicrovmMachineState MicrovmMachineState; =20 #define TYPE_MICROVM_MACHINE MACHINE_TYPE_NAME("microvm") -DECLARE_OBJ_CHECKERS(MicrovmMachineState, MicrovmMachineClass, - MICROVM_MACHINE, TYPE_MICROVM_MACHINE) +OBJECT_DECLARE_TYPE(MicrovmMachineState, MicrovmMachineClass, MICROVM_MACH= INE) =20 #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index c14e14dfe0..b2da2c8d2b 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -119,11 +119,9 @@ struct PCMachineClass { /* use PVH to load kernels that support this feature */ bool pvh_enabled; }; -typedef struct PCMachineClass PCMachineClass; =20 #define TYPE_PC_MACHINE "generic-pc-machine" -DECLARE_OBJ_CHECKERS(PCMachineState, PCMachineClass, - PC_MACHINE, TYPE_PC_MACHINE) +OBJECT_DECLARE_TYPE(PCMachineState, PCMachineClass, PC_MACHINE) =20 /* ioapic.c */ =20 diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h index bbfaf44e79..9de92d33a1 100644 --- a/include/hw/i386/x86-iommu.h +++ b/include/hw/i386/x86-iommu.h @@ -26,10 +26,7 @@ #include "qom/object.h" =20 #define TYPE_X86_IOMMU_DEVICE ("x86-iommu") -typedef struct X86IOMMUClass X86IOMMUClass; -typedef struct X86IOMMUState X86IOMMUState; -DECLARE_OBJ_CHECKERS(X86IOMMUState, X86IOMMUClass, - X86_IOMMU_DEVICE, TYPE_X86_IOMMU_DEVICE) +OBJECT_DECLARE_TYPE(X86IOMMUState, X86IOMMUClass, 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 0eef9fb0c0..d5dcf7a07f 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -39,7 +39,6 @@ struct X86MachineClass { /* Enables contiguous-apic-ID mode */ bool compat_apic_id_mode; }; -typedef struct X86MachineClass X86MachineClass; =20 struct X86MachineState { /*< private >*/ @@ -72,14 +71,12 @@ struct X86MachineState { */ AddressSpace *ioapic_as; }; -typedef struct X86MachineState X86MachineState; =20 #define X86_MACHINE_SMM "smm" #define X86_MACHINE_ACPI "acpi" =20 #define TYPE_X86_MACHINE MACHINE_TYPE_NAME("x86") -DECLARE_OBJ_CHECKERS(X86MachineState, X86MachineClass, - X86_MACHINE, TYPE_X86_MACHINE) +OBJECT_DECLARE_TYPE(X86MachineState, X86MachineClass, X86_MACHINE) =20 void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86m= s); =20 diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index eb9eb4e0ae..77c9372c27 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -488,9 +488,7 @@ struct IDEBus { }; =20 #define TYPE_IDE_DEVICE "ide-device" -typedef struct IDEDeviceClass IDEDeviceClass; -DECLARE_OBJ_CHECKERS(IDEDevice, IDEDeviceClass, - IDE_DEVICE, TYPE_IDE_DEVICE) +OBJECT_DECLARE_TYPE(IDEDevice, IDEDeviceClass, IDE_DEVICE) =20 struct IDEDeviceClass { DeviceClass parent_class; diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h index 285f70db55..3d1c2f4b10 100644 --- a/include/hw/input/adb.h +++ b/include/hw/input/adb.h @@ -43,9 +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; -DECLARE_OBJ_CHECKERS(ADBDevice, ADBDeviceClass, - ADB_DEVICE, TYPE_ADB_DEVICE) +OBJECT_DECLARE_TYPE(ADBDevice, ADBDeviceClass, ADB_DEVICE) =20 struct ADBDevice { /*< private >*/ diff --git a/include/hw/isa/i8259_internal.h b/include/hw/isa/i8259_interna= l.h index cd050bb9f2..a6ae8a583f 100644 --- a/include/hw/isa/i8259_internal.h +++ b/include/hw/isa/i8259_internal.h @@ -30,12 +30,9 @@ #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; -DECLARE_OBJ_CHECKERS(PICCommonState, PICCommonClass, - PIC_COMMON, TYPE_PIC_COMMON) +OBJECT_DECLARE_TYPE(PICCommonState, PICCommonClass, PIC_COMMON) =20 struct PICCommonClass { ISADeviceClass parent_class; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index ddb6a2d168..5f7943fa67 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -11,9 +11,7 @@ #define ISA_NUM_IRQS 16 =20 #define TYPE_ISA_DEVICE "isa-device" -typedef struct ISADeviceClass ISADeviceClass; -DECLARE_OBJ_CHECKERS(ISADevice, ISADeviceClass, - ISA_DEVICE, TYPE_ISA_DEVICE) +OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE) =20 #define TYPE_ISA_BUS "ISA" DECLARE_INSTANCE_CHECKER(ISABus, ISA_BUS, diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index 19e3d3092d..c699842dd0 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -46,10 +46,7 @@ #define MIN_NAMESPACE_LABEL_SIZE (128UL << 10) =20 #define TYPE_NVDIMM "nvdimm" -typedef struct NVDIMMClass NVDIMMClass; -typedef struct NVDIMMDevice NVDIMMDevice; -DECLARE_OBJ_CHECKERS(NVDIMMDevice, NVDIMMClass, - NVDIMM, TYPE_NVDIMM) +OBJECT_DECLARE_TYPE(NVDIMMDevice, NVDIMMClass, NVDIMM) =20 #define NVDIMM_LABEL_SIZE_PROP "label-size" #define NVDIMM_UUID_PROP "uuid" diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h index 8d3b14acd4..d49bfb02fb 100644 --- a/include/hw/misc/aspeed_scu.h +++ b/include/hw/misc/aspeed_scu.h @@ -15,10 +15,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_SCU "aspeed.scu" -typedef struct AspeedSCUClass AspeedSCUClass; -typedef struct AspeedSCUState AspeedSCUState; -DECLARE_OBJ_CHECKERS(AspeedSCUState, AspeedSCUClass, - ASPEED_SCU, TYPE_ASPEED_SCU) +OBJECT_DECLARE_TYPE(AspeedSCUState, AspeedSCUClass, 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" diff --git a/include/hw/misc/aspeed_sdmc.h b/include/hw/misc/aspeed_sdmc.h index 3375afc89b..ec2d59a14f 100644 --- a/include/hw/misc/aspeed_sdmc.h +++ b/include/hw/misc/aspeed_sdmc.h @@ -13,10 +13,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_SDMC "aspeed.sdmc" -typedef struct AspeedSDMCClass AspeedSDMCClass; -typedef struct AspeedSDMCState AspeedSDMCState; -DECLARE_OBJ_CHECKERS(AspeedSDMCState, AspeedSDMCClass, - ASPEED_SDMC, TYPE_ASPEED_SDMC) +OBJECT_DECLARE_TYPE(AspeedSDMCState, AspeedSDMCClass, 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" diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h index e9d82a2a50..7e5678e972 100644 --- a/include/hw/misc/imx_ccm.h +++ b/include/hw/misc/imx_ccm.h @@ -28,10 +28,7 @@ #define PLL_MFN(x) (((x) & 0x3ff) << 0) =20 #define TYPE_IMX_CCM "imx.ccm" -typedef struct IMXCCMClass IMXCCMClass; -typedef struct IMXCCMState IMXCCMState; -DECLARE_OBJ_CHECKERS(IMXCCMState, IMXCCMClass, - IMX_CCM, TYPE_IMX_CCM) +OBJECT_DECLARE_TYPE(IMXCCMState, IMXCCMClass, IMX_CCM) =20 struct IMXCCMState { /* */ diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index f73271ba67..fc95d22b0f 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -122,12 +122,9 @@ struct MOS6522State { =20 qemu_irq irq; }; -typedef struct MOS6522State MOS6522State; =20 #define TYPE_MOS6522 "mos6522" -typedef struct MOS6522DeviceClass MOS6522DeviceClass; -DECLARE_OBJ_CHECKERS(MOS6522State, MOS6522DeviceClass, - MOS6522, TYPE_MOS6522) +OBJECT_DECLARE_TYPE(MOS6522State, MOS6522DeviceClass, MOS6522) =20 struct MOS6522DeviceClass { DeviceClass parent_class; diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 15a4633178..05efb4e6b9 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -15,7 +15,6 @@ #include "hw/ppc/xive.h" #include "qom/object.h" =20 -typedef struct PnvPhb4PecState PnvPhb4PecState; typedef struct PnvPhb4PecStack PnvPhb4PecStack; typedef struct PnvPHB4 PnvPHB4; typedef struct PnvChip PnvChip; @@ -142,9 +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; -DECLARE_OBJ_CHECKERS(PnvPhb4PecState, PnvPhb4PecClass, - PNV_PHB4_PEC, TYPE_PNV_PHB4_PEC) +OBJECT_DECLARE_TYPE(PnvPhb4PecState, PnvPhb4PecClass, PNV_PHB4_PEC) =20 #define TYPE_PNV_PHB4_PEC_STACK "pnv-phb4-pec-stack" DECLARE_INSTANCE_CHECKER(PnvPhb4PecStack, PNV_PHB4_PEC_STACK, diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index c13ae1f858..0a59a06b14 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -394,9 +394,7 @@ typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int i= rq_num); typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin); =20 #define TYPE_PCI_BUS "PCI" -typedef struct PCIBusClass PCIBusClass; -DECLARE_OBJ_CHECKERS(PCIBus, PCIBusClass, - PCI_BUS, TYPE_PCI_BUS) +OBJECT_DECLARE_TYPE(PCIBus, PCIBusClass, PCI_BUS) #define TYPE_PCIE_BUS "PCIE" =20 bool pci_bus_is_express(PCIBus *bus); diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index d1fc1c3604..52e038c019 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -32,9 +32,7 @@ #include "qom/object.h" =20 #define TYPE_PCI_HOST_BRIDGE "pci-host-bridge" -typedef struct PCIHostBridgeClass PCIHostBridgeClass; -DECLARE_OBJ_CHECKERS(PCIHostState, PCIHostBridgeClass, - PCI_HOST_BRIDGE, TYPE_PCI_HOST_BRIDGE) +OBJECT_DECLARE_TYPE(PCIHostState, PCIHostBridgeClass, PCI_HOST_BRIDGE) =20 struct PCIHostState { SysBusDevice busdev; diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index fb40ae7e09..e3ba44e0bf 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -12,10 +12,7 @@ typedef struct PCMCIASocket { } PCMCIASocket; =20 #define TYPE_PCMCIA_CARD "pcmcia-card" -typedef struct PCMCIACardClass PCMCIACardClass; -typedef struct PCMCIACardState PCMCIACardState; -DECLARE_OBJ_CHECKERS(PCMCIACardState, PCMCIACardClass, - PCMCIA_CARD, TYPE_PCMCIA_CARD) +OBJECT_DECLARE_TYPE(PCMCIACardState, PCMCIACardClass, PCMCIA_CARD) =20 struct PCMCIACardState { /*< private >*/ diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index c8cd63bc06..eea7ac8624 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -39,12 +39,9 @@ struct SpaprRtcState { }; =20 typedef struct SpaprDimmState SpaprDimmState; -typedef struct SpaprMachineClass SpaprMachineClass; =20 #define TYPE_SPAPR_MACHINE "spapr-machine" -typedef struct SpaprMachineState SpaprMachineState; -DECLARE_OBJ_CHECKERS(SpaprMachineState, SpaprMachineClass, - SPAPR_MACHINE, TYPE_SPAPR_MACHINE) +OBJECT_DECLARE_TYPE(SpaprMachineState, SpaprMachineClass, SPAPR_MACHINE) =20 typedef enum { SPAPR_RESIZE_HPT_DEFAULT =3D 0, diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index e025ba9653..72064f4dd4 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -12,9 +12,7 @@ enum { }; =20 #define TYPE_DEVICE "device" -typedef struct DeviceClass DeviceClass; -DECLARE_OBJ_CHECKERS(DeviceState, DeviceClass, - DEVICE, TYPE_DEVICE) +OBJECT_DECLARE_TYPE(DeviceState, DeviceClass, DEVICE) =20 typedef enum DeviceCategory { DEVICE_CATEGORY_BRIDGE, diff --git a/include/hw/rtc/allwinner-rtc.h b/include/hw/rtc/allwinner-rtc.h index 5a6e9fff32..bf415431cd 100644 --- a/include/hw/rtc/allwinner-rtc.h +++ b/include/hw/rtc/allwinner-rtc.h @@ -60,10 +60,7 @@ * @{ */ =20 -typedef struct AwRtcClass AwRtcClass; -typedef struct AwRtcState AwRtcState; -DECLARE_OBJ_CHECKERS(AwRtcState, AwRtcClass, - AW_RTC, TYPE_AW_RTC) +OBJECT_DECLARE_TYPE(AwRtcState, AwRtcClass, AW_RTC) =20 /** @} */ =20 diff --git a/include/hw/s390x/3270-ccw.h b/include/hw/s390x/3270-ccw.h index 9a11093192..1439882294 100644 --- a/include/hw/s390x/3270-ccw.h +++ b/include/hw/s390x/3270-ccw.h @@ -31,10 +31,7 @@ #define TC_EWRITEA 0x0d /* Erase write alternate */ #define TC_WRITESF 0x11 /* Write structured field */ =20 -typedef struct EmulatedCcw3270Class EmulatedCcw3270Class; -typedef struct EmulatedCcw3270Device EmulatedCcw3270Device; -DECLARE_OBJ_CHECKERS(EmulatedCcw3270Device, EmulatedCcw3270Class, - EMULATED_CCW_3270, TYPE_EMULATED_CCW_3270) +OBJECT_DECLARE_TYPE(EmulatedCcw3270Device, EmulatedCcw3270Class, EMULATED_= CCW_3270) =20 struct EmulatedCcw3270Device { CcwDevice parent_obj; diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 54d14da0a6..3331990e02 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -16,10 +16,7 @@ =20 #define TYPE_S390_CCW_MACHINE "s390-ccw-machine" =20 -typedef struct S390CcwMachineClass S390CcwMachineClass; -typedef struct S390CcwMachineState S390CcwMachineState; -DECLARE_OBJ_CHECKERS(S390CcwMachineState, S390CcwMachineClass, - S390_CCW_MACHINE, TYPE_S390_CCW_MACHINE) +OBJECT_DECLARE_TYPE(S390CcwMachineState, S390CcwMachineClass, S390_CCW_MAC= HINE) =20 =20 struct S390CcwMachineState { diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/stora= ge-attributes.h index efb28c48be..5239eb538c 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -20,10 +20,7 @@ #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; -DECLARE_OBJ_CHECKERS(S390StAttribState, S390StAttribClass, - S390_STATTRIB, TYPE_S390_STATTRIB) +OBJECT_DECLARE_TYPE(S390StAttribState, S390StAttribClass, S390_STATTRIB) =20 struct S390StAttribState { DeviceState parent_obj; diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-key= s.h index 40f042f54e..2888d42d0b 100644 --- a/include/hw/s390x/storage-keys.h +++ b/include/hw/s390x/storage-keys.h @@ -17,10 +17,7 @@ #include "qom/object.h" =20 #define TYPE_S390_SKEYS "s390-skeys" -typedef struct S390SKeysClass S390SKeysClass; -typedef struct S390SKeysState S390SKeysState; -DECLARE_OBJ_CHECKERS(S390SKeysState, S390SKeysClass, - S390_SKEYS, TYPE_S390_SKEYS) +OBJECT_DECLARE_TYPE(S390SKeysState, S390SKeysClass, S390_SKEYS) =20 struct S390SKeysState { DeviceState parent_obj; diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h index c02498f65e..ff3195a4bf 100644 --- a/include/hw/s390x/tod.h +++ b/include/hw/s390x/tod.h @@ -21,10 +21,7 @@ typedef struct S390TOD { } S390TOD; =20 #define TYPE_S390_TOD "s390-tod" -typedef struct S390TODClass S390TODClass; -typedef struct S390TODState S390TODState; -DECLARE_OBJ_CHECKERS(S390TODState, S390TODClass, - S390_TOD, TYPE_S390_TOD) +OBJECT_DECLARE_TYPE(S390TODState, S390TODClass, 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/scsi/scsi.h b/include/hw/scsi/scsi.h index 3818e3fa46..b1e2ed7c35 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -50,9 +50,7 @@ struct SCSIRequest { }; =20 #define TYPE_SCSI_DEVICE "scsi-device" -typedef struct SCSIDeviceClass SCSIDeviceClass; -DECLARE_OBJ_CHECKERS(SCSIDevice, SCSIDeviceClass, - SCSI_DEVICE, TYPE_SCSI_DEVICE) +OBJECT_DECLARE_TYPE(SCSIDevice, SCSIDeviceClass, SCSI_DEVICE) =20 struct SCSIDeviceClass { DeviceClass parent_class; diff --git a/include/hw/sd/allwinner-sdhost.h b/include/hw/sd/allwinner-sdh= ost.h index 7bccc06d1c..bfe08ff4ef 100644 --- a/include/hw/sd/allwinner-sdhost.h +++ b/include/hw/sd/allwinner-sdhost.h @@ -45,10 +45,7 @@ * @{ */ =20 -typedef struct AwSdHostClass AwSdHostClass; -typedef struct AwSdHostState AwSdHostState; -DECLARE_OBJ_CHECKERS(AwSdHostState, AwSdHostClass, - AW_SDHOST, TYPE_AW_SDHOST) +OBJECT_DECLARE_TYPE(AwSdHostState, AwSdHostClass, AW_SDHOST) =20 /** @} */ =20 diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 8dd4c363f5..59d108d453 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -89,12 +89,9 @@ typedef struct { uint8_t crc; } SDRequest; =20 -typedef struct SDState SDState; =20 #define TYPE_SD_CARD "sd-card" -typedef struct SDCardClass SDCardClass; -DECLARE_OBJ_CHECKERS(SDState, SDCardClass, - SD_CARD, TYPE_SD_CARD) +OBJECT_DECLARE_TYPE(SDState, SDCardClass, SD_CARD) =20 struct SDCardClass { /*< private >*/ diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index 8e023d8ff6..3dd354b52e 100644 --- a/include/hw/ssi/aspeed_smc.h +++ b/include/hw/ssi/aspeed_smc.h @@ -68,10 +68,7 @@ typedef struct AspeedSMCFlash { } AspeedSMCFlash; =20 #define TYPE_ASPEED_SMC "aspeed.smc" -typedef struct AspeedSMCClass AspeedSMCClass; -typedef struct AspeedSMCState AspeedSMCState; -DECLARE_OBJ_CHECKERS(AspeedSMCState, AspeedSMCClass, - ASPEED_SMC, TYPE_ASPEED_SMC) +OBJECT_DECLARE_TYPE(AspeedSMCState, AspeedSMCClass, ASPEED_SMC) =20 struct AspeedSMCClass { SysBusDevice parent_obj; diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index b1ab347617..a2bf2cf3c7 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -130,14 +130,12 @@ struct XilinxSPIPSClass { uint32_t rx_fifo_size; uint32_t tx_fifo_size; }; -typedef struct XilinxSPIPSClass XilinxSPIPSClass; =20 #define TYPE_XILINX_SPIPS "xlnx.ps7-spi" #define TYPE_XILINX_QSPIPS "xlnx.ps7-qspi" #define TYPE_XLNX_ZYNQMP_QSPIPS "xlnx.usmp-gqspi" =20 -DECLARE_OBJ_CHECKERS(XilinxSPIPS, XilinxSPIPSClass, - XILINX_SPIPS, TYPE_XILINX_SPIPS) +OBJECT_DECLARE_TYPE(XilinxSPIPS, XilinxSPIPSClass, XILINX_SPIPS) =20 DECLARE_INSTANCE_CHECKER(XilinxQSPIPS, XILINX_QSPIPS, TYPE_XILINX_QSPIPS) diff --git a/include/hw/timer/aspeed_timer.h b/include/hw/timer/aspeed_time= r.h index 4c76f955c9..d36034a10c 100644 --- a/include/hw/timer/aspeed_timer.h +++ b/include/hw/timer/aspeed_timer.h @@ -27,10 +27,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_TIMER "aspeed.timer" -typedef struct AspeedTimerClass AspeedTimerClass; -typedef struct AspeedTimerCtrlState AspeedTimerCtrlState; -DECLARE_OBJ_CHECKERS(AspeedTimerCtrlState, AspeedTimerClass, - ASPEED_TIMER, TYPE_ASPEED_TIMER) +OBJECT_DECLARE_TYPE(AspeedTimerCtrlState, AspeedTimerClass, 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" diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 1a522a2457..3e569f42b6 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -40,10 +40,7 @@ typedef struct PITChannelInfo { } PITChannelInfo; =20 #define TYPE_PIT_COMMON "pit-common" -typedef struct PITCommonState PITCommonState; -typedef struct PITCommonClass PITCommonClass; -DECLARE_OBJ_CHECKERS(PITCommonState, PITCommonClass, - PIT_COMMON, TYPE_PIT_COMMON) +OBJECT_DECLARE_TYPE(PITCommonState, PITCommonClass, PIT_COMMON) =20 #define TYPE_I8254 "isa-pit" #define TYPE_KVM_I8254 "kvm-pit" diff --git a/include/hw/usb.h b/include/hw/usb.h index 5783635491..355745c23a 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -265,9 +265,7 @@ struct USBDevice { }; =20 #define TYPE_USB_DEVICE "usb-device" -typedef struct USBDeviceClass USBDeviceClass; -DECLARE_OBJ_CHECKERS(USBDevice, USBDeviceClass, - USB_DEVICE, TYPE_USB_DEVICE) +OBJECT_DECLARE_TYPE(USBDevice, USBDeviceClass, USB_DEVICE) =20 typedef void (*USBDeviceRealize)(USBDevice *dev, Error **errp); typedef void (*USBDeviceUnrealize)(USBDevice *dev); diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 807280451b..28cf3b9120 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -68,9 +68,7 @@ typedef struct VirtQueueElement #define VIRTIO_NO_VECTOR 0xffff =20 #define TYPE_VIRTIO_DEVICE "virtio-device" -typedef struct VirtioDeviceClass VirtioDeviceClass; -DECLARE_OBJ_CHECKERS(VirtIODevice, VirtioDeviceClass, - VIRTIO_DEVICE, TYPE_VIRTIO_DEVICE) +OBJECT_DECLARE_TYPE(VirtIODevice, VirtioDeviceClass, VIRTIO_DEVICE) =20 enum virtio_device_endian { VIRTIO_DEVICE_ENDIAN_UNKNOWN, diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_asp= eed.h index 2ca1eb5432..80b03661e3 100644 --- a/include/hw/watchdog/wdt_aspeed.h +++ b/include/hw/watchdog/wdt_aspeed.h @@ -15,10 +15,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_WDT "aspeed.wdt" -typedef struct AspeedWDTClass AspeedWDTClass; -typedef struct AspeedWDTState AspeedWDTState; -DECLARE_OBJ_CHECKERS(AspeedWDTState, AspeedWDTClass, - ASPEED_WDT, TYPE_ASPEED_WDT) +OBJECT_DECLARE_TYPE(AspeedWDTState, AspeedWDTClass, 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" diff --git a/include/hw/xen/xen-block.h b/include/hw/xen/xen-block.h index 8ff5421dc3..a74fd9384f 100644 --- a/include/hw/xen/xen-block.h +++ b/include/hw/xen/xen-block.h @@ -68,11 +68,9 @@ struct XenBlockDeviceClass { XenBlockDeviceRealize realize; XenBlockDeviceUnrealize unrealize; }; -typedef struct XenBlockDeviceClass XenBlockDeviceClass; =20 #define TYPE_XEN_BLOCK_DEVICE "xen-block" -DECLARE_OBJ_CHECKERS(XenBlockDevice, XenBlockDeviceClass, - XEN_BLOCK_DEVICE, TYPE_XEN_BLOCK_DEVICE) +OBJECT_DECLARE_TYPE(XenBlockDevice, XenBlockDeviceClass, XEN_BLOCK_DEVICE) =20 struct XenDiskDevice { XenBlockDevice blockdev; diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 1924d93c6c..3df696136f 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -57,11 +57,9 @@ struct XenDeviceClass { XenDeviceFrontendChanged frontend_changed; XenDeviceUnrealize unrealize; }; -typedef struct XenDeviceClass XenDeviceClass; =20 #define TYPE_XEN_DEVICE "xen-device" -DECLARE_OBJ_CHECKERS(XenDevice, XenDeviceClass, - XEN_DEVICE, TYPE_XEN_DEVICE) +OBJECT_DECLARE_TYPE(XenDevice, XenDeviceClass, XEN_DEVICE) =20 struct XenBus { BusState qbus; diff --git a/include/net/can_host.h b/include/net/can_host.h index 18979c2e2d..4e3ce3f954 100644 --- a/include/net/can_host.h +++ b/include/net/can_host.h @@ -32,10 +32,7 @@ #include "qom/object.h" =20 #define TYPE_CAN_HOST "can-host" -typedef struct CanHostClass CanHostClass; -typedef struct CanHostState CanHostState; -DECLARE_OBJ_CHECKERS(CanHostState, CanHostClass, - CAN_HOST, TYPE_CAN_HOST) +OBJECT_DECLARE_TYPE(CanHostState, CanHostClass, CAN_HOST) =20 struct CanHostState { ObjectClass oc; diff --git a/include/net/filter.h b/include/net/filter.h index e7e593128a..27ffc630df 100644 --- a/include/net/filter.h +++ b/include/net/filter.h @@ -15,9 +15,7 @@ #include "net/queue.h" =20 #define TYPE_NETFILTER "netfilter" -typedef struct NetFilterClass NetFilterClass; -DECLARE_OBJ_CHECKERS(NetFilterState, NetFilterClass, - NETFILTER, TYPE_NETFILTER) +OBJECT_DECLARE_TYPE(NetFilterState, NetFilterClass, NETFILTER) =20 typedef void (FilterSetup) (NetFilterState *nf, Error **errp); typedef void (FilterCleanup) (NetFilterState *nf); diff --git a/include/ui/console.h b/include/ui/console.h index 8602203523..d091c2e1e2 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -106,9 +106,7 @@ void kbd_put_keysym(int keysym); /* consoles */ =20 #define TYPE_QEMU_CONSOLE "qemu-console" -typedef struct QemuConsoleClass QemuConsoleClass; -DECLARE_OBJ_CHECKERS(QemuConsole, QemuConsoleClass, - QEMU_CONSOLE, TYPE_QEMU_CONSOLE) +OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE) =20 =20 struct QemuConsoleClass { diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index dbf7d63dc8..3707876d6d 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -77,7 +77,6 @@ struct MPS2TZMachineClass { uint32_t scc_id; const char *armsse_type; }; -typedef struct MPS2TZMachineClass MPS2TZMachineClass; =20 struct MPS2TZMachineState { MachineState parent; @@ -102,14 +101,12 @@ struct MPS2TZMachineState { DeviceState *lan9118; SplitIRQ cpu_irq_splitter[MPS2TZ_NUMIRQ]; }; -typedef struct MPS2TZMachineState MPS2TZMachineState; =20 #define TYPE_MPS2TZ_MACHINE "mps2tz" #define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505") #define TYPE_MPS2TZ_AN521_MACHINE MACHINE_TYPE_NAME("mps2-an521") =20 -DECLARE_OBJ_CHECKERS(MPS2TZMachineState, MPS2TZMachineClass, - MPS2TZ_MACHINE, TYPE_MPS2TZ_MACHINE) +OBJECT_DECLARE_TYPE(MPS2TZMachineState, MPS2TZMachineClass, 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 5d47160850..9a8b23c64c 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -63,7 +63,6 @@ struct MPS2MachineClass { hwaddr ethernet_base; hwaddr psram_base; }; -typedef struct MPS2MachineClass MPS2MachineClass; =20 struct MPS2MachineState { MachineState parent; @@ -85,7 +84,6 @@ struct MPS2MachineState { CMSDKAPBDualTimer dualtimer; CMSDKAPBWatchdog watchdog; }; -typedef struct MPS2MachineState MPS2MachineState; =20 #define TYPE_MPS2_MACHINE "mps2" #define TYPE_MPS2_AN385_MACHINE MACHINE_TYPE_NAME("mps2-an385") @@ -93,8 +91,7 @@ typedef struct MPS2MachineState MPS2MachineState; #define TYPE_MPS2_AN500_MACHINE MACHINE_TYPE_NAME("mps2-an500") #define TYPE_MPS2_AN511_MACHINE MACHINE_TYPE_NAME("mps2-an511") =20 -DECLARE_OBJ_CHECKERS(MPS2MachineState, MPS2MachineClass, - MPS2_MACHINE, TYPE_MPS2_MACHINE) +OBJECT_DECLARE_TYPE(MPS2MachineState, MPS2MachineClass, 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 16015255c8..b50157f63a 100644 --- a/hw/arm/musca.c +++ b/hw/arm/musca.c @@ -55,7 +55,6 @@ struct MuscaMachineClass { const MPCInfo *mpc_info; int num_mpcs; }; -typedef struct MuscaMachineClass MuscaMachineClass; =20 struct MuscaMachineState { MachineState parent; @@ -84,14 +83,12 @@ struct MuscaMachineState { UnimplementedDeviceState gpio; UnimplementedDeviceState cryptoisland; }; -typedef struct MuscaMachineState MuscaMachineState; =20 #define TYPE_MUSCA_MACHINE "musca" #define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a") #define TYPE_MUSCA_B1_MACHINE MACHINE_TYPE_NAME("musca-b1") =20 -DECLARE_OBJ_CHECKERS(MuscaMachineState, MuscaMachineClass, - MUSCA_MACHINE, TYPE_MUSCA_MACHINE) +OBJECT_DECLARE_TYPE(MuscaMachineState, MuscaMachineClass, MUSCA_MACHINE) =20 /* * Main SYSCLK frequency in Hz diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index a7ad667f06..b5b867e6ed 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -43,7 +43,6 @@ struct SpitzMachineClass { enum spitz_model_e model; int arm_id; }; -typedef struct SpitzMachineClass SpitzMachineClass; =20 struct SpitzMachineState { MachineState parent; @@ -56,11 +55,9 @@ struct SpitzMachineState { DeviceState *scp1; DeviceState *misc_gpio; }; -typedef struct SpitzMachineState SpitzMachineState; =20 #define TYPE_SPITZ_MACHINE "spitz-common" -DECLARE_OBJ_CHECKERS(SpitzMachineState, SpitzMachineClass, - SPITZ_MACHINE, TYPE_SPITZ_MACHINE) +OBJECT_DECLARE_TYPE(SpitzMachineState, SpitzMachineClass, SPITZ_MACHINE) =20 #define zaurus_printf(format, ...) \ fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 01bb4bba1e..94ff094ab3 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -171,20 +171,17 @@ struct VexpressMachineClass { MachineClass parent; VEDBoardInfo *daughterboard; }; -typedef struct VexpressMachineClass VexpressMachineClass; =20 struct VexpressMachineState { MachineState parent; bool secure; bool virt; }; -typedef struct VexpressMachineState VexpressMachineState; =20 #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") -DECLARE_OBJ_CHECKERS(VexpressMachineState, VexpressMachineClass, - VEXPRESS_MACHINE, TYPE_VEXPRESS_MACHINE) +OBJECT_DECLARE_TYPE(VexpressMachineState, VexpressMachineClass, VEXPRESS_M= ACHINE) =20 typedef void DBoardInitFn(const VexpressMachineState *machine, ram_addr_t ram_size, diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 8dae779c76..483925f57a 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -456,17 +456,14 @@ struct Flash { const FlashPartInfo *pi; =20 }; -typedef struct Flash Flash; =20 struct M25P80Class { SSISlaveClass parent_class; FlashPartInfo *pi; }; -typedef struct M25P80Class M25P80Class; =20 #define TYPE_M25P80 "m25p80-generic" -DECLARE_OBJ_CHECKERS(Flash, M25P80Class, - M25P80, TYPE_M25P80) +OBJECT_DECLARE_TYPE(Flash, M25P80Class, M25P80) =20 static inline Manufacturer get_man(Flash *s) { diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c index fe0c363d64..a9088c910c 100644 --- a/hw/input/adb-kbd.c +++ b/hw/input/adb-kbd.c @@ -32,10 +32,7 @@ #include "trace.h" #include "qom/object.h" =20 -typedef struct ADBKeyboardClass ADBKeyboardClass; -typedef struct KBDState KBDState; -DECLARE_OBJ_CHECKERS(KBDState, ADBKeyboardClass, - ADB_KEYBOARD, TYPE_ADB_KEYBOARD) +OBJECT_DECLARE_TYPE(KBDState, ADBKeyboardClass, ADB_KEYBOARD) =20 struct KBDState { /*< private >*/ diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c index f5750909b4..e6b341f028 100644 --- a/hw/input/adb-mouse.c +++ b/hw/input/adb-mouse.c @@ -31,10 +31,7 @@ #include "trace.h" #include "qom/object.h" =20 -typedef struct ADBMouseClass ADBMouseClass; -typedef struct MouseState MouseState; -DECLARE_OBJ_CHECKERS(MouseState, ADBMouseClass, - ADB_MOUSE, TYPE_ADB_MOUSE) +OBJECT_DECLARE_TYPE(MouseState, ADBMouseClass, ADB_MOUSE) =20 struct MouseState { /*< public >*/ diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c index 212d6e0e83..ef3c682e32 100644 --- a/hw/misc/tmp421.c +++ b/hw/misc/tmp421.c @@ -65,17 +65,14 @@ struct TMP421State { uint8_t pointer; =20 }; -typedef struct TMP421State TMP421State; =20 struct TMP421Class { I2CSlaveClass parent_class; DeviceInfo *dev; }; -typedef struct TMP421Class TMP421Class; =20 #define TYPE_TMP421 "tmp421-generic" -DECLARE_OBJ_CHECKERS(TMP421State, TMP421Class, - TMP421, TYPE_TMP421) +OBJECT_DECLARE_TYPE(TMP421State, TMP421Class, TMP421) =20 =20 /* the TMP421 registers */ diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 1f0388a755..e859534eaf 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -55,10 +55,7 @@ =20 #define TYPE_SCSI_DISK_BASE "scsi-disk-base" =20 -typedef struct SCSIDiskClass SCSIDiskClass; -typedef struct SCSIDiskState SCSIDiskState; -DECLARE_OBJ_CHECKERS(SCSIDiskState, SCSIDiskClass, - SCSI_DISK_BASE, TYPE_SCSI_DISK_BASE) +OBJECT_DECLARE_TYPE(SCSIDiskState, SCSIDiskClass, SCSI_DISK_BASE) =20 struct SCSIDiskClass { SCSIDeviceClass parent_class; diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index 40095bed09..a63d25de48 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -61,12 +61,9 @@ struct PVSCSIClass { PCIDeviceClass parent_class; DeviceRealize parent_dc_realize; }; -typedef struct PVSCSIClass PVSCSIClass; =20 #define TYPE_PVSCSI "pvscsi" -typedef struct PVSCSIState PVSCSIState; -DECLARE_OBJ_CHECKERS(PVSCSIState, PVSCSIClass, - PVSCSI, TYPE_PVSCSI) +OBJECT_DECLARE_TYPE(PVSCSIState, PVSCSIClass, PVSCSI) =20 =20 /* Compatibility flags for migration */ --=20 2.26.2 From nobody Sat May 4 16:38:13 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=1600464000; cv=none; d=zohomail.com; s=zohoarc; b=NMHT3DKHmBneu6rcubvI6dkzc6PAxoqtVEcZxe66H9JsYERQZ1GDVjiI6/4wqEzmd1uhVXs6MXWXiARdXCPuDSPXD0cxfL+eFFE7wJzKyPlrFFNp/IUt5vA331eVrRnQdQbqRY+GOxzsz/dEDzp8a1PI2hjdYvwPSyEj8LKyLk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600464000; 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=GycFYFK5jZqSKr3xs3+dexokOizzSkuxs2TR4z8SHMQ=; b=MKK80CzjAujsQLLCbGMKRrWHR57zlAMsSC9CYJ4s4Jfzuw6HBT2IJDWg4SODEDUqbZQj/U3Pai85QZ8/POugceCfNf4hOjSg/O9iw34AnzxZaox6URc4TjOknJL4CWnUlS07UGgGvFXZo5L6faxukvPhwAMzejCLDfWoUt98Vpo= 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 1600464000632434.6277443871602; Fri, 18 Sep 2020 14:20:00 -0700 (PDT) Received: from localhost ([::1]:52876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJNnR-0002sN-Pw for importer@patchew.org; Fri, 18 Sep 2020 17:19:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJNIa-0002tO-VC for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:48:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kJNIS-0006M2-BS for qemu-devel@nongnu.org; Fri, 18 Sep 2020 16:48:04 -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-470-Rp61P66ePkytxnt66t3cFQ-1; Fri, 18 Sep 2020 16:47:36 -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 34F0C9CC28; Fri, 18 Sep 2020 20:47:35 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5688573674; Fri, 18 Sep 2020 20:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600462073; 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=GycFYFK5jZqSKr3xs3+dexokOizzSkuxs2TR4z8SHMQ=; b=AmPXJZjPGWyZqYZSAmC1sPwyIMmCmOihm0W5sTktQSOBw1mMhlhYgM7N/7bUZLc0fE928E ujUmB1Rep2NEoPHlPbkmQL0KajiumBIM3XrQ5Ung2SSMVMeOJQ0R95lWU5O9bpfklbf1Xu 2TF07eF02skrMhwQDKqGubsrE8JEZIY= X-MC-Unique: Rp61P66ePkytxnt66t3cFQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 17/17] Use OBJECT_DECLARE_SIMPLE_TYPE when possible Date: Fri, 18 Sep 2020 16:47:14 -0400 Message-Id: <20200918204714.27276-18-ehabkost@redhat.com> In-Reply-To: <20200918204714.27276-1-ehabkost@redhat.com> References: <20200918204714.27276-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 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/18 00:20:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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?= , Paul Durrant 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 converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=3DAddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost Acked-by: Paul Durrant Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/9pfs/virtio-9p.h | 4 +- hw/audio/intel-hda.h | 4 +- hw/display/ati_int.h | 4 +- hw/display/qxl.h | 4 +- hw/i386/amd_iommu.h | 4 +- hw/misc/tmp105.h | 4 +- hw/net/fsl_etsec/etsec.h | 3 +- hw/net/tulip.h | 4 +- hw/ppc/e500-ccsr.h | 4 +- hw/ppc/mac.h | 4 +- hw/s390x/ipl.h | 4 +- hw/s390x/s390-pci-bus.h | 16 ++------ hw/s390x/virtio-ccw.h | 52 ++++++------------------ hw/usb/hcd-ehci.h | 8 +--- hw/usb/hcd-ohci.h | 4 +- hw/usb/hcd-xhci.h | 4 +- hw/vfio/pci.h | 4 +- hw/xen/xen_pt.h | 4 +- include/block/throttle-groups.h | 4 +- include/hw/acpi/generic_event_device.h | 4 +- include/hw/acpi/vmgenid.h | 4 +- include/hw/adc/stm32f2xx_adc.h | 4 +- include/hw/arm/allwinner-a10.h | 4 +- include/hw/arm/allwinner-h3.h | 4 +- include/hw/arm/armv7m.h | 8 +--- include/hw/arm/bcm2835_peripherals.h | 4 +- include/hw/arm/digic.h | 4 +- include/hw/arm/exynos4210.h | 4 +- include/hw/arm/fsl-imx25.h | 4 +- include/hw/arm/fsl-imx31.h | 4 +- include/hw/arm/fsl-imx6.h | 4 +- include/hw/arm/fsl-imx6ul.h | 4 +- include/hw/arm/fsl-imx7.h | 4 +- include/hw/arm/msf2-soc.h | 4 +- include/hw/arm/nrf51_soc.h | 4 +- include/hw/arm/omap.h | 4 +- include/hw/arm/pxa.h | 15 ++----- include/hw/arm/stm32f205_soc.h | 4 +- include/hw/arm/stm32f405_soc.h | 4 +- include/hw/arm/xlnx-versal.h | 4 +- include/hw/arm/xlnx-zynqmp.h | 4 +- include/hw/block/flash.h | 8 +--- include/hw/block/swim.h | 12 ++---- include/hw/char/avr_usart.h | 4 +- include/hw/char/bcm2835_aux.h | 4 +- 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 | 4 +- include/hw/char/ibex_uart.h | 4 +- include/hw/char/imx_serial.h | 4 +- include/hw/char/nrf51_uart.h | 4 +- include/hw/char/pl011.h | 4 +- include/hw/char/serial.h | 11 ++--- include/hw/char/stm32f2xx_usart.h | 4 +- include/hw/clock.h | 4 +- include/hw/core/generic-loader.h | 4 +- include/hw/core/split-irq.h | 4 +- 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 | 4 +- include/hw/display/dpcd.h | 4 +- include/hw/display/i2c-ddc.h | 4 +- include/hw/display/macfb.h | 4 +- include/hw/display/xlnx_dp.h | 4 +- include/hw/dma/bcm2835_dma.h | 4 +- include/hw/dma/i8257.h | 4 +- include/hw/dma/pl080.h | 4 +- include/hw/dma/xlnx-zdma.h | 4 +- include/hw/dma/xlnx-zynq-devcfg.h | 4 +- include/hw/dma/xlnx_dpdma.h | 4 +- include/hw/gpio/bcm2835_gpio.h | 4 +- include/hw/gpio/imx_gpio.h | 4 +- include/hw/gpio/nrf51_gpio.h | 4 +- include/hw/hyperv/vmbus-bridge.h | 4 +- include/hw/hyperv/vmbus.h | 4 +- include/hw/i2c/i2c.h | 3 +- include/hw/i2c/imx_i2c.h | 4 +- include/hw/i2c/microbit_i2c.h | 4 +- include/hw/i2c/ppc4xx_i2c.h | 4 +- include/hw/i386/ich9.h | 4 +- include/hw/i386/intel_iommu.h | 4 +- include/hw/ide/ahci.h | 12 ++---- include/hw/ide/internal.h | 4 +- include/hw/ide/pci.h | 4 +- include/hw/input/adb.h | 4 +- include/hw/input/i8042.h | 4 +- include/hw/intc/allwinner-a10-pic.h | 4 +- include/hw/intc/aspeed_vic.h | 4 +- include/hw/intc/bcm2835_ic.h | 4 +- include/hw/intc/bcm2836_control.h | 4 +- include/hw/intc/heathrow_pic.h | 4 +- include/hw/intc/ibex_plic.h | 4 +- include/hw/intc/imx_avic.h | 4 +- include/hw/intc/imx_gpcv2.h | 4 +- include/hw/intc/mips_gic.h | 4 +- include/hw/intc/realview_gic.h | 4 +- include/hw/intc/rx_icu.h | 4 +- include/hw/intc/xlnx-pmu-iomod-intc.h | 4 +- include/hw/intc/xlnx-zynqmp-ipi.h | 4 +- include/hw/ipack/ipack.h | 4 +- include/hw/ipmi/ipmi.h | 4 +- include/hw/isa/isa.h | 3 +- include/hw/isa/pc87312.h | 4 +- include/hw/m68k/mcf_fec.h | 4 +- include/hw/mips/cps.h | 4 +- include/hw/misc/a9scu.h | 4 +- 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 | 4 +- include/hw/misc/armsse-cpuid.h | 4 +- include/hw/misc/armsse-mhu.h | 4 +- include/hw/misc/aspeed_xdma.h | 4 +- include/hw/misc/auxbus.h | 11 ++--- include/hw/misc/avr_power.h | 4 +- include/hw/misc/bcm2835_mbox.h | 4 +- include/hw/misc/bcm2835_mphi.h | 3 +- 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 | 4 +- include/hw/misc/imx31_ccm.h | 4 +- include/hw/misc/imx6_ccm.h | 4 +- include/hw/misc/imx6_src.h | 4 +- include/hw/misc/imx6ul_ccm.h | 4 +- include/hw/misc/imx7_ccm.h | 8 +--- include/hw/misc/imx7_gpr.h | 4 +- include/hw/misc/imx7_snvs.h | 4 +- include/hw/misc/imx_rngc.h | 4 +- include/hw/misc/iotkit-secctl.h | 4 +- include/hw/misc/iotkit-sysctl.h | 4 +- include/hw/misc/iotkit-sysinfo.h | 4 +- include/hw/misc/mac_via.h | 12 ++---- include/hw/misc/macio/cuda.h | 8 +--- include/hw/misc/macio/gpio.h | 4 +- include/hw/misc/macio/macio.h | 20 +++------ include/hw/misc/macio/pmu.h | 8 +--- include/hw/misc/max111x.h | 4 +- include/hw/misc/mips_cmgcr.h | 4 +- include/hw/misc/mips_cpc.h | 4 +- include/hw/misc/mips_itu.h | 4 +- include/hw/misc/mps2-fpgaio.h | 4 +- include/hw/misc/mps2-scc.h | 4 +- include/hw/misc/msf2-sysreg.h | 4 +- include/hw/misc/nrf51_rng.h | 4 +- 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 | 4 +- include/hw/misc/tz-msc.h | 4 +- include/hw/misc/tz-ppc.h | 4 +- include/hw/misc/unimp.h | 4 +- include/hw/misc/zynq-xadc.h | 4 +- include/hw/net/allwinner-sun8i-emac.h | 4 +- include/hw/net/allwinner_emac.h | 4 +- include/hw/net/cadence_gem.h | 4 +- include/hw/net/ftgmac100.h | 8 +--- include/hw/net/imx_fec.h | 4 +- include/hw/net/msf2-emac.h | 4 +- include/hw/nubus/mac-nubus-bridge.h | 4 +- include/hw/nubus/nubus.h | 8 +--- include/hw/nvram/fw_cfg.h | 9 ++-- include/hw/nvram/nrf51_nvm.h | 4 +- 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 | 7 +--- include/hw/pci-host/pnv_phb4.h | 6 +-- 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 | 4 +- include/hw/pci-host/xilinx-pcie.h | 8 +--- include/hw/pci/pci_bridge.h | 3 +- include/hw/pci/pcie_host.h | 3 +- include/hw/pci/pcie_port.h | 6 +-- include/hw/platform-bus.h | 4 +- include/hw/ppc/mac_dbdma.h | 3 +- include/hw/ppc/openpic.h | 4 +- include/hw/ppc/pnv_core.h | 4 +- include/hw/ppc/pnv_pnor.h | 4 +- include/hw/ppc/pnv_psi.h | 8 +--- include/hw/ppc/spapr.h | 8 +--- include/hw/ppc/spapr_tpm_proxy.h | 4 +- include/hw/ppc/spapr_vio.h | 4 +- include/hw/ppc/xive.h | 12 ++---- include/hw/riscv/opentitan.h | 4 +- include/hw/riscv/riscv_hart.h | 4 +- include/hw/rtc/aspeed_rtc.h | 4 +- include/hw/rtc/goldfish_rtc.h | 4 +- include/hw/rtc/mc146818rtc.h | 4 +- include/hw/rtc/pl031.h | 4 +- include/hw/rtc/xlnx-zynqmp-rtc.h | 4 +- include/hw/s390x/css-bridge.h | 8 +--- include/hw/s390x/s390_flic.h | 4 +- include/hw/s390x/vfio-ccw.h | 4 +- include/hw/scsi/esp.h | 4 +- include/hw/scsi/scsi.h | 3 +- include/hw/sd/aspeed_sdhci.h | 4 +- include/hw/sd/bcm2835_sdhost.h | 4 +- include/hw/sparc/sparc32_dma.h | 16 ++------ include/hw/ssi/imx_spi.h | 4 +- include/hw/ssi/mss-spi.h | 4 +- include/hw/ssi/pl022.h | 4 +- include/hw/ssi/stm32f2xx_spi.h | 4 +- include/hw/ssi/xilinx_spips.h | 7 +--- include/hw/timer/a9gtimer.h | 4 +- include/hw/timer/allwinner-a10-pit.h | 4 +- include/hw/timer/arm_mptimer.h | 4 +- include/hw/timer/armv7m_systick.h | 4 +- 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 | 4 +- include/hw/timer/imx_epit.h | 4 +- include/hw/timer/mss-timer.h | 4 +- include/hw/timer/nrf51_timer.h | 4 +- include/hw/usb.h | 4 +- include/hw/usb/chipidea.h | 4 +- include/hw/usb/imx-usb-phy.h | 4 +- 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-crypto.h | 4 +- include/hw/virtio/virtio-gpu-pci.h | 4 +- include/hw/virtio/virtio-gpu.h | 8 +--- include/hw/virtio/virtio-input.h | 12 ++---- include/hw/virtio/virtio-iommu.h | 4 +- include/hw/virtio/virtio-mmio.h | 4 +- include/hw/virtio/virtio-net.h | 4 +- include/hw/virtio/virtio-rng.h | 4 +- include/hw/virtio/virtio-scsi.h | 8 +--- include/hw/virtio/virtio-serial.h | 7 +--- include/hw/watchdog/cmsdk-apb-watchdog.h | 4 +- include/hw/watchdog/wdt_imx2.h | 4 +- include/hw/xen/xen-block.h | 8 +--- 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/net/can_emu.h | 3 +- include/sysemu/rng-random.h | 4 +- backends/cryptodev-builtin.c | 5 +-- backends/cryptodev-vhost-user.c | 4 +- backends/hostmem-file.c | 4 +- backends/hostmem-memfd.c | 4 +- backends/rng-builtin.c | 4 +- backends/rng-egd.c | 4 +- backends/tpm/tpm_emulator.c | 4 +- backends/tpm/tpm_passthrough.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/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/sbsa-ref.c | 4 +- hw/arm/spitz.c | 20 +++------ hw/arm/stellaris.c | 8 +--- hw/arm/strongarm.c | 24 +++-------- hw/arm/tosa.c | 8 +--- hw/arm/versatilepb.c | 4 +- hw/arm/xilinx_zynq.c | 4 +- hw/arm/xlnx-versal-virt.c | 4 +- hw/arm/xlnx-zcu102.c | 4 +- hw/arm/z2.c | 8 +--- hw/audio/ac97.c | 4 +- hw/audio/adlib.c | 4 +- hw/audio/es1370.c | 3 +- hw/audio/gus.c | 4 +- hw/audio/hda-codec.c | 3 +- hw/audio/marvell_88w8618.c | 4 +- hw/audio/milkymist-ac97.c | 4 +- hw/audio/pcspk.c | 4 +- hw/audio/pl041.c | 4 +- hw/audio/sb16.c | 4 +- hw/audio/wm8750.c | 4 +- hw/block/fdc.c | 16 ++------ hw/block/nand.c | 3 +- hw/block/onenand.c | 4 +- hw/char/debugcon.c | 4 +- hw/char/exynos4210_uart.c | 4 +- hw/char/grlib_apbuart.c | 4 +- hw/char/ipoctal232.c | 3 +- hw/char/lm32_juart.c | 4 +- hw/char/lm32_uart.c | 4 +- hw/char/mcf_uart.c | 4 +- hw/char/milkymist-uart.c | 4 +- hw/char/parallel.c | 4 +- hw/char/serial-isa.c | 4 +- hw/char/serial-pci.c | 4 +- hw/char/spapr_vty.c | 4 +- hw/char/xilinx_uartlite.c | 4 +- hw/cpu/realview_mpcore.c | 4 +- hw/display/ads7846.c | 4 +- hw/display/artist.c | 4 +- hw/display/bochs-display.c | 4 +- hw/display/cg3.c | 4 +- hw/display/cirrus_vga.c | 4 +- hw/display/cirrus_vga_isa.c | 4 +- hw/display/exynos4210_fimd.c | 4 +- hw/display/g364fb.c | 4 +- hw/display/jazz_led.c | 4 +- hw/display/milkymist-tmu2.c | 4 +- hw/display/milkymist-vgafb.c | 4 +- hw/display/next-fb.c | 4 +- hw/display/pl110.c | 4 +- hw/display/sii9022.c | 4 +- hw/display/sm501.c | 8 +--- hw/display/ssd0303.c | 4 +- hw/display/ssd0323.c | 4 +- hw/display/tcx.c | 4 +- hw/display/vga-isa.c | 4 +- hw/display/vga-pci.c | 4 +- hw/dma/i82374.c | 4 +- hw/dma/pl330.c | 3 +- hw/dma/puv3_dma.c | 4 +- hw/dma/pxa2xx_dma.c | 4 +- hw/dma/rc4030.c | 4 +- hw/dma/xilinx_axidma.c | 4 +- hw/gpio/gpio_key.c | 4 +- hw/gpio/max7310.c | 4 +- hw/gpio/mpc8xxx.c | 4 +- hw/gpio/pl061.c | 4 +- hw/gpio/puv3_gpio.c | 4 +- hw/gpio/zaurus.c | 4 +- hw/hppa/dino.c | 4 +- hw/hppa/lasi.c | 4 +- hw/hyperv/hyperv.c | 4 +- hw/hyperv/hyperv_testdev.c | 4 +- hw/i2c/bitbang_i2c.c | 4 +- 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/i386/kvm/clock.c | 4 +- hw/i386/kvmvapic.c | 4 +- hw/i386/port92.c | 4 +- hw/i386/vmmouse.c | 4 +- hw/i386/vmport.c | 4 +- hw/i386/xen/xen_platform.c | 4 +- hw/i386/xen/xen_pvdevice.c | 4 +- hw/ide/isa.c | 4 +- hw/ide/microdrive.c | 4 +- hw/ide/sii3112.c | 4 +- hw/input/lm832x.c | 4 +- hw/input/milkymist-softusb.c | 4 +- hw/input/pl050.c | 4 +- hw/intc/arm_gicv2m.c | 4 +- hw/intc/exynos4210_combiner.c | 4 +- hw/intc/exynos4210_gic.c | 8 +--- hw/intc/grlib_irqmp.c | 4 +- hw/intc/lm32_pic.c | 4 +- hw/intc/nios2_iic.c | 4 +- hw/intc/ompic.c | 4 +- hw/intc/openpic_kvm.c | 4 +- hw/intc/pl190.c | 4 +- hw/intc/puv3_intc.c | 4 +- hw/intc/slavio_intctl.c | 4 +- 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 | 4 +- hw/isa/i82378.c | 4 +- hw/isa/piix4.c | 4 +- hw/isa/vt82c686.c | 16 ++------ hw/m68k/mcf_intc.c | 4 +- hw/m68k/next-cube.c | 4 +- hw/m68k/next-kbd.c | 4 +- hw/microblaze/xlnx-zynqmp-pmu.c | 4 +- hw/mips/gt64xxx_pci.c | 4 +- hw/mips/malta.c | 4 +- hw/misc/applesmc.c | 4 +- hw/misc/arm_integrator_debug.c | 4 +- hw/misc/arm_l2x0.c | 4 +- hw/misc/arm_sysctl.c | 4 +- hw/misc/debugexit.c | 4 +- hw/misc/eccmemctl.c | 4 +- hw/misc/empty_slot.c | 4 +- hw/misc/exynos4210_clk.c | 4 +- hw/misc/exynos4210_pmu.c | 4 +- hw/misc/exynos4210_rng.c | 4 +- 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/pci-testdev.c | 4 +- hw/misc/puv3_pm.c | 4 +- hw/misc/sga.c | 4 +- hw/misc/slavio_misc.c | 4 +- hw/misc/zynq_slcr.c | 4 +- hw/net/dp8393x.c | 4 +- hw/net/e1000e.c | 4 +- hw/net/etraxfs_eth.c | 4 +- hw/net/lan9118.c | 4 +- hw/net/milkymist-minimac2.c | 4 +- hw/net/mipsnet.c | 4 +- hw/net/ne2000-isa.c | 4 +- hw/net/opencores_eth.c | 4 +- hw/net/pcnet-pci.c | 4 +- hw/net/rtl8139.c | 4 +- hw/net/smc91c111.c | 4 +- hw/net/spapr_llan.c | 4 +- hw/net/stellaris_enet.c | 4 +- hw/net/sungem.c | 4 +- hw/net/sunhme.c | 4 +- hw/net/xgmac.c | 4 +- hw/net/xilinx_axienet.c | 4 +- hw/nvram/ds1225y.c | 4 +- hw/nvram/spapr_nvram.c | 4 +- hw/pci-bridge/dec.c | 4 +- hw/pci-bridge/gen_pcie_root_port.c | 4 +- hw/pci-bridge/pci_bridge_dev.c | 4 +- hw/pci-bridge/pcie_pci_bridge.c | 4 +- hw/pci-host/bonito.c | 6 +-- hw/pci-host/grackle.c | 4 +- hw/pci-host/i440fx.c | 4 +- hw/pci-host/ppce500.c | 8 +--- hw/pci-host/prep.c | 4 +- hw/ppc/mpc8544_guts.c | 4 +- hw/ppc/ppc440_pcix.c | 4 +- hw/ppc/ppc440_uc.c | 4 +- hw/ppc/ppc4xx_pci.c | 4 +- hw/ppc/ppce500_spin.c | 4 +- hw/ppc/prep_systemio.c | 4 +- hw/ppc/rs6000_mc.c | 4 +- hw/ppc/spapr_rng.c | 4 +- hw/rtc/ds1338.c | 4 +- hw/rtc/exynos4210_rtc.c | 4 +- hw/rtc/m41t80.c | 4 +- hw/rtc/sun4v-rtc.c | 4 +- hw/rtc/twl92230.c | 4 +- hw/scsi/lsi53c895a.c | 4 +- hw/scsi/spapr_vscsi.c | 4 +- hw/sd/milkymist-memcard.c | 4 +- hw/sd/pl181.c | 4 +- hw/sd/ssi-sd.c | 4 +- hw/sh4/sh_pci.c | 4 +- hw/sparc/sun4m.c | 8 +--- hw/sparc64/sun4u.c | 8 +--- hw/ssi/ssi.c | 3 +- hw/ssi/xilinx_spi.c | 4 +- hw/timer/altera_timer.c | 4 +- hw/timer/arm_timer.c | 8 +--- hw/timer/cadence_ttc.c | 4 +- hw/timer/exynos4210_mct.c | 4 +- hw/timer/exynos4210_pwm.c | 4 +- hw/timer/grlib_gptimer.c | 4 +- hw/timer/hpet.c | 4 +- hw/timer/lm32_timer.c | 4 +- hw/timer/milkymist-sysctl.c | 4 +- hw/timer/puv3_ost.c | 4 +- hw/timer/pxa2xx_timer.c | 4 +- hw/timer/slavio_timer.c | 4 +- hw/tpm/tpm_tis_isa.c | 4 +- hw/tpm/tpm_tis_sysbus.c | 4 +- hw/usb/dev-audio.c | 4 +- hw/usb/dev-hid.c | 4 +- hw/usb/dev-hub.c | 4 +- hw/usb/dev-mtp.c | 3 +- hw/usb/dev-network.c | 4 +- hw/usb/dev-serial.c | 4 +- hw/usb/dev-smartcard-reader.c | 7 +--- hw/usb/dev-uas.c | 3 +- hw/usb/dev-wacom.c | 4 +- hw/usb/hcd-ohci-pci.c | 4 +- hw/usb/host-libusb.c | 4 +- hw/usb/tusb6010.c | 4 +- hw/vfio/ap.c | 4 +- hw/virtio/virtio-input-pci.c | 8 +--- hw/watchdog/wdt_i6300esb.c | 4 +- migration/rdma.c | 4 +- net/can/can_socketcan.c | 4 +- net/dump.c | 4 +- net/filter-buffer.c | 4 +- net/filter-replay.c | 4 +- net/filter-rewriter.c | 4 +- scsi/pr-manager-helper.c | 4 +- target/i386/sev.c | 4 +- 505 files changed, 609 insertions(+), 1795 deletions(-) diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index ff70c5a971..20fa118f3a 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -13,10 +13,8 @@ struct V9fsVirtioState { VirtQueueElement *elems[MAX_REQ]; V9fsState state; }; -typedef struct V9fsVirtioState V9fsVirtioState; =20 #define TYPE_VIRTIO_9P "virtio-9p-device" -DECLARE_INSTANCE_CHECKER(V9fsVirtioState, VIRTIO_9P, - TYPE_VIRTIO_9P) +OBJECT_DECLARE_SIMPLE_TYPE(V9fsVirtioState, VIRTIO_9P) =20 #endif diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index e2372abbdc..f78c1833e3 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -12,9 +12,7 @@ OBJECT_DECLARE_TYPE(HDACodecDevice, HDACodecDeviceClass, HDA_CODEC_DEVICE) =20 #define TYPE_HDA_BUS "HDA" -typedef struct HDACodecBus HDACodecBus; -DECLARE_INSTANCE_CHECKER(HDACodecBus, HDA_BUS, - TYPE_HDA_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(HDACodecBus, HDA_BUS) =20 =20 typedef void (*hda_codec_response_func)(HDACodecDevice *dev, diff --git a/hw/display/ati_int.h b/hw/display/ati_int.h index 714005447d..8acb9c7466 100644 --- a/hw/display/ati_int.h +++ b/hw/display/ati_int.h @@ -30,9 +30,7 @@ #define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 =20 #define TYPE_ATI_VGA "ati-vga" -typedef struct ATIVGAState ATIVGAState; -DECLARE_INSTANCE_CHECKER(ATIVGAState, ATI_VGA, - TYPE_ATI_VGA) +OBJECT_DECLARE_SIMPLE_TYPE(ATIVGAState, ATI_VGA) =20 typedef struct ATIVGARegs { uint32_t mm_index; diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 714cd01b63..379d3304ab 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -128,11 +128,9 @@ struct PCIQXLDevice { QXLRect dirty[QXL_NUM_DIRTY_RECTS]; QEMUBH *update_area_bh; }; -typedef struct PCIQXLDevice PCIQXLDevice; =20 #define TYPE_PCI_QXL "pci-qxl" -DECLARE_INSTANCE_CHECKER(PCIQXLDevice, PCI_QXL, - TYPE_PCI_QXL) +OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL) =20 #define PANIC_ON(x) if ((x)) { \ printf("%s: PANIC %s failed\n", __func__, #x); \ diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index fa5feb183c..79d38a3e41 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -297,9 +297,7 @@ struct irte_ga { }; =20 #define TYPE_AMD_IOMMU_DEVICE "amd-iommu" -typedef struct AMDVIState AMDVIState; -DECLARE_INSTANCE_CHECKER(AMDVIState, AMD_IOMMU_DEVICE, - TYPE_AMD_IOMMU_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(AMDVIState, 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 7ee8a496ff..e5198fce80 100644 --- a/hw/misc/tmp105.h +++ b/hw/misc/tmp105.h @@ -19,9 +19,7 @@ #include "qom/object.h" =20 #define TYPE_TMP105 "tmp105" -typedef struct TMP105State TMP105State; -DECLARE_INSTANCE_CHECKER(TMP105State, TMP105, - TYPE_TMP105) +OBJECT_DECLARE_SIMPLE_TYPE(TMP105State, TMP105) =20 /** * TMP105State: diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h index 0c929d9afd..fddf551544 100644 --- a/hw/net/fsl_etsec/etsec.h +++ b/hw/net/fsl_etsec/etsec.h @@ -150,8 +150,7 @@ struct eTSEC { typedef struct eTSEC eTSEC; =20 #define TYPE_ETSEC_COMMON "eTSEC" -DECLARE_INSTANCE_CHECKER(eTSEC, ETSEC_COMMON, - TYPE_ETSEC_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(eTSEC, ETSEC_COMMON) =20 #define eTSEC_TRANSMIT 1 #define eTSEC_RECEIVE 2 diff --git a/hw/net/tulip.h b/hw/net/tulip.h index 87e3ab79bc..ffd1f88d57 100644 --- a/hw/net/tulip.h +++ b/hw/net/tulip.h @@ -6,9 +6,7 @@ #include "qom/object.h" =20 #define TYPE_TULIP "tulip" -typedef struct TULIPState TULIPState; -DECLARE_INSTANCE_CHECKER(TULIPState, TULIP, - TYPE_TULIP) +OBJECT_DECLARE_SIMPLE_TYPE(TULIPState, TULIP) =20 #define CSR(_x) ((_x) << 3) =20 diff --git a/hw/ppc/e500-ccsr.h b/hw/ppc/e500-ccsr.h index de4b9d2bc3..249c17be3b 100644 --- a/hw/ppc/e500-ccsr.h +++ b/hw/ppc/e500-ccsr.h @@ -11,10 +11,8 @@ struct PPCE500CCSRState { =20 MemoryRegion ccsr_space; }; -typedef struct PPCE500CCSRState PPCE500CCSRState; =20 #define TYPE_CCSR "e500-ccsr" -DECLARE_INSTANCE_CHECKER(PPCE500CCSRState, CCSR, - TYPE_CCSR) +OBJECT_DECLARE_SIMPLE_TYPE(PPCE500CCSRState, CCSR) =20 #endif /* E500_CCSR_H */ diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 2b6425f600..f3976b9a45 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -92,9 +92,7 @@ struct Core99MachineState { =20 /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" -typedef struct MacIONVRAMState MacIONVRAMState; -DECLARE_INSTANCE_CHECKER(MacIONVRAMState, MACIO_NVRAM, - TYPE_MACIO_NVRAM) +OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM) =20 struct MacIONVRAMState { /*< private >*/ diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 9e6061a043..9e90169695 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -153,9 +153,7 @@ struct QemuIplParameters { typedef struct QemuIplParameters QemuIplParameters; =20 #define TYPE_S390_IPL "s390-ipl" -typedef struct S390IPLState S390IPLState; -DECLARE_INSTANCE_CHECKER(S390IPLState, S390_IPL, - TYPE_S390_IPL) +OBJECT_DECLARE_SIMPLE_TYPE(S390IPLState, S390_IPL) =20 struct S390IPLState { /*< private >*/ diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index 045805980f..97464d0ad3 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -37,18 +37,10 @@ #define UID_UNDEFINED 0 #define UID_CHECKING_ENABLED 0x01 =20 -typedef struct S390pciState S390pciState; -DECLARE_INSTANCE_CHECKER(S390pciState, S390_PCI_HOST_BRIDGE, - TYPE_S390_PCI_HOST_BRIDGE) -typedef struct S390PCIBus S390PCIBus; -DECLARE_INSTANCE_CHECKER(S390PCIBus, S390_PCI_BUS, - TYPE_S390_PCI_BUS) -typedef struct S390PCIBusDevice S390PCIBusDevice; -DECLARE_INSTANCE_CHECKER(S390PCIBusDevice, S390_PCI_DEVICE, - TYPE_S390_PCI_DEVICE) -typedef struct S390PCIIOMMU S390PCIIOMMU; -DECLARE_INSTANCE_CHECKER(S390PCIIOMMU, S390_PCI_IOMMU, - TYPE_S390_PCI_IOMMU) +OBJECT_DECLARE_SIMPLE_TYPE(S390pciState, S390_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(S390PCIBus, S390_PCI_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(S390PCIBusDevice, S390_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(S390PCIIOMMU, 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 21790608b4..49a2b8ca42 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -102,9 +102,7 @@ static inline int virtio_ccw_rev_max(VirtioCcwDevice *d= ev) /* virtio-scsi-ccw */ =20 #define TYPE_VIRTIO_SCSI_CCW "virtio-scsi-ccw" -typedef struct VirtIOSCSICcw VirtIOSCSICcw; -DECLARE_INSTANCE_CHECKER(VirtIOSCSICcw, VIRTIO_SCSI_CCW, - TYPE_VIRTIO_SCSI_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSCSICcw, VIRTIO_SCSI_CCW) =20 struct VirtIOSCSICcw { VirtioCcwDevice parent_obj; @@ -115,9 +113,7 @@ struct VirtIOSCSICcw { /* vhost-scsi-ccw */ =20 #define TYPE_VHOST_SCSI_CCW "vhost-scsi-ccw" -typedef struct VHostSCSICcw VHostSCSICcw; -DECLARE_INSTANCE_CHECKER(VHostSCSICcw, VHOST_SCSI_CCW, - TYPE_VHOST_SCSI_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VHostSCSICcw, VHOST_SCSI_CCW) =20 struct VHostSCSICcw { VirtioCcwDevice parent_obj; @@ -128,9 +124,7 @@ struct VHostSCSICcw { /* virtio-blk-ccw */ =20 #define TYPE_VIRTIO_BLK_CCW "virtio-blk-ccw" -typedef struct VirtIOBlkCcw VirtIOBlkCcw; -DECLARE_INSTANCE_CHECKER(VirtIOBlkCcw, VIRTIO_BLK_CCW, - TYPE_VIRTIO_BLK_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBlkCcw, VIRTIO_BLK_CCW) =20 struct VirtIOBlkCcw { VirtioCcwDevice parent_obj; @@ -140,9 +134,7 @@ struct VirtIOBlkCcw { /* virtio-balloon-ccw */ =20 #define TYPE_VIRTIO_BALLOON_CCW "virtio-balloon-ccw" -typedef struct VirtIOBalloonCcw VirtIOBalloonCcw; -DECLARE_INSTANCE_CHECKER(VirtIOBalloonCcw, VIRTIO_BALLOON_CCW, - TYPE_VIRTIO_BALLOON_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBalloonCcw, VIRTIO_BALLOON_CCW) =20 struct VirtIOBalloonCcw { VirtioCcwDevice parent_obj; @@ -152,9 +144,7 @@ struct VirtIOBalloonCcw { /* virtio-serial-ccw */ =20 #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw" -typedef struct VirtioSerialCcw VirtioSerialCcw; -DECLARE_INSTANCE_CHECKER(VirtioSerialCcw, VIRTIO_SERIAL_CCW, - TYPE_VIRTIO_SERIAL_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtioSerialCcw, VIRTIO_SERIAL_CCW) =20 struct VirtioSerialCcw { VirtioCcwDevice parent_obj; @@ -164,9 +154,7 @@ struct VirtioSerialCcw { /* virtio-net-ccw */ =20 #define TYPE_VIRTIO_NET_CCW "virtio-net-ccw" -typedef struct VirtIONetCcw VirtIONetCcw; -DECLARE_INSTANCE_CHECKER(VirtIONetCcw, VIRTIO_NET_CCW, - TYPE_VIRTIO_NET_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIONetCcw, VIRTIO_NET_CCW) =20 struct VirtIONetCcw { VirtioCcwDevice parent_obj; @@ -176,9 +164,7 @@ struct VirtIONetCcw { /* virtio-rng-ccw */ =20 #define TYPE_VIRTIO_RNG_CCW "virtio-rng-ccw" -typedef struct VirtIORNGCcw VirtIORNGCcw; -DECLARE_INSTANCE_CHECKER(VirtIORNGCcw, VIRTIO_RNG_CCW, - TYPE_VIRTIO_RNG_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIORNGCcw, VIRTIO_RNG_CCW) =20 struct VirtIORNGCcw { VirtioCcwDevice parent_obj; @@ -188,9 +174,7 @@ struct VirtIORNGCcw { /* virtio-crypto-ccw */ =20 #define TYPE_VIRTIO_CRYPTO_CCW "virtio-crypto-ccw" -typedef struct VirtIOCryptoCcw VirtIOCryptoCcw; -DECLARE_INSTANCE_CHECKER(VirtIOCryptoCcw, VIRTIO_CRYPTO_CCW, - TYPE_VIRTIO_CRYPTO_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOCryptoCcw, VIRTIO_CRYPTO_CCW) =20 struct VirtIOCryptoCcw { VirtioCcwDevice parent_obj; @@ -203,9 +187,7 @@ 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; -DECLARE_INSTANCE_CHECKER(V9fsCCWState, VIRTIO_9P_CCW, - TYPE_VIRTIO_9P_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(V9fsCCWState, VIRTIO_9P_CCW) =20 struct V9fsCCWState { VirtioCcwDevice parent_obj; @@ -216,9 +198,7 @@ struct V9fsCCWState { =20 #ifdef CONFIG_VHOST_VSOCK #define TYPE_VHOST_VSOCK_CCW "vhost-vsock-ccw" -typedef struct VHostVSockCCWState VHostVSockCCWState; -DECLARE_INSTANCE_CHECKER(VHostVSockCCWState, VHOST_VSOCK_CCW, - TYPE_VHOST_VSOCK_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VHostVSockCCWState, VHOST_VSOCK_CCW) =20 struct VHostVSockCCWState { VirtioCcwDevice parent_obj; @@ -228,9 +208,7 @@ struct VHostVSockCCWState { #endif /* CONFIG_VHOST_VSOCK */ =20 #define TYPE_VIRTIO_GPU_CCW "virtio-gpu-ccw" -typedef struct VirtIOGPUCcw VirtIOGPUCcw; -DECLARE_INSTANCE_CHECKER(VirtIOGPUCcw, VIRTIO_GPU_CCW, - TYPE_VIRTIO_GPU_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUCcw, VIRTIO_GPU_CCW) =20 struct VirtIOGPUCcw { VirtioCcwDevice parent_obj; @@ -238,9 +216,7 @@ struct VirtIOGPUCcw { }; =20 #define TYPE_VIRTIO_INPUT_CCW "virtio-input-ccw" -typedef struct VirtIOInputCcw VirtIOInputCcw; -DECLARE_INSTANCE_CHECKER(VirtIOInputCcw, VIRTIO_INPUT_CCW, - TYPE_VIRTIO_INPUT_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputCcw, VIRTIO_INPUT_CCW) =20 struct VirtIOInputCcw { VirtioCcwDevice parent_obj; @@ -251,9 +227,7 @@ struct VirtIOInputCcw { #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; -DECLARE_INSTANCE_CHECKER(VirtIOInputHIDCcw, VIRTIO_INPUT_HID_CCW, - TYPE_VIRTIO_INPUT_HID_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHIDCcw, VIRTIO_INPUT_HID_CCW) =20 struct VirtIOInputHIDCcw { VirtioCcwDevice parent_obj; diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 199913bca5..fd122dd4cd 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -329,9 +329,7 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *dev); void ehci_reset(void *opaque); =20 #define TYPE_PCI_EHCI "pci-ehci-usb" -typedef struct EHCIPCIState EHCIPCIState; -DECLARE_INSTANCE_CHECKER(EHCIPCIState, PCI_EHCI, - TYPE_PCI_EHCI) +OBJECT_DECLARE_SIMPLE_TYPE(EHCIPCIState, PCI_EHCI) =20 struct EHCIPCIState { /*< private >*/ @@ -371,9 +369,7 @@ struct SysBusEHCIClass { uint16_t portnr; }; =20 -typedef struct FUSBH200EHCIState FUSBH200EHCIState; -DECLARE_INSTANCE_CHECKER(FUSBH200EHCIState, FUSBH200_EHCI, - TYPE_FUSBH200_EHCI) +OBJECT_DECLARE_SIMPLE_TYPE(FUSBH200EHCIState, FUSBH200_EHCI) =20 struct FUSBH200EHCIState { /*< private >*/ diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 6e28e97839..11ac57058d 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -93,9 +93,7 @@ typedef struct OHCIState { } OHCIState; =20 #define TYPE_SYSBUS_OHCI "sysbus-ohci" -typedef struct OHCISysBusState OHCISysBusState; -DECLARE_INSTANCE_CHECKER(OHCISysBusState, SYSBUS_OHCI, - TYPE_SYSBUS_OHCI) +OBJECT_DECLARE_SIMPLE_TYPE(OHCISysBusState, SYSBUS_OHCI) =20 struct OHCISysBusState { /*< private >*/ diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 2110c0399e..c3dfc14405 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -27,9 +27,7 @@ #define TYPE_NEC_XHCI "nec-usb-xhci" #define TYPE_QEMU_XHCI "qemu-xhci" =20 -typedef struct XHCIState XHCIState; -DECLARE_INSTANCE_CHECKER(XHCIState, XHCI, - TYPE_XHCI) +OBJECT_DECLARE_SIMPLE_TYPE(XHCIState, XHCI) =20 #define MAXPORTS_2 15 #define MAXPORTS_3 15 diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 5e53d5b863..bce71a9ac9 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -115,9 +115,7 @@ typedef struct VFIOMSIXInfo { } VFIOMSIXInfo; =20 #define TYPE_VFIO_PCI "vfio-pci" -typedef struct VFIOPCIDevice VFIOPCIDevice; -DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, VFIO_PCI, - TYPE_VFIO_PCI) +OBJECT_DECLARE_SIMPLE_TYPE(VFIOPCIDevice, VFIO_PCI) =20 struct VFIOPCIDevice { PCIDevice pdev; diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index f46971eac6..c74c4678f2 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -37,11 +37,9 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...) = GCC_FMT_ATTR(2, 3); typedef const struct XenPTRegInfo XenPTRegInfo; typedef struct XenPTReg XenPTReg; =20 -typedef struct XenPCIPassthroughState XenPCIPassthroughState; =20 #define TYPE_XEN_PT_DEVICE "xen-pci-passthrough" -DECLARE_INSTANCE_CHECKER(XenPCIPassthroughState, XEN_PT_DEVICE, - TYPE_XEN_PT_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(XenPCIPassthroughState, XEN_PT_DEVICE) =20 uint32_t igd_read_opregion(XenPCIPassthroughState *s); void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val); diff --git a/include/block/throttle-groups.h b/include/block/throttle-group= s.h index 20b308f619..8bf7d233fa 100644 --- a/include/block/throttle-groups.h +++ b/include/block/throttle-groups.h @@ -60,9 +60,7 @@ typedef struct ThrottleGroupMember { } ThrottleGroupMember; =20 #define TYPE_THROTTLE_GROUP "throttle-group" -typedef struct ThrottleGroup ThrottleGroup; -DECLARE_INSTANCE_CHECKER(ThrottleGroup, THROTTLE_GROUP, - TYPE_THROTTLE_GROUP) +OBJECT_DECLARE_SIMPLE_TYPE(ThrottleGroup, THROTTLE_GROUP) =20 const char *throttle_group_get_name(ThrottleGroupMember *tgm); =20 diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/gener= ic_event_device.h index ac921e9f0c..6bed92e8fc 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -67,9 +67,7 @@ #define ACPI_POWER_BUTTON_DEVICE "PWRB" =20 #define TYPE_ACPI_GED "acpi-ged" -typedef struct AcpiGedState AcpiGedState; -DECLARE_INSTANCE_CHECKER(AcpiGedState, ACPI_GED, - TYPE_ACPI_GED) +OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) =20 #define TYPE_ACPI_GED_X86 "acpi-ged-x86" #define ACPI_GED_X86(obj) \ diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index aff574df5f..d50fbacb8e 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -16,9 +16,7 @@ * OVMF SDT Header Probe Supressor */ =20 -typedef struct VmGenIdState VmGenIdState; -DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID, - TYPE_VMGENID) +OBJECT_DECLARE_SIMPLE_TYPE(VmGenIdState, VMGENID) =20 struct VmGenIdState { DeviceClass parent_obj; diff --git a/include/hw/adc/stm32f2xx_adc.h b/include/hw/adc/stm32f2xx_adc.h index 6a4f8e955b..42b48981f2 100644 --- a/include/hw/adc/stm32f2xx_adc.h +++ b/include/hw/adc/stm32f2xx_adc.h @@ -59,9 +59,7 @@ #define ADC_COMMON_ADDRESS 0x100 =20 #define TYPE_STM32F2XX_ADC "stm32f2xx-adc" -typedef struct STM32F2XXADCState STM32F2XXADCState; -DECLARE_INSTANCE_CHECKER(STM32F2XXADCState, STM32F2XX_ADC, - TYPE_STM32F2XX_ADC) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXADCState, STM32F2XX_ADC) =20 struct STM32F2XXADCState { /* */ diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index d13b6cf50f..a76dc7b84d 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -22,9 +22,7 @@ #define AW_A10_NUM_USB 2 =20 #define TYPE_AW_A10 "allwinner-a10" -typedef struct AwA10State AwA10State; -DECLARE_INSTANCE_CHECKER(AwA10State, AW_A10, - TYPE_AW_A10) +OBJECT_DECLARE_SIMPLE_TYPE(AwA10State, AW_A10) =20 struct AwA10State { /*< private >*/ diff --git a/include/hw/arm/allwinner-h3.h b/include/hw/arm/allwinner-h3.h index a93e019521..cc308a5d2c 100644 --- a/include/hw/arm/allwinner-h3.h +++ b/include/hw/arm/allwinner-h3.h @@ -106,9 +106,7 @@ enum { #define TYPE_AW_H3 "allwinner-h3" =20 /** Convert input object to Allwinner H3 state object */ -typedef struct AwH3State AwH3State; -DECLARE_INSTANCE_CHECKER(AwH3State, AW_H3, - TYPE_AW_H3) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3State, AW_H3) =20 /** @} */ =20 diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h index dcb891d9cc..0791dcb68a 100644 --- a/include/hw/arm/armv7m.h +++ b/include/hw/arm/armv7m.h @@ -16,9 +16,7 @@ #include "qom/object.h" =20 #define TYPE_BITBAND "ARM,bitband-memory" -typedef struct BitBandState BitBandState; -DECLARE_INSTANCE_CHECKER(BitBandState, BITBAND, - TYPE_BITBAND) +OBJECT_DECLARE_SIMPLE_TYPE(BitBandState, BITBAND) =20 struct BitBandState { /*< private >*/ @@ -32,9 +30,7 @@ struct BitBandState { }; =20 #define TYPE_ARMV7M "armv7m" -typedef struct ARMv7MState ARMv7MState; -DECLARE_INSTANCE_CHECKER(ARMv7MState, ARMV7M, - TYPE_ARMV7M) +OBJECT_DECLARE_SIMPLE_TYPE(ARMv7MState, ARMV7M) =20 #define ARMV7M_NUM_BITBANDS 2 =20 diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_= peripherals.h index b4d3ae121a..13d7c4c553 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -32,9 +32,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals" -typedef struct BCM2835PeripheralState BCM2835PeripheralState; -DECLARE_INSTANCE_CHECKER(BCM2835PeripheralState, BCM2835_PERIPHERALS, - TYPE_BCM2835_PERIPHERALS) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835PeripheralState, BCM2835_PERIPHERALS) =20 struct BCM2835PeripheralState { /*< private >*/ diff --git a/include/hw/arm/digic.h b/include/hw/arm/digic.h index f3ba398914..8f2735c284 100644 --- a/include/hw/arm/digic.h +++ b/include/hw/arm/digic.h @@ -25,9 +25,7 @@ =20 #define TYPE_DIGIC "digic" =20 -typedef struct DigicState DigicState; -DECLARE_INSTANCE_CHECKER(DigicState, DIGIC, - TYPE_DIGIC) +OBJECT_DECLARE_SIMPLE_TYPE(DigicState, DIGIC) =20 #define DIGIC4_NB_TIMERS 3 =20 diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index c2de1dc102..60b9e126f5 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -103,11 +103,9 @@ struct Exynos4210State { I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; qemu_or_irq pl330_irq_orgate[EXYNOS4210_NUM_DMA]; }; -typedef struct Exynos4210State Exynos4210State; =20 #define TYPE_EXYNOS4210_SOC "exynos4210" -DECLARE_INSTANCE_CHECKER(Exynos4210State, EXYNOS4210_SOC, - TYPE_EXYNOS4210_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210State, 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 e239505724..971f35dd16 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -35,9 +35,7 @@ #include "qom/object.h" =20 #define TYPE_FSL_IMX25 "fsl,imx25" -typedef struct FslIMX25State FslIMX25State; -DECLARE_INSTANCE_CHECKER(FslIMX25State, FSL_IMX25, - TYPE_FSL_IMX25) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX25State, 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 64b4ca07b7..b9792d58ae 100644 --- a/include/hw/arm/fsl-imx31.h +++ b/include/hw/arm/fsl-imx31.h @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_FSL_IMX31 "fsl,imx31" -typedef struct FslIMX31State FslIMX31State; -DECLARE_INSTANCE_CHECKER(FslIMX31State, FSL_IMX31, - TYPE_FSL_IMX31) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX31State, 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 602b9aff36..29cc425acc 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -37,9 +37,7 @@ #include "qom/object.h" =20 #define TYPE_FSL_IMX6 "fsl,imx6" -typedef struct FslIMX6State FslIMX6State; -DECLARE_INSTANCE_CHECKER(FslIMX6State, FSL_IMX6, - TYPE_FSL_IMX6) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX6State, 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 e4862fdb2c..f8ebfba4f9 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -41,9 +41,7 @@ #include "qom/object.h" =20 #define TYPE_FSL_IMX6UL "fsl,imx6ul" -typedef struct FslIMX6ULState FslIMX6ULState; -DECLARE_INSTANCE_CHECKER(FslIMX6ULState, FSL_IMX6UL, - TYPE_FSL_IMX6UL) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX6ULState, 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 434d1d0641..161fdc36da 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -42,9 +42,7 @@ #include "qom/object.h" =20 #define TYPE_FSL_IMX7 "fsl,imx7" -typedef struct FslIMX7State FslIMX7State; -DECLARE_INSTANCE_CHECKER(FslIMX7State, FSL_IMX7, - TYPE_FSL_IMX7) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX7State, FSL_IMX7) =20 enum FslIMX7Configuration { FSL_IMX7_NUM_CPUS =3D 2, diff --git a/include/hw/arm/msf2-soc.h b/include/hw/arm/msf2-soc.h index 9b93d0d64e..d406184685 100644 --- a/include/hw/arm/msf2-soc.h +++ b/include/hw/arm/msf2-soc.h @@ -33,9 +33,7 @@ #include "qom/object.h" =20 #define TYPE_MSF2_SOC "msf2-soc" -typedef struct MSF2State MSF2State; -DECLARE_INSTANCE_CHECKER(MSF2State, MSF2_SOC, - TYPE_MSF2_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(MSF2State, 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 b69492b29d..f8a6725b77 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -20,9 +20,7 @@ #include "qom/object.h" =20 #define TYPE_NRF51_SOC "nrf51-soc" -typedef struct NRF51State NRF51State; -DECLARE_INSTANCE_CHECKER(NRF51State, NRF51_SOC, - TYPE_NRF51_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51State, NRF51_SOC) =20 #define NRF51_NUM_TIMERS 3 =20 diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 0dbf1712f4..ff6a173f8a 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -94,9 +94,7 @@ 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; -DECLARE_INSTANCE_CHECKER(OMAPI2CState, OMAP_I2C, - TYPE_OMAP_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(OMAPI2CState, OMAP_I2C) =20 =20 /* TODO: clock framework (see above) */ diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 9046876134..1095504b86 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -88,9 +88,7 @@ void pxa2xx_lcd_vsync_notifier(PXA2xxLCDState *s, qemu_ir= q handler); =20 /* pxa2xx_mmci.c */ #define TYPE_PXA2XX_MMCI "pxa2xx-mmci" -typedef struct PXA2xxMMCIState PXA2xxMMCIState; -DECLARE_INSTANCE_CHECKER(PXA2xxMMCIState, PXA2XX_MMCI, - TYPE_PXA2XX_MMCI) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxMMCIState, PXA2XX_MMCI) =20 PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, hwaddr base, @@ -100,9 +98,7 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq r= eadonly, =20 /* pxa2xx_pcmcia.c */ #define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia" -typedef struct PXA2xxPCMCIAState PXA2xxPCMCIAState; -DECLARE_INSTANCE_CHECKER(PXA2xxPCMCIAState, PXA2XX_PCMCIA, - TYPE_PXA2XX_PCMCIA) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxPCMCIAState, PXA2XX_PCMCIA) =20 PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base); @@ -130,13 +126,10 @@ I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s); =20 #define TYPE_PXA2XX_I2C "pxa2xx_i2c" typedef struct PXA2xxI2SState PXA2xxI2SState; -DECLARE_INSTANCE_CHECKER(PXA2xxI2CState, PXA2XX_I2C, - TYPE_PXA2XX_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CState, PXA2XX_I2C) =20 #define TYPE_PXA2XX_FIR "pxa2xx-fir" -typedef struct PXA2xxFIrState PXA2xxFIrState; -DECLARE_INSTANCE_CHECKER(PXA2xxFIrState, PXA2XX_FIR, - TYPE_PXA2XX_FIR) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxFIrState, PXA2XX_FIR) =20 typedef struct { ARMCPU *cpu; diff --git a/include/hw/arm/stm32f205_soc.h b/include/hw/arm/stm32f205_soc.h index 9c2f4818a6..985ff63aa9 100644 --- a/include/hw/arm/stm32f205_soc.h +++ b/include/hw/arm/stm32f205_soc.h @@ -35,9 +35,7 @@ #include "qom/object.h" =20 #define TYPE_STM32F205_SOC "stm32f205-soc" -typedef struct STM32F205State STM32F205State; -DECLARE_INSTANCE_CHECKER(STM32F205State, STM32F205_SOC, - TYPE_STM32F205_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F205State, 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 f1a22763f4..347105e709 100644 --- a/include/hw/arm/stm32f405_soc.h +++ b/include/hw/arm/stm32f405_soc.h @@ -36,9 +36,7 @@ #include "qom/object.h" =20 #define TYPE_STM32F405_SOC "stm32f405-soc" -typedef struct STM32F405State STM32F405State; -DECLARE_INSTANCE_CHECKER(STM32F405State, STM32F405_SOC, - TYPE_STM32F405_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F405State, STM32F405_SOC) =20 #define STM_NUM_USARTS 7 #define STM_NUM_TIMERS 4 diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index eaa9023fd6..8ce8e63b56 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -23,9 +23,7 @@ #include "qom/object.h" =20 #define TYPE_XLNX_VERSAL "xlnx-versal" -typedef struct Versal Versal; -DECLARE_INSTANCE_CHECKER(Versal, XLNX_VERSAL, - TYPE_XLNX_VERSAL) +OBJECT_DECLARE_SIMPLE_TYPE(Versal, 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 4cc97b4610..567d0dba09 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -35,9 +35,7 @@ #include "qom/object.h" =20 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" -typedef struct XlnxZynqMPState XlnxZynqMPState; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPState, XLNX_ZYNQMP, - TYPE_XLNX_ZYNQMP) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPState, 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 3e26303705..7dde0adcee 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -9,9 +9,7 @@ /* pflash_cfi01.c */ =20 #define TYPE_PFLASH_CFI01 "cfi.pflash01" -typedef struct PFlashCFI01 PFlashCFI01; -DECLARE_INSTANCE_CHECKER(PFlashCFI01, PFLASH_CFI01, - TYPE_PFLASH_CFI01) +OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI01, PFLASH_CFI01) =20 =20 PFlashCFI01 *pflash_cfi01_register(hwaddr base, @@ -30,9 +28,7 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveInf= o *dinfo); /* pflash_cfi02.c */ =20 #define TYPE_PFLASH_CFI02 "cfi.pflash02" -typedef struct PFlashCFI02 PFlashCFI02; -DECLARE_INSTANCE_CHECKER(PFlashCFI02, PFLASH_CFI02, - TYPE_PFLASH_CFI02) +OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI02, 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 8287da7c30..5a49029543 100644 --- a/include/hw/block/swim.h +++ b/include/hw/block/swim.h @@ -17,13 +17,10 @@ =20 #define SWIM_MAX_FD 2 =20 -typedef struct SWIMDrive SWIMDrive; -typedef struct SWIMBus SWIMBus; typedef struct SWIMCtrl SWIMCtrl; =20 #define TYPE_SWIM_DRIVE "swim-drive" -DECLARE_INSTANCE_CHECKER(SWIMDrive, SWIM_DRIVE, - TYPE_SWIM_DRIVE) +OBJECT_DECLARE_SIMPLE_TYPE(SWIMDrive, SWIM_DRIVE) =20 struct SWIMDrive { DeviceState qdev; @@ -32,8 +29,7 @@ struct SWIMDrive { }; =20 #define TYPE_SWIM_BUS "swim-bus" -DECLARE_INSTANCE_CHECKER(SWIMBus, SWIM_BUS, - TYPE_SWIM_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SWIMBus, SWIM_BUS) =20 struct SWIMBus { BusState bus; @@ -70,9 +66,7 @@ struct SWIMCtrl { }; =20 #define TYPE_SWIM "swim" -typedef struct Swim Swim; -DECLARE_INSTANCE_CHECKER(Swim, SWIM, - TYPE_SWIM) +OBJECT_DECLARE_SIMPLE_TYPE(Swim, SWIM) =20 struct Swim { SysBusDevice parent_obj; diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h index 5202f152b0..bb57532403 100644 --- a/include/hw/char/avr_usart.h +++ b/include/hw/char/avr_usart.h @@ -58,9 +58,7 @@ #define USART_CSRC_CSZ0 (1 << 1) =20 #define TYPE_AVR_USART "avr-usart" -typedef struct AVRUsartState AVRUsartState; -DECLARE_INSTANCE_CHECKER(AVRUsartState, AVR_USART, - TYPE_AVR_USART) +OBJECT_DECLARE_SIMPLE_TYPE(AVRUsartState, AVR_USART) =20 struct AVRUsartState { /* */ diff --git a/include/hw/char/bcm2835_aux.h b/include/hw/char/bcm2835_aux.h index a08795c47f..9e081793a0 100644 --- a/include/hw/char/bcm2835_aux.h +++ b/include/hw/char/bcm2835_aux.h @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_AUX "bcm2835-aux" -typedef struct BCM2835AuxState BCM2835AuxState; -DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX, - TYPE_BCM2835_AUX) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835AuxState, 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 1734f53541..e7f7cd8468 100644 --- a/include/hw/char/cadence_uart.h +++ b/include/hw/char/cadence_uart.h @@ -32,9 +32,7 @@ #define CADENCE_UART_R_MAX (0x48/4) =20 #define TYPE_CADENCE_UART "cadence_uart" -typedef struct CadenceUARTState CadenceUARTState; -DECLARE_INSTANCE_CHECKER(CadenceUARTState, CADENCE_UART, - TYPE_CADENCE_UART) +OBJECT_DECLARE_SIMPLE_TYPE(CadenceUARTState, 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 2c3869aa16..9daff0eeee 100644 --- a/include/hw/char/cmsdk-apb-uart.h +++ b/include/hw/char/cmsdk-apb-uart.h @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" -typedef struct CMSDKAPBUART CMSDKAPBUART; -DECLARE_INSTANCE_CHECKER(CMSDKAPBUART, CMSDK_APB_UART, - TYPE_CMSDK_APB_UART) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBUART, CMSDK_APB_UART) =20 struct CMSDKAPBUART { /*< private >*/ diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h index 01d406833d..f710a1a099 100644 --- a/include/hw/char/digic-uart.h +++ b/include/hw/char/digic-uart.h @@ -23,9 +23,7 @@ #include "qom/object.h" =20 #define TYPE_DIGIC_UART "digic-uart" -typedef struct DigicUartState DigicUartState; -DECLARE_INSTANCE_CHECKER(DigicUartState, DIGIC_UART, - TYPE_DIGIC_UART) +OBJECT_DECLARE_SIMPLE_TYPE(DigicUartState, DIGIC_UART) =20 enum { R_TX =3D 0x00, diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h index 5eaec507da..7e9482dee2 100644 --- a/include/hw/char/escc.h +++ b/include/hw/char/escc.h @@ -11,9 +11,7 @@ #define TYPE_ESCC "escc" #define ESCC_SIZE 4 =20 -typedef struct ESCCState ESCCState; -DECLARE_INSTANCE_CHECKER(ESCCState, ESCC, - TYPE_ESCC) +OBJECT_DECLARE_SIMPLE_TYPE(ESCCState, 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 36eb75fc4c..03d19e3f6f 100644 --- a/include/hw/char/ibex_uart.h +++ b/include/hw/char/ibex_uart.h @@ -70,9 +70,7 @@ REG32(TIMEOUT_CTRL, 0x2c) #define IBEX_UART_CLOCK 50000000 /* 50MHz clock */ =20 #define TYPE_IBEX_UART "ibex-uart" -typedef struct IbexUartState IbexUartState; -DECLARE_INSTANCE_CHECKER(IbexUartState, IBEX_UART, - TYPE_IBEX_UART) +OBJECT_DECLARE_SIMPLE_TYPE(IbexUartState, IBEX_UART) =20 struct IbexUartState { /* */ diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h index 200f1ec33a..91c9894ad5 100644 --- a/include/hw/char/imx_serial.h +++ b/include/hw/char/imx_serial.h @@ -23,9 +23,7 @@ #include "qom/object.h" =20 #define TYPE_IMX_SERIAL "imx.serial" -typedef struct IMXSerialState IMXSerialState; -DECLARE_INSTANCE_CHECKER(IMXSerialState, IMX_SERIAL, - TYPE_IMX_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(IMXSerialState, 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 0cf3c4e328..561b6383c4 100644 --- a/include/hw/char/nrf51_uart.h +++ b/include/hw/char/nrf51_uart.h @@ -20,9 +20,7 @@ #define UART_SIZE 0x1000 =20 #define TYPE_NRF51_UART "nrf51_soc.uart" -typedef struct NRF51UARTState NRF51UARTState; -DECLARE_INSTANCE_CHECKER(NRF51UARTState, NRF51_UART, - TYPE_NRF51_UART) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51UARTState, 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 80de4ecde6..a91ea50e11 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -22,9 +22,7 @@ #include "qom/object.h" =20 #define TYPE_PL011 "pl011" -typedef struct PL011State PL011State; -DECLARE_INSTANCE_CHECKER(PL011State, PL011, - TYPE_PL011) +OBJECT_DECLARE_SIMPLE_TYPE(PL011State, 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/serial.h b/include/hw/char/serial.h index 264f529a7f..db4f9af18c 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -89,14 +89,12 @@ struct SerialMM { uint8_t regshift; uint8_t endianness; }; -typedef struct SerialMM SerialMM; =20 struct SerialIO { SysBusDevice parent; =20 SerialState serial; }; -typedef struct SerialIO SerialIO; =20 extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; @@ -104,16 +102,13 @@ extern const MemoryRegionOps serial_io_ops; void serial_set_frequency(SerialState *s, uint32_t frequency); =20 #define TYPE_SERIAL "serial" -DECLARE_INSTANCE_CHECKER(SerialState, SERIAL, - TYPE_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL) =20 #define TYPE_SERIAL_MM "serial-mm" -DECLARE_INSTANCE_CHECKER(SerialMM, SERIAL_MM, - TYPE_SERIAL_MM) +OBJECT_DECLARE_SIMPLE_TYPE(SerialMM, SERIAL_MM) =20 #define TYPE_SERIAL_IO "serial-io" -DECLARE_INSTANCE_CHECKER(SerialIO, SERIAL_IO, - TYPE_SERIAL_IO) +OBJECT_DECLARE_SIMPLE_TYPE(SerialIO, 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 1670c076d4..65bcc85470 100644 --- a/include/hw/char/stm32f2xx_usart.h +++ b/include/hw/char/stm32f2xx_usart.h @@ -54,9 +54,7 @@ #define USART_CR1_RE (1 << 2) =20 #define TYPE_STM32F2XX_USART "stm32f2xx-usart" -typedef struct STM32F2XXUsartState STM32F2XXUsartState; -DECLARE_INSTANCE_CHECKER(STM32F2XXUsartState, STM32F2XX_USART, - TYPE_STM32F2XX_USART) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXUsartState, STM32F2XX_USART) =20 struct STM32F2XXUsartState { /* */ diff --git a/include/hw/clock.h b/include/hw/clock.h index b524509b47..d357594df9 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -18,9 +18,7 @@ #include "qemu/queue.h" =20 #define TYPE_CLOCK "clock" -typedef struct Clock Clock; -DECLARE_INSTANCE_CHECKER(Clock, CLOCK, - TYPE_CLOCK) +OBJECT_DECLARE_SIMPLE_TYPE(Clock, CLOCK) =20 typedef void ClockCallback(void *opaque); =20 diff --git a/include/hw/core/generic-loader.h b/include/hw/core/generic-loa= der.h index 8e86532df6..19d87b39c8 100644 --- a/include/hw/core/generic-loader.h +++ b/include/hw/core/generic-loader.h @@ -40,10 +40,8 @@ struct GenericLoaderState { bool data_be; bool set_pc; }; -typedef struct GenericLoaderState GenericLoaderState; =20 #define TYPE_GENERIC_LOADER "loader" -DECLARE_INSTANCE_CHECKER(GenericLoaderState, GENERIC_LOADER, - TYPE_GENERIC_LOADER) +OBJECT_DECLARE_SIMPLE_TYPE(GenericLoaderState, GENERIC_LOADER) =20 #endif diff --git a/include/hw/core/split-irq.h b/include/hw/core/split-irq.h index 76d42b29aa..ff8852f407 100644 --- a/include/hw/core/split-irq.h +++ b/include/hw/core/split-irq.h @@ -42,10 +42,8 @@ =20 #define MAX_SPLIT_LINES 16 =20 -typedef struct SplitIRQ SplitIRQ; =20 -DECLARE_INSTANCE_CHECKER(SplitIRQ, SPLIT_IRQ, - TYPE_SPLIT_IRQ) +OBJECT_DECLARE_SIMPLE_TYPE(SplitIRQ, SPLIT_IRQ) =20 struct SplitIRQ { DeviceState parent_obj; diff --git a/include/hw/cpu/a15mpcore.h b/include/hw/cpu/a15mpcore.h index 58d8ac7415..75d39e5458 100644 --- a/include/hw/cpu/a15mpcore.h +++ b/include/hw/cpu/a15mpcore.h @@ -27,9 +27,7 @@ /* A15MP private memory region. */ =20 #define TYPE_A15MPCORE_PRIV "a15mpcore_priv" -typedef struct A15MPPrivState A15MPPrivState; -DECLARE_INSTANCE_CHECKER(A15MPPrivState, A15MPCORE_PRIV, - TYPE_A15MPCORE_PRIV) +OBJECT_DECLARE_SIMPLE_TYPE(A15MPPrivState, A15MPCORE_PRIV) =20 struct A15MPPrivState { /*< private >*/ diff --git a/include/hw/cpu/a9mpcore.h b/include/hw/cpu/a9mpcore.h index 37e5cfce08..e0396ab6af 100644 --- a/include/hw/cpu/a9mpcore.h +++ b/include/hw/cpu/a9mpcore.h @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_A9MPCORE_PRIV "a9mpcore_priv" -typedef struct A9MPPrivState A9MPPrivState; -DECLARE_INSTANCE_CHECKER(A9MPPrivState, A9MPCORE_PRIV, - TYPE_A9MPCORE_PRIV) +OBJECT_DECLARE_SIMPLE_TYPE(A9MPPrivState, A9MPCORE_PRIV) =20 struct A9MPPrivState { /*< private >*/ diff --git a/include/hw/cpu/arm11mpcore.h b/include/hw/cpu/arm11mpcore.h index 411d7e6659..2cac8c1232 100644 --- a/include/hw/cpu/arm11mpcore.h +++ b/include/hw/cpu/arm11mpcore.h @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_ARM11MPCORE_PRIV "arm11mpcore_priv" -typedef struct ARM11MPCorePriveState ARM11MPCorePriveState; -DECLARE_INSTANCE_CHECKER(ARM11MPCorePriveState, ARM11MPCORE_PRIV, - TYPE_ARM11MPCORE_PRIV) +OBJECT_DECLARE_SIMPLE_TYPE(ARM11MPCorePriveState, ARM11MPCORE_PRIV) =20 struct ARM11MPCorePriveState { SysBusDevice parent_obj; diff --git a/include/hw/cpu/cluster.h b/include/hw/cpu/cluster.h index 1c807c5902..53fbf36af5 100644 --- a/include/hw/cpu/cluster.h +++ b/include/hw/cpu/cluster.h @@ -55,9 +55,7 @@ */ =20 #define TYPE_CPU_CLUSTER "cpu-cluster" -typedef struct CPUClusterState CPUClusterState; -DECLARE_INSTANCE_CHECKER(CPUClusterState, CPU_CLUSTER, - TYPE_CPU_CLUSTER) +OBJECT_DECLARE_SIMPLE_TYPE(CPUClusterState, 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 61ea3481f8..98ab91647e 100644 --- a/include/hw/cpu/core.h +++ b/include/hw/cpu/core.h @@ -14,9 +14,7 @@ =20 #define TYPE_CPU_CORE "cpu-core" =20 -typedef struct CPUCore CPUCore; -DECLARE_INSTANCE_CHECKER(CPUCore, CPU_CORE, - TYPE_CPU_CORE) +OBJECT_DECLARE_SIMPLE_TYPE(CPUCore, CPU_CORE) =20 struct CPUCore { /*< private >*/ diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_f= b.h index 226d77a264..38671afffd 100644 --- a/include/hw/display/bcm2835_fb.h +++ b/include/hw/display/bcm2835_fb.h @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_FB "bcm2835-fb" -typedef struct BCM2835FBState BCM2835FBState; -DECLARE_INSTANCE_CHECKER(BCM2835FBState, BCM2835_FB, - TYPE_BCM2835_FB) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835FBState, 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 09304dd1f6..a4e37abf6f 100644 --- a/include/hw/display/dpcd.h +++ b/include/hw/display/dpcd.h @@ -26,11 +26,9 @@ #define DPCD_H #include "qom/object.h" =20 -typedef struct DPCDState DPCDState; =20 #define TYPE_DPCD "dpcd" -DECLARE_INSTANCE_CHECKER(DPCDState, DPCD, - TYPE_DPCD) +OBJECT_DECLARE_SIMPLE_TYPE(DPCDState, 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 fbabfea5a9..94b5880587 100644 --- a/include/hw/display/i2c-ddc.h +++ b/include/hw/display/i2c-ddc.h @@ -34,10 +34,8 @@ struct I2CDDCState { uint8_t edid_blob[128]; }; =20 -typedef struct I2CDDCState I2CDDCState; =20 #define TYPE_I2CDDC "i2c-ddc" -DECLARE_INSTANCE_CHECKER(I2CDDCState, I2CDDC, - TYPE_I2CDDC) +OBJECT_DECLARE_SIMPLE_TYPE(I2CDDCState, I2CDDC) =20 #endif /* I2C_DDC_H */ diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 4adfaa725a..c133fa271e 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -32,9 +32,7 @@ typedef struct MacfbState { } MacfbState; =20 #define TYPE_MACFB "sysbus-macfb" -typedef struct MacfbSysBusState MacfbSysBusState; -DECLARE_INSTANCE_CHECKER(MacfbSysBusState, MACFB, - TYPE_MACFB) +OBJECT_DECLARE_SIMPLE_TYPE(MacfbSysBusState, MACFB) =20 struct MacfbSysBusState { SysBusDevice busdev; diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index 3b7d9e5a2a..8ab4733bb8 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -103,10 +103,8 @@ struct XlnxDPState { DPCDState *dpcd; I2CDDCState *edid; }; -typedef struct XlnxDPState XlnxDPState; =20 #define TYPE_XLNX_DP "xlnx.v-dp" -DECLARE_INSTANCE_CHECKER(XlnxDPState, XLNX_DP, - TYPE_XLNX_DP) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxDPState, XLNX_DP) =20 #endif diff --git a/include/hw/dma/bcm2835_dma.h b/include/hw/dma/bcm2835_dma.h index b94dae779a..1d26b1d8d0 100644 --- a/include/hw/dma/bcm2835_dma.h +++ b/include/hw/dma/bcm2835_dma.h @@ -26,9 +26,7 @@ typedef struct { } BCM2835DMAChan; =20 #define TYPE_BCM2835_DMA "bcm2835-dma" -typedef struct BCM2835DMAState BCM2835DMAState; -DECLARE_INSTANCE_CHECKER(BCM2835DMAState, BCM2835_DMA, - TYPE_BCM2835_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835DMAState, BCM2835_DMA) =20 #define BCM2835_DMA_NCHANS 16 =20 diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 362ce7b8dc..f652345d65 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -6,9 +6,7 @@ #include "qom/object.h" =20 #define TYPE_I8257 "i8257" -typedef struct I8257State I8257State; -DECLARE_INSTANCE_CHECKER(I8257State, I8257, - TYPE_I8257) +OBJECT_DECLARE_SIMPLE_TYPE(I8257State, I8257) =20 typedef struct I8257Regs { int now[2]; diff --git a/include/hw/dma/pl080.h b/include/hw/dma/pl080.h index e9669bf5ae..1883f04270 100644 --- a/include/hw/dma/pl080.h +++ b/include/hw/dma/pl080.h @@ -43,9 +43,7 @@ typedef struct { =20 #define TYPE_PL080 "pl080" #define TYPE_PL081 "pl081" -typedef struct PL080State PL080State; -DECLARE_INSTANCE_CHECKER(PL080State, PL080, - TYPE_PL080) +OBJECT_DECLARE_SIMPLE_TYPE(PL080State, PL080) =20 struct PL080State { SysBusDevice parent_obj; diff --git a/include/hw/dma/xlnx-zdma.h b/include/hw/dma/xlnx-zdma.h index f638abe568..6602e7ffa7 100644 --- a/include/hw/dma/xlnx-zdma.h +++ b/include/hw/dma/xlnx-zdma.h @@ -76,11 +76,9 @@ struct XlnxZDMA { to model write only mode. */ uint8_t buf[2048]; }; -typedef struct XlnxZDMA XlnxZDMA; =20 #define TYPE_XLNX_ZDMA "xlnx.zdma" =20 -DECLARE_INSTANCE_CHECKER(XlnxZDMA, XLNX_ZDMA, - TYPE_XLNX_ZDMA) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZDMA, 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 e16b08f9c5..e4cf085d70 100644 --- a/include/hw/dma/xlnx-zynq-devcfg.h +++ b/include/hw/dma/xlnx-zynq-devcfg.h @@ -33,9 +33,7 @@ =20 #define TYPE_XLNX_ZYNQ_DEVCFG "xlnx.ps7-dev-cfg" =20 -typedef struct XlnxZynqDevcfg XlnxZynqDevcfg; -DECLARE_INSTANCE_CHECKER(XlnxZynqDevcfg, XLNX_ZYNQ_DEVCFG, - TYPE_XLNX_ZYNQ_DEVCFG) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqDevcfg, 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 94b01cad0a..40537a848b 100644 --- a/include/hw/dma/xlnx_dpdma.h +++ b/include/hw/dma/xlnx_dpdma.h @@ -43,11 +43,9 @@ struct XlnxDPDMAState { qemu_irq irq; }; =20 -typedef struct XlnxDPDMAState XlnxDPDMAState; =20 #define TYPE_XLNX_DPDMA "xlnx.dpdma" -DECLARE_INSTANCE_CHECKER(XlnxDPDMAState, XLNX_DPDMA, - TYPE_XLNX_DPDMA) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxDPDMAState, XLNX_DPDMA) =20 /* * xlnx_dpdma_start_operation: Start the operation on the specified channe= l. The diff --git a/include/hw/gpio/bcm2835_gpio.h b/include/hw/gpio/bcm2835_gpio.h index e06e08a0fe..1c53a05090 100644 --- a/include/hw/gpio/bcm2835_gpio.h +++ b/include/hw/gpio/bcm2835_gpio.h @@ -33,10 +33,8 @@ struct BCM2835GpioState { uint8_t sd_fsel; qemu_irq out[54]; }; -typedef struct BCM2835GpioState BCM2835GpioState; =20 #define TYPE_BCM2835_GPIO "bcm2835_gpio" -DECLARE_INSTANCE_CHECKER(BCM2835GpioState, BCM2835_GPIO, - TYPE_BCM2835_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835GpioState, BCM2835_GPIO) =20 #endif diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h index a72b272ace..227860b9f0 100644 --- a/include/hw/gpio/imx_gpio.h +++ b/include/hw/gpio/imx_gpio.h @@ -24,9 +24,7 @@ #include "qom/object.h" =20 #define TYPE_IMX_GPIO "imx.gpio" -typedef struct IMXGPIOState IMXGPIOState; -DECLARE_INSTANCE_CHECKER(IMXGPIOState, IMX_GPIO, - TYPE_IMX_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(IMXGPIOState, 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 55d7d24a52..8f9c2f86da 100644 --- a/include/hw/gpio/nrf51_gpio.h +++ b/include/hw/gpio/nrf51_gpio.h @@ -29,9 +29,7 @@ #include "hw/sysbus.h" #include "qom/object.h" #define TYPE_NRF51_GPIO "nrf51_soc.gpio" -typedef struct NRF51GPIOState NRF51GPIOState; -DECLARE_INSTANCE_CHECKER(NRF51GPIOState, NRF51_GPIO, - TYPE_NRF51_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51GPIOState, NRF51_GPIO) =20 #define NRF51_GPIO_PINS 32 =20 diff --git a/include/hw/hyperv/vmbus-bridge.h b/include/hw/hyperv/vmbus-bri= dge.h index 1324873775..1e5419574e 100644 --- a/include/hw/hyperv/vmbus-bridge.h +++ b/include/hw/hyperv/vmbus-bridge.h @@ -23,10 +23,8 @@ struct VMBusBridge { =20 VMBus *bus; }; -typedef struct VMBusBridge VMBusBridge; =20 -DECLARE_INSTANCE_CHECKER(VMBusBridge, VMBUS_BRIDGE, - TYPE_VMBUS_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(VMBusBridge, 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 6e9d1c16be..f98bea3888 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -24,9 +24,7 @@ OBJECT_DECLARE_TYPE(VMBusDevice, VMBusDeviceClass, VMBUS_DEVICE) =20 #define TYPE_VMBUS "vmbus" -typedef struct VMBus VMBus; -DECLARE_INSTANCE_CHECKER(VMBus, VMBUS, - TYPE_VMBUS) +OBJECT_DECLARE_SIMPLE_TYPE(VMBus, VMBUS) =20 /* * Object wrapping a GPADL -- GPA Descriptor List -- an array of guest phy= sical diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 17e57436ce..277dd9f2d6 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -49,8 +49,7 @@ struct I2CSlave { }; =20 #define TYPE_I2C_BUS "i2c-bus" -DECLARE_INSTANCE_CHECKER(I2CBus, I2C_BUS, - TYPE_I2C_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(I2CBus, 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 e7f09104cf..e4f91339f5 100644 --- a/include/hw/i2c/imx_i2c.h +++ b/include/hw/i2c/imx_i2c.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_IMX_I2C "imx.i2c" -typedef struct IMXI2CState IMXI2CState; -DECLARE_INSTANCE_CHECKER(IMXI2CState, IMX_I2C, - TYPE_IMX_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(IMXI2CState, 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 69d70287d7..3c29e09bf3 100644 --- a/include/hw/i2c/microbit_i2c.h +++ b/include/hw/i2c/microbit_i2c.h @@ -27,9 +27,7 @@ #define NRF51_TWI_REG_ADDRESS 0x588 =20 #define TYPE_MICROBIT_I2C "microbit.i2c" -typedef struct MicrobitI2CState MicrobitI2CState; -DECLARE_INSTANCE_CHECKER(MicrobitI2CState, MICROBIT_I2C, - TYPE_MICROBIT_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(MicrobitI2CState, 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 7cbcdaf12f..4e882fa3c8 100644 --- a/include/hw/i2c/ppc4xx_i2c.h +++ b/include/hw/i2c/ppc4xx_i2c.h @@ -32,9 +32,7 @@ #include "qom/object.h" =20 #define TYPE_PPC4xx_I2C "ppc4xx-i2c" -typedef struct PPC4xxI2CState PPC4xxI2CState; -DECLARE_INSTANCE_CHECKER(PPC4xxI2CState, PPC4xx_I2C, - TYPE_PPC4xx_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(PPC4xxI2CState, PPC4xx_I2C) =20 struct PPC4xxI2CState { /*< private >*/ diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index e750d67975..48b442bc0b 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -24,9 +24,7 @@ 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; -DECLARE_INSTANCE_CHECKER(ICH9LPCState, ICH9_LPC_DEVICE, - TYPE_ICH9_LPC_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ICH9LPCState, 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 98cfc77723..41783ee46d 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu" -typedef struct IntelIOMMUState IntelIOMMUState; -DECLARE_INSTANCE_CHECKER(IntelIOMMUState, INTEL_IOMMU_DEVICE, - TYPE_INTEL_IOMMU_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(IntelIOMMUState, INTEL_IOMMU_DEVICE) =20 #define TYPE_INTEL_IOMMU_MEMORY_REGION "intel-iommu-iommu-memory-region" =20 diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index da3cddcc65..b1bdf648f8 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -51,19 +51,15 @@ typedef struct AHCIState { AddressSpace *as; } AHCIState; =20 -typedef struct AHCIPCIState AHCIPCIState; =20 #define TYPE_ICH9_AHCI "ich9-ahci" -DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH9_AHCI, - TYPE_ICH9_AHCI) +OBJECT_DECLARE_SIMPLE_TYPE(AHCIPCIState, 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; -DECLARE_INSTANCE_CHECKER(SysbusAHCIState, SYSBUS_AHCI, - TYPE_SYSBUS_AHCI) +OBJECT_DECLARE_SIMPLE_TYPE(SysbusAHCIState, SYSBUS_AHCI) =20 struct SysbusAHCIState { /*< private >*/ @@ -75,9 +71,7 @@ struct SysbusAHCIState { }; =20 #define TYPE_ALLWINNER_AHCI "allwinner-ahci" -typedef struct AllwinnerAHCIState AllwinnerAHCIState; -DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState, ALLWINNER_AHCI, - TYPE_ALLWINNER_AHCI) +OBJECT_DECLARE_SIMPLE_TYPE(AllwinnerAHCIState, 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 77c9372c27..8a95ad8c4d 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -19,15 +19,13 @@ #define USE_DMA_CDROM #include "qom/object.h" =20 -typedef struct IDEBus IDEBus; typedef struct IDEDevice IDEDevice; typedef struct IDEState IDEState; typedef struct IDEDMA IDEDMA; typedef struct IDEDMAOps IDEDMAOps; =20 #define TYPE_IDE_BUS "IDE" -DECLARE_INSTANCE_CHECKER(IDEBus, IDE_BUS, - TYPE_IDE_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) =20 #define MAX_IDE_DEVS 2 =20 diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index b8d7270ec8..d8384e1c42 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -40,9 +40,7 @@ typedef struct BMDMAState { } BMDMAState; =20 #define TYPE_PCI_IDE "pci-ide" -typedef struct PCIIDEState PCIIDEState; -DECLARE_INSTANCE_CHECKER(PCIIDEState, PCI_IDE, - TYPE_PCI_IDE) +OBJECT_DECLARE_SIMPLE_TYPE(PCIIDEState, PCI_IDE) =20 struct PCIIDEState { /*< private >*/ diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h index 3d1c2f4b10..20fced15f7 100644 --- a/include/hw/input/adb.h +++ b/include/hw/input/adb.h @@ -33,7 +33,6 @@ =20 #define ADB_MAX_OUT_LEN 16 =20 -typedef struct ADBBusState ADBBusState; typedef struct ADBDevice ADBDevice; =20 /* buf =3D NULL means polling */ @@ -65,8 +64,7 @@ struct ADBDeviceClass { }; =20 #define TYPE_ADB_BUS "apple-desktop-bus" -DECLARE_INSTANCE_CHECKER(ADBBusState, ADB_BUS, - TYPE_ADB_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(ADBBusState, 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 f8a3bf88ac..1d90432dae 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -12,9 +12,7 @@ #include "qom/object.h" =20 #define TYPE_I8042 "i8042" -typedef struct ISAKBDState ISAKBDState; -DECLARE_INSTANCE_CHECKER(ISAKBDState, I8042, - TYPE_I8042) +OBJECT_DECLARE_SIMPLE_TYPE(ISAKBDState, 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 4d7199480a..b8364d3ed4 100644 --- a/include/hw/intc/allwinner-a10-pic.h +++ b/include/hw/intc/allwinner-a10-pic.h @@ -5,9 +5,7 @@ #include "qom/object.h" =20 #define TYPE_AW_A10_PIC "allwinner-a10-pic" -typedef struct AwA10PICState AwA10PICState; -DECLARE_INSTANCE_CHECKER(AwA10PICState, AW_A10_PIC, - TYPE_AW_A10_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(AwA10PICState, AW_A10_PIC) =20 #define AW_A10_PIC_VECTOR 0 #define AW_A10_PIC_BASE_ADDR 4 diff --git a/include/hw/intc/aspeed_vic.h b/include/hw/intc/aspeed_vic.h index 8f2e67db5a..68d6ab997a 100644 --- a/include/hw/intc/aspeed_vic.h +++ b/include/hw/intc/aspeed_vic.h @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_VIC "aspeed.vic" -typedef struct AspeedVICState AspeedVICState; -DECLARE_INSTANCE_CHECKER(AspeedVICState, ASPEED_VIC, - TYPE_ASPEED_VIC) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedVICState, 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 fd4a767845..588eb76c5c 100644 --- a/include/hw/intc/bcm2835_ic.h +++ b/include/hw/intc/bcm2835_ic.h @@ -12,9 +12,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_IC "bcm2835-ic" -typedef struct BCM2835ICState BCM2835ICState; -DECLARE_INSTANCE_CHECKER(BCM2835ICState, BCM2835_IC, - TYPE_BCM2835_IC) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835ICState, 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 f23292776e..a410c817e8 100644 --- a/include/hw/intc/bcm2836_control.h +++ b/include/hw/intc/bcm2836_control.h @@ -24,9 +24,7 @@ #define BCM2836_MBPERCORE 4 =20 #define TYPE_BCM2836_CONTROL "bcm2836-control" -typedef struct BCM2836ControlState BCM2836ControlState; -DECLARE_INSTANCE_CHECKER(BCM2836ControlState, BCM2836_CONTROL, - TYPE_BCM2836_CONTROL) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2836ControlState, BCM2836_CONTROL) =20 struct BCM2836ControlState { /*< private >*/ diff --git a/include/hw/intc/heathrow_pic.h b/include/hw/intc/heathrow_pic.h index f8c9bc20ab..c0a7f6f546 100644 --- a/include/hw/intc/heathrow_pic.h +++ b/include/hw/intc/heathrow_pic.h @@ -30,9 +30,7 @@ #include "qom/object.h" =20 #define TYPE_HEATHROW "heathrow" -typedef struct HeathrowState HeathrowState; -DECLARE_INSTANCE_CHECKER(HeathrowState, HEATHROW, - TYPE_HEATHROW) +OBJECT_DECLARE_SIMPLE_TYPE(HeathrowState, 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 8da6b03805..37f03356b3 100644 --- a/include/hw/intc/ibex_plic.h +++ b/include/hw/intc/ibex_plic.h @@ -23,9 +23,7 @@ #include "qom/object.h" =20 #define TYPE_IBEX_PLIC "ibex-plic" -typedef struct IbexPlicState IbexPlicState; -DECLARE_INSTANCE_CHECKER(IbexPlicState, IBEX_PLIC, - TYPE_IBEX_PLIC) +OBJECT_DECLARE_SIMPLE_TYPE(IbexPlicState, IBEX_PLIC) =20 struct IbexPlicState { /*< private >*/ diff --git a/include/hw/intc/imx_avic.h b/include/hw/intc/imx_avic.h index 621742533c..75fbd1a89c 100644 --- a/include/hw/intc/imx_avic.h +++ b/include/hw/intc/imx_avic.h @@ -21,9 +21,7 @@ #include "qom/object.h" =20 #define TYPE_IMX_AVIC "imx.avic" -typedef struct IMXAVICState IMXAVICState; -DECLARE_INSTANCE_CHECKER(IMXAVICState, IMX_AVIC, - TYPE_IMX_AVIC) +OBJECT_DECLARE_SIMPLE_TYPE(IMXAVICState, 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 2d8075e527..7bdee7e80a 100644 --- a/include/hw/intc/imx_gpcv2.h +++ b/include/hw/intc/imx_gpcv2.h @@ -16,10 +16,8 @@ struct IMXGPCv2State { MemoryRegion iomem; uint32_t regs[GPC_NUM]; }; -typedef struct IMXGPCv2State IMXGPCv2State; =20 #define TYPE_IMX_GPCV2 "imx-gpcv2" -DECLARE_INSTANCE_CHECKER(IMXGPCv2State, IMX_GPCV2, - TYPE_IMX_GPCV2) +OBJECT_DECLARE_SIMPLE_TYPE(IMXGPCv2State, IMX_GPCV2) =20 #endif /* IMX_GPCV2_H */ diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index 65aa3a9a5e..eeb136e261 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -171,9 +171,7 @@ #define GIC_LOCAL_INT_WD 0 /* GIC watchdog */ =20 #define TYPE_MIPS_GIC "mips-gic" -typedef struct MIPSGICState MIPSGICState; -DECLARE_INSTANCE_CHECKER(MIPSGICState, MIPS_GIC, - TYPE_MIPS_GIC) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSGICState, 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 a93ace87c8..f37339dc0b 100644 --- a/include/hw/intc/realview_gic.h +++ b/include/hw/intc/realview_gic.h @@ -15,9 +15,7 @@ #include "qom/object.h" =20 #define TYPE_REALVIEW_GIC "realview_gic" -typedef struct RealViewGICState RealViewGICState; -DECLARE_INSTANCE_CHECKER(RealViewGICState, REALVIEW_GIC, - TYPE_REALVIEW_GIC) +OBJECT_DECLARE_SIMPLE_TYPE(RealViewGICState, 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 ec02df35e3..7f5889b36f 100644 --- a/include/hw/intc/rx_icu.h +++ b/include/hw/intc/rx_icu.h @@ -69,10 +69,8 @@ struct RXICUState { qemu_irq _fir; qemu_irq _swi; }; -typedef struct RXICUState RXICUState; =20 #define TYPE_RX_ICU "rx-icu" -DECLARE_INSTANCE_CHECKER(RXICUState, RX_ICU, - TYPE_RX_ICU) +OBJECT_DECLARE_SIMPLE_TYPE(RXICUState, 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 7a560e97af..ccc8bd272a 100644 --- a/include/hw/intc/xlnx-pmu-iomod-intc.h +++ b/include/hw/intc/xlnx-pmu-iomod-intc.h @@ -31,9 +31,7 @@ =20 #define TYPE_XLNX_PMU_IO_INTC "xlnx.pmu_io_intc" =20 -typedef struct XlnxPMUIOIntc XlnxPMUIOIntc; -DECLARE_INSTANCE_CHECKER(XlnxPMUIOIntc, XLNX_PMU_IO_INTC, - TYPE_XLNX_PMU_IO_INTC) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxPMUIOIntc, 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 29c48db307..33eff1d4f6 100644 --- a/include/hw/intc/xlnx-zynqmp-ipi.h +++ b/include/hw/intc/xlnx-zynqmp-ipi.h @@ -31,9 +31,7 @@ =20 #define TYPE_XLNX_ZYNQMP_IPI "xlnx.zynqmp_ipi" =20 -typedef struct XlnxZynqMPIPI XlnxZynqMPIPI; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPIPI, XLNX_ZYNQMP_IPI, - TYPE_XLNX_ZYNQMP_IPI) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPIPI, 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 58c611af25..75014e74ae 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -14,11 +14,9 @@ #include "hw/qdev-core.h" #include "qom/object.h" =20 -typedef struct IPackBus IPackBus; =20 #define TYPE_IPACK_BUS "IndustryPack" -DECLARE_INSTANCE_CHECKER(IPackBus, IPACK_BUS, - TYPE_IPACK_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(IPackBus, IPACK_BUS) =20 struct IPackBus { /*< private >*/ diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index 5290dab1d6..77a7213ed9 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -264,9 +264,7 @@ 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; -DECLARE_INSTANCE_CHECKER(IPMIBmcSim, IPMI_BMC_SIMULATOR, - TYPE_IPMI_BMC_SIMULATOR) +OBJECT_DECLARE_SIMPLE_TYPE(IPMIBmcSim, IPMI_BMC_SIMULATOR) =20 =20 typedef struct RspBuffer { diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 5f7943fa67..ddaae89a85 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -14,8 +14,7 @@ OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE) =20 #define TYPE_ISA_BUS "ISA" -DECLARE_INSTANCE_CHECKER(ISABus, ISA_BUS, - TYPE_ISA_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(ISABus, ISA_BUS) =20 #define TYPE_APPLE_SMC "isa-applesmc" #define APPLESMC_MAX_DATA_LENGTH 32 diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index da8dc5ddf5..edaf723f4d 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -30,9 +30,7 @@ =20 =20 #define TYPE_PC87312 "pc87312" -typedef struct PC87312State PC87312State; -DECLARE_INSTANCE_CHECKER(PC87312State, PC87312, - TYPE_PC87312) +OBJECT_DECLARE_SIMPLE_TYPE(PC87312State, PC87312) =20 struct PC87312State { /*< private >*/ diff --git a/include/hw/m68k/mcf_fec.h b/include/hw/m68k/mcf_fec.h index 840c5bbf53..80d4f651ba 100644 --- a/include/hw/m68k/mcf_fec.h +++ b/include/hw/m68k/mcf_fec.h @@ -12,9 +12,7 @@ #include "qom/object.h" =20 #define TYPE_MCF_FEC_NET "mcf-fec" -typedef struct mcf_fec_state mcf_fec_state; -DECLARE_INSTANCE_CHECKER(mcf_fec_state, MCF_FEC_NET, - TYPE_MCF_FEC_NET) +OBJECT_DECLARE_SIMPLE_TYPE(mcf_fec_state, MCF_FEC_NET) =20 #define FEC_NUM_IRQ 13 =20 diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h index 849e640570..9e35a88136 100644 --- a/include/hw/mips/cps.h +++ b/include/hw/mips/cps.h @@ -29,9 +29,7 @@ #include "qom/object.h" =20 #define TYPE_MIPS_CPS "mips-cps" -typedef struct MIPSCPSState MIPSCPSState; -DECLARE_INSTANCE_CHECKER(MIPSCPSState, MIPS_CPS, - TYPE_MIPS_CPS) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSCPSState, MIPS_CPS) =20 struct MIPSCPSState { SysBusDevice parent_obj; diff --git a/include/hw/misc/a9scu.h b/include/hw/misc/a9scu.h index fd1b92e923..c3759fb8c8 100644 --- a/include/hw/misc/a9scu.h +++ b/include/hw/misc/a9scu.h @@ -25,10 +25,8 @@ struct A9SCUState { uint32_t status; uint32_t num_cpu; }; -typedef struct A9SCUState A9SCUState; =20 #define TYPE_A9_SCU "a9-scu" -DECLARE_INSTANCE_CHECKER(A9SCUState, A9_SCU, - TYPE_A9_SCU) +OBJECT_DECLARE_SIMPLE_TYPE(A9SCUState, A9_SCU) =20 #endif diff --git a/include/hw/misc/allwinner-cpucfg.h b/include/hw/misc/allwinner= -cpucfg.h index 058514de15..a717b47299 100644 --- a/include/hw/misc/allwinner-cpucfg.h +++ b/include/hw/misc/allwinner-cpucfg.h @@ -29,9 +29,7 @@ */ =20 #define TYPE_AW_CPUCFG "allwinner-cpucfg" -typedef struct AwCpuCfgState AwCpuCfgState; -DECLARE_INSTANCE_CHECKER(AwCpuCfgState, AW_CPUCFG, - TYPE_AW_CPUCFG) +OBJECT_DECLARE_SIMPLE_TYPE(AwCpuCfgState, AW_CPUCFG) =20 /** @} */ =20 diff --git a/include/hw/misc/allwinner-h3-ccu.h b/include/hw/misc/allwinner= -h3-ccu.h index 05f5c7bd8e..a04875bfca 100644 --- a/include/hw/misc/allwinner-h3-ccu.h +++ b/include/hw/misc/allwinner-h3-ccu.h @@ -42,9 +42,7 @@ */ =20 #define TYPE_AW_H3_CCU "allwinner-h3-ccu" -typedef struct AwH3ClockCtlState AwH3ClockCtlState; -DECLARE_INSTANCE_CHECKER(AwH3ClockCtlState, AW_H3_CCU, - TYPE_AW_H3_CCU) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3ClockCtlState, 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 60a13a6958..0b6c877ef7 100644 --- a/include/hw/misc/allwinner-h3-dramc.h +++ b/include/hw/misc/allwinner-h3-dramc.h @@ -58,9 +58,7 @@ */ =20 #define TYPE_AW_H3_DRAMC "allwinner-h3-dramc" -typedef struct AwH3DramCtlState AwH3DramCtlState; -DECLARE_INSTANCE_CHECKER(AwH3DramCtlState, AW_H3_DRAMC, - TYPE_AW_H3_DRAMC) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3DramCtlState, 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 50baa8eb07..ec1c220535 100644 --- a/include/hw/misc/allwinner-h3-sysctrl.h +++ b/include/hw/misc/allwinner-h3-sysctrl.h @@ -43,9 +43,7 @@ */ =20 #define TYPE_AW_H3_SYSCTRL "allwinner-h3-sysctrl" -typedef struct AwH3SysCtrlState AwH3SysCtrlState; -DECLARE_INSTANCE_CHECKER(AwH3SysCtrlState, AW_H3_SYSCTRL, - TYPE_AW_H3_SYSCTRL) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3SysCtrlState, AW_H3_SYSCTRL) =20 /** @} */ =20 diff --git a/include/hw/misc/allwinner-sid.h b/include/hw/misc/allwinner-si= d.h index b8e83bb7ce..3bfa887a96 100644 --- a/include/hw/misc/allwinner-sid.h +++ b/include/hw/misc/allwinner-sid.h @@ -30,9 +30,7 @@ */ =20 #define TYPE_AW_SID "allwinner-sid" -typedef struct AwSidState AwSidState; -DECLARE_INSTANCE_CHECKER(AwSidState, AW_SID, - TYPE_AW_SID) +OBJECT_DECLARE_SIMPLE_TYPE(AwSidState, AW_SID) =20 /** @} */ =20 diff --git a/include/hw/misc/arm11scu.h b/include/hw/misc/arm11scu.h index 71b4bc9a22..e5c0282aec 100644 --- a/include/hw/misc/arm11scu.h +++ b/include/hw/misc/arm11scu.h @@ -15,9 +15,7 @@ #include "qom/object.h" =20 #define TYPE_ARM11_SCU "arm11-scu" -typedef struct ARM11SCUState ARM11SCUState; -DECLARE_INSTANCE_CHECKER(ARM11SCUState, ARM11_SCU, - TYPE_ARM11_SCU) +OBJECT_DECLARE_SIMPLE_TYPE(ARM11SCUState, ARM11_SCU) =20 struct ARM11SCUState { /*< private >*/ diff --git a/include/hw/misc/armsse-cpuid.h b/include/hw/misc/armsse-cpuid.h index 80691c7180..a61355e516 100644 --- a/include/hw/misc/armsse-cpuid.h +++ b/include/hw/misc/armsse-cpuid.h @@ -26,9 +26,7 @@ #include "qom/object.h" =20 #define TYPE_ARMSSE_CPUID "armsse-cpuid" -typedef struct ARMSSECPUID ARMSSECPUID; -DECLARE_INSTANCE_CHECKER(ARMSSECPUID, ARMSSE_CPUID, - TYPE_ARMSSE_CPUID) +OBJECT_DECLARE_SIMPLE_TYPE(ARMSSECPUID, ARMSSE_CPUID) =20 struct ARMSSECPUID { /*< private >*/ diff --git a/include/hw/misc/armsse-mhu.h b/include/hw/misc/armsse-mhu.h index 310643a022..2671b5b978 100644 --- a/include/hw/misc/armsse-mhu.h +++ b/include/hw/misc/armsse-mhu.h @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_ARMSSE_MHU "armsse-mhu" -typedef struct ARMSSEMHU ARMSSEMHU; -DECLARE_INSTANCE_CHECKER(ARMSSEMHU, ARMSSE_MHU, - TYPE_ARMSSE_MHU) +OBJECT_DECLARE_SIMPLE_TYPE(ARMSSEMHU, ARMSSE_MHU) =20 struct ARMSSEMHU { /*< private >*/ diff --git a/include/hw/misc/aspeed_xdma.h b/include/hw/misc/aspeed_xdma.h index 0e62c04520..9869ef4728 100644 --- a/include/hw/misc/aspeed_xdma.h +++ b/include/hw/misc/aspeed_xdma.h @@ -13,9 +13,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_XDMA "aspeed.xdma" -typedef struct AspeedXDMAState AspeedXDMAState; -DECLARE_INSTANCE_CHECKER(AspeedXDMAState, ASPEED_XDMA, - TYPE_ASPEED_XDMA) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedXDMAState, 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 f910d94118..b05799d2f7 100644 --- a/include/hw/misc/auxbus.h +++ b/include/hw/misc/auxbus.h @@ -29,15 +29,12 @@ #include "hw/qdev-core.h" #include "qom/object.h" =20 -typedef struct AUXBus AUXBus; typedef struct AUXSlave AUXSlave; typedef enum AUXCommand AUXCommand; typedef enum AUXReply AUXReply; =20 #define TYPE_AUXTOI2C "aux-to-i2c-bridge" -typedef struct AUXTOI2CState AUXTOI2CState; -DECLARE_INSTANCE_CHECKER(AUXTOI2CState, AUXTOI2C, - TYPE_AUXTOI2C) +OBJECT_DECLARE_SIMPLE_TYPE(AUXTOI2CState, AUXTOI2C) =20 enum AUXCommand { WRITE_I2C =3D 0, @@ -58,8 +55,7 @@ enum AUXReply { }; =20 #define TYPE_AUX_BUS "aux-bus" -DECLARE_INSTANCE_CHECKER(AUXBus, AUX_BUS, - TYPE_AUX_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(AUXBus, AUX_BUS) =20 struct AUXBus { /* < private > */ @@ -78,8 +74,7 @@ struct AUXBus { }; =20 #define TYPE_AUX_SLAVE "aux-slave" -DECLARE_INSTANCE_CHECKER(AUXSlave, AUX_SLAVE, - TYPE_AUX_SLAVE) +OBJECT_DECLARE_SIMPLE_TYPE(AUXSlave, AUX_SLAVE) =20 struct AUXSlave { /* < private > */ diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h index 938ab3e21b..707df030b1 100644 --- a/include/hw/misc/avr_power.h +++ b/include/hw/misc/avr_power.h @@ -31,9 +31,7 @@ =20 =20 #define TYPE_AVR_MASK "avr-power" -typedef struct AVRMaskState AVRMaskState; -DECLARE_INSTANCE_CHECKER(AVRMaskState, AVR_MASK, - TYPE_AVR_MASK) +OBJECT_DECLARE_SIMPLE_TYPE(AVRMaskState, AVR_MASK) =20 struct AVRMaskState { /* */ diff --git a/include/hw/misc/bcm2835_mbox.h b/include/hw/misc/bcm2835_mbox.h index d8c8017f4e..ade27af25d 100644 --- a/include/hw/misc/bcm2835_mbox.h +++ b/include/hw/misc/bcm2835_mbox.h @@ -13,9 +13,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_MBOX "bcm2835-mbox" -typedef struct BCM2835MboxState BCM2835MboxState; -DECLARE_INSTANCE_CHECKER(BCM2835MboxState, BCM2835_MBOX, - TYPE_BCM2835_MBOX) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835MboxState, 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 249511182e..751363f496 100644 --- a/include/hw/misc/bcm2835_mphi.h +++ b/include/hw/misc/bcm2835_mphi.h @@ -39,7 +39,6 @@ struct BCM2835MphiState { =20 #define TYPE_BCM2835_MPHI "bcm2835-mphi" =20 -DECLARE_INSTANCE_CHECKER(BCM2835MphiState, BCM2835_MPHI, - TYPE_BCM2835_MPHI) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835MphiState, BCM2835_MPHI) =20 #endif diff --git a/include/hw/misc/bcm2835_property.h b/include/hw/misc/bcm2835_p= roperty.h index 5c827a1900..712b76b7a3 100644 --- a/include/hw/misc/bcm2835_property.h +++ b/include/hw/misc/bcm2835_property.h @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_PROPERTY "bcm2835-property" -typedef struct BCM2835PropertyState BCM2835PropertyState; -DECLARE_INSTANCE_CHECKER(BCM2835PropertyState, BCM2835_PROPERTY, - TYPE_BCM2835_PROPERTY) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835PropertyState, BCM2835_PROPERTY) =20 struct BCM2835PropertyState { /*< private >*/ diff --git a/include/hw/misc/bcm2835_rng.h b/include/hw/misc/bcm2835_rng.h index fec76eef8e..7c1fb3ef40 100644 --- a/include/hw/misc/bcm2835_rng.h +++ b/include/hw/misc/bcm2835_rng.h @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_RNG "bcm2835-rng" -typedef struct BCM2835RngState BCM2835RngState; -DECLARE_INSTANCE_CHECKER(BCM2835RngState, BCM2835_RNG, - TYPE_BCM2835_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835RngState, 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 5b827c970e..f90f9e487c 100644 --- a/include/hw/misc/bcm2835_thermal.h +++ b/include/hw/misc/bcm2835_thermal.h @@ -14,9 +14,7 @@ =20 #define TYPE_BCM2835_THERMAL "bcm2835-thermal" =20 -typedef struct Bcm2835ThermalState Bcm2835ThermalState; -DECLARE_INSTANCE_CHECKER(Bcm2835ThermalState, BCM2835_THERMAL, - TYPE_BCM2835_THERMAL) +OBJECT_DECLARE_SIMPLE_TYPE(Bcm2835ThermalState, 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 34b18e3193..341451bff6 100644 --- a/include/hw/misc/grlib_ahb_apb_pnp.h +++ b/include/hw/misc/grlib_ahb_apb_pnp.h @@ -26,14 +26,10 @@ #include "qom/object.h" =20 #define TYPE_GRLIB_AHB_PNP "grlib,ahbpnp" -typedef struct AHBPnp AHBPnp; -DECLARE_INSTANCE_CHECKER(AHBPnp, GRLIB_AHB_PNP, - TYPE_GRLIB_AHB_PNP) +OBJECT_DECLARE_SIMPLE_TYPE(AHBPnp, GRLIB_AHB_PNP) =20 #define TYPE_GRLIB_APB_PNP "grlib,apbpnp" -typedef struct APBPnp APBPnp; -DECLARE_INSTANCE_CHECKER(APBPnp, GRLIB_APB_PNP, - TYPE_GRLIB_APB_PNP) +OBJECT_DECLARE_SIMPLE_TYPE(APBPnp, 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 55c5db8815..c3b89018c6 100644 --- a/include/hw/misc/imx25_ccm.h +++ b/include/hw/misc/imx25_ccm.h @@ -64,9 +64,7 @@ CCTL_##name##_SHIFT) =20 #define TYPE_IMX25_CCM "imx25.ccm" -typedef struct IMX25CCMState IMX25CCMState; -DECLARE_INSTANCE_CHECKER(IMX25CCMState, IMX25_CCM, - TYPE_IMX25_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX25CCMState, IMX25_CCM) =20 struct IMX25CCMState { /* */ diff --git a/include/hw/misc/imx31_ccm.h b/include/hw/misc/imx31_ccm.h index 25e280e976..18e08ee84f 100644 --- a/include/hw/misc/imx31_ccm.h +++ b/include/hw/misc/imx31_ccm.h @@ -73,9 +73,7 @@ PDR0_##name##_PODF_SHIFT) =20 #define TYPE_IMX31_CCM "imx31.ccm" -typedef struct IMX31CCMState IMX31CCMState; -DECLARE_INSTANCE_CHECKER(IMX31CCMState, IMX31_CCM, - TYPE_IMX31_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX31CCMState, IMX31_CCM) =20 struct IMX31CCMState { /* */ diff --git a/include/hw/misc/imx6_ccm.h b/include/hw/misc/imx6_ccm.h index 85f32417d6..ccf46d7353 100644 --- a/include/hw/misc/imx6_ccm.h +++ b/include/hw/misc/imx6_ccm.h @@ -179,9 +179,7 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 #define TYPE_IMX6_CCM "imx6.ccm" -typedef struct IMX6CCMState IMX6CCMState; -DECLARE_INSTANCE_CHECKER(IMX6CCMState, IMX6_CCM, - TYPE_IMX6_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX6CCMState, IMX6_CCM) =20 struct IMX6CCMState { /* */ diff --git a/include/hw/misc/imx6_src.h b/include/hw/misc/imx6_src.h index 15b51757ba..f380da3810 100644 --- a/include/hw/misc/imx6_src.h +++ b/include/hw/misc/imx6_src.h @@ -58,9 +58,7 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 #define TYPE_IMX6_SRC "imx6.src" -typedef struct IMX6SRCState IMX6SRCState; -DECLARE_INSTANCE_CHECKER(IMX6SRCState, IMX6_SRC, - TYPE_IMX6_SRC) +OBJECT_DECLARE_SIMPLE_TYPE(IMX6SRCState, IMX6_SRC) =20 struct IMX6SRCState { /* */ diff --git a/include/hw/misc/imx6ul_ccm.h b/include/hw/misc/imx6ul_ccm.h index d614de0edd..edb5f784d5 100644 --- a/include/hw/misc/imx6ul_ccm.h +++ b/include/hw/misc/imx6ul_ccm.h @@ -208,9 +208,7 @@ #define CCM_ANALOG_PLL_LOCK (1 << 31); =20 #define TYPE_IMX6UL_CCM "imx6ul.ccm" -typedef struct IMX6ULCCMState IMX6ULCCMState; -DECLARE_INSTANCE_CHECKER(IMX6ULCCMState, IMX6UL_CCM, - TYPE_IMX6UL_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX6ULCCMState, IMX6UL_CCM) =20 struct IMX6ULCCMState { /* */ diff --git a/include/hw/misc/imx7_ccm.h b/include/hw/misc/imx7_ccm.h index e2757622d0..dcaebfb4ef 100644 --- a/include/hw/misc/imx7_ccm.h +++ b/include/hw/misc/imx7_ccm.h @@ -105,9 +105,7 @@ enum IMX7PMURegisters { }; =20 #define TYPE_IMX7_CCM "imx7.ccm" -typedef struct IMX7CCMState IMX7CCMState; -DECLARE_INSTANCE_CHECKER(IMX7CCMState, IMX7_CCM, - TYPE_IMX7_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7CCMState, IMX7_CCM) =20 struct IMX7CCMState { /* */ @@ -121,9 +119,7 @@ struct IMX7CCMState { =20 =20 #define TYPE_IMX7_ANALOG "imx7.analog" -typedef struct IMX7AnalogState IMX7AnalogState; -DECLARE_INSTANCE_CHECKER(IMX7AnalogState, IMX7_ANALOG, - TYPE_IMX7_ANALOG) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7AnalogState, IMX7_ANALOG) =20 struct IMX7AnalogState { /* */ diff --git a/include/hw/misc/imx7_gpr.h b/include/hw/misc/imx7_gpr.h index f80b3ed28c..df364bd8f0 100644 --- a/include/hw/misc/imx7_gpr.h +++ b/include/hw/misc/imx7_gpr.h @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_IMX7_GPR "imx7.gpr" -typedef struct IMX7GPRState IMX7GPRState; -DECLARE_INSTANCE_CHECKER(IMX7GPRState, IMX7_GPR, - TYPE_IMX7_GPR) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7GPRState, IMX7_GPR) =20 struct IMX7GPRState { /* */ diff --git a/include/hw/misc/imx7_snvs.h b/include/hw/misc/imx7_snvs.h index ea5395c107..14a1d6fe6b 100644 --- a/include/hw/misc/imx7_snvs.h +++ b/include/hw/misc/imx7_snvs.h @@ -24,9 +24,7 @@ enum IMX7SNVSRegisters { }; =20 #define TYPE_IMX7_SNVS "imx7.snvs" -typedef struct IMX7SNVSState IMX7SNVSState; -DECLARE_INSTANCE_CHECKER(IMX7SNVSState, IMX7_SNVS, - TYPE_IMX7_SNVS) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7SNVSState, IMX7_SNVS) =20 struct IMX7SNVSState { /* */ diff --git a/include/hw/misc/imx_rngc.h b/include/hw/misc/imx_rngc.h index f7b569cac5..34ad699225 100644 --- a/include/hw/misc/imx_rngc.h +++ b/include/hw/misc/imx_rngc.h @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_IMX_RNGC "imx.rngc" -typedef struct IMXRNGCState IMXRNGCState; -DECLARE_INSTANCE_CHECKER(IMXRNGCState, IMX_RNGC, - TYPE_IMX_RNGC) +OBJECT_DECLARE_SIMPLE_TYPE(IMXRNGCState, IMX_RNGC) =20 struct IMXRNGCState { /*< private >*/ diff --git a/include/hw/misc/iotkit-secctl.h b/include/hw/misc/iotkit-secct= l.h index d062ed43e7..54c212b515 100644 --- a/include/hw/misc/iotkit-secctl.h +++ b/include/hw/misc/iotkit-secctl.h @@ -59,9 +59,7 @@ #include "qom/object.h" =20 #define TYPE_IOTKIT_SECCTL "iotkit-secctl" -typedef struct IoTKitSecCtl IoTKitSecCtl; -DECLARE_INSTANCE_CHECKER(IoTKitSecCtl, IOTKIT_SECCTL, - TYPE_IOTKIT_SECCTL) +OBJECT_DECLARE_SIMPLE_TYPE(IoTKitSecCtl, 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 22ceb5d76d..2b5636b218 100644 --- a/include/hw/misc/iotkit-sysctl.h +++ b/include/hw/misc/iotkit-sysctl.h @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_IOTKIT_SYSCTL "iotkit-sysctl" -typedef struct IoTKitSysCtl IoTKitSysCtl; -DECLARE_INSTANCE_CHECKER(IoTKitSysCtl, IOTKIT_SYSCTL, - TYPE_IOTKIT_SYSCTL) +OBJECT_DECLARE_SIMPLE_TYPE(IoTKitSysCtl, IOTKIT_SYSCTL) =20 struct IoTKitSysCtl { /*< private >*/ diff --git a/include/hw/misc/iotkit-sysinfo.h b/include/hw/misc/iotkit-sysi= nfo.h index 23ae43e549..7e620e2eaf 100644 --- a/include/hw/misc/iotkit-sysinfo.h +++ b/include/hw/misc/iotkit-sysinfo.h @@ -26,9 +26,7 @@ #include "qom/object.h" =20 #define TYPE_IOTKIT_SYSINFO "iotkit-sysinfo" -typedef struct IoTKitSysInfo IoTKitSysInfo; -DECLARE_INSTANCE_CHECKER(IoTKitSysInfo, IOTKIT_SYSINFO, - TYPE_IOTKIT_SYSINFO) +OBJECT_DECLARE_SIMPLE_TYPE(IoTKitSysInfo, IOTKIT_SYSINFO) =20 struct IoTKitSysInfo { /*< private >*/ diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h index 862cbba3ab..a59f0bd422 100644 --- a/include/hw/misc/mac_via.h +++ b/include/hw/misc/mac_via.h @@ -32,9 +32,7 @@ =20 =20 #define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1" -typedef struct MOS6522Q800VIA1State MOS6522Q800VIA1State; -DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA1State, MOS6522_Q800_VIA1, - TYPE_MOS6522_Q800_VIA1) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522Q800VIA1State, MOS6522_Q800_VIA1) =20 struct MOS6522Q800VIA1State { /*< private >*/ @@ -68,9 +66,7 @@ struct MOS6522Q800VIA1State { #define VIA2_IRQ_ASC (1 << VIA2_IRQ_ASC_BIT) =20 #define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2" -typedef struct MOS6522Q800VIA2State MOS6522Q800VIA2State; -DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA2State, MOS6522_Q800_VIA2, - TYPE_MOS6522_Q800_VIA2) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522Q800VIA2State, MOS6522_Q800_VIA2) =20 struct MOS6522Q800VIA2State { /*< private >*/ @@ -79,9 +75,7 @@ struct MOS6522Q800VIA2State { =20 =20 #define TYPE_MAC_VIA "mac_via" -typedef struct MacVIAState MacVIAState; -DECLARE_INSTANCE_CHECKER(MacVIAState, MAC_VIA, - TYPE_MAC_VIA) +OBJECT_DECLARE_SIMPLE_TYPE(MacVIAState, MAC_VIA) =20 struct MacVIAState { SysBusDevice busdev; diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h index e738b6376f..a71deec968 100644 --- a/include/hw/misc/macio/cuda.h +++ b/include/hw/misc/macio/cuda.h @@ -63,17 +63,13 @@ struct MOS6522CUDAState { /*< private >*/ MOS6522State parent_obj; }; -typedef struct MOS6522CUDAState MOS6522CUDAState; =20 #define TYPE_MOS6522_CUDA "mos6522-cuda" -DECLARE_INSTANCE_CHECKER(MOS6522CUDAState, MOS6522_CUDA, - TYPE_MOS6522_CUDA) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522CUDAState, MOS6522_CUDA) =20 /* Cuda */ #define TYPE_CUDA "cuda" -typedef struct CUDAState CUDAState; -DECLARE_INSTANCE_CHECKER(CUDAState, CUDA, - TYPE_CUDA) +OBJECT_DECLARE_SIMPLE_TYPE(CUDAState, CUDA) =20 struct CUDAState { /*< private >*/ diff --git a/include/hw/misc/macio/gpio.h b/include/hw/misc/macio/gpio.h index 1d0c8434ae..4dee09a9dd 100644 --- a/include/hw/misc/macio/gpio.h +++ b/include/hw/misc/macio/gpio.h @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_MACIO_GPIO "macio-gpio" -typedef struct MacIOGPIOState MacIOGPIOState; -DECLARE_INSTANCE_CHECKER(MacIOGPIOState, MACIO_GPIO, - TYPE_MACIO_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(MacIOGPIOState, MACIO_GPIO) =20 struct MacIOGPIOState { /*< private >*/ diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 02dbf37630..22b4e64b2c 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -40,9 +40,7 @@ =20 /* MacIO virtual bus */ #define TYPE_MACIO_BUS "macio-bus" -typedef struct MacIOBusState MacIOBusState; -DECLARE_INSTANCE_CHECKER(MacIOBusState, MACIO_BUS, - TYPE_MACIO_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(MacIOBusState, MACIO_BUS) =20 struct MacIOBusState { /*< private >*/ @@ -51,9 +49,7 @@ struct MacIOBusState { =20 /* MacIO IDE */ #define TYPE_MACIO_IDE "macio-ide" -typedef struct MACIOIDEState MACIOIDEState; -DECLARE_INSTANCE_CHECKER(MACIOIDEState, MACIO_IDE, - TYPE_MACIO_IDE) +OBJECT_DECLARE_SIMPLE_TYPE(MACIOIDEState, MACIO_IDE) =20 struct MACIOIDEState { /*< private >*/ @@ -79,9 +75,7 @@ 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; -DECLARE_INSTANCE_CHECKER(MacIOState, MACIO, - TYPE_MACIO) +OBJECT_DECLARE_SIMPLE_TYPE(MacIOState, MACIO) =20 struct MacIOState { /*< private >*/ @@ -98,9 +92,7 @@ struct MacIOState { }; =20 #define TYPE_OLDWORLD_MACIO "macio-oldworld" -typedef struct OldWorldMacIOState OldWorldMacIOState; -DECLARE_INSTANCE_CHECKER(OldWorldMacIOState, OLDWORLD_MACIO, - TYPE_OLDWORLD_MACIO) +OBJECT_DECLARE_SIMPLE_TYPE(OldWorldMacIOState, OLDWORLD_MACIO) =20 struct OldWorldMacIOState { /*< private >*/ @@ -114,9 +106,7 @@ struct OldWorldMacIOState { }; =20 #define TYPE_NEWWORLD_MACIO "macio-newworld" -typedef struct NewWorldMacIOState NewWorldMacIOState; -DECLARE_INSTANCE_CHECKER(NewWorldMacIOState, NEWWORLD_MACIO, - TYPE_NEWWORLD_MACIO) +OBJECT_DECLARE_SIMPLE_TYPE(NewWorldMacIOState, NEWWORLD_MACIO) =20 struct NewWorldMacIOState { /*< private >*/ diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h index 0d1a5c1406..78237d99a2 100644 --- a/include/hw/misc/macio/pmu.h +++ b/include/hw/misc/macio/pmu.h @@ -178,11 +178,9 @@ struct MOS6522PMUState { /*< private >*/ MOS6522State parent_obj; }; -typedef struct MOS6522PMUState MOS6522PMUState; =20 #define TYPE_MOS6522_PMU "mos6522-pmu" -DECLARE_INSTANCE_CHECKER(MOS6522PMUState, MOS6522_PMU, - TYPE_MOS6522_PMU) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522PMUState, MOS6522_PMU) /** * PMUState: * @last_b: last value of B register @@ -231,10 +229,8 @@ struct PMUState { /* GPIO */ MacIOGPIOState *gpio; }; -typedef struct PMUState PMUState; =20 #define TYPE_VIA_PMU "via-pmu" -DECLARE_INSTANCE_CHECKER(PMUState, VIA_PMU, - TYPE_VIA_PMU) +OBJECT_DECLARE_SIMPLE_TYPE(PMUState, VIA_PMU) =20 #endif /* PMU_H */ diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h index 6350a3f7c0..606cf1e0a2 100644 --- a/include/hw/misc/max111x.h +++ b/include/hw/misc/max111x.h @@ -45,12 +45,10 @@ struct MAX111xState { uint8_t input[8]; int inputs, com; }; -typedef struct MAX111xState MAX111xState; =20 #define TYPE_MAX_111X "max111x" =20 -DECLARE_INSTANCE_CHECKER(MAX111xState, MAX_111X, - TYPE_MAX_111X) +OBJECT_DECLARE_SIMPLE_TYPE(MAX111xState, 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 923df4f112..9fa58942d7 100644 --- a/include/hw/misc/mips_cmgcr.h +++ b/include/hw/misc/mips_cmgcr.h @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_MIPS_GCR "mips-gcr" -typedef struct MIPSGCRState MIPSGCRState; -DECLARE_INSTANCE_CHECKER(MIPSGCRState, MIPS_GCR, - TYPE_MIPS_GCR) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSGCRState, 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 7dc188e8a2..e5dccea151 100644 --- a/include/hw/misc/mips_cpc.h +++ b/include/hw/misc/mips_cpc.h @@ -35,9 +35,7 @@ #define CPC_VP_RUNNING_OFS 0x30 =20 #define TYPE_MIPS_CPC "mips-cpc" -typedef struct MIPSCPCState MIPSCPCState; -DECLARE_INSTANCE_CHECKER(MIPSCPCState, MIPS_CPC, - TYPE_MIPS_CPC) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSCPCState, 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 7c19f61fbb..96347dbf65 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -24,9 +24,7 @@ #include "qom/object.h" =20 #define TYPE_MIPS_ITU "mips-itu" -typedef struct MIPSITUState MIPSITUState; -DECLARE_INSTANCE_CHECKER(MIPSITUState, MIPS_ITU, - TYPE_MIPS_ITU) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSITUState, MIPS_ITU) =20 #define ITC_CELL_DEPTH_SHIFT 2 #define ITC_CELL_DEPTH (1u << ITC_CELL_DEPTH_SHIFT) diff --git a/include/hw/misc/mps2-fpgaio.h b/include/hw/misc/mps2-fpgaio.h index 991f5b731e..80f9227aa6 100644 --- a/include/hw/misc/mps2-fpgaio.h +++ b/include/hw/misc/mps2-fpgaio.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_MPS2_FPGAIO "mps2-fpgaio" -typedef struct MPS2FPGAIO MPS2FPGAIO; -DECLARE_INSTANCE_CHECKER(MPS2FPGAIO, MPS2_FPGAIO, - TYPE_MPS2_FPGAIO) +OBJECT_DECLARE_SIMPLE_TYPE(MPS2FPGAIO, MPS2_FPGAIO) =20 struct MPS2FPGAIO { /*< private >*/ diff --git a/include/hw/misc/mps2-scc.h b/include/hw/misc/mps2-scc.h index 445e268b1f..e922b3c8e0 100644 --- a/include/hw/misc/mps2-scc.h +++ b/include/hw/misc/mps2-scc.h @@ -16,9 +16,7 @@ #include "qom/object.h" =20 #define TYPE_MPS2_SCC "mps2-scc" -typedef struct MPS2SCC MPS2SCC; -DECLARE_INSTANCE_CHECKER(MPS2SCC, MPS2_SCC, - TYPE_MPS2_SCC) +OBJECT_DECLARE_SIMPLE_TYPE(MPS2SCC, 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 625932354a..fc1890e710 100644 --- a/include/hw/misc/msf2-sysreg.h +++ b/include/hw/misc/msf2-sysreg.h @@ -62,9 +62,7 @@ enum { #define MSF2_SYSREG_MMIO_SIZE 0x300 =20 #define TYPE_MSF2_SYSREG "msf2-sysreg" -typedef struct MSF2SysregState MSF2SysregState; -DECLARE_INSTANCE_CHECKER(MSF2SysregState, MSF2_SYSREG, - TYPE_MSF2_SYSREG) +OBJECT_DECLARE_SIMPLE_TYPE(MSF2SysregState, 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 7f2263a906..9aff9a76f8 100644 --- a/include/hw/misc/nrf51_rng.h +++ b/include/hw/misc/nrf51_rng.h @@ -38,9 +38,7 @@ #include "qemu/timer.h" #include "qom/object.h" #define TYPE_NRF51_RNG "nrf51_soc.rng" -typedef struct NRF51RNGState NRF51RNGState; -DECLARE_INSTANCE_CHECKER(NRF51RNGState, NRF51_RNG, - TYPE_NRF51_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51RNGState, NRF51_RNG) =20 #define NRF51_RNG_SIZE 0x1000 =20 diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx= _syscfg.h index 82ccd7cc24..57a98c533d 100644 --- a/include/hw/misc/stm32f2xx_syscfg.h +++ b/include/hw/misc/stm32f2xx_syscfg.h @@ -37,9 +37,7 @@ #define SYSCFG_CMPCR 0x20 =20 #define TYPE_STM32F2XX_SYSCFG "stm32f2xx-syscfg" -typedef struct STM32F2XXSyscfgState STM32F2XXSyscfgState; -DECLARE_INSTANCE_CHECKER(STM32F2XXSyscfgState, STM32F2XX_SYSCFG, - TYPE_STM32F2XX_SYSCFG) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXSyscfgState, STM32F2XX_SYSCFG) =20 struct STM32F2XXSyscfgState { /* */ diff --git a/include/hw/misc/stm32f4xx_exti.h b/include/hw/misc/stm32f4xx_e= xti.h index 4987c286ed..24b6fa7724 100644 --- a/include/hw/misc/stm32f4xx_exti.h +++ b/include/hw/misc/stm32f4xx_exti.h @@ -37,9 +37,7 @@ #define EXTI_PR 0x14 =20 #define TYPE_STM32F4XX_EXTI "stm32f4xx-exti" -typedef struct STM32F4xxExtiState STM32F4xxExtiState; -DECLARE_INSTANCE_CHECKER(STM32F4xxExtiState, STM32F4XX_EXTI, - TYPE_STM32F4XX_EXTI) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F4xxExtiState, 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 c3d89d4536..8c31feccd3 100644 --- a/include/hw/misc/stm32f4xx_syscfg.h +++ b/include/hw/misc/stm32f4xx_syscfg.h @@ -38,9 +38,7 @@ #define SYSCFG_CMPCR 0x20 =20 #define TYPE_STM32F4XX_SYSCFG "stm32f4xx-syscfg" -typedef struct STM32F4xxSyscfgState STM32F4xxSyscfgState; -DECLARE_INSTANCE_CHECKER(STM32F4xxSyscfgState, STM32F4XX_SYSCFG, - TYPE_STM32F4XX_SYSCFG) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F4xxSyscfgState, 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 34e45fdb97..74d5d822cf 100644 --- a/include/hw/misc/tz-mpc.h +++ b/include/hw/misc/tz-mpc.h @@ -35,9 +35,7 @@ #include "qom/object.h" =20 #define TYPE_TZ_MPC "tz-mpc" -typedef struct TZMPC TZMPC; -DECLARE_INSTANCE_CHECKER(TZMPC, TZ_MPC, - TYPE_TZ_MPC) +OBJECT_DECLARE_SIMPLE_TYPE(TZMPC, 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 7169f330ff..77cc7f2404 100644 --- a/include/hw/misc/tz-msc.h +++ b/include/hw/misc/tz-msc.h @@ -55,9 +55,7 @@ #include "qom/object.h" =20 #define TYPE_TZ_MSC "tz-msc" -typedef struct TZMSC TZMSC; -DECLARE_INSTANCE_CHECKER(TZMSC, TZ_MSC, - TYPE_TZ_MSC) +OBJECT_DECLARE_SIMPLE_TYPE(TZMSC, TZ_MSC) =20 struct TZMSC { /*< private >*/ diff --git a/include/hw/misc/tz-ppc.h b/include/hw/misc/tz-ppc.h index b5251b715e..021d671b29 100644 --- a/include/hw/misc/tz-ppc.h +++ b/include/hw/misc/tz-ppc.h @@ -69,9 +69,7 @@ #include "qom/object.h" =20 #define TYPE_TZ_PPC "tz-ppc" -typedef struct TZPPC TZPPC; -DECLARE_INSTANCE_CHECKER(TZPPC, TZ_PPC, - TYPE_TZ_PPC) +OBJECT_DECLARE_SIMPLE_TYPE(TZPPC, TZ_PPC) =20 #define TZ_NUM_PORTS 16 =20 diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index 7c724bab94..518d627dc5 100644 --- a/include/hw/misc/unimp.h +++ b/include/hw/misc/unimp.h @@ -15,9 +15,7 @@ =20 #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device" =20 -typedef struct UnimplementedDeviceState UnimplementedDeviceState; -DECLARE_INSTANCE_CHECKER(UnimplementedDeviceState, UNIMPLEMENTED_DEVICE, - TYPE_UNIMPLEMENTED_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(UnimplementedDeviceState, UNIMPLEMENTED_DEVICE) =20 struct UnimplementedDeviceState { SysBusDevice parent_obj; diff --git a/include/hw/misc/zynq-xadc.h b/include/hw/misc/zynq-xadc.h index 052f47954f..602bfb4ab1 100644 --- a/include/hw/misc/zynq-xadc.h +++ b/include/hw/misc/zynq-xadc.h @@ -24,9 +24,7 @@ #define ZYNQ_XADC_FIFO_DEPTH 15 =20 #define TYPE_ZYNQ_XADC "xlnx,zynq-xadc" -typedef struct ZynqXADCState ZynqXADCState; -DECLARE_INSTANCE_CHECKER(ZynqXADCState, ZYNQ_XADC, - TYPE_ZYNQ_XADC) +OBJECT_DECLARE_SIMPLE_TYPE(ZynqXADCState, 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 89e56b815b..460a58f1ca 100644 --- a/include/hw/net/allwinner-sun8i-emac.h +++ b/include/hw/net/allwinner-sun8i-emac.h @@ -30,9 +30,7 @@ */ =20 #define TYPE_AW_SUN8I_EMAC "allwinner-sun8i-emac" -typedef struct AwSun8iEmacState AwSun8iEmacState; -DECLARE_INSTANCE_CHECKER(AwSun8iEmacState, AW_SUN8I_EMAC, - TYPE_AW_SUN8I_EMAC) +OBJECT_DECLARE_SIMPLE_TYPE(AwSun8iEmacState, AW_SUN8I_EMAC) =20 /** @} */ =20 diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_ema= c.h index f5f5b67939..534e748982 100644 --- a/include/hw/net/allwinner_emac.h +++ b/include/hw/net/allwinner_emac.h @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_AW_EMAC "allwinner-emac" -typedef struct AwEmacState AwEmacState; -DECLARE_INSTANCE_CHECKER(AwEmacState, AW_EMAC, - TYPE_AW_EMAC) +OBJECT_DECLARE_SIMPLE_TYPE(AwEmacState, AW_EMAC) =20 /* * Allwinner EMAC register list diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index 89d2dab513..91ebb5c8ae 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_CADENCE_GEM "cadence_gem" -typedef struct CadenceGEMState CadenceGEMState; -DECLARE_INSTANCE_CHECKER(CadenceGEMState, CADENCE_GEM, - TYPE_CADENCE_GEM) +OBJECT_DECLARE_SIMPLE_TYPE(CadenceGEMState, 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 c6b1c11fca..765d1538a4 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -12,9 +12,7 @@ #include "qom/object.h" =20 #define TYPE_FTGMAC100 "ftgmac100" -typedef struct FTGMAC100State FTGMAC100State; -DECLARE_INSTANCE_CHECKER(FTGMAC100State, FTGMAC100, - TYPE_FTGMAC100) +OBJECT_DECLARE_SIMPLE_TYPE(FTGMAC100State, FTGMAC100) =20 #include "hw/sysbus.h" #include "net/net.h" @@ -70,9 +68,7 @@ struct FTGMAC100State { }; =20 #define TYPE_ASPEED_MII "aspeed-mmi" -typedef struct AspeedMiiState AspeedMiiState; -DECLARE_INSTANCE_CHECKER(AspeedMiiState, ASPEED_MII, - TYPE_ASPEED_MII) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedMiiState, ASPEED_MII) =20 /* * AST2600 MII controller diff --git a/include/hw/net/imx_fec.h b/include/hw/net/imx_fec.h index ffdbc304b6..e3a8755db9 100644 --- a/include/hw/net/imx_fec.h +++ b/include/hw/net/imx_fec.h @@ -26,9 +26,7 @@ #include "qom/object.h" =20 #define TYPE_IMX_FEC "imx.fec" -typedef struct IMXFECState IMXFECState; -DECLARE_INSTANCE_CHECKER(IMXFECState, IMX_FEC, - TYPE_IMX_FEC) +OBJECT_DECLARE_SIMPLE_TYPE(IMXFECState, IMX_FEC) =20 #define TYPE_IMX_ENET "imx.enet" =20 diff --git a/include/hw/net/msf2-emac.h b/include/hw/net/msf2-emac.h index 68194d798c..846ba6e6dc 100644 --- a/include/hw/net/msf2-emac.h +++ b/include/hw/net/msf2-emac.h @@ -29,9 +29,7 @@ #include "qom/object.h" =20 #define TYPE_MSS_EMAC "msf2-emac" -typedef struct MSF2EmacState MSF2EmacState; -DECLARE_INSTANCE_CHECKER(MSF2EmacState, MSS_EMAC, - TYPE_MSS_EMAC) +OBJECT_DECLARE_SIMPLE_TYPE(MSF2EmacState, MSS_EMAC) =20 #define R_MAX (0x1a0 / 4) #define PHY_MAX_REGS 32 diff --git a/include/hw/nubus/mac-nubus-bridge.h b/include/hw/nubus/mac-nub= us-bridge.h index 6856d7e095..36aa098dd4 100644 --- a/include/hw/nubus/mac-nubus-bridge.h +++ b/include/hw/nubus/mac-nubus-bridge.h @@ -13,9 +13,7 @@ #include "qom/object.h" =20 #define TYPE_MAC_NUBUS_BRIDGE "mac-nubus-bridge" -typedef struct MacNubusState MacNubusState; -DECLARE_INSTANCE_CHECKER(MacNubusState, MAC_NUBUS_BRIDGE, - TYPE_MAC_NUBUS_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(MacNubusState, MAC_NUBUS_BRIDGE) =20 struct MacNubusState { SysBusDevice sysbus_dev; diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index 9370f0d8f0..e2b5cf260b 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -23,14 +23,10 @@ #define NUBUS_LAST_SLOT 0xF =20 #define TYPE_NUBUS_DEVICE "nubus-device" -typedef struct NubusDevice NubusDevice; -DECLARE_INSTANCE_CHECKER(NubusDevice, NUBUS_DEVICE, - TYPE_NUBUS_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(NubusDevice, NUBUS_DEVICE) =20 #define TYPE_NUBUS_BUS "nubus-bus" -typedef struct NubusBus NubusBus; -DECLARE_INSTANCE_CHECKER(NubusBus, NUBUS_BUS, - TYPE_NUBUS_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(NubusBus, 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 f85393400c..8a9f5738bf 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -12,12 +12,9 @@ #define TYPE_FW_CFG_MEM "fw_cfg_mem" #define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator" =20 -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) +OBJECT_DECLARE_SIMPLE_TYPE(FWCfgState, FW_CFG) +OBJECT_DECLARE_SIMPLE_TYPE(FWCfgIoState, FW_CFG_IO) +OBJECT_DECLARE_SIMPLE_TYPE(FWCfgMemState, FW_CFG_MEM) =20 typedef struct FWCfgDataGeneratorClass FWCfgDataGeneratorClass; DECLARE_CLASS_CHECKERS(FWCfgDataGeneratorClass, FW_CFG_DATA_GENERATOR, diff --git a/include/hw/nvram/nrf51_nvm.h b/include/hw/nvram/nrf51_nvm.h index ab99b09206..d85e788df5 100644 --- a/include/hw/nvram/nrf51_nvm.h +++ b/include/hw/nvram/nrf51_nvm.h @@ -25,9 +25,7 @@ #include "hw/sysbus.h" #include "qom/object.h" #define TYPE_NRF51_NVM "nrf51_soc.nvm" -typedef struct NRF51NVMState NRF51NVMState; -DECLARE_INSTANCE_CHECKER(NRF51NVMState, NRF51_NVM, - TYPE_NRF51_NVM) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51NVMState, NRF51_NVM) =20 #define NRF51_UICR_FIXTURE_SIZE 64 =20 diff --git a/include/hw/pci-bridge/simba.h b/include/hw/pci-bridge/simba.h index 675aa5a990..979cb17435 100644 --- a/include/hw/pci-bridge/simba.h +++ b/include/hw/pci-bridge/simba.h @@ -35,10 +35,8 @@ struct SimbaPCIBridge { /*< private >*/ PCIBridge parent_obj; }; -typedef struct SimbaPCIBridge SimbaPCIBridge; =20 #define TYPE_SIMBA_PCI_BRIDGE "pbm-bridge" -DECLARE_INSTANCE_CHECKER(SimbaPCIBridge, SIMBA_PCI_BRIDGE, - TYPE_SIMBA_PCI_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(SimbaPCIBridge, SIMBA_PCI_BRIDGE) =20 #endif diff --git a/include/hw/pci-host/designware.h b/include/hw/pci-host/designw= are.h index 551eec3107..79869c7066 100644 --- a/include/hw/pci-host/designware.h +++ b/include/hw/pci-host/designware.h @@ -29,14 +29,10 @@ #include "qom/object.h" =20 #define TYPE_DESIGNWARE_PCIE_HOST "designware-pcie-host" -typedef struct DesignwarePCIEHost DesignwarePCIEHost; -DECLARE_INSTANCE_CHECKER(DesignwarePCIEHost, DESIGNWARE_PCIE_HOST, - TYPE_DESIGNWARE_PCIE_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(DesignwarePCIEHost, DESIGNWARE_PCIE_HOST) =20 #define TYPE_DESIGNWARE_PCIE_ROOT "designware-pcie-root" -typedef struct DesignwarePCIERoot DesignwarePCIERoot; -DECLARE_INSTANCE_CHECKER(DesignwarePCIERoot, DESIGNWARE_PCIE_ROOT, - TYPE_DESIGNWARE_PCIE_ROOT) +OBJECT_DECLARE_SIMPLE_TYPE(DesignwarePCIERoot, DESIGNWARE_PCIE_ROOT) =20 struct DesignwarePCIERoot; =20 diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index 2f4e852eee..7abdb8b406 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -26,14 +26,10 @@ #include "qom/object.h" =20 #define TYPE_GPEX_HOST "gpex-pcihost" -typedef struct GPEXHost GPEXHost; -DECLARE_INSTANCE_CHECKER(GPEXHost, GPEX_HOST, - TYPE_GPEX_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(GPEXHost, GPEX_HOST) =20 #define TYPE_GPEX_ROOT_DEVICE "gpex-root" -typedef struct GPEXRootState GPEXRootState; -DECLARE_INSTANCE_CHECKER(GPEXRootState, GPEX_ROOT_DEVICE, - TYPE_GPEX_ROOT_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(GPEXRootState, 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 046c64576d..6c16eaf876 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -19,9 +19,7 @@ #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" #define TYPE_I440FX_PCI_DEVICE "i440FX" =20 -typedef struct PCII440FXState PCII440FXState; -DECLARE_INSTANCE_CHECKER(PCII440FXState, I440FX_PCI_DEVICE, - TYPE_I440FX_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PCII440FXState, 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 182f29d681..e2a2e36245 100644 --- a/include/hw/pci-host/pnv_phb3.h +++ b/include/hw/pci-host/pnv_phb3.h @@ -72,9 +72,7 @@ typedef struct PnvPhb3DMASpace { * PHB3 Power Bus Common Queue */ #define TYPE_PNV_PBCQ "pnv-pbcq" -typedef struct PnvPBCQState PnvPBCQState; -DECLARE_INSTANCE_CHECKER(PnvPBCQState, PNV_PBCQ, - TYPE_PNV_PBCQ) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPBCQState, PNV_PBCQ) =20 struct PnvPBCQState { DeviceState parent; @@ -118,8 +116,7 @@ typedef struct PnvPHB3RootPort { * PHB3 PCIe Host Bridge for PowerNV machines (POWER8) */ #define TYPE_PNV_PHB3 "pnv-phb3" -DECLARE_INSTANCE_CHECKER(PnvPHB3, PNV_PHB3, - TYPE_PNV_PHB3) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB3, 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 05efb4e6b9..27556ae534 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -57,8 +57,7 @@ typedef struct PnvPHB4RootPort { * PHB4 PCIe Host Bridge for PowerNV machines (POWER9) */ #define TYPE_PNV_PHB4 "pnv-phb4" -DECLARE_INSTANCE_CHECKER(PnvPHB4, PNV_PHB4, - TYPE_PNV_PHB4) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB4, PNV_PHB4) =20 #define PNV_PHB4_MAX_LSIs 8 #define PNV_PHB4_MAX_INTs 4096 @@ -144,8 +143,7 @@ extern const MemoryRegionOps pnv_phb4_xscom_ops; OBJECT_DECLARE_TYPE(PnvPhb4PecState, PnvPhb4PecClass, PNV_PHB4_PEC) =20 #define TYPE_PNV_PHB4_PEC_STACK "pnv-phb4-pec-stack" -DECLARE_INSTANCE_CHECKER(PnvPhb4PecStack, PNV_PHB4_PEC_STACK, - TYPE_PNV_PHB4_PEC_STACK) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPhb4PecStack, PNV_PHB4_PEC_STACK) =20 /* Per-stack data */ struct PnvPhb4PecStack { diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index 0f5a534f77..bbb9581765 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -30,14 +30,10 @@ #include "qom/object.h" =20 #define TYPE_Q35_HOST_DEVICE "q35-pcihost" -typedef struct Q35PCIHost Q35PCIHost; -DECLARE_INSTANCE_CHECKER(Q35PCIHost, Q35_HOST_DEVICE, - TYPE_Q35_HOST_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(Q35PCIHost, Q35_HOST_DEVICE) =20 #define TYPE_MCH_PCI_DEVICE "mch" -typedef struct MCHPCIState MCHPCIState; -DECLARE_INSTANCE_CHECKER(MCHPCIState, MCH_PCI_DEVICE, - TYPE_MCH_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(MCHPCIState, MCH_PCI_DEVICE) =20 struct MCHPCIState { /*< private >*/ diff --git a/include/hw/pci-host/sabre.h b/include/hw/pci-host/sabre.h index 7a76de4b9e..01190241bb 100644 --- a/include/hw/pci-host/sabre.h +++ b/include/hw/pci-host/sabre.h @@ -20,11 +20,9 @@ struct SabrePCIState { PCIDevice parent_obj; }; -typedef struct SabrePCIState SabrePCIState; =20 #define TYPE_SABRE_PCI_DEVICE "sabre-pci" -DECLARE_INSTANCE_CHECKER(SabrePCIState, SABRE_PCI_DEVICE, - TYPE_SABRE_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(SabrePCIState, SABRE_PCI_DEVICE) =20 struct SabreState { PCIHostState parent_obj; @@ -48,10 +46,8 @@ struct SabreState { uint32_t reset_control; unsigned int nr_resets; }; -typedef struct SabreState SabreState; =20 #define TYPE_SABRE "sabre" -DECLARE_INSTANCE_CHECKER(SabreState, SABRE, - TYPE_SABRE) +OBJECT_DECLARE_SIMPLE_TYPE(SabreState, SABRE) =20 #endif diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 0431ce1048..04917f31ef 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -28,9 +28,7 @@ =20 #define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" =20 -typedef struct SpaprPhbState SpaprPhbState; -DECLARE_INSTANCE_CHECKER(SpaprPhbState, SPAPR_PCI_HOST_BRIDGE, - TYPE_SPAPR_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprPhbState, 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 d10c598298..a6ba5f21a8 100644 --- a/include/hw/pci-host/uninorth.h +++ b/include/hw/pci-host/uninorth.h @@ -63,10 +63,8 @@ struct UNINState { =20 MemoryRegion mem; }; -typedef struct UNINState UNINState; =20 #define TYPE_UNI_NORTH "uni-north" -DECLARE_INSTANCE_CHECKER(UNINState, UNI_NORTH, - TYPE_UNI_NORTH) +OBJECT_DECLARE_SIMPLE_TYPE(UNINState, 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 6058c8c9e2..f079e50db4 100644 --- a/include/hw/pci-host/xilinx-pcie.h +++ b/include/hw/pci-host/xilinx-pcie.h @@ -27,14 +27,10 @@ #include "qom/object.h" =20 #define TYPE_XILINX_PCIE_HOST "xilinx-pcie-host" -typedef struct XilinxPCIEHost XilinxPCIEHost; -DECLARE_INSTANCE_CHECKER(XilinxPCIEHost, XILINX_PCIE_HOST, - TYPE_XILINX_PCIE_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxPCIEHost, XILINX_PCIE_HOST) =20 #define TYPE_XILINX_PCIE_ROOT "xilinx-pcie-root" -typedef struct XilinxPCIERoot XilinxPCIERoot; -DECLARE_INSTANCE_CHECKER(XilinxPCIERoot, XILINX_PCIE_ROOT, - TYPE_XILINX_PCIE_ROOT) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxPCIERoot, XILINX_PCIE_ROOT) =20 struct XilinxPCIERoot { PCIBridge parent_obj; diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index 7ab145955a..a94d350034 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -51,8 +51,7 @@ struct PCIBridgeWindows { }; =20 #define TYPE_PCI_BRIDGE "base-pci-bridge" -DECLARE_INSTANCE_CHECKER(PCIBridge, PCI_BRIDGE, - TYPE_PCI_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PCIBridge, PCI_BRIDGE) =20 struct PCIBridge { /*< private >*/ diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h index f512646c0c..076457b270 100644 --- a/include/hw/pci/pcie_host.h +++ b/include/hw/pci/pcie_host.h @@ -26,8 +26,7 @@ #include "qom/object.h" =20 #define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge" -DECLARE_INSTANCE_CHECKER(PCIExpressHost, PCIE_HOST_BRIDGE, - TYPE_PCIE_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PCIExpressHost, 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 2463c07fa7..bea8ecad0f 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -26,8 +26,7 @@ #include "qom/object.h" =20 #define TYPE_PCIE_PORT "pcie-port" -DECLARE_INSTANCE_CHECKER(PCIEPort, PCIE_PORT, - TYPE_PCIE_PORT) +OBJECT_DECLARE_SIMPLE_TYPE(PCIEPort, PCIE_PORT) =20 struct PCIEPort { /*< private >*/ @@ -41,8 +40,7 @@ struct PCIEPort { void pcie_port_init_reg(PCIDevice *d); =20 #define TYPE_PCIE_SLOT "pcie-slot" -DECLARE_INSTANCE_CHECKER(PCIESlot, PCIE_SLOT, - TYPE_PCIE_SLOT) +OBJECT_DECLARE_SIMPLE_TYPE(PCIESlot, PCIE_SLOT) =20 struct PCIESlot { /*< private >*/ diff --git a/include/hw/platform-bus.h b/include/hw/platform-bus.h index 0d035e1b71..1f3d1ce869 100644 --- a/include/hw/platform-bus.h +++ b/include/hw/platform-bus.h @@ -25,11 +25,9 @@ #include "hw/sysbus.h" #include "qom/object.h" =20 -typedef struct PlatformBusDevice PlatformBusDevice; =20 #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device" -DECLARE_INSTANCE_CHECKER(PlatformBusDevice, PLATFORM_BUS_DEVICE, - TYPE_PLATFORM_BUS_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PlatformBusDevice, PLATFORM_BUS_DEVICE) =20 struct PlatformBusDevice { /*< private >*/ diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h index 9166d5f758..4a3f644516 100644 --- a/include/hw/ppc/mac_dbdma.h +++ b/include/hw/ppc/mac_dbdma.h @@ -178,7 +178,6 @@ void DBDMA_register_channel(void *dbdma, int nchan, qem= u_irq irq, void DBDMA_kick(DBDMAState *dbdma); =20 #define TYPE_MAC_DBDMA "mac-dbdma" -DECLARE_INSTANCE_CHECKER(DBDMAState, MAC_DBDMA, - TYPE_MAC_DBDMA) +OBJECT_DECLARE_SIMPLE_TYPE(DBDMAState, MAC_DBDMA) =20 #endif diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h index 61908c7858..74ff44bff0 100644 --- a/include/hw/ppc/openpic.h +++ b/include/hw/ppc/openpic.h @@ -137,9 +137,7 @@ typedef struct IRQDest { } IRQDest; =20 #define TYPE_OPENPIC "openpic" -typedef struct OpenPICState OpenPICState; -DECLARE_INSTANCE_CHECKER(OpenPICState, OPENPIC, - TYPE_OPENPIC) +OBJECT_DECLARE_SIMPLE_TYPE(OpenPICState, OPENPIC) =20 struct OpenPICState { /*< private >*/ diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index fc11edee28..f15829dfae 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -62,9 +62,7 @@ static inline PnvCPUState *pnv_cpu_state(PowerPCCPU *cpu) } =20 #define TYPE_PNV_QUAD "powernv-cpu-quad" -typedef struct PnvQuad PnvQuad; -DECLARE_INSTANCE_CHECKER(PnvQuad, PNV_QUAD, - TYPE_PNV_QUAD) +OBJECT_DECLARE_SIMPLE_TYPE(PnvQuad, PNV_QUAD) =20 struct PnvQuad { DeviceState parent_obj; diff --git a/include/hw/ppc/pnv_pnor.h b/include/hw/ppc/pnv_pnor.h index 1ec4098bb9..99f9a3adfb 100644 --- a/include/hw/ppc/pnv_pnor.h +++ b/include/hw/ppc/pnv_pnor.h @@ -16,9 +16,7 @@ #define PNOR_SPI_OFFSET 0x0c000000UL =20 #define TYPE_PNV_PNOR "pnv-pnor" -typedef struct PnvPnor PnvPnor; -DECLARE_INSTANCE_CHECKER(PnvPnor, PNV_PNOR, - TYPE_PNV_PNOR) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPnor, 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 a1fe25b3eb..682b09f874 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -51,9 +51,7 @@ struct PnvPsi { }; =20 #define TYPE_PNV8_PSI TYPE_PNV_PSI "-POWER8" -typedef struct Pnv8Psi Pnv8Psi; -DECLARE_INSTANCE_CHECKER(Pnv8Psi, PNV8_PSI, - TYPE_PNV8_PSI) +OBJECT_DECLARE_SIMPLE_TYPE(Pnv8Psi, PNV8_PSI) =20 struct Pnv8Psi { PnvPsi parent; @@ -62,9 +60,7 @@ struct Pnv8Psi { }; =20 #define TYPE_PNV9_PSI TYPE_PNV_PSI "-POWER9" -typedef struct Pnv9Psi Pnv9Psi; -DECLARE_INSTANCE_CHECKER(Pnv9Psi, PNV9_PSI, - TYPE_PNV9_PSI) +OBJECT_DECLARE_SIMPLE_TYPE(Pnv9Psi, PNV9_PSI) =20 struct Pnv9Psi { PnvPsi parent; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index eea7ac8624..194f3b9d07 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -28,9 +28,7 @@ typedef struct SpaprPendingHpt SpaprPendingHpt; =20 #define TYPE_SPAPR_RTC "spapr-rtc" =20 -typedef struct SpaprRtcState SpaprRtcState; -DECLARE_INSTANCE_CHECKER(SpaprRtcState, SPAPR_RTC, - TYPE_SPAPR_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprRtcState, SPAPR_RTC) =20 struct SpaprRtcState { /*< private >*/ @@ -781,11 +779,9 @@ static inline void spapr_dt_irq(uint32_t *intspec, int= irq, bool is_lsi) intspec[1] =3D is_lsi ? cpu_to_be32(1) : 0; } =20 -typedef struct SpaprTceTable SpaprTceTable; =20 #define TYPE_SPAPR_TCE_TABLE "spapr-tce-table" -DECLARE_INSTANCE_CHECKER(SpaprTceTable, SPAPR_TCE_TABLE, - TYPE_SPAPR_TCE_TABLE) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprTceTable, SPAPR_TCE_TABLE) =20 #define TYPE_SPAPR_IOMMU_MEMORY_REGION "spapr-iommu-memory-region" DECLARE_INSTANCE_CHECKER(IOMMUMemoryRegion, SPAPR_IOMMU_MEMORY_REGION, diff --git a/include/hw/ppc/spapr_tpm_proxy.h b/include/hw/ppc/spapr_tpm_pr= oxy.h index 300c81b1f0..96d2a9697e 100644 --- a/include/hw/ppc/spapr_tpm_proxy.h +++ b/include/hw/ppc/spapr_tpm_proxy.h @@ -17,9 +17,7 @@ #include "hw/qdev-core.h" =20 #define TYPE_SPAPR_TPM_PROXY "spapr-tpm-proxy" -typedef struct SpaprTpmProxy SpaprTpmProxy; -DECLARE_INSTANCE_CHECKER(SpaprTpmProxy, SPAPR_TPM_PROXY, - TYPE_SPAPR_TPM_PROXY) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprTpmProxy, SPAPR_TPM_PROXY) =20 struct SpaprTpmProxy { /*< private >*/ diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index aae03ea6ab..356751e2d7 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -32,9 +32,7 @@ OBJECT_DECLARE_TYPE(SpaprVioDevice, SpaprVioDeviceClass, VIO_SPAPR_DEVICE) =20 #define TYPE_SPAPR_VIO_BUS "spapr-vio-bus" -typedef struct SpaprVioBus SpaprVioBus; -DECLARE_INSTANCE_CHECKER(SpaprVioBus, SPAPR_VIO_BUS, - TYPE_SPAPR_VIO_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprVioBus, SPAPR_VIO_BUS) =20 #define TYPE_SPAPR_VIO_BRIDGE "spapr-vio-bridge" =20 diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 26771bb2b3..445eccfe6b 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -168,9 +168,7 @@ struct XiveNotifierClass { */ =20 #define TYPE_XIVE_SOURCE "xive-source" -typedef struct XiveSource XiveSource; -DECLARE_INSTANCE_CHECKER(XiveSource, XIVE_SOURCE, - TYPE_XIVE_SOURCE) +OBJECT_DECLARE_SIMPLE_TYPE(XiveSource, XIVE_SOURCE) =20 /* * XIVE Interrupt Source characteristics, which define how the ESB are @@ -306,9 +304,7 @@ void xive_source_set_irq(void *opaque, int srcno, int v= al); */ =20 #define TYPE_XIVE_TCTX "xive-tctx" -typedef struct XiveTCTX XiveTCTX; -DECLARE_INSTANCE_CHECKER(XiveTCTX, XIVE_TCTX, - TYPE_XIVE_TCTX) +OBJECT_DECLARE_SIMPLE_TYPE(XiveTCTX, XIVE_TCTX) =20 /* * XIVE Thread interrupt Management register rings : @@ -433,9 +429,7 @@ struct XiveFabricClass { */ =20 #define TYPE_XIVE_END_SOURCE "xive-end-source" -typedef struct XiveENDSource XiveENDSource; -DECLARE_INSTANCE_CHECKER(XiveENDSource, XIVE_END_SOURCE, - TYPE_XIVE_END_SOURCE) +OBJECT_DECLARE_SIMPLE_TYPE(XiveENDSource, XIVE_END_SOURCE) =20 struct XiveENDSource { DeviceState parent; diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index 8c15b6325f..5ff0c0f85e 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_RISCV_IBEX_SOC "riscv.lowrisc.ibex.soc" -typedef struct LowRISCIbexSoCState LowRISCIbexSoCState; -DECLARE_INSTANCE_CHECKER(LowRISCIbexSoCState, RISCV_IBEX_SOC, - TYPE_RISCV_IBEX_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(LowRISCIbexSoCState, RISCV_IBEX_SOC) =20 struct LowRISCIbexSoCState { /*< private >*/ diff --git a/include/hw/riscv/riscv_hart.h b/include/hw/riscv/riscv_hart.h index ac2cb62e1b..bbc21cdc9a 100644 --- a/include/hw/riscv/riscv_hart.h +++ b/include/hw/riscv/riscv_hart.h @@ -27,9 +27,7 @@ =20 #define TYPE_RISCV_HART_ARRAY "riscv.hart_array" =20 -typedef struct RISCVHartArrayState RISCVHartArrayState; -DECLARE_INSTANCE_CHECKER(RISCVHartArrayState, RISCV_HART_ARRAY, - TYPE_RISCV_HART_ARRAY) +OBJECT_DECLARE_SIMPLE_TYPE(RISCVHartArrayState, RISCV_HART_ARRAY) =20 struct RISCVHartArrayState { /*< private >*/ diff --git a/include/hw/rtc/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h index d7691ab88f..df61e46059 100644 --- a/include/hw/rtc/aspeed_rtc.h +++ b/include/hw/rtc/aspeed_rtc.h @@ -21,10 +21,8 @@ struct AspeedRtcState { int offset; =20 }; -typedef struct AspeedRtcState AspeedRtcState; =20 #define TYPE_ASPEED_RTC "aspeed.rtc" -DECLARE_INSTANCE_CHECKER(AspeedRtcState, ASPEED_RTC, - TYPE_ASPEED_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedRtcState, 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 b710c21c94..79ca7daf5d 100644 --- a/include/hw/rtc/goldfish_rtc.h +++ b/include/hw/rtc/goldfish_rtc.h @@ -26,9 +26,7 @@ #include "qom/object.h" =20 #define TYPE_GOLDFISH_RTC "goldfish_rtc" -typedef struct GoldfishRTCState GoldfishRTCState; -DECLARE_INSTANCE_CHECKER(GoldfishRTCState, GOLDFISH_RTC, - TYPE_GOLDFISH_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(GoldfishRTCState, GOLDFISH_RTC) =20 struct GoldfishRTCState { SysBusDevice parent_obj; diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index e58e006d0d..6224b5276a 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -16,9 +16,7 @@ #include "qom/object.h" =20 #define TYPE_MC146818_RTC "mc146818rtc" -typedef struct RTCState RTCState; -DECLARE_INSTANCE_CHECKER(RTCState, MC146818_RTC, - TYPE_MC146818_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(RTCState, MC146818_RTC) =20 struct RTCState { ISADevice parent_obj; diff --git a/include/hw/rtc/pl031.h b/include/hw/rtc/pl031.h index 3897b424d4..9fd4be1abb 100644 --- a/include/hw/rtc/pl031.h +++ b/include/hw/rtc/pl031.h @@ -19,9 +19,7 @@ #include "qom/object.h" =20 #define TYPE_PL031 "pl031" -typedef struct PL031State PL031State; -DECLARE_INSTANCE_CHECKER(PL031State, PL031, - TYPE_PL031) +OBJECT_DECLARE_SIMPLE_TYPE(PL031State, 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 209de85ae6..5f1ad0a946 100644 --- a/include/hw/rtc/xlnx-zynqmp-rtc.h +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h @@ -33,9 +33,7 @@ =20 #define TYPE_XLNX_ZYNQMP_RTC "xlnx-zynmp.rtc" =20 -typedef struct XlnxZynqMPRTC XlnxZynqMPRTC; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPRTC, XLNX_ZYNQMP_RTC, - TYPE_XLNX_ZYNQMP_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPRTC, XLNX_ZYNQMP_RTC) =20 REG32(SET_TIME_WRITE, 0x0) REG32(SET_TIME_READ, 0x4) diff --git a/include/hw/s390x/css-bridge.h b/include/hw/s390x/css-bridge.h index 9fd4484204..deb606d71f 100644 --- a/include/hw/s390x/css-bridge.h +++ b/include/hw/s390x/css-bridge.h @@ -21,21 +21,17 @@ struct VirtualCssBridge { SysBusDevice sysbus_dev; bool css_dev_path; }; -typedef struct VirtualCssBridge VirtualCssBridge; =20 #define TYPE_VIRTUAL_CSS_BRIDGE "virtual-css-bridge" -DECLARE_INSTANCE_CHECKER(VirtualCssBridge, VIRTUAL_CSS_BRIDGE, - TYPE_VIRTUAL_CSS_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(VirtualCssBridge, VIRTUAL_CSS_BRIDGE) =20 /* virtual css bus type */ struct VirtualCssBus { BusState parent_obj; }; -typedef struct VirtualCssBus VirtualCssBus; =20 #define TYPE_VIRTUAL_CSS_BUS "virtual-css-bus" -DECLARE_INSTANCE_CHECKER(VirtualCssBus, VIRTUAL_CSS_BUS, - TYPE_VIRTUAL_CSS_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(VirtualCssBus, VIRTUAL_CSS_BUS) VirtualCssBus *virtual_css_bus_init(void); =20 #endif diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index 648ae793a1..e91b15d2d6 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -77,9 +77,7 @@ DECLARE_INSTANCE_CHECKER(KVMS390FLICState, KVM_S390_FLIC, TYPE_KVM_S390_FLIC) =20 #define TYPE_QEMU_S390_FLIC "s390-flic-qemu" -typedef struct QEMUS390FLICState QEMUS390FLICState; -DECLARE_INSTANCE_CHECKER(QEMUS390FLICState, QEMU_S390_FLIC, - TYPE_QEMU_S390_FLIC) +OBJECT_DECLARE_SIMPLE_TYPE(QEMUS390FLICState, QEMU_S390_FLIC) =20 #define SIC_IRQ_MODE_ALL 0 #define SIC_IRQ_MODE_SINGLE 1 diff --git a/include/hw/s390x/vfio-ccw.h b/include/hw/s390x/vfio-ccw.h index 9c9c8944ad..63a909eb7e 100644 --- a/include/hw/s390x/vfio-ccw.h +++ b/include/hw/s390x/vfio-ccw.h @@ -20,9 +20,7 @@ #include "qom/object.h" =20 #define TYPE_VFIO_CCW "vfio-ccw" -typedef struct VFIOCCWDevice VFIOCCWDevice; -DECLARE_INSTANCE_CHECKER(VFIOCCWDevice, VFIO_CCW, - TYPE_VFIO_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VFIOCCWDevice, 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 20800dbf5b..60cc3047a5 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -66,9 +66,7 @@ struct ESPState { }; =20 #define TYPE_ESP "esp" -typedef struct SysBusESPState SysBusESPState; -DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP, - TYPE_ESP) +OBJECT_DECLARE_SIMPLE_TYPE(SysBusESPState, ESP) =20 struct SysBusESPState { /*< private >*/ diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index b1e2ed7c35..7a55cdbd74 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -132,8 +132,7 @@ struct SCSIBusInfo { }; =20 #define TYPE_SCSI_BUS "SCSI" -DECLARE_INSTANCE_CHECKER(SCSIBus, SCSI_BUS, - TYPE_SCSI_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SCSIBus, SCSI_BUS) =20 struct SCSIBus { BusState qbus; diff --git a/include/hw/sd/aspeed_sdhci.h b/include/hw/sd/aspeed_sdhci.h index 783ccc2956..b093d1b861 100644 --- a/include/hw/sd/aspeed_sdhci.h +++ b/include/hw/sd/aspeed_sdhci.h @@ -13,9 +13,7 @@ #include "qom/object.h" =20 #define TYPE_ASPEED_SDHCI "aspeed.sdhci" -typedef struct AspeedSDHCIState AspeedSDHCIState; -DECLARE_INSTANCE_CHECKER(AspeedSDHCIState, ASPEED_SDHCI, - TYPE_ASPEED_SDHCI) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedSDHCIState, 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 751ba531d6..f6bca5c397 100644 --- a/include/hw/sd/bcm2835_sdhost.h +++ b/include/hw/sd/bcm2835_sdhost.h @@ -19,9 +19,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_SDHOST "bcm2835-sdhost" -typedef struct BCM2835SDHostState BCM2835SDHostState; -DECLARE_INSTANCE_CHECKER(BCM2835SDHostState, BCM2835_SDHOST, - TYPE_BCM2835_SDHOST) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835SDHostState, BCM2835_SDHOST) =20 #define BCM2835_SDHOST_FIFO_LEN 16 =20 diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index a402665a9c..e650489414 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -9,9 +9,7 @@ #define DMA_REGS 4 =20 #define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" -typedef struct DMADeviceState DMADeviceState; -DECLARE_INSTANCE_CHECKER(DMADeviceState, SPARC32_DMA_DEVICE, - TYPE_SPARC32_DMA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(DMADeviceState, SPARC32_DMA_DEVICE) =20 =20 struct DMADeviceState { @@ -25,9 +23,7 @@ struct DMADeviceState { }; =20 #define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" -typedef struct ESPDMADeviceState ESPDMADeviceState; -DECLARE_INSTANCE_CHECKER(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE, - TYPE_SPARC32_ESPDMA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE) =20 struct ESPDMADeviceState { DMADeviceState parent_obj; @@ -36,9 +32,7 @@ struct ESPDMADeviceState { }; =20 #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" -typedef struct LEDMADeviceState LEDMADeviceState; -DECLARE_INSTANCE_CHECKER(LEDMADeviceState, SPARC32_LEDMA_DEVICE, - TYPE_SPARC32_LEDMA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(LEDMADeviceState, SPARC32_LEDMA_DEVICE) =20 struct LEDMADeviceState { DMADeviceState parent_obj; @@ -47,9 +41,7 @@ struct LEDMADeviceState { }; =20 #define TYPE_SPARC32_DMA "sparc32-dma" -typedef struct SPARC32DMAState SPARC32DMAState; -DECLARE_INSTANCE_CHECKER(SPARC32DMAState, SPARC32_DMA, - TYPE_SPARC32_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(SPARC32DMAState, SPARC32_DMA) =20 struct SPARC32DMAState { SysBusDevice parent_obj; diff --git a/include/hw/ssi/imx_spi.h b/include/hw/ssi/imx_spi.h index 874fea492d..b82b17f364 100644 --- a/include/hw/ssi/imx_spi.h +++ b/include/hw/ssi/imx_spi.h @@ -78,9 +78,7 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 #define TYPE_IMX_SPI "imx.spi" -typedef struct IMXSPIState IMXSPIState; -DECLARE_INSTANCE_CHECKER(IMXSPIState, IMX_SPI, - TYPE_IMX_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(IMXSPIState, IMX_SPI) =20 struct IMXSPIState { /* */ diff --git a/include/hw/ssi/mss-spi.h b/include/hw/ssi/mss-spi.h index 7c16cf6b49..ce6279c431 100644 --- a/include/hw/ssi/mss-spi.h +++ b/include/hw/ssi/mss-spi.h @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_MSS_SPI "mss-spi" -typedef struct MSSSpiState MSSSpiState; -DECLARE_INSTANCE_CHECKER(MSSSpiState, MSS_SPI, - TYPE_MSS_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(MSSSpiState, MSS_SPI) =20 #define R_SPI_MAX 16 =20 diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h index 1f5da7cc44..545b52689c 100644 --- a/include/hw/ssi/pl022.h +++ b/include/hw/ssi/pl022.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_PL022 "pl022" -typedef struct PL022State PL022State; -DECLARE_INSTANCE_CHECKER(PL022State, PL022, - TYPE_PL022) +OBJECT_DECLARE_SIMPLE_TYPE(PL022State, PL022) =20 struct PL022State { SysBusDevice parent_obj; diff --git a/include/hw/ssi/stm32f2xx_spi.h b/include/hw/ssi/stm32f2xx_spi.h index 4bb36d04ed..3683b4ad32 100644 --- a/include/hw/ssi/stm32f2xx_spi.h +++ b/include/hw/ssi/stm32f2xx_spi.h @@ -45,9 +45,7 @@ #define STM_SPI_SR_RXNE 1 =20 #define TYPE_STM32F2XX_SPI "stm32f2xx-spi" -typedef struct STM32F2XXSPIState STM32F2XXSPIState; -DECLARE_INSTANCE_CHECKER(STM32F2XXSPIState, STM32F2XX_SPI, - TYPE_STM32F2XX_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXSPIState, STM32F2XX_SPI) =20 struct STM32F2XXSPIState { /* */ diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index a2bf2cf3c7..b96de21b34 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -120,7 +120,6 @@ struct XlnxZynqMPQSPIPS { uint32_t dma_burst_size; uint8_t dma_buf[QSPI_DMA_MAX_BURST_SIZE]; }; -typedef struct XlnxZynqMPQSPIPS XlnxZynqMPQSPIPS; =20 struct XilinxSPIPSClass { SysBusDeviceClass parent_class; @@ -137,10 +136,8 @@ struct XilinxSPIPSClass { =20 OBJECT_DECLARE_TYPE(XilinxSPIPS, XilinxSPIPSClass, XILINX_SPIPS) =20 -DECLARE_INSTANCE_CHECKER(XilinxQSPIPS, XILINX_QSPIPS, - TYPE_XILINX_QSPIPS) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxQSPIPS, XILINX_QSPIPS) =20 -DECLARE_INSTANCE_CHECKER(XlnxZynqMPQSPIPS, XLNX_ZYNQMP_QSPIPS, - TYPE_XLNX_ZYNQMP_QSPIPS) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPQSPIPS, XLNX_ZYNQMP_QSPIPS) =20 #endif /* XILINX_SPIPS_H */ diff --git a/include/hw/timer/a9gtimer.h b/include/hw/timer/a9gtimer.h index f6fcc4bfc6..6ae9122e4b 100644 --- a/include/hw/timer/a9gtimer.h +++ b/include/hw/timer/a9gtimer.h @@ -29,9 +29,7 @@ #define A9_GTIMER_MAX_CPUS 4 =20 #define TYPE_A9_GTIMER "arm.cortex-a9-global-timer" -typedef struct A9GTimerState A9GTimerState; -DECLARE_INSTANCE_CHECKER(A9GTimerState, A9_GTIMER, - TYPE_A9_GTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(A9GTimerState, 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 9638e3c84c..8435758ad6 100644 --- a/include/hw/timer/allwinner-a10-pit.h +++ b/include/hw/timer/allwinner-a10-pit.h @@ -6,9 +6,7 @@ #include "qom/object.h" =20 #define TYPE_AW_A10_PIT "allwinner-A10-timer" -typedef struct AwA10PITState AwA10PITState; -DECLARE_INSTANCE_CHECKER(AwA10PITState, AW_A10_PIT, - TYPE_AW_A10_PIT) +OBJECT_DECLARE_SIMPLE_TYPE(AwA10PITState, 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 47d5e51686..65a96e2a0d 100644 --- a/include/hw/timer/arm_mptimer.h +++ b/include/hw/timer/arm_mptimer.h @@ -36,9 +36,7 @@ typedef struct { } TimerBlock; =20 #define TYPE_ARM_MPTIMER "arm_mptimer" -typedef struct ARMMPTimerState ARMMPTimerState; -DECLARE_INSTANCE_CHECKER(ARMMPTimerState, ARM_MPTIMER, - TYPE_ARM_MPTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(ARMMPTimerState, ARM_MPTIMER) =20 struct ARMMPTimerState { /*< private >*/ diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_sy= stick.h index b605688fee..97cb345ddb 100644 --- a/include/hw/timer/armv7m_systick.h +++ b/include/hw/timer/armv7m_systick.h @@ -17,9 +17,7 @@ =20 #define TYPE_SYSTICK "armv7m_systick" =20 -typedef struct SysTickState SysTickState; -DECLARE_INSTANCE_CHECKER(SysTickState, SYSTICK, - TYPE_SYSTICK) +OBJECT_DECLARE_SIMPLE_TYPE(SysTickState, SYSTICK) =20 struct SysTickState { /*< private >*/ diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h index d454bb31cb..0536254337 100644 --- a/include/hw/timer/avr_timer16.h +++ b/include/hw/timer/avr_timer16.h @@ -42,9 +42,7 @@ enum NextInterrupt { }; =20 #define TYPE_AVR_TIMER16 "avr-timer16" -typedef struct AVRTimer16State AVRTimer16State; -DECLARE_INSTANCE_CHECKER(AVRTimer16State, AVR_TIMER16, - TYPE_AVR_TIMER16) +OBJECT_DECLARE_SIMPLE_TYPE(AVRTimer16State, AVR_TIMER16) =20 struct AVRTimer16State { /* */ diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index 64166bd712..7ce8f6ef4d 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer" -typedef struct BCM2835SystemTimerState BCM2835SystemTimerState; -DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM2835_SYSTIMER, - TYPE_BCM2835_SYSTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835SystemTimerState, 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 7a5b9df5e5..08d9e6fa3d 100644 --- a/include/hw/timer/cmsdk-apb-dualtimer.h +++ b/include/hw/timer/cmsdk-apb-dualtimer.h @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_CMSDK_APB_DUALTIMER "cmsdk-apb-dualtimer" -typedef struct CMSDKAPBDualTimer CMSDKAPBDualTimer; -DECLARE_INSTANCE_CHECKER(CMSDKAPBDualTimer, CMSDK_APB_DUALTIMER, - TYPE_CMSDK_APB_DUALTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBDualTimer, 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 0912bc0f3c..0d80b2a48c 100644 --- a/include/hw/timer/cmsdk-apb-timer.h +++ b/include/hw/timer/cmsdk-apb-timer.h @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_CMSDK_APB_TIMER "cmsdk-apb-timer" -typedef struct CMSDKAPBTIMER CMSDKAPBTIMER; -DECLARE_INSTANCE_CHECKER(CMSDKAPBTIMER, CMSDK_APB_TIMER, - TYPE_CMSDK_APB_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBTIMER, CMSDK_APB_TIMER) =20 struct CMSDKAPBTIMER { /*< private >*/ diff --git a/include/hw/timer/digic-timer.h b/include/hw/timer/digic-timer.h index 84a0ef473a..da82fb4663 100644 --- a/include/hw/timer/digic-timer.h +++ b/include/hw/timer/digic-timer.h @@ -23,9 +23,7 @@ #include "qom/object.h" =20 #define TYPE_DIGIC_TIMER "digic-timer" -typedef struct DigicTimerState DigicTimerState; -DECLARE_INSTANCE_CHECKER(DigicTimerState, DIGIC_TIMER, - TYPE_DIGIC_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(DigicTimerState, DIGIC_TIMER) =20 #define DIGIC_TIMER_CONTROL 0x00 #define DIGIC_TIMER_CONTROL_RST 0x80000000 diff --git a/include/hw/timer/imx_epit.h b/include/hw/timer/imx_epit.h index 39bcf81331..2acc41e982 100644 --- a/include/hw/timer/imx_epit.h +++ b/include/hw/timer/imx_epit.h @@ -56,9 +56,7 @@ #define EPIT_TIMER_MAX 0XFFFFFFFFUL =20 #define TYPE_IMX_EPIT "imx.epit" -typedef struct IMXEPITState IMXEPITState; -DECLARE_INSTANCE_CHECKER(IMXEPITState, IMX_EPIT, - TYPE_IMX_EPIT) +OBJECT_DECLARE_SIMPLE_TYPE(IMXEPITState, IMX_EPIT) =20 struct IMXEPITState { /*< private >*/ diff --git a/include/hw/timer/mss-timer.h b/include/hw/timer/mss-timer.h index d207bae2c0..da38512904 100644 --- a/include/hw/timer/mss-timer.h +++ b/include/hw/timer/mss-timer.h @@ -30,9 +30,7 @@ #include "qom/object.h" =20 #define TYPE_MSS_TIMER "mss-timer" -typedef struct MSSTimerState MSSTimerState; -DECLARE_INSTANCE_CHECKER(MSSTimerState, MSS_TIMER, - TYPE_MSS_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(MSSTimerState, 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 4261a03b95..76827c11dc 100644 --- a/include/hw/timer/nrf51_timer.h +++ b/include/hw/timer/nrf51_timer.h @@ -17,9 +17,7 @@ #include "qemu/timer.h" #include "qom/object.h" #define TYPE_NRF51_TIMER "nrf51_soc.timer" -typedef struct NRF51TimerState NRF51TimerState; -DECLARE_INSTANCE_CHECKER(NRF51TimerState, NRF51_TIMER, - TYPE_NRF51_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51TimerState, NRF51_TIMER) =20 #define NRF51_TIMER_REG_COUNT 4 =20 diff --git a/include/hw/usb.h b/include/hw/usb.h index 355745c23a..a70a72e917 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -175,7 +175,6 @@ =20 #define USB_INTERFACE_INVALID 255 =20 -typedef struct USBBus USBBus; typedef struct USBBusOps USBBusOps; typedef struct USBPort USBPort; typedef struct USBDevice USBDevice; @@ -473,8 +472,7 @@ bool usb_host_dev_is_scsi_storage(USBDevice *usbdev); /* usb-bus.c */ =20 #define TYPE_USB_BUS "usb-bus" -DECLARE_INSTANCE_CHECKER(USBBus, USB_BUS, - TYPE_USB_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(USBBus, USB_BUS) =20 struct USBBus { BusState qbus; diff --git a/include/hw/usb/chipidea.h b/include/hw/usb/chipidea.h index f0303b8721..fe4113ee01 100644 --- a/include/hw/usb/chipidea.h +++ b/include/hw/usb/chipidea.h @@ -10,10 +10,8 @@ struct ChipideaState { =20 MemoryRegion iomem[3]; }; -typedef struct ChipideaState ChipideaState; =20 #define TYPE_CHIPIDEA "usb-chipidea" -DECLARE_INSTANCE_CHECKER(ChipideaState, CHIPIDEA, - TYPE_CHIPIDEA) +OBJECT_DECLARE_SIMPLE_TYPE(ChipideaState, CHIPIDEA) =20 #endif /* CHIPIDEA_H */ diff --git a/include/hw/usb/imx-usb-phy.h b/include/hw/usb/imx-usb-phy.h index f7f92fc462..d1e867b77a 100644 --- a/include/hw/usb/imx-usb-phy.h +++ b/include/hw/usb/imx-usb-phy.h @@ -39,9 +39,7 @@ enum IMXUsbPhyRegisters { #define USBPHY_CTRL_SFTRST BIT(31) =20 #define TYPE_IMX_USBPHY "imx.usbphy" -typedef struct IMXUSBPHYState IMXUSBPHYState; -DECLARE_INSTANCE_CHECKER(IMXUSBPHYState, IMX_USBPHY, - TYPE_IMX_USBPHY) +OBJECT_DECLARE_SIMPLE_TYPE(IMXUSBPHYState, IMX_USBPHY) =20 struct IMXUSBPHYState { /* */ diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhos= t-scsi-common.h index 5f0bf73d9d..0c8909d12a 100644 --- a/include/hw/virtio/vhost-scsi-common.h +++ b/include/hw/virtio/vhost-scsi-common.h @@ -20,9 +20,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_SCSI_COMMON "vhost-scsi-common" -typedef struct VHostSCSICommon VHostSCSICommon; -DECLARE_INSTANCE_CHECKER(VHostSCSICommon, VHOST_SCSI_COMMON, - TYPE_VHOST_SCSI_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(VHostSCSICommon, 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 7a77644150..7dc2bdd69d 100644 --- a/include/hw/virtio/vhost-scsi.h +++ b/include/hw/virtio/vhost-scsi.h @@ -26,9 +26,7 @@ enum vhost_scsi_vq_list { }; =20 #define TYPE_VHOST_SCSI "vhost-scsi" -typedef struct VHostSCSI VHostSCSI; -DECLARE_INSTANCE_CHECKER(VHostSCSI, VHOST_SCSI, - TYPE_VHOST_SCSI) +OBJECT_DECLARE_SIMPLE_TYPE(VHostSCSI, 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 dc40ab6f11..f536576d20 100644 --- a/include/hw/virtio/vhost-user-blk.h +++ b/include/hw/virtio/vhost-user-blk.h @@ -23,9 +23,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_USER_BLK "vhost-user-blk" -typedef struct VHostUserBlk VHostUserBlk; -DECLARE_INSTANCE_CHECKER(VHostUserBlk, VHOST_USER_BLK, - TYPE_VHOST_USER_BLK) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserBlk, 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 9033e6f902..6985752771 100644 --- a/include/hw/virtio/vhost-user-fs.h +++ b/include/hw/virtio/vhost-user-fs.h @@ -21,9 +21,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_USER_FS "vhost-user-fs-device" -typedef struct VHostUserFS VHostUserFS; -DECLARE_INSTANCE_CHECKER(VHostUserFS, VHOST_USER_FS, - TYPE_VHOST_USER_FS) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserFS, 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 342d67ee9e..521b08e559 100644 --- a/include/hw/virtio/vhost-user-scsi.h +++ b/include/hw/virtio/vhost-user-scsi.h @@ -24,9 +24,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_USER_SCSI "vhost-user-scsi" -typedef struct VHostUserSCSI VHostUserSCSI; -DECLARE_INSTANCE_CHECKER(VHostUserSCSI, VHOST_USER_SCSI, - TYPE_VHOST_USER_SCSI) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserSCSI, 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 b3c40c16a3..4cfd558245 100644 --- a/include/hw/virtio/vhost-user-vsock.h +++ b/include/hw/virtio/vhost-user-vsock.h @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_USER_VSOCK "vhost-user-vsock-device" -typedef struct VHostUserVSock VHostUserVSock; -DECLARE_INSTANCE_CHECKER(VHostUserVSock, VHOST_USER_VSOCK, - TYPE_VHOST_USER_VSOCK) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserVSock, 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 60bfb68db1..e412b5ee98 100644 --- a/include/hw/virtio/vhost-vsock-common.h +++ b/include/hw/virtio/vhost-vsock-common.h @@ -16,9 +16,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common" -typedef struct VHostVSockCommon VHostVSockCommon; -DECLARE_INSTANCE_CHECKER(VHostVSockCommon, VHOST_VSOCK_COMMON, - TYPE_VHOST_VSOCK_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(VHostVSockCommon, 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 c561cc427a..84f4e727c7 100644 --- a/include/hw/virtio/vhost-vsock.h +++ b/include/hw/virtio/vhost-vsock.h @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_VHOST_VSOCK "vhost-vsock-device" -typedef struct VHostVSock VHostVSock; -DECLARE_INSTANCE_CHECKER(VHostVSock, VHOST_VSOCK, - TYPE_VHOST_VSOCK) +OBJECT_DECLARE_SIMPLE_TYPE(VHostVSock, 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 0d08f496d9..5139cf8ab6 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -21,9 +21,7 @@ #include "qom/object.h" =20 #define TYPE_VIRTIO_BALLOON "virtio-balloon-device" -typedef struct VirtIOBalloon VirtIOBalloon; -DECLARE_INSTANCE_CHECKER(VirtIOBalloon, VIRTIO_BALLOON, - TYPE_VIRTIO_BALLOON) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBalloon, 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 29c9f32353..5953cf8961 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -22,9 +22,7 @@ #include "qom/object.h" =20 #define TYPE_VIRTIO_BLK "virtio-blk-device" -typedef struct VirtIOBlock VirtIOBlock; -DECLARE_INSTANCE_CHECKER(VirtIOBlock, VIRTIO_BLK, - TYPE_VIRTIO_BLK) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBlock, 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-crypto.h b/include/hw/virtio/virtio-c= rypto.h index 7969695983..a2228d7b2e 100644 --- a/include/hw/virtio/virtio-crypto.h +++ b/include/hw/virtio/virtio-crypto.h @@ -32,9 +32,7 @@ do { \ =20 =20 #define TYPE_VIRTIO_CRYPTO "virtio-crypto-device" -typedef struct VirtIOCrypto VirtIOCrypto; -DECLARE_INSTANCE_CHECKER(VirtIOCrypto, VIRTIO_CRYPTO, - TYPE_VIRTIO_CRYPTO) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOCrypto, 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 5201792ede..225cbbc2e4 100644 --- a/include/hw/virtio/virtio-gpu-pci.h +++ b/include/hw/virtio/virtio-gpu-pci.h @@ -18,14 +18,12 @@ #include "hw/virtio/virtio-gpu.h" #include "qom/object.h" =20 -typedef struct VirtIOGPUPCIBase VirtIOGPUPCIBase; =20 /* * virtio-gpu-pci-base: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_GPU_PCI_BASE "virtio-gpu-pci-base" -DECLARE_INSTANCE_CHECKER(VirtIOGPUPCIBase, VIRTIO_GPU_PCI_BASE, - TYPE_VIRTIO_GPU_PCI_BASE) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUPCIBase, 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 7ef405975a..455e0a7433 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -29,14 +29,10 @@ OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, VIRTIO_GPU_BASE) =20 #define TYPE_VIRTIO_GPU "virtio-gpu-device" -typedef struct VirtIOGPU VirtIOGPU; -DECLARE_INSTANCE_CHECKER(VirtIOGPU, VIRTIO_GPU, - TYPE_VIRTIO_GPU) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPU, VIRTIO_GPU) =20 #define TYPE_VHOST_USER_GPU "vhost-user-gpu" -typedef struct VhostUserGPU VhostUserGPU; -DECLARE_INSTANCE_CHECKER(VhostUserGPU, VHOST_USER_GPU, - TYPE_VHOST_USER_GPU) +OBJECT_DECLARE_SIMPLE_TYPE(VhostUserGPU, 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 91df34b534..f2da63d309 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -29,23 +29,17 @@ OBJECT_DECLARE_TYPE(VirtIOInput, VirtIOInputClass, #define TYPE_VIRTIO_MOUSE "virtio-mouse-device" #define TYPE_VIRTIO_TABLET "virtio-tablet-device" =20 -typedef struct VirtIOInputHID VirtIOInputHID; -DECLARE_INSTANCE_CHECKER(VirtIOInputHID, VIRTIO_INPUT_HID, - TYPE_VIRTIO_INPUT_HID) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHID, 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; -DECLARE_INSTANCE_CHECKER(VirtIOInputHost, VIRTIO_INPUT_HOST, - TYPE_VIRTIO_INPUT_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHost, 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; -DECLARE_INSTANCE_CHECKER(VHostUserInput, VHOST_USER_INPUT, - TYPE_VHOST_USER_INPUT) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserInput, 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 ae9dc566c7..273e35c04b 100644 --- a/include/hw/virtio/virtio-iommu.h +++ b/include/hw/virtio/virtio-iommu.h @@ -27,9 +27,7 @@ =20 #define TYPE_VIRTIO_IOMMU "virtio-iommu-device" #define TYPE_VIRTIO_IOMMU_PCI "virtio-iommu-device-base" -typedef struct VirtIOIOMMU VirtIOIOMMU; -DECLARE_INSTANCE_CHECKER(VirtIOIOMMU, VIRTIO_IOMMU, - TYPE_VIRTIO_IOMMU) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOIOMMU, VIRTIO_IOMMU) =20 #define TYPE_VIRTIO_IOMMU_MEMORY_REGION "virtio-iommu-memory-region" =20 diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmi= o.h index 6a1c2c20d4..d4c4c386ab 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -34,9 +34,7 @@ DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass, =20 /* virtio-mmio */ #define TYPE_VIRTIO_MMIO "virtio-mmio" -typedef struct VirtIOMMIOProxy VirtIOMMIOProxy; -DECLARE_INSTANCE_CHECKER(VirtIOMMIOProxy, VIRTIO_MMIO, - TYPE_VIRTIO_MMIO) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOMMIOProxy, 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 929ed232dd..f4852ac27b 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -22,9 +22,7 @@ #include "qom/object.h" =20 #define TYPE_VIRTIO_NET "virtio-net-device" -typedef struct VirtIONet VirtIONet; -DECLARE_INSTANCE_CHECKER(VirtIONet, VIRTIO_NET, - TYPE_VIRTIO_NET) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIONet, VIRTIO_NET) =20 #define TX_TIMER_INTERVAL 150000 /* 150 us */ =20 diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index 3671c9ba19..82734255d9 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_VIRTIO_RNG "virtio-rng-device" -typedef struct VirtIORNG VirtIORNG; -DECLARE_INSTANCE_CHECKER(VirtIORNG, VIRTIO_RNG, - TYPE_VIRTIO_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIORNG, 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 9a8a06fdd1..543681bc18 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -26,14 +26,10 @@ #include "sysemu/iothread.h" =20 #define TYPE_VIRTIO_SCSI_COMMON "virtio-scsi-common" -typedef struct VirtIOSCSICommon VirtIOSCSICommon; -DECLARE_INSTANCE_CHECKER(VirtIOSCSICommon, VIRTIO_SCSI_COMMON, - TYPE_VIRTIO_SCSI_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSCSICommon, VIRTIO_SCSI_COMMON) =20 #define TYPE_VIRTIO_SCSI "virtio-scsi-device" -typedef struct VirtIOSCSI VirtIOSCSI; -DECLARE_INSTANCE_CHECKER(VirtIOSCSI, VIRTIO_SCSI, - TYPE_VIRTIO_SCSI) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSCSI, 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 17359918f7..d87c62eab7 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -32,9 +32,7 @@ OBJECT_DECLARE_TYPE(VirtIOSerialPort, VirtIOSerialPortCla= ss, typedef struct VirtIOSerial VirtIOSerial; =20 #define TYPE_VIRTIO_SERIAL_BUS "virtio-serial-bus" -typedef struct VirtIOSerialBus VirtIOSerialBus; -DECLARE_INSTANCE_CHECKER(VirtIOSerialBus, VIRTIO_SERIAL_BUS, - TYPE_VIRTIO_SERIAL_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSerialBus, VIRTIO_SERIAL_BUS) =20 =20 struct VirtIOSerialPortClass { @@ -224,7 +222,6 @@ 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" -DECLARE_INSTANCE_CHECKER(VirtIOSerial, VIRTIO_SERIAL, - TYPE_VIRTIO_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSerial, VIRTIO_SERIAL) =20 #endif diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog= /cmsdk-apb-watchdog.h index 63f4becf86..3da0d43e35 100644 --- a/include/hw/watchdog/cmsdk-apb-watchdog.h +++ b/include/hw/watchdog/cmsdk-apb-watchdog.h @@ -36,9 +36,7 @@ #include "qom/object.h" =20 #define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog" -typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog; -DECLARE_INSTANCE_CHECKER(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG, - TYPE_CMSDK_APB_WATCHDOG) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG) =20 /* * This shares the same struct (and cast macro) as the base diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h index 7665d93640..023d83f48f 100644 --- a/include/hw/watchdog/wdt_imx2.h +++ b/include/hw/watchdog/wdt_imx2.h @@ -19,9 +19,7 @@ #include "qom/object.h" =20 #define TYPE_IMX2_WDT "imx2.wdt" -typedef struct IMX2WdtState IMX2WdtState; -DECLARE_INSTANCE_CHECKER(IMX2WdtState, IMX2_WDT, - TYPE_IMX2_WDT) +OBJECT_DECLARE_SIMPLE_TYPE(IMX2WdtState, 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 a74fd9384f..d692ea7580 100644 --- a/include/hw/xen/xen-block.h +++ b/include/hw/xen/xen-block.h @@ -75,19 +75,15 @@ OBJECT_DECLARE_TYPE(XenBlockDevice, XenBlockDeviceClass= , XEN_BLOCK_DEVICE) struct XenDiskDevice { XenBlockDevice blockdev; }; -typedef struct XenDiskDevice XenDiskDevice; =20 #define TYPE_XEN_DISK_DEVICE "xen-disk" -DECLARE_INSTANCE_CHECKER(XenDiskDevice, XEN_DISK_DEVICE, - TYPE_XEN_DISK_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(XenDiskDevice, XEN_DISK_DEVICE) =20 struct XenCDRomDevice { XenBlockDevice blockdev; }; -typedef struct XenCDRomDevice XenCDRomDevice; =20 #define TYPE_XEN_CDROM_DEVICE "xen-cdrom" -DECLARE_INSTANCE_CHECKER(XenCDRomDevice, XEN_CDROM_DEVICE, - TYPE_XEN_CDROM_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(XenCDRomDevice, XEN_CDROM_DEVICE) =20 #endif /* HW_XEN_BLOCK_H */ diff --git a/include/io/channel-buffer.h b/include/io/channel-buffer.h index 89632ef437..518c28f13f 100644 --- a/include/io/channel-buffer.h +++ b/include/io/channel-buffer.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_BUFFER "qio-channel-buffer" -typedef struct QIOChannelBuffer QIOChannelBuffer; -DECLARE_INSTANCE_CHECKER(QIOChannelBuffer, QIO_CHANNEL_BUFFER, - TYPE_QIO_CHANNEL_BUFFER) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelBuffer, QIO_CHANNEL_BUFFER) =20 =20 /** diff --git a/include/io/channel-command.h b/include/io/channel-command.h index 4b64ff011b..5556a38d7e 100644 --- a/include/io/channel-command.h +++ b/include/io/channel-command.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_COMMAND "qio-channel-command" -typedef struct QIOChannelCommand QIOChannelCommand; -DECLARE_INSTANCE_CHECKER(QIOChannelCommand, QIO_CHANNEL_COMMAND, - TYPE_QIO_CHANNEL_COMMAND) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelCommand, QIO_CHANNEL_COMMAND) =20 =20 =20 diff --git a/include/io/channel-file.h b/include/io/channel-file.h index c6caf179d9..c61d6e0ef7 100644 --- a/include/io/channel-file.h +++ b/include/io/channel-file.h @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_FILE "qio-channel-file" -typedef struct QIOChannelFile QIOChannelFile; -DECLARE_INSTANCE_CHECKER(QIOChannelFile, QIO_CHANNEL_FILE, - TYPE_QIO_CHANNEL_FILE) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelFile, QIO_CHANNEL_FILE) =20 =20 /** diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h index 62e3e2e970..d07d67fab6 100644 --- a/include/io/channel-socket.h +++ b/include/io/channel-socket.h @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_SOCKET "qio-channel-socket" -typedef struct QIOChannelSocket QIOChannelSocket; -DECLARE_INSTANCE_CHECKER(QIOChannelSocket, QIO_CHANNEL_SOCKET, - TYPE_QIO_CHANNEL_SOCKET) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelSocket, QIO_CHANNEL_SOCKET) =20 =20 /** diff --git a/include/io/channel-tls.h b/include/io/channel-tls.h index 036bf54195..6dd1a3cd3c 100644 --- a/include/io/channel-tls.h +++ b/include/io/channel-tls.h @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_TLS "qio-channel-tls" -typedef struct QIOChannelTLS QIOChannelTLS; -DECLARE_INSTANCE_CHECKER(QIOChannelTLS, QIO_CHANNEL_TLS, - TYPE_QIO_CHANNEL_TLS) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelTLS, QIO_CHANNEL_TLS) =20 =20 /** diff --git a/include/io/channel-websock.h b/include/io/channel-websock.h index b07eddabe1..9c40513e74 100644 --- a/include/io/channel-websock.h +++ b/include/io/channel-websock.h @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_QIO_CHANNEL_WEBSOCK "qio-channel-websock" -typedef struct QIOChannelWebsock QIOChannelWebsock; -DECLARE_INSTANCE_CHECKER(QIOChannelWebsock, QIO_CHANNEL_WEBSOCK, - TYPE_QIO_CHANNEL_WEBSOCK) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelWebsock, QIO_CHANNEL_WEBSOCK) =20 typedef union QIOChannelWebsockMask QIOChannelWebsockMask; =20 diff --git a/include/net/can_emu.h b/include/net/can_emu.h index 150f91a657..743c6647c1 100644 --- a/include/net/can_emu.h +++ b/include/net/can_emu.h @@ -100,8 +100,7 @@ struct CanBusClientState { }; =20 #define TYPE_CAN_BUS "can-bus" -DECLARE_INSTANCE_CHECKER(CanBusState, CAN_BUS, - TYPE_CAN_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(CanBusState, CAN_BUS) =20 int can_bus_filter_match(struct qemu_can_filter *filter, qemu_canid_t can_= id); =20 diff --git a/include/sysemu/rng-random.h b/include/sysemu/rng-random.h index 58033ac3fe..0fdc6c6974 100644 --- a/include/sysemu/rng-random.h +++ b/include/sysemu/rng-random.h @@ -15,9 +15,7 @@ #include "qom/object.h" =20 #define TYPE_RNG_RANDOM "rng-random" -typedef struct RngRandom RngRandom; -DECLARE_INSTANCE_CHECKER(RngRandom, RNG_RANDOM, - TYPE_RNG_RANDOM) +OBJECT_DECLARE_SIMPLE_TYPE(RngRandom, RNG_RANDOM) =20 =20 #endif diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index f047ad0362..c6edb1b28a 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -35,10 +35,7 @@ */ #define TYPE_CRYPTODEV_BACKEND_BUILTIN "cryptodev-backend-builtin" =20 -typedef struct CryptoDevBackendBuiltin - CryptoDevBackendBuiltin; -DECLARE_INSTANCE_CHECKER(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTI= N, - TYPE_CRYPTODEV_BACKEND_BUILTIN) +OBJECT_DECLARE_SIMPLE_TYPE(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUIL= TIN) =20 =20 typedef struct CryptoDevBackendBuiltinSession { diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index 41089dede1..60ec4908aa 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -39,9 +39,7 @@ */ #define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user" =20 -typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser; -DECLARE_INSTANCE_CHECKER(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOS= T_USER, - TYPE_CRYPTODEV_BACKEND_VHOST_USER) +OBJECT_DECLARE_SIMPLE_TYPE(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VH= OST_USER) =20 =20 struct CryptoDevBackendVhostUser { diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index a3b2e8209e..40e1e5b3e3 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -19,9 +19,7 @@ #include "qom/object_interfaces.h" #include "qom/object.h" =20 -typedef struct HostMemoryBackendFile HostMemoryBackendFile; -DECLARE_INSTANCE_CHECKER(HostMemoryBackendFile, MEMORY_BACKEND_FILE, - TYPE_MEMORY_BACKEND_FILE) +OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE) =20 =20 struct HostMemoryBackendFile { diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 8cf6bcbda2..e5626d4330 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -21,9 +21,7 @@ =20 #define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd" =20 -typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd; -DECLARE_INSTANCE_CHECKER(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD, - TYPE_MEMORY_BACKEND_MEMFD) +OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD) =20 =20 struct HostMemoryBackendMemfd { diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c index 459be97a5a..f38dff117d 100644 --- a/backends/rng-builtin.c +++ b/backends/rng-builtin.c @@ -11,9 +11,7 @@ #include "qemu/guest-random.h" #include "qom/object.h" =20 -typedef struct RngBuiltin RngBuiltin; -DECLARE_INSTANCE_CHECKER(RngBuiltin, RNG_BUILTIN, - TYPE_RNG_BUILTIN) +OBJECT_DECLARE_SIMPLE_TYPE(RngBuiltin, RNG_BUILTIN) =20 struct RngBuiltin { RngBackend parent; diff --git a/backends/rng-egd.c b/backends/rng-egd.c index d905fe657c..20198ff26e 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -19,9 +19,7 @@ #include "qom/object.h" =20 #define TYPE_RNG_EGD "rng-egd" -typedef struct RngEgd RngEgd; -DECLARE_INSTANCE_CHECKER(RngEgd, RNG_EGD, - TYPE_RNG_EGD) +OBJECT_DECLARE_SIMPLE_TYPE(RngEgd, RNG_EGD) =20 struct RngEgd { RngBackend parent; diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index 13657d9aba..201cd38503 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -45,9 +45,7 @@ #include "qom/object.h" =20 #define TYPE_TPM_EMULATOR "tpm-emulator" -typedef struct TPMEmulator TPMEmulator; -DECLARE_INSTANCE_CHECKER(TPMEmulator, TPM_EMULATOR, - TYPE_TPM_EMULATOR) +OBJECT_DECLARE_SIMPLE_TYPE(TPMEmulator, 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 6d6294ef0a..8f6f4998a5 100644 --- a/backends/tpm/tpm_passthrough.c +++ b/backends/tpm/tpm_passthrough.c @@ -36,9 +36,7 @@ #include "qom/object.h" =20 #define TYPE_TPM_PASSTHROUGH "tpm-passthrough" -typedef struct TPMPassthruState TPMPassthruState; -DECLARE_INSTANCE_CHECKER(TPMPassthruState, TPM_PASSTHROUGH, - TYPE_TPM_PASSTHROUGH) +OBJECT_DECLARE_SIMPLE_TYPE(TPMPassthruState, TPM_PASSTHROUGH) =20 /* data structures */ struct TPMPassthruState { diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 1574f7db3e..832f8fba82 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -91,10 +91,8 @@ struct PIIX4PMState { =20 MemHotplugState acpi_memory_hotplug; }; -typedef struct PIIX4PMState PIIX4PMState; =20 -DECLARE_INSTANCE_CHECKER(PIIX4PMState, PIIX4_PM, - TYPE_PIIX4_PM) +OBJECT_DECLARE_SIMPLE_TYPE(PIIX4PMState, 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 d02b14d89f..a42b319812 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -50,9 +50,7 @@ typedef struct TyphoonPchip { TyphoonWindow win[4]; } TyphoonPchip; =20 -typedef struct TyphoonState TyphoonState; -DECLARE_INSTANCE_CHECKER(TyphoonState, TYPHOON_PCI_HOST_BRIDGE, - TYPE_TYPHOON_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(TyphoonState, TYPHOON_PCI_HOST_BRIDGE) =20 struct TyphoonState { PCIHostState parent_obj; diff --git a/hw/arm/collie.c b/hw/arm/collie.c index a49f4a1c7c..8df31e2793 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -25,11 +25,9 @@ struct CollieMachineState { =20 StrongARMState *sa1110; }; -typedef struct CollieMachineState CollieMachineState; =20 #define TYPE_COLLIE_MACHINE MACHINE_TYPE_NAME("collie") -DECLARE_INSTANCE_CHECKER(CollieMachineState, COLLIE_MACHINE, - TYPE_COLLIE_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(CollieMachineState, 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 e2ace803ef..7da984171b 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -156,9 +156,7 @@ static const MemoryRegionOps hb_mem_ops =3D { }; =20 #define TYPE_HIGHBANK_REGISTERS "highbank-regs" -typedef struct HighbankRegsState HighbankRegsState; -DECLARE_INSTANCE_CHECKER(HighbankRegsState, HIGHBANK_REGISTERS, - TYPE_HIGHBANK_REGISTERS) +OBJECT_DECLARE_SIMPLE_TYPE(HighbankRegsState, HIGHBANK_REGISTERS) =20 struct HighbankRegsState { /*< private >*/ diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 19989b61b9..de670b08a9 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -29,9 +29,7 @@ #include "qom/object.h" =20 #define TYPE_INTEGRATOR_CM "integrator_core" -typedef struct IntegratorCMState IntegratorCMState; -DECLARE_INSTANCE_CHECKER(IntegratorCMState, INTEGRATOR_CM, - TYPE_INTEGRATOR_CM) +OBJECT_DECLARE_SIMPLE_TYPE(IntegratorCMState, INTEGRATOR_CM) =20 struct IntegratorCMState { /*< private >*/ @@ -328,9 +326,7 @@ static void integratorcm_realize(DeviceState *d, Error = **errp) /* Primary interrupt controller. */ =20 #define TYPE_INTEGRATOR_PIC "integrator_pic" -typedef struct icp_pic_state icp_pic_state; -DECLARE_INSTANCE_CHECKER(icp_pic_state, INTEGRATOR_PIC, - TYPE_INTEGRATOR_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(icp_pic_state, INTEGRATOR_PIC) =20 struct icp_pic_state { /*< private >*/ @@ -468,9 +464,7 @@ static void icp_pic_init(Object *obj) /* CP control registers. */ =20 #define TYPE_ICP_CONTROL_REGS "icp-ctrl-regs" -typedef struct ICPCtrlRegsState ICPCtrlRegsState; -DECLARE_INSTANCE_CHECKER(ICPCtrlRegsState, ICP_CONTROL_REGS, - TYPE_ICP_CONTROL_REGS) +OBJECT_DECLARE_SIMPLE_TYPE(ICPCtrlRegsState, ICP_CONTROL_REGS) =20 struct ICPCtrlRegsState { /*< private >*/ diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index 9a4a3d357a..0947491cb9 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -26,12 +26,10 @@ struct MicrobitMachineState { NRF51State nrf51; MicrobitI2CState i2c; }; -typedef struct MicrobitMachineState MicrobitMachineState; =20 #define TYPE_MICROBIT_MACHINE MACHINE_TYPE_NAME("microbit") =20 -DECLARE_INSTANCE_CHECKER(MicrobitMachineState, MICROBIT_MACHINE, - TYPE_MICROBIT_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(MicrobitMachineState, MICROBIT_MACHINE) =20 static void microbit_init(MachineState *machine) { diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 2117a04171..5eb3f969fb 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -155,9 +155,7 @@ typedef struct mv88w8618_rx_desc { } mv88w8618_rx_desc; =20 #define TYPE_MV88W8618_ETH "mv88w8618_eth" -typedef struct mv88w8618_eth_state mv88w8618_eth_state; -DECLARE_INSTANCE_CHECKER(mv88w8618_eth_state, MV88W8618_ETH, - TYPE_MV88W8618_ETH) +OBJECT_DECLARE_SIMPLE_TYPE(mv88w8618_eth_state, MV88W8618_ETH) =20 struct mv88w8618_eth_state { /*< private >*/ @@ -485,9 +483,7 @@ 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; -DECLARE_INSTANCE_CHECKER(musicpal_lcd_state, MUSICPAL_LCD, - TYPE_MUSICPAL_LCD) +OBJECT_DECLARE_SIMPLE_TYPE(musicpal_lcd_state, MUSICPAL_LCD) =20 struct musicpal_lcd_state { /*< private >*/ @@ -703,9 +699,7 @@ 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; -DECLARE_INSTANCE_CHECKER(mv88w8618_pic_state, MV88W8618_PIC, - TYPE_MV88W8618_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(mv88w8618_pic_state, MV88W8618_PIC) =20 struct mv88w8618_pic_state { /*< private >*/ @@ -841,9 +835,7 @@ typedef struct mv88w8618_timer_state { } mv88w8618_timer_state; =20 #define TYPE_MV88W8618_PIT "mv88w8618_pit" -typedef struct mv88w8618_pit_state mv88w8618_pit_state; -DECLARE_INSTANCE_CHECKER(mv88w8618_pit_state, MV88W8618_PIT, - TYPE_MV88W8618_PIT) +OBJECT_DECLARE_SIMPLE_TYPE(mv88w8618_pit_state, MV88W8618_PIT) =20 struct mv88w8618_pit_state { /*< private >*/ @@ -1009,9 +1001,7 @@ 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; -DECLARE_INSTANCE_CHECKER(mv88w8618_flashcfg_state, MV88W8618_FLASHCFG, - TYPE_MV88W8618_FLASHCFG) +OBJECT_DECLARE_SIMPLE_TYPE(mv88w8618_flashcfg_state, MV88W8618_FLASHCFG) =20 struct mv88w8618_flashcfg_state { /*< private >*/ @@ -1100,11 +1090,9 @@ struct MusicPalMiscState { SysBusDevice parent_obj; MemoryRegion iomem; }; -typedef struct MusicPalMiscState MusicPalMiscState; =20 #define TYPE_MUSICPAL_MISC "musicpal-misc" -DECLARE_INSTANCE_CHECKER(MusicPalMiscState, MUSICPAL_MISC, - TYPE_MUSICPAL_MISC) +OBJECT_DECLARE_SIMPLE_TYPE(MusicPalMiscState, MUSICPAL_MISC) =20 static uint64_t musicpal_misc_read(void *opaque, hwaddr offset, unsigned size) @@ -1209,9 +1197,7 @@ 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; -DECLARE_INSTANCE_CHECKER(musicpal_gpio_state, MUSICPAL_GPIO, - TYPE_MUSICPAL_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(musicpal_gpio_state, MUSICPAL_GPIO) =20 struct musicpal_gpio_state { /*< private >*/ @@ -1460,9 +1446,7 @@ 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; -DECLARE_INSTANCE_CHECKER(musicpal_key_state, MUSICPAL_KEY, - TYPE_MUSICPAL_KEY) +OBJECT_DECLARE_SIMPLE_TYPE(musicpal_key_state, MUSICPAL_KEY) =20 struct musicpal_key_state { /*< private >*/ diff --git a/hw/arm/palm.c b/hw/arm/palm.c index abc6495489..4e3dc5fbbf 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -133,9 +133,7 @@ static void palmte_button_event(void *opaque, int keyco= de) */ =20 #define TYPE_PALM_MISC_GPIO "palm-misc-gpio" -typedef struct PalmMiscGPIOState PalmMiscGPIOState; -DECLARE_INSTANCE_CHECKER(PalmMiscGPIOState, PALM_MISC_GPIO, - TYPE_PALM_MISC_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(PalmMiscGPIOState, PALM_MISC_GPIO) =20 struct PalmMiscGPIOState { SysBusDevice parent_obj; diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 33074dbf82..591776ba88 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -470,9 +470,7 @@ static const VMStateDescription vmstate_pxa2xx_mm =3D { }; =20 #define TYPE_PXA2XX_SSP "pxa2xx-ssp" -typedef struct PXA2xxSSPState PXA2xxSSPState; -DECLARE_INSTANCE_CHECKER(PXA2xxSSPState, PXA2XX_SSP, - TYPE_PXA2XX_SSP) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxSSPState, PXA2XX_SSP) =20 /* Synchronous Serial Ports */ struct PXA2xxSSPState { @@ -811,9 +809,7 @@ 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; -DECLARE_INSTANCE_CHECKER(PXA2xxRTCState, PXA2XX_RTC, - TYPE_PXA2XX_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxRTCState, PXA2XX_RTC) =20 struct PXA2xxRTCState { /*< private >*/ @@ -1245,9 +1241,7 @@ static const TypeInfo pxa2xx_rtc_sysbus_info =3D { /* I2C Interface */ =20 #define TYPE_PXA2XX_I2C_SLAVE "pxa2xx-i2c-slave" -typedef struct PXA2xxI2CSlaveState PXA2xxI2CSlaveState; -DECLARE_INSTANCE_CHECKER(PXA2xxI2CSlaveState, PXA2XX_I2C_SLAVE, - TYPE_PXA2XX_I2C_SLAVE) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CSlaveState, PXA2XX_I2C_SLAVE) =20 struct PXA2xxI2CSlaveState { I2CSlave parent_obj; diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index 16bbe4fb70..e7c3d99224 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -22,9 +22,7 @@ #define PXA2XX_GPIO_BANKS 4 =20 #define TYPE_PXA2XX_GPIO "pxa2xx-gpio" -typedef struct PXA2xxGPIOInfo PXA2xxGPIOInfo; -DECLARE_INSTANCE_CHECKER(PXA2xxGPIOInfo, PXA2XX_GPIO, - TYPE_PXA2XX_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxGPIOInfo, PXA2XX_GPIO) =20 struct PXA2xxGPIOInfo { /*< private >*/ diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index cb52a9dff3..cf6cb2a373 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -38,9 +38,7 @@ #define PXA2XX_PIC_SRCS 40 =20 #define TYPE_PXA2XX_PIC "pxa2xx_pic" -typedef struct PXA2xxPICState PXA2xxPICState; -DECLARE_INSTANCE_CHECKER(PXA2xxPICState, PXA2XX_PIC, - TYPE_PXA2XX_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxPICState, PXA2XX_PIC) =20 struct PXA2xxPICState { /*< private >*/ diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index ac68b4640d..bcb2cb4761 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -95,11 +95,9 @@ struct SBSAMachineState { DeviceState *gic; PFlashCFI01 *flash[2]; }; -typedef struct SBSAMachineState SBSAMachineState; =20 #define TYPE_SBSA_MACHINE MACHINE_TYPE_NAME("sbsa-ref") -DECLARE_INSTANCE_CHECKER(SBSAMachineState, SBSA_MACHINE, - TYPE_SBSA_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(SBSAMachineState, 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 b5b867e6ed..32bdeacfd3 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -81,9 +81,7 @@ OBJECT_DECLARE_TYPE(SpitzMachineState, SpitzMachineClass,= SPITZ_MACHINE) #define FLASHCTL_NCE (FLASHCTL_CE0 | FLASHCTL_CE1) =20 #define TYPE_SL_NAND "sl-nand" -typedef struct SLNANDState SLNANDState; -DECLARE_INSTANCE_CHECKER(SLNANDState, SL_NAND, - TYPE_SL_NAND) +OBJECT_DECLARE_SIMPLE_TYPE(SLNANDState, SL_NAND) =20 struct SLNANDState { SysBusDevice parent_obj; @@ -259,9 +257,7 @@ static const int spitz_gpiomap[5] =3D { }; =20 #define TYPE_SPITZ_KEYBOARD "spitz-keyboard" -typedef struct SpitzKeyboardState SpitzKeyboardState; -DECLARE_INSTANCE_CHECKER(SpitzKeyboardState, SPITZ_KEYBOARD, - TYPE_SPITZ_KEYBOARD) +OBJECT_DECLARE_SIMPLE_TYPE(SpitzKeyboardState, SPITZ_KEYBOARD) =20 struct SpitzKeyboardState { SysBusDevice parent_obj; @@ -579,9 +575,7 @@ static void spitz_keyboard_realize(DeviceState *dev, Er= ror **errp) #define LCDTG_POLCTRL 0x07 =20 #define TYPE_SPITZ_LCDTG "spitz-lcdtg" -typedef struct SpitzLCDTG SpitzLCDTG; -DECLARE_INSTANCE_CHECKER(SpitzLCDTG, SPITZ_LCDTG, - TYPE_SPITZ_LCDTG) +OBJECT_DECLARE_SIMPLE_TYPE(SpitzLCDTG, SPITZ_LCDTG) =20 struct SpitzLCDTG { SSISlave ssidev; @@ -669,9 +663,7 @@ 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; -DECLARE_INSTANCE_CHECKER(CorgiSSPState, CORGI_SSP, - TYPE_CORGI_SSP) +OBJECT_DECLARE_SIMPLE_TYPE(CorgiSSPState, CORGI_SSP) =20 /* "Demux" the signal based on current chipselect */ struct CorgiSSPState { @@ -822,9 +814,7 @@ 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; -DECLARE_INSTANCE_CHECKER(SpitzMiscGPIOState, SPITZ_MISC_GPIO, - TYPE_SPITZ_MISC_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(SpitzMiscGPIOState, SPITZ_MISC_GPIO) =20 struct SpitzMiscGPIOState { SysBusDevice parent_obj; diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index d6fc4a4681..1237f5af02 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -58,9 +58,7 @@ typedef const struct { /* General purpose timer module. */ =20 #define TYPE_STELLARIS_GPTM "stellaris-gptm" -typedef struct gptm_state gptm_state; -DECLARE_INSTANCE_CHECKER(gptm_state, STELLARIS_GPTM, - TYPE_STELLARIS_GPTM) +OBJECT_DECLARE_SIMPLE_TYPE(gptm_state, STELLARIS_GPTM) =20 struct gptm_state { SysBusDevice parent_obj; @@ -721,9 +719,7 @@ static int stellaris_sys_init(uint32_t base, qemu_irq i= rq, /* I2C controller. */ =20 #define TYPE_STELLARIS_I2C "stellaris-i2c" -typedef struct stellaris_i2c_state stellaris_i2c_state; -DECLARE_INSTANCE_CHECKER(stellaris_i2c_state, STELLARIS_I2C, - TYPE_STELLARIS_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(stellaris_i2c_state, STELLARIS_I2C) =20 struct stellaris_i2c_state { SysBusDevice parent_obj; diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 0fe829b868..d7133eea6f 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -85,9 +85,7 @@ static struct { /* Interrupt Controller */ =20 #define TYPE_STRONGARM_PIC "strongarm_pic" -typedef struct StrongARMPICState StrongARMPICState; -DECLARE_INSTANCE_CHECKER(StrongARMPICState, STRONGARM_PIC, - TYPE_STRONGARM_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(StrongARMPICState, STRONGARM_PIC) =20 struct StrongARMPICState { SysBusDevice parent_obj; @@ -254,9 +252,7 @@ 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; -DECLARE_INSTANCE_CHECKER(StrongARMRTCState, STRONGARM_RTC, - TYPE_STRONGARM_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(StrongARMRTCState, STRONGARM_RTC) =20 struct StrongARMRTCState { SysBusDevice parent_obj; @@ -481,9 +477,7 @@ static const TypeInfo strongarm_rtc_sysbus_info =3D { #define GAFR 0x1c =20 #define TYPE_STRONGARM_GPIO "strongarm-gpio" -typedef struct StrongARMGPIOInfo StrongARMGPIOInfo; -DECLARE_INSTANCE_CHECKER(StrongARMGPIOInfo, STRONGARM_GPIO, - TYPE_STRONGARM_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(StrongARMGPIOInfo, STRONGARM_GPIO) =20 struct StrongARMGPIOInfo { SysBusDevice busdev; @@ -720,9 +714,7 @@ static const TypeInfo strongarm_gpio_info =3D { #define PPFR 0x10 =20 #define TYPE_STRONGARM_PPC "strongarm-ppc" -typedef struct StrongARMPPCInfo StrongARMPPCInfo; -DECLARE_INSTANCE_CHECKER(StrongARMPPCInfo, STRONGARM_PPC, - TYPE_STRONGARM_PPC) +OBJECT_DECLARE_SIMPLE_TYPE(StrongARMPPCInfo, STRONGARM_PPC) =20 struct StrongARMPPCInfo { SysBusDevice parent_obj; @@ -921,9 +913,7 @@ static const TypeInfo strongarm_ppc_info =3D { #define RX_FIFO_ROR (1 << 10) =20 #define TYPE_STRONGARM_UART "strongarm-uart" -typedef struct StrongARMUARTState StrongARMUARTState; -DECLARE_INSTANCE_CHECKER(StrongARMUARTState, STRONGARM_UART, - TYPE_STRONGARM_UART) +OBJECT_DECLARE_SIMPLE_TYPE(StrongARMUARTState, STRONGARM_UART) =20 struct StrongARMUARTState { SysBusDevice parent_obj; @@ -1353,9 +1343,7 @@ static const TypeInfo strongarm_uart_info =3D { /* Synchronous Serial Ports */ =20 #define TYPE_STRONGARM_SSP "strongarm-ssp" -typedef struct StrongARMSSPState StrongARMSSPState; -DECLARE_INSTANCE_CHECKER(StrongARMSSPState, STRONGARM_SSP, - TYPE_STRONGARM_SSP) +OBJECT_DECLARE_SIMPLE_TYPE(StrongARMSSPState, STRONGARM_SSP) =20 struct StrongARMSSPState { SysBusDevice parent_obj; diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 2ef6c7b288..c196f0d2f8 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -75,9 +75,7 @@ static void tosa_microdrive_attach(PXA2xxState *cpu) */ =20 #define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio" -typedef struct TosaMiscGPIOState TosaMiscGPIOState; -DECLARE_INSTANCE_CHECKER(TosaMiscGPIOState, TOSA_MISC_GPIO, - TYPE_TOSA_MISC_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(TosaMiscGPIOState, TOSA_MISC_GPIO) =20 struct TosaMiscGPIOState { SysBusDevice parent_obj; @@ -172,9 +170,7 @@ static void tosa_ssp_realize(SSISlave *dev, Error **err= p) } =20 #define TYPE_TOSA_DAC "tosa_dac" -typedef struct TosaDACState TosaDACState; -DECLARE_INSTANCE_CHECKER(TosaDACState, TOSA_DAC, - TYPE_TOSA_DAC) +OBJECT_DECLARE_SIMPLE_TYPE(TosaDACState, TOSA_DAC) =20 struct TosaDACState { I2CSlave parent_obj; diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 2ba69f24b7..84d4677abb 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -35,9 +35,7 @@ /* Primary interrupt controller. */ =20 #define TYPE_VERSATILE_PB_SIC "versatilepb_sic" -typedef struct vpb_sic_state vpb_sic_state; -DECLARE_INSTANCE_CHECKER(vpb_sic_state, VERSATILE_PB_SIC, - TYPE_VERSATILE_PB_SIC) +OBJECT_DECLARE_SIMPLE_TYPE(vpb_sic_state, VERSATILE_PB_SIC) =20 struct vpb_sic_state { SysBusDevice parent_obj; diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index f45e71e89b..2c0bff4fa6 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -40,9 +40,7 @@ #include "qom/object.h" =20 #define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") -typedef struct ZynqMachineState ZynqMachineState; -DECLARE_INSTANCE_CHECKER(ZynqMachineState, ZYNQ_MACHINE, - TYPE_ZYNQ_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, 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 1f9409eb32..03e23201b1 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt") -typedef struct VersalVirt VersalVirt; -DECLARE_INSTANCE_CHECKER(VersalVirt, XLNX_VERSAL_VIRT_MACHINE, - TYPE_XLNX_VERSAL_VIRT_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(VersalVirt, 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 19d5a4d4e0..066571a972 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -36,11 +36,9 @@ struct XlnxZCU102 { =20 struct arm_boot_info binfo; }; -typedef struct XlnxZCU102 XlnxZCU102; =20 #define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102") -DECLARE_INSTANCE_CHECKER(XlnxZCU102, ZCU102_MACHINE, - TYPE_ZCU102_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZCU102, 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 72ecb6df29..4fc5699dae 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -111,11 +111,9 @@ struct ZipitLCD { uint32_t cur_reg; int pos; }; -typedef struct ZipitLCD ZipitLCD; =20 #define TYPE_ZIPIT_LCD "zipit-lcd" -DECLARE_INSTANCE_CHECKER(ZipitLCD, ZIPIT_LCD, - TYPE_ZIPIT_LCD) +OBJECT_DECLARE_SIMPLE_TYPE(ZipitLCD, ZIPIT_LCD) =20 static uint32_t zipit_lcd_transfer(SSISlave *dev, uint32_t value) { @@ -198,9 +196,7 @@ static const TypeInfo zipit_lcd_info =3D { }; =20 #define TYPE_AER915 "aer915" -typedef struct AER915State AER915State; -DECLARE_INSTANCE_CHECKER(AER915State, AER915, - TYPE_AER915) +OBJECT_DECLARE_SIMPLE_TYPE(AER915State, AER915) =20 struct AER915State { I2CSlave parent_obj; diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index eb8a7f032d..3cb8131060 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -127,9 +127,7 @@ enum { #define MUTE_SHIFT 15 =20 #define TYPE_AC97 "AC97" -typedef struct AC97LinkState AC97LinkState; -DECLARE_INSTANCE_CHECKER(AC97LinkState, AC97, - TYPE_AC97) +OBJECT_DECLARE_SIMPLE_TYPE(AC97LinkState, AC97) =20 #define REC_MASK 7 enum { diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 870116e324..42d50d2fdc 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -52,9 +52,7 @@ #define SHIFT 1 =20 #define TYPE_ADLIB "adlib" -typedef struct AdlibState AdlibState; -DECLARE_INSTANCE_CHECKER(AdlibState, ADLIB, - TYPE_ADLIB) +OBJECT_DECLARE_SIMPLE_TYPE(AdlibState, ADLIB) =20 struct AdlibState { ISADevice parent_obj; diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index a824f8949e..6904589814 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -293,8 +293,7 @@ struct chan_bits { }; =20 #define TYPE_ES1370 "ES1370" -DECLARE_INSTANCE_CHECKER(ES1370State, ES1370, - TYPE_ES1370) +OBJECT_DECLARE_SIMPLE_TYPE(ES1370State, 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 307fd48315..e8719ee117 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -43,9 +43,7 @@ #endif =20 #define TYPE_GUS "gus" -typedef struct GUSState GUSState; -DECLARE_INSTANCE_CHECKER(GUSState, GUS, - TYPE_GUS) +OBJECT_DECLARE_SIMPLE_TYPE(GUSState, GUS) =20 struct GUSState { ISADevice dev; diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 77d31b91a4..feb8f9e2bb 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -172,8 +172,7 @@ struct HDAAudioStream { }; =20 #define TYPE_HDA_AUDIO "hda-audio" -DECLARE_INSTANCE_CHECKER(HDAAudioState, HDA_AUDIO, - TYPE_HDA_AUDIO) +OBJECT_DECLARE_SIMPLE_TYPE(HDAAudioState, HDA_AUDIO) =20 struct HDAAudioState { HDACodecDevice hda; diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index c8641562cc..e6c09bdb8e 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -43,9 +43,7 @@ #define MP_AUDIO_CLOCK_24MHZ (1 << 9) #define MP_AUDIO_MONO (1 << 14) =20 -typedef struct mv88w8618_audio_state mv88w8618_audio_state; -DECLARE_INSTANCE_CHECKER(mv88w8618_audio_state, MV88W8618_AUDIO, - TYPE_MV88W8618_AUDIO) +OBJECT_DECLARE_SIMPLE_TYPE(mv88w8618_audio_state, 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 7893539019..04b39f8345 100644 --- a/hw/audio/milkymist-ac97.c +++ b/hw/audio/milkymist-ac97.c @@ -56,9 +56,7 @@ enum { }; =20 #define TYPE_MILKYMIST_AC97 "milkymist-ac97" -typedef struct MilkymistAC97State MilkymistAC97State; -DECLARE_INSTANCE_CHECKER(MilkymistAC97State, MILKYMIST_AC97, - TYPE_MILKYMIST_AC97) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistAC97State, MILKYMIST_AC97) =20 struct MilkymistAC97State { SysBusDevice parent_obj; diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index cbee8855fb..b056c05387 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -40,9 +40,7 @@ #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; -DECLARE_INSTANCE_CHECKER(PCSpkState, PC_SPEAKER, - TYPE_PC_SPEAKER) +OBJECT_DECLARE_SIMPLE_TYPE(PCSpkState, PC_SPEAKER) =20 struct PCSpkState { ISADevice parent_obj; diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c index 570a234b72..03acd4fe34 100644 --- a/hw/audio/pl041.c +++ b/hw/audio/pl041.c @@ -78,9 +78,7 @@ typedef struct { } pl041_channel; =20 #define TYPE_PL041 "pl041" -typedef struct PL041State PL041State; -DECLARE_INSTANCE_CHECKER(PL041State, PL041, - TYPE_PL041) +OBJECT_DECLARE_SIMPLE_TYPE(PL041State, PL041) =20 struct PL041State { SysBusDevice parent_obj; diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 6aa2c0fb93..8b20700410 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -50,9 +50,7 @@ static const char e3[] =3D "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992."; =20 #define TYPE_SB16 "sb16" -typedef struct SB16State SB16State; -DECLARE_INSTANCE_CHECKER(SB16State, SB16, - TYPE_SB16) +OBJECT_DECLARE_SIMPLE_TYPE(SB16State, SB16) =20 struct SB16State { ISADevice parent_obj; diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 7d6fcfec03..b5722b37c3 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -27,9 +27,7 @@ typedef struct { int dac_hz; } WMRate; =20 -typedef struct WM8750State WM8750State; -DECLARE_INSTANCE_CHECKER(WM8750State, WM8750, - TYPE_WM8750) +OBJECT_DECLARE_SIMPLE_TYPE(WM8750State, WM8750) =20 struct WM8750State { I2CSlave parent_obj; diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 224bac504f..4c2c35e223 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -65,9 +65,7 @@ /* qdev floppy bus */ =20 #define TYPE_FLOPPY_BUS "floppy-bus" -typedef struct FloppyBus FloppyBus; -DECLARE_INSTANCE_CHECKER(FloppyBus, FLOPPY_BUS, - TYPE_FLOPPY_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(FloppyBus, FLOPPY_BUS) =20 typedef struct FDCtrl FDCtrl; typedef struct FDrive FDrive; @@ -497,9 +495,7 @@ static const BlockDevOps fd_block_ops =3D { =20 =20 #define TYPE_FLOPPY_DRIVE "floppy" -typedef struct FloppyDrive FloppyDrive; -DECLARE_INSTANCE_CHECKER(FloppyDrive, FLOPPY_DRIVE, - TYPE_FLOPPY_DRIVE) +OBJECT_DECLARE_SIMPLE_TYPE(FloppyDrive, FLOPPY_DRIVE) =20 struct FloppyDrive { DeviceState qdev; @@ -890,9 +886,7 @@ static FloppyDriveType get_fallback_drive_type(FDrive *= drv) } =20 #define TYPE_SYSBUS_FDC "base-sysbus-fdc" -typedef struct FDCtrlSysBus FDCtrlSysBus; -DECLARE_INSTANCE_CHECKER(FDCtrlSysBus, SYSBUS_FDC, - TYPE_SYSBUS_FDC) +OBJECT_DECLARE_SIMPLE_TYPE(FDCtrlSysBus, SYSBUS_FDC) =20 struct FDCtrlSysBus { /*< private >*/ @@ -902,9 +896,7 @@ struct FDCtrlSysBus { struct FDCtrl state; }; =20 -typedef struct FDCtrlISABus FDCtrlISABus; -DECLARE_INSTANCE_CHECKER(FDCtrlISABus, ISA_FDC, - TYPE_ISA_FDC) +OBJECT_DECLARE_SIMPLE_TYPE(FDCtrlISABus, ISA_FDC) =20 struct FDCtrlISABus { ISADevice parent_obj; diff --git a/hw/block/nand.c b/hw/block/nand.c index 5c8112ed5a..bcceb64ebb 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -90,8 +90,7 @@ struct NANDFlashState { =20 #define TYPE_NAND "nand" =20 -DECLARE_INSTANCE_CHECKER(NANDFlashState, NAND, - TYPE_NAND) +OBJECT_DECLARE_SIMPLE_TYPE(NANDFlashState, 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 19f55aba66..5ff7be86bb 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -40,9 +40,7 @@ #define BLOCK_SHIFT (PAGE_SHIFT + 6) =20 #define TYPE_ONE_NAND "onenand" -typedef struct OneNANDState OneNANDState; -DECLARE_INSTANCE_CHECKER(OneNANDState, ONE_NAND, - TYPE_ONE_NAND) +OBJECT_DECLARE_SIMPLE_TYPE(OneNANDState, ONE_NAND) =20 struct OneNANDState { SysBusDevice parent_obj; diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c index daaaca0f39..2a063ad72c 100644 --- a/hw/char/debugcon.c +++ b/hw/char/debugcon.c @@ -33,9 +33,7 @@ #include "qom/object.h" =20 #define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon" -typedef struct ISADebugconState ISADebugconState; -DECLARE_INSTANCE_CHECKER(ISADebugconState, ISA_DEBUGCON_DEVICE, - TYPE_ISA_DEBUGCON_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ISADebugconState, ISA_DEBUGCON_DEVICE) =20 //#define DEBUG_DEBUGCON =20 diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index b8ea34edbd..96afe3580f 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -139,9 +139,7 @@ typedef struct { } Exynos4210UartFIFO; =20 #define TYPE_EXYNOS4210_UART "exynos4210.uart" -typedef struct Exynos4210UartState Exynos4210UartState; -DECLARE_INSTANCE_CHECKER(Exynos4210UartState, EXYNOS4210_UART, - TYPE_EXYNOS4210_UART) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210UartState, EXYNOS4210_UART) =20 struct Exynos4210UartState { SysBusDevice parent_obj; diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index 6fd88d83ad..3f80f6824e 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -73,9 +73,7 @@ =20 #define FIFO_LENGTH 1024 =20 -typedef struct UART UART; -DECLARE_INSTANCE_CHECKER(UART, GRLIB_APB_UART, - TYPE_GRLIB_APB_UART) +OBJECT_DECLARE_SIMPLE_TYPE(UART, GRLIB_APB_UART) =20 struct UART { SysBusDevice parent_obj; diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index 2c987df8ad..ad000a39b9 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -123,8 +123,7 @@ struct IPOctalState { =20 #define TYPE_IPOCTAL "ipoctal232" =20 -DECLARE_INSTANCE_CHECKER(IPOctalState, IPOCTAL, - TYPE_IPOCTAL) +OBJECT_DECLARE_SIMPLE_TYPE(IPOctalState, 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 5723f2e189..b97aacba91 100644 --- a/hw/char/lm32_juart.c +++ b/hw/char/lm32_juart.c @@ -42,9 +42,7 @@ enum { JRX_FULL =3D (1<<8), }; =20 -typedef struct LM32JuartState LM32JuartState; -DECLARE_INSTANCE_CHECKER(LM32JuartState, LM32_JUART, - TYPE_LM32_JUART) +OBJECT_DECLARE_SIMPLE_TYPE(LM32JuartState, LM32_JUART) =20 struct LM32JuartState { SysBusDevice parent_obj; diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 624bc83c5f..0e8b4e46a3 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -95,9 +95,7 @@ enum { }; =20 #define TYPE_LM32_UART "lm32-uart" -typedef struct LM32UartState LM32UartState; -DECLARE_INSTANCE_CHECKER(LM32UartState, LM32_UART, - TYPE_LM32_UART) +OBJECT_DECLARE_SIMPLE_TYPE(LM32UartState, LM32_UART) =20 struct LM32UartState { SysBusDevice parent_obj; diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index f6baa3ce77..e6814faffb 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -35,11 +35,9 @@ struct mcf_uart_state { qemu_irq irq; CharBackend chr; }; -typedef struct mcf_uart_state mcf_uart_state; =20 #define TYPE_MCF_UART "mcf-uart" -DECLARE_INSTANCE_CHECKER(mcf_uart_state, MCF_UART, - TYPE_MCF_UART) +OBJECT_DECLARE_SIMPLE_TYPE(mcf_uart_state, 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 41204a0e28..1e83dbcafa 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -58,9 +58,7 @@ enum { }; =20 #define TYPE_MILKYMIST_UART "milkymist-uart" -typedef struct MilkymistUartState MilkymistUartState; -DECLARE_INSTANCE_CHECKER(MilkymistUartState, MILKYMIST_UART, - TYPE_MILKYMIST_UART) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistUartState, MILKYMIST_UART) =20 struct MilkymistUartState { SysBusDevice parent_obj; diff --git a/hw/char/parallel.c b/hw/char/parallel.c index ddb14f3197..8b418abf71 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -93,9 +93,7 @@ typedef struct ParallelState { } ParallelState; =20 #define TYPE_ISA_PARALLEL "isa-parallel" -typedef struct ISAParallelState ISAParallelState; -DECLARE_INSTANCE_CHECKER(ISAParallelState, ISA_PARALLEL, - TYPE_ISA_PARALLEL) +OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL) =20 struct ISAParallelState { ISADevice parent_obj; diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index d4aad81a85..32c2fc0ebe 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -34,9 +34,7 @@ #include "migration/vmstate.h" #include "qom/object.h" =20 -typedef struct ISASerialState ISASerialState; -DECLARE_INSTANCE_CHECKER(ISASerialState, ISA_SERIAL, - TYPE_ISA_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(ISASerialState, ISA_SERIAL) =20 struct ISASerialState { ISADevice parent_obj; diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index f68948154e..b0520a5a09 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -40,11 +40,9 @@ struct PCISerialState { SerialState state; uint8_t prog_if; }; -typedef struct PCISerialState PCISerialState; =20 #define TYPE_PCI_SERIAL "pci-serial" -DECLARE_INSTANCE_CHECKER(PCISerialState, PCI_SERIAL, - TYPE_PCI_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(PCISerialState, 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 dd6dd2d8c3..e726d4d915 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -18,11 +18,9 @@ struct SpaprVioVty { uint32_t in, out; uint8_t buf[VTERM_BUFSIZE]; }; -typedef struct SpaprVioVty SpaprVioVty; =20 #define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty" -DECLARE_INSTANCE_CHECKER(SpaprVioVty, VIO_SPAPR_VTY_DEVICE, - TYPE_VIO_SPAPR_VTY_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprVioVty, VIO_SPAPR_VTY_DEVICE) =20 static int vty_can_receive(void *opaque) { diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index 8e9f9cd9ec..2e773ec4c4 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -53,9 +53,7 @@ #define CONTROL_IE 0x10 =20 #define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite" -typedef struct XilinxUARTLite XilinxUARTLite; -DECLARE_INSTANCE_CHECKER(XilinxUARTLite, XILINX_UARTLITE, - TYPE_XILINX_UARTLITE) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxUARTLite, XILINX_UARTLITE) =20 struct XilinxUARTLite { SysBusDevice parent_obj; diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index fb547aceef..72c792eef1 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore" -typedef struct mpcore_rirq_state mpcore_rirq_state; -DECLARE_INSTANCE_CHECKER(mpcore_rirq_state, REALVIEW_MPCORE_RIRQ, - TYPE_REALVIEW_MPCORE_RIRQ) +OBJECT_DECLARE_SIMPLE_TYPE(mpcore_rirq_state, 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 4b87ee7135..023165b2a3 100644 --- a/hw/display/ads7846.c +++ b/hw/display/ads7846.c @@ -29,11 +29,9 @@ struct ADS7846State { int cycle; int output; }; -typedef struct ADS7846State ADS7846State; =20 #define TYPE_ADS7846 "ads7846" -DECLARE_INSTANCE_CHECKER(ADS7846State, ADS7846, - TYPE_ADS7846) +OBJECT_DECLARE_SIMPLE_TYPE(ADS7846State, ADS7846) =20 /* Control-byte bitfields */ #define CB_PD0 (1 << 0) diff --git a/hw/display/artist.c b/hw/display/artist.c index 80cd66e41d..ed0e637f25 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_ARTIST "artist" -typedef struct ARTISTState ARTISTState; -DECLARE_INSTANCE_CHECKER(ARTISTState, ARTIST, - TYPE_ARTIST) +OBJECT_DECLARE_SIMPLE_TYPE(ARTISTState, 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 41587388c4..8ed734b195 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -55,11 +55,9 @@ struct BochsDisplayState { /* device state */ BochsDisplayMode mode; }; -typedef struct BochsDisplayState BochsDisplayState; =20 #define TYPE_BOCHS_DISPLAY "bochs-display" -DECLARE_INSTANCE_CHECKER(BochsDisplayState, BOCHS_DISPLAY, - TYPE_BOCHS_DISPLAY) +OBJECT_DECLARE_SIMPLE_TYPE(BochsDisplayState, 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 d66ba9ad6a..42fcf40010 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -66,9 +66,7 @@ #define CG3_VRAM_OFFSET 0x800000 =20 #define TYPE_CG3 "cgthree" -typedef struct CG3State CG3State; -DECLARE_INSTANCE_CHECKER(CG3State, CG3, - TYPE_CG3) +OBJECT_DECLARE_SIMPLE_TYPE(CG3State, CG3) =20 struct CG3State { SysBusDevice parent_obj; diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index c088f38cf8..722b9e7004 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -183,11 +183,9 @@ struct PCICirrusVGAState { PCIDevice dev; CirrusVGAState cirrus_vga; }; -typedef struct PCICirrusVGAState PCICirrusVGAState; =20 #define TYPE_PCI_CIRRUS_VGA "cirrus-vga" -DECLARE_INSTANCE_CHECKER(PCICirrusVGAState, PCI_CIRRUS_VGA, - TYPE_PCI_CIRRUS_VGA) +OBJECT_DECLARE_SIMPLE_TYPE(PCICirrusVGAState, 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 e6adee1df4..4f6fb1af3b 100644 --- a/hw/display/cirrus_vga_isa.c +++ b/hw/display/cirrus_vga_isa.c @@ -33,9 +33,7 @@ #include "qom/object.h" =20 #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga" -typedef struct ISACirrusVGAState ISACirrusVGAState; -DECLARE_INSTANCE_CHECKER(ISACirrusVGAState, ISA_CIRRUS_VGA, - TYPE_ISA_CIRRUS_VGA) +OBJECT_DECLARE_SIMPLE_TYPE(ISACirrusVGAState, ISA_CIRRUS_VGA) =20 struct ISACirrusVGAState { ISADevice parent_obj; diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 3ef8698eb7..4c16e1f5a0 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -294,9 +294,7 @@ struct Exynos4210fimdWindow { }; =20 #define TYPE_EXYNOS4210_FIMD "exynos4210.fimd" -typedef struct Exynos4210fimdState Exynos4210fimdState; -DECLARE_INSTANCE_CHECKER(Exynos4210fimdState, EXYNOS4210_FIMD, - TYPE_EXYNOS4210_FIMD) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210fimdState, EXYNOS4210_FIMD) =20 struct Exynos4210fimdState { SysBusDevice parent_obj; diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 4a32fe4c94..8f1725432c 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -487,9 +487,7 @@ static void g364fb_init(DeviceState *dev, G364State *s) } =20 #define TYPE_G364 "sysbus-g364" -typedef struct G364SysBusState G364SysBusState; -DECLARE_INSTANCE_CHECKER(G364SysBusState, G364, - TYPE_G364) +OBJECT_DECLARE_SIMPLE_TYPE(G364SysBusState, G364) =20 struct G364SysBusState { SysBusDevice parent_obj; diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c index 647d05f602..dd5f4696c4 100644 --- a/hw/display/jazz_led.c +++ b/hw/display/jazz_led.c @@ -36,9 +36,7 @@ typedef enum { } screen_state_t; =20 #define TYPE_JAZZ_LED "jazz-led" -typedef struct LedState LedState; -DECLARE_INSTANCE_CHECKER(LedState, JAZZ_LED, - TYPE_JAZZ_LED) +OBJECT_DECLARE_SIMPLE_TYPE(LedState, JAZZ_LED) =20 struct LedState { SysBusDevice parent_obj; diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c index 8a9e7c23fb..64636db86f 100644 --- a/hw/display/milkymist-tmu2.c +++ b/hw/display/milkymist-tmu2.c @@ -83,9 +83,7 @@ struct vertex { } QEMU_PACKED; =20 #define TYPE_MILKYMIST_TMU2 "milkymist-tmu2" -typedef struct MilkymistTMU2State MilkymistTMU2State; -DECLARE_INSTANCE_CHECKER(MilkymistTMU2State, MILKYMIST_TMU2, - TYPE_MILKYMIST_TMU2) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistTMU2State, MILKYMIST_TMU2) =20 struct MilkymistTMU2State { SysBusDevice parent_obj; diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c index 2c879129fb..6f2b11d6c9 100644 --- a/hw/display/milkymist-vgafb.c +++ b/hw/display/milkymist-vgafb.c @@ -69,9 +69,7 @@ enum { }; =20 #define TYPE_MILKYMIST_VGAFB "milkymist-vgafb" -typedef struct MilkymistVgafbState MilkymistVgafbState; -DECLARE_INSTANCE_CHECKER(MilkymistVgafbState, MILKYMIST_VGAFB, - TYPE_MILKYMIST_VGAFB) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistVgafbState, MILKYMIST_VGAFB) =20 struct MilkymistVgafbState { SysBusDevice parent_obj; diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c index 94db0202a3..e2d895109d 100644 --- a/hw/display/next-fb.c +++ b/hw/display/next-fb.c @@ -32,9 +32,7 @@ #include "hw/m68k/next-cube.h" #include "qom/object.h" =20 -typedef struct NeXTFbState NeXTFbState; -DECLARE_INSTANCE_CHECKER(NeXTFbState, NEXTFB, - TYPE_NEXTFB) +OBJECT_DECLARE_SIMPLE_TYPE(NeXTFbState, NEXTFB) =20 struct NeXTFbState { SysBusDevice parent_obj; diff --git a/hw/display/pl110.c b/hw/display/pl110.c index af51a2b9e7..02b0d45f06 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -49,9 +49,7 @@ enum pl110_version }; =20 #define TYPE_PL110 "pl110" -typedef struct PL110State PL110State; -DECLARE_INSTANCE_CHECKER(PL110State, PL110, - TYPE_PL110) +OBJECT_DECLARE_SIMPLE_TYPE(PL110State, PL110) =20 struct PL110State { SysBusDevice parent_obj; diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c index d88166f449..b591a58789 100644 --- a/hw/display/sii9022.c +++ b/hw/display/sii9022.c @@ -36,9 +36,7 @@ #define SII9022_INT_STATUS_PLUGGED 0x04; =20 #define TYPE_SII9022 "sii9022" -typedef struct sii9022_state sii9022_state; -DECLARE_INSTANCE_CHECKER(sii9022_state, SII9022, - TYPE_SII9022) +OBJECT_DECLARE_SIMPLE_TYPE(sii9022_state, SII9022) =20 struct sii9022_state { I2CSlave parent_obj; diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 51120c6c3e..8966b69bc7 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1932,9 +1932,7 @@ static const VMStateDescription vmstate_sm501_state = =3D { }; =20 #define TYPE_SYSBUS_SM501 "sysbus-sm501" -typedef struct SM501SysBusState SM501SysBusState; -DECLARE_INSTANCE_CHECKER(SM501SysBusState, SYSBUS_SM501, - TYPE_SYSBUS_SM501) +OBJECT_DECLARE_SIMPLE_TYPE(SM501SysBusState, SYSBUS_SM501) =20 struct SM501SysBusState { /*< private >*/ @@ -2036,9 +2034,7 @@ static const TypeInfo sm501_sysbus_info =3D { }; =20 #define TYPE_PCI_SM501 "sm501" -typedef struct SM501PCIState SM501PCIState; -DECLARE_INSTANCE_CHECKER(SM501PCIState, PCI_SM501, - TYPE_PCI_SM501) +OBJECT_DECLARE_SIMPLE_TYPE(SM501PCIState, PCI_SM501) =20 struct SM501PCIState { /*< private >*/ diff --git a/hw/display/ssd0303.c b/hw/display/ssd0303.c index 0378573a42..aeae22da9c 100644 --- a/hw/display/ssd0303.c +++ b/hw/display/ssd0303.c @@ -47,9 +47,7 @@ enum ssd0303_cmd { }; =20 #define TYPE_SSD0303 "ssd0303" -typedef struct ssd0303_state ssd0303_state; -DECLARE_INSTANCE_CHECKER(ssd0303_state, SSD0303, - TYPE_SSD0303) +OBJECT_DECLARE_SIMPLE_TYPE(ssd0303_state, SSD0303) =20 struct ssd0303_state { I2CSlave parent_obj; diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c index 037da81127..17d4b32ae3 100644 --- a/hw/display/ssd0323.c +++ b/hw/display/ssd0323.c @@ -66,11 +66,9 @@ struct ssd0323_state { uint32_t mode; uint8_t framebuffer[128 * 80 / 2]; }; -typedef struct ssd0323_state ssd0323_state; =20 #define TYPE_SSD0323 "ssd0323" -DECLARE_INSTANCE_CHECKER(ssd0323_state, SSD0323, - TYPE_SSD0323) +OBJECT_DECLARE_SIMPLE_TYPE(ssd0323_state, 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 69e901a800..c9d5e45cd1 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -56,9 +56,7 @@ #define TCX_THC_CURSBITS 0x980 =20 #define TYPE_TCX "SUNW,tcx" -typedef struct TCXState TCXState; -DECLARE_INSTANCE_CHECKER(TCXState, TCX, - TYPE_TCX) +OBJECT_DECLARE_SIMPLE_TYPE(TCXState, TCX) =20 struct TCXState { SysBusDevice parent_obj; diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c index 0ebfcca9d1..90851e730b 100644 --- a/hw/display/vga-isa.c +++ b/hw/display/vga-isa.c @@ -35,9 +35,7 @@ #include "qom/object.h" =20 #define TYPE_ISA_VGA "isa-vga" -typedef struct ISAVGAState ISAVGAState; -DECLARE_INSTANCE_CHECKER(ISAVGAState, ISA_VGA, - TYPE_ISA_VGA) +OBJECT_DECLARE_SIMPLE_TYPE(ISAVGAState, ISA_VGA) =20 struct ISAVGAState { ISADevice parent_obj; diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index 3b45fa3bad..e5d9af5868 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -51,11 +51,9 @@ struct PCIVGAState { MemoryRegion mrs[4]; uint8_t edid[256]; }; -typedef struct PCIVGAState PCIVGAState; =20 #define TYPE_PCI_VGA "pci-vga" -DECLARE_INSTANCE_CHECKER(PCIVGAState, PCI_VGA, - TYPE_PCI_VGA) +OBJECT_DECLARE_SIMPLE_TYPE(PCIVGAState, PCI_VGA) =20 static const VMStateDescription vmstate_vga_pci =3D { .name =3D "vga", diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 5b7ff635f7..34c3aaf7d3 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -32,9 +32,7 @@ #include "qom/object.h" =20 #define TYPE_I82374 "i82374" -typedef struct I82374State I82374State; -DECLARE_INSTANCE_CHECKER(I82374State, I82374, - TYPE_I82374) +OBJECT_DECLARE_SIMPLE_TYPE(I82374State, I82374) =20 //#define DEBUG_I82374 =20 diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 859586fd2f..944ba296b0 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -272,8 +272,7 @@ struct PL330State { }; =20 #define TYPE_PL330 "pl330" -DECLARE_INSTANCE_CHECKER(PL330State, PL330, - TYPE_PL330) +OBJECT_DECLARE_SIMPLE_TYPE(PL330State, 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 825e3dc0ac..cca1e9ec21 100644 --- a/hw/dma/puv3_dma.c +++ b/hw/dma/puv3_dma.c @@ -23,9 +23,7 @@ #define PUV3_DMA_CH(offset) ((offset) >> 8) =20 #define TYPE_PUV3_DMA "puv3_dma" -typedef struct PUV3DMAState PUV3DMAState; -DECLARE_INSTANCE_CHECKER(PUV3DMAState, PUV3_DMA, - TYPE_PUV3_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(PUV3DMAState, PUV3_DMA) =20 struct PUV3DMAState { SysBusDevice parent_obj; diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index 4f6c0e5e5e..b3707ff3de 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -35,9 +35,7 @@ typedef struct { } PXA2xxDMAChannel; =20 #define TYPE_PXA2XX_DMA "pxa2xx-dma" -typedef struct PXA2xxDMAState PXA2xxDMAState; -DECLARE_INSTANCE_CHECKER(PXA2xxDMAState, PXA2XX_DMA, - TYPE_PXA2XX_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxDMAState, PXA2XX_DMA) =20 struct PXA2xxDMAState { SysBusDevice parent_obj; diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index c584815d06..e4d2f1725b 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -56,9 +56,7 @@ typedef struct dma_pagetable_entry { #define DMA_FLAG_ADDR_INTR 0x0400 =20 #define TYPE_RC4030 "rc4030" -typedef struct rc4030State rc4030State; -DECLARE_INSTANCE_CHECKER(rc4030State, RC4030, - TYPE_RC4030) +OBJECT_DECLARE_SIMPLE_TYPE(rc4030State, 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 498fc17d8a..0a7f5acb4b 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -43,9 +43,7 @@ #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; -DECLARE_INSTANCE_CHECKER(XilinxAXIDMA, XILINX_AXI_DMA, - TYPE_XILINX_AXI_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxAXIDMA, XILINX_AXI_DMA) =20 typedef struct XilinxAXIDMAStreamSlave XilinxAXIDMAStreamSlave; DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSlave, XILINX_AXI_DMA_DATA_STRE= AM, diff --git a/hw/gpio/gpio_key.c b/hw/gpio/gpio_key.c index 86aa78aae4..74f6138356 100644 --- a/hw/gpio/gpio_key.c +++ b/hw/gpio/gpio_key.c @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_GPIOKEY "gpio-key" -typedef struct GPIOKEYState GPIOKEYState; -DECLARE_INSTANCE_CHECKER(GPIOKEYState, GPIOKEY, - TYPE_GPIOKEY) +OBJECT_DECLARE_SIMPLE_TYPE(GPIOKEYState, GPIOKEY) #define GPIO_KEY_LATENCY 100 /* 100ms */ =20 struct GPIOKEYState { diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index 2888d071ac..256d833c3a 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_MAX7310 "max7310" -typedef struct MAX7310State MAX7310State; -DECLARE_INSTANCE_CHECKER(MAX7310State, MAX7310, - TYPE_MAX7310) +OBJECT_DECLARE_SIMPLE_TYPE(MAX7310State, MAX7310) =20 struct MAX7310State { I2CSlave parent_obj; diff --git a/hw/gpio/mpc8xxx.c b/hw/gpio/mpc8xxx.c index dac8b1be38..e60c919a13 100644 --- a/hw/gpio/mpc8xxx.c +++ b/hw/gpio/mpc8xxx.c @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_MPC8XXX_GPIO "mpc8xxx_gpio" -typedef struct MPC8XXXGPIOState MPC8XXXGPIOState; -DECLARE_INSTANCE_CHECKER(MPC8XXXGPIOState, MPC8XXX_GPIO, - TYPE_MPC8XXX_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(MPC8XXXGPIOState, MPC8XXX_GPIO) =20 struct MPC8XXXGPIOState { SysBusDevice parent_obj; diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c index 3420df0d1f..e72e77572a 100644 --- a/hw/gpio/pl061.c +++ b/hw/gpio/pl061.c @@ -35,9 +35,7 @@ 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; -DECLARE_INSTANCE_CHECKER(PL061State, PL061, - TYPE_PL061) +OBJECT_DECLARE_SIMPLE_TYPE(PL061State, PL061) =20 #define N_GPIOS 8 =20 diff --git a/hw/gpio/puv3_gpio.c b/hw/gpio/puv3_gpio.c index 98ea2b4c2e..e003ae505c 100644 --- a/hw/gpio/puv3_gpio.c +++ b/hw/gpio/puv3_gpio.c @@ -19,9 +19,7 @@ #include "qemu/log.h" =20 #define TYPE_PUV3_GPIO "puv3_gpio" -typedef struct PUV3GPIOState PUV3GPIOState; -DECLARE_INSTANCE_CHECKER(PUV3GPIOState, PUV3_GPIO, - TYPE_PUV3_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(PUV3GPIOState, PUV3_GPIO) =20 struct PUV3GPIOState { SysBusDevice parent_obj; diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c index 3d25c55d06..7cf52a5041 100644 --- a/hw/gpio/zaurus.c +++ b/hw/gpio/zaurus.c @@ -28,9 +28,7 @@ /* SCOOP devices */ =20 #define TYPE_SCOOP "scoop" -typedef struct ScoopInfo ScoopInfo; -DECLARE_INSTANCE_CHECKER(ScoopInfo, SCOOP, - TYPE_SCOOP) +OBJECT_DECLARE_SIMPLE_TYPE(ScoopInfo, SCOOP) =20 struct ScoopInfo { SysBusDevice parent_obj; diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index c0c9b8a2b8..81053b5fb6 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -81,9 +81,7 @@ =20 #define DINO_MEM_CHUNK_SIZE (8 * MiB) =20 -typedef struct DinoState DinoState; -DECLARE_INSTANCE_CHECKER(DinoState, DINO_PCI_HOST_BRIDGE, - TYPE_DINO_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(DinoState, 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 c0b970f55c..1a85657948 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -53,9 +53,7 @@ #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; -DECLARE_INSTANCE_CHECKER(LasiState, LASI_CHIP, - TYPE_LASI_CHIP) +OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) =20 struct LasiState { PCIHostState parent_obj; diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c index aa5a2a9bd8..4b26db1365 100644 --- a/hw/hyperv/hyperv.c +++ b/hw/hyperv/hyperv.c @@ -35,11 +35,9 @@ struct SynICState { struct hyperv_message_page *msg_page; struct hyperv_event_flags_page *event_page; }; -typedef struct SynICState SynICState; =20 #define TYPE_SYNIC "hyperv-synic" -DECLARE_INSTANCE_CHECKER(SynICState, SYNIC, - TYPE_SYNIC) +OBJECT_DECLARE_SIMPLE_TYPE(SynICState, SYNIC) =20 static bool synic_enabled; =20 diff --git a/hw/hyperv/hyperv_testdev.c b/hw/hyperv/hyperv_testdev.c index f6ee98e00c..9a56ddf83f 100644 --- a/hw/hyperv/hyperv_testdev.c +++ b/hw/hyperv/hyperv_testdev.c @@ -47,11 +47,9 @@ struct HypervTestDev { QLIST_HEAD(, TestMsgConn) msg_conns; QLIST_HEAD(, TestEvtConn) evt_conns; }; -typedef struct HypervTestDev HypervTestDev; =20 #define TYPE_HYPERV_TEST_DEV "hyperv-testdev" -DECLARE_INSTANCE_CHECKER(HypervTestDev, HYPERV_TEST_DEV, - TYPE_HYPERV_TEST_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(HypervTestDev, 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 c1b9f298d9..e9a0612a04 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -163,9 +163,7 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBus = *bus) /* GPIO interface. */ =20 #define TYPE_GPIO_I2C "gpio_i2c" -typedef struct GPIOI2CState GPIOI2CState; -DECLARE_INSTANCE_CHECKER(GPIOI2CState, GPIO_I2C, - TYPE_GPIO_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(GPIOI2CState, GPIO_I2C) =20 struct GPIOI2CState { SysBusDevice parent_obj; diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c index ff82226e9f..b65a7d0222 100644 --- a/hw/i2c/exynos4210_i2c.c +++ b/hw/i2c/exynos4210_i2c.c @@ -34,9 +34,7 @@ #endif =20 #define TYPE_EXYNOS4_I2C "exynos4210.i2c" -typedef struct Exynos4210I2CState Exynos4210I2CState; -DECLARE_INSTANCE_CHECKER(Exynos4210I2CState, EXYNOS4_I2C, - TYPE_EXYNOS4_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210I2CState, 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 156a25a8e9..720d2331e9 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -37,9 +37,7 @@ #endif =20 #define TYPE_MPC_I2C "mpc-i2c" -typedef struct MPCI2CState MPCI2CState; -DECLARE_INSTANCE_CHECKER(MPCI2CState, MPC_I2C, - TYPE_MPC_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(MPCI2CState, 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 c6777844cf..4d2bf99207 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -37,9 +37,7 @@ =20 #define TYPE_SMBUS_EEPROM "smbus-eeprom" =20 -typedef struct SMBusEEPROMDevice SMBusEEPROMDevice; -DECLARE_INSTANCE_CHECKER(SMBusEEPROMDevice, SMBUS_EEPROM, - TYPE_SMBUS_EEPROM) +OBJECT_DECLARE_SIMPLE_TYPE(SMBusEEPROMDevice, SMBUS_EEPROM) =20 #define SMBUS_EEPROM_SIZE 256 =20 diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 2d4578511d..44dd5653b7 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -30,9 +30,7 @@ #include "hw/i386/ich9.h" #include "qom/object.h" =20 -typedef struct ICH9SMBState ICH9SMBState; -DECLARE_INSTANCE_CHECKER(ICH9SMBState, ICH9_SMB_DEVICE, - TYPE_ICH9_SMB_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ICH9SMBState, ICH9_SMB_DEVICE) =20 struct ICH9SMBState { PCIDevice dev; diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 37f47540e5..7b296ae192 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -32,9 +32,7 @@ #include "qom/object.h" =20 #define TYPE_KVM_CLOCK "kvmclock" -typedef struct KVMClockState KVMClockState; -DECLARE_INSTANCE_CHECKER(KVMClockState, KVM_CLOCK, - TYPE_KVM_CLOCK) +OBJECT_DECLARE_SIMPLE_TYPE(KVMClockState, KVM_CLOCK) =20 struct KVMClockState { /*< private >*/ diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index a4e05f086e..077c3f4866 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -71,11 +71,9 @@ struct VAPICROMState { bool rom_mapped_writable; VMChangeStateEntry *vmsentry; }; -typedef struct VAPICROMState VAPICROMState; =20 #define TYPE_VAPIC "kvmvapic" -DECLARE_INSTANCE_CHECKER(VAPICROMState, VAPIC, - TYPE_VAPIC) +OBJECT_DECLARE_SIMPLE_TYPE(VAPICROMState, 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 c00dcb261b..e1379a4f98 100644 --- a/hw/i386/port92.c +++ b/hw/i386/port92.c @@ -14,9 +14,7 @@ #include "trace.h" #include "qom/object.h" =20 -typedef struct Port92State Port92State; -DECLARE_INSTANCE_CHECKER(Port92State, PORT92, - TYPE_PORT92) +OBJECT_DECLARE_SIMPLE_TYPE(Port92State, PORT92) =20 struct Port92State { ISADevice parent_obj; diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index ae4cbc7add..a3556438f0 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -51,9 +51,7 @@ #endif =20 #define TYPE_VMMOUSE "vmmouse" -typedef struct VMMouseState VMMouseState; -DECLARE_INSTANCE_CHECKER(VMMouseState, VMMOUSE, - TYPE_VMMOUSE) +OBJECT_DECLARE_SIMPLE_TYPE(VMMouseState, VMMOUSE) =20 struct VMMouseState { ISADevice parent_obj; diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index df52b6f903..20d605506b 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -63,9 +63,7 @@ #define VCPU_INFO_LEGACY_X2APIC_BIT 3 #define VCPU_INFO_RESERVED_BIT 31 =20 -typedef struct VMPortState VMPortState; -DECLARE_INSTANCE_CHECKER(VMPortState, VMPORT, - TYPE_VMPORT) +OBJECT_DECLARE_SIMPLE_TYPE(VMPortState, VMPORT) =20 struct VMPortState { ISADevice parent_obj; diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index a8bbe8c833..e9601031bf 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -69,11 +69,9 @@ struct PCIXenPlatformState { char log_buffer[4096]; int log_buffer_off; }; -typedef struct PCIXenPlatformState PCIXenPlatformState; =20 #define TYPE_XEN_PLATFORM "xen-platform" -DECLARE_INSTANCE_CHECKER(PCIXenPlatformState, XEN_PLATFORM, - TYPE_XEN_PLATFORM) +OBJECT_DECLARE_SIMPLE_TYPE(PCIXenPlatformState, 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 67f83616d3..1ea95fa601 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -40,9 +40,7 @@ =20 #define TYPE_XEN_PV_DEVICE "xen-pvdevice" =20 -typedef struct XenPVDevice XenPVDevice; -DECLARE_INSTANCE_CHECKER(XenPVDevice, XEN_PV_DEVICE, - TYPE_XEN_PV_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(XenPVDevice, XEN_PV_DEVICE) =20 struct XenPVDevice { /*< private >*/ diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 9a3489691b..6bc19de226 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -38,9 +38,7 @@ /* ISA IDE definitions */ =20 #define TYPE_ISA_IDE "isa-ide" -typedef struct ISAIDEState ISAIDEState; -DECLARE_INSTANCE_CHECKER(ISAIDEState, ISA_IDE, - TYPE_ISA_IDE) +OBJECT_DECLARE_SIMPLE_TYPE(ISAIDEState, ISA_IDE) =20 struct ISAIDEState { ISADevice parent_obj; diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index 6e7f5df901..58a14fea36 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -34,9 +34,7 @@ #include "qom/object.h" =20 #define TYPE_MICRODRIVE "microdrive" -typedef struct MicroDriveState MicroDriveState; -DECLARE_INSTANCE_CHECKER(MicroDriveState, MICRODRIVE, - TYPE_MICRODRIVE) +OBJECT_DECLARE_SIMPLE_TYPE(MicroDriveState, MICRODRIVE) =20 /***********************************************************/ /* CF-ATA Microdrive */ diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 968c239ab8..34c347b9c2 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -19,9 +19,7 @@ #include "qom/object.h" =20 #define TYPE_SII3112_PCI "sii3112" -typedef struct SiI3112PCIState SiI3112PCIState; -DECLARE_INSTANCE_CHECKER(SiI3112PCIState, SII3112_PCI, - TYPE_SII3112_PCI) +OBJECT_DECLARE_SIMPLE_TYPE(SiI3112PCIState, SII3112_PCI) =20 typedef struct SiI3112Regs { uint32_t confstat; diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index 70245fd817..4cb1e9de01 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -28,9 +28,7 @@ #include "qom/object.h" =20 #define TYPE_LM8323 "lm8323" -typedef struct LM823KbdState LM823KbdState; -DECLARE_INSTANCE_CHECKER(LM823KbdState, LM8323, - TYPE_LM8323) +OBJECT_DECLARE_SIMPLE_TYPE(LM823KbdState, LM8323) =20 struct LM823KbdState { I2CSlave parent_obj; diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c index eaaf8adde4..5acd7a6f7d 100644 --- a/hw/input/milkymist-softusb.c +++ b/hw/input/milkymist-softusb.c @@ -51,9 +51,7 @@ enum { #define COMLOC_KEVT_BASE 0x1143 =20 #define TYPE_MILKYMIST_SOFTUSB "milkymist-softusb" -typedef struct MilkymistSoftUsbState MilkymistSoftUsbState; -DECLARE_INSTANCE_CHECKER(MilkymistSoftUsbState, MILKYMIST_SOFTUSB, - TYPE_MILKYMIST_SOFTUSB) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistSoftUsbState, MILKYMIST_SOFTUSB) =20 struct MilkymistSoftUsbState { SysBusDevice parent_obj; diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 7c53ae97da..d279b6c148 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_PL050 "pl050" -typedef struct PL050State PL050State; -DECLARE_INSTANCE_CHECKER(PL050State, PL050, - TYPE_PL050) +OBJECT_DECLARE_SIMPLE_TYPE(PL050State, PL050) =20 struct PL050State { SysBusDevice parent_obj; diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index 04d7a6d68b..596fa66648 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -37,9 +37,7 @@ #include "qom/object.h" =20 #define TYPE_ARM_GICV2M "arm-gicv2m" -typedef struct ARMGICv2mState ARMGICv2mState; -DECLARE_INSTANCE_CHECKER(ARMGICv2mState, ARM_GICV2M, - TYPE_ARM_GICV2M) +OBJECT_DECLARE_SIMPLE_TYPE(ARMGICv2mState, ARM_GICV2M) =20 #define GICV2M_NUM_SPI_MAX 128 =20 diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index 7b01481ab8..4534ee248d 100644 --- a/hw/intc/exynos4210_combiner.c +++ b/hw/intc/exynos4210_combiner.c @@ -64,9 +64,7 @@ typedef struct CombinerGroupState { } CombinerGroupState; =20 #define TYPE_EXYNOS4210_COMBINER "exynos4210.combiner" -typedef struct Exynos4210CombinerState Exynos4210CombinerState; -DECLARE_INSTANCE_CHECKER(Exynos4210CombinerState, EXYNOS4210_COMBINER, - TYPE_EXYNOS4210_COMBINER) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210CombinerState, EXYNOS4210_COMBINER) =20 struct Exynos4210CombinerState { SysBusDevice parent_obj; diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index f9487673fc..bc73d1f115 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -265,9 +265,7 @@ uint32_t exynos4210_get_irq(uint32_t grp, uint32_t bit) /********* GIC part *********/ =20 #define TYPE_EXYNOS4210_GIC "exynos4210.gic" -typedef struct Exynos4210GicState Exynos4210GicState; -DECLARE_INSTANCE_CHECKER(Exynos4210GicState, EXYNOS4210_GIC, - TYPE_EXYNOS4210_GIC) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210GicState, EXYNOS4210_GIC) =20 struct Exynos4210GicState { SysBusDevice parent_obj; @@ -384,9 +382,7 @@ type_init(exynos4210_gic_register_types) */ =20 #define TYPE_EXYNOS4210_IRQ_GATE "exynos4210.irq_gate" -typedef struct Exynos4210IRQGateState Exynos4210IRQGateState; -DECLARE_INSTANCE_CHECKER(Exynos4210IRQGateState, EXYNOS4210_IRQ_GATE, - TYPE_EXYNOS4210_IRQ_GATE) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210IRQGateState, EXYNOS4210_IRQ_GATE) =20 struct Exynos4210IRQGateState { SysBusDevice parent_obj; diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c index 9b34a8ae03..ffec4a07ee 100644 --- a/hw/intc/grlib_irqmp.c +++ b/hw/intc/grlib_irqmp.c @@ -51,9 +51,7 @@ #define FORCE_OFFSET 0x80 #define EXTENDED_OFFSET 0xC0 =20 -typedef struct IRQMP IRQMP; -DECLARE_INSTANCE_CHECKER(IRQMP, GRLIB_IRQMP, - TYPE_GRLIB_IRQMP) +OBJECT_DECLARE_SIMPLE_TYPE(IRQMP, GRLIB_IRQMP) =20 typedef struct IRQMPState IRQMPState; =20 diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c index e8b4015efd..0c48a9cd85 100644 --- a/hw/intc/lm32_pic.c +++ b/hw/intc/lm32_pic.c @@ -30,9 +30,7 @@ #include "qom/object.h" =20 #define TYPE_LM32_PIC "lm32-pic" -typedef struct LM32PicState LM32PicState; -DECLARE_INSTANCE_CHECKER(LM32PicState, LM32_PIC, - TYPE_LM32_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(LM32PicState, LM32_PIC) =20 struct LM32PicState { SysBusDevice parent_obj; diff --git a/hw/intc/nios2_iic.c b/hw/intc/nios2_iic.c index aa26f059a1..216db67059 100644 --- a/hw/intc/nios2_iic.c +++ b/hw/intc/nios2_iic.c @@ -28,9 +28,7 @@ #include "qom/object.h" =20 #define TYPE_ALTERA_IIC "altera,iic" -typedef struct AlteraIIC AlteraIIC; -DECLARE_INSTANCE_CHECKER(AlteraIIC, ALTERA_IIC, - TYPE_ALTERA_IIC) +OBJECT_DECLARE_SIMPLE_TYPE(AlteraIIC, ALTERA_IIC) =20 struct AlteraIIC { SysBusDevice parent_obj; diff --git a/hw/intc/ompic.c b/hw/intc/ompic.c index a8ea621d9e..1731a10683 100644 --- a/hw/intc/ompic.c +++ b/hw/intc/ompic.c @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_OR1K_OMPIC "or1k-ompic" -typedef struct OR1KOMPICState OR1KOMPICState; -DECLARE_INSTANCE_CHECKER(OR1KOMPICState, OR1K_OMPIC, - TYPE_OR1K_OMPIC) +OBJECT_DECLARE_SIMPLE_TYPE(OR1KOMPICState, 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 8c8fbeddfe..e1a39e33cb 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -39,9 +39,7 @@ =20 #define GCR_RESET 0x80000000 =20 -typedef struct KVMOpenPICState KVMOpenPICState; -DECLARE_INSTANCE_CHECKER(KVMOpenPICState, KVM_OPENPIC, - TYPE_KVM_OPENPIC) +OBJECT_DECLARE_SIMPLE_TYPE(KVMOpenPICState, KVM_OPENPIC) =20 struct KVMOpenPICState { /*< private >*/ diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c index ee3206132f..cd88443601 100644 --- a/hw/intc/pl190.c +++ b/hw/intc/pl190.c @@ -22,9 +22,7 @@ #define PL190_NUM_PRIO 17 =20 #define TYPE_PL190 "pl190" -typedef struct PL190State PL190State; -DECLARE_INSTANCE_CHECKER(PL190State, PL190, - TYPE_PL190) +OBJECT_DECLARE_SIMPLE_TYPE(PL190State, PL190) =20 struct PL190State { SysBusDevice parent_obj; diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c index 8bceede256..65226f5e7c 100644 --- a/hw/intc/puv3_intc.c +++ b/hw/intc/puv3_intc.c @@ -20,9 +20,7 @@ #include "qemu/log.h" =20 #define TYPE_PUV3_INTC "puv3_intc" -typedef struct PUV3INTCState PUV3INTCState; -DECLARE_INSTANCE_CHECKER(PUV3INTCState, PUV3_INTC, - TYPE_PUV3_INTC) +OBJECT_DECLARE_SIMPLE_TYPE(PUV3INTCState, PUV3_INTC) =20 struct PUV3INTCState { SysBusDevice parent_obj; diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index 4a72ef5d0d..f7e59ba643 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -59,9 +59,7 @@ typedef struct SLAVIO_CPUINTCTLState { } SLAVIO_CPUINTCTLState; =20 #define TYPE_SLAVIO_INTCTL "slavio_intctl" -typedef struct SLAVIO_INTCTLState SLAVIO_INTCTLState; -DECLARE_INSTANCE_CHECKER(SLAVIO_INTCTLState, SLAVIO_INTCTL, - TYPE_SLAVIO_INTCTL) +OBJECT_DECLARE_SIMPLE_TYPE(SLAVIO_INTCTLState, SLAVIO_INTCTL) =20 struct SLAVIO_INTCTLState { SysBusDevice parent_obj; diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index b35e1d2ac4..d107e134c4 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -69,12 +69,10 @@ struct TPCI200State { uint16_t status; uint8_t int_set; }; -typedef struct TPCI200State TPCI200State; =20 #define TYPE_TPCI200 "tpci200" =20 -DECLARE_INSTANCE_CHECKER(TPCI200State, TPCI200, - TYPE_TPCI200) +OBJECT_DECLARE_SIMPLE_TYPE(TPCI200State, 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 159831cbc5..c3f3306e66 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -62,9 +62,7 @@ #define VM_CMD_GRACEFUL_SHUTDOWN 0x09 =20 #define TYPE_IPMI_BMC_EXTERN "ipmi-bmc-extern" -typedef struct IPMIBmcExtern IPMIBmcExtern; -DECLARE_INSTANCE_CHECKER(IPMIBmcExtern, IPMI_BMC_EXTERN, - TYPE_IPMI_BMC_EXTERN) +OBJECT_DECLARE_SIMPLE_TYPE(IPMIBmcExtern, 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 0b69acc2e9..b7c2ad557b 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -34,9 +34,7 @@ #include "qom/object.h" =20 #define TYPE_ISA_IPMI_BT "isa-ipmi-bt" -typedef struct ISAIPMIBTDevice ISAIPMIBTDevice; -DECLARE_INSTANCE_CHECKER(ISAIPMIBTDevice, ISA_IPMI_BT, - TYPE_ISA_IPMI_BT) +OBJECT_DECLARE_SIMPLE_TYPE(ISAIPMIBTDevice, 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 af69e9a008..7dd6bf0040 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -34,9 +34,7 @@ #include "qom/object.h" =20 #define TYPE_ISA_IPMI_KCS "isa-ipmi-kcs" -typedef struct ISAIPMIKCSDevice ISAIPMIKCSDevice; -DECLARE_INSTANCE_CHECKER(ISAIPMIKCSDevice, ISA_IPMI_KCS, - TYPE_ISA_IPMI_KCS) +OBJECT_DECLARE_SIMPLE_TYPE(ISAIPMIKCSDevice, 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 7e5ecea6cc..b6e52730d3 100644 --- a/hw/ipmi/pci_ipmi_bt.c +++ b/hw/ipmi/pci_ipmi_bt.c @@ -29,9 +29,7 @@ #include "qom/object.h" =20 #define TYPE_PCI_IPMI_BT "pci-ipmi-bt" -typedef struct PCIIPMIBTDevice PCIIPMIBTDevice; -DECLARE_INSTANCE_CHECKER(PCIIPMIBTDevice, PCI_IPMI_BT, - TYPE_PCI_IPMI_BT) +OBJECT_DECLARE_SIMPLE_TYPE(PCIIPMIBTDevice, 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 c2a283a982..de13418862 100644 --- a/hw/ipmi/pci_ipmi_kcs.c +++ b/hw/ipmi/pci_ipmi_kcs.c @@ -29,9 +29,7 @@ #include "qom/object.h" =20 #define TYPE_PCI_IPMI_KCS "pci-ipmi-kcs" -typedef struct PCIIPMIKCSDevice PCIIPMIKCSDevice; -DECLARE_INSTANCE_CHECKER(PCIIPMIKCSDevice, PCI_IPMI_KCS, - TYPE_PCI_IPMI_KCS) +OBJECT_DECLARE_SIMPLE_TYPE(PCIIPMIKCSDevice, PCI_IPMI_KCS) =20 struct PCIIPMIKCSDevice { PCIDevice dev; diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c index cd4c05dd1b..1fdf0a66b6 100644 --- a/hw/ipmi/smbus_ipmi.c +++ b/hw/ipmi/smbus_ipmi.c @@ -30,9 +30,7 @@ #include "qom/object.h" =20 #define TYPE_SMBUS_IPMI "smbus-ipmi" -typedef struct SMBusIPMIDevice SMBusIPMIDevice; -DECLARE_INSTANCE_CHECKER(SMBusIPMIDevice, SMBUS_IPMI, - TYPE_SMBUS_IPMI) +OBJECT_DECLARE_SIMPLE_TYPE(SMBusIPMIDevice, 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 1dcf525f3f..8285b06e1d 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -27,9 +27,7 @@ #include "qom/object.h" =20 #define TYPE_I82378 "i82378" -typedef struct I82378State I82378State; -DECLARE_INSTANCE_CHECKER(I82378State, I82378, - TYPE_I82378) +OBJECT_DECLARE_SIMPLE_TYPE(I82378State, I82378) =20 struct I82378State { PCIDevice parent_obj; diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 8e3ac845b8..a50d97834c 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -52,10 +52,8 @@ struct PIIX4State { MemoryRegion rcr_mem; uint8_t rcr; }; -typedef struct PIIX4State PIIX4State; =20 -DECLARE_INSTANCE_CHECKER(PIIX4State, PIIX4_PCI_DEVICE, - TYPE_PIIX4_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PIIX4State, PIIX4_PCI_DEVICE) =20 static void piix4_isa_reset(DeviceState *dev) { diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 1e6b48b2a2..b3170c70c3 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -48,11 +48,9 @@ struct VT82C686BState { MemoryRegion superio; SuperIOConfig superio_conf; }; -typedef struct VT82C686BState VT82C686BState; =20 #define TYPE_VT82C686B_DEVICE "VT82C686B" -DECLARE_INSTANCE_CHECKER(VT82C686BState, VT82C686B_DEVICE, - TYPE_VT82C686B_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(VT82C686BState, VT82C686B_DEVICE) =20 static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data, unsigned size) @@ -169,29 +167,23 @@ struct VT686PMState { PMSMBus smb; uint32_t smb_io_base; }; -typedef struct VT686PMState VT686PMState; =20 struct VT686AC97State { PCIDevice dev; }; -typedef struct VT686AC97State VT686AC97State; =20 struct VT686MC97State { PCIDevice dev; }; -typedef struct VT686MC97State VT686MC97State; =20 #define TYPE_VT82C686B_PM_DEVICE "VT82C686B_PM" -DECLARE_INSTANCE_CHECKER(VT686PMState, VT82C686B_PM_DEVICE, - TYPE_VT82C686B_PM_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(VT686PMState, VT82C686B_PM_DEVICE) =20 #define TYPE_VT82C686B_MC97_DEVICE "VT82C686B_MC97" -DECLARE_INSTANCE_CHECKER(VT686MC97State, VT82C686B_MC97_DEVICE, - TYPE_VT82C686B_MC97_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(VT686MC97State, VT82C686B_MC97_DEVICE) =20 #define TYPE_VT82C686B_AC97_DEVICE "VT82C686B_AC97" -DECLARE_INSTANCE_CHECKER(VT686AC97State, VT82C686B_AC97_DEVICE, - TYPE_VT82C686B_AC97_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(VT686AC97State, 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 7ee447240b..cf02f57a71 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_MCF_INTC "mcf-intc" -typedef struct mcf_intc_state mcf_intc_state; -DECLARE_INSTANCE_CHECKER(mcf_intc_state, MCF_INTC, - TYPE_MCF_INTC) +OBJECT_DECLARE_SIMPLE_TYPE(mcf_intc_state, 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 cbd913b0a2..e7045980b7 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -38,9 +38,7 @@ #endif =20 #define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube") -typedef struct NeXTState NeXTState; -DECLARE_INSTANCE_CHECKER(NeXTState, NEXT_MACHINE, - TYPE_NEXT_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(NeXTState, 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 c7ca3fbbc9..c11b5281f1 100644 --- a/hw/m68k/next-kbd.c +++ b/hw/m68k/next-kbd.c @@ -38,9 +38,7 @@ #include "migration/vmstate.h" #include "qom/object.h" =20 -typedef struct NextKBDState NextKBDState; -DECLARE_INSTANCE_CHECKER(NextKBDState, NEXTKBD, - TYPE_NEXTKBD) +OBJECT_DECLARE_SIMPLE_TYPE(NextKBDState, 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 ab9924bf20..1d1b4b5c19 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -29,9 +29,7 @@ /* Define the PMU device */ =20 #define TYPE_XLNX_ZYNQMP_PMU_SOC "xlnx,zynqmp-pmu-soc" -typedef struct XlnxZynqMPPMUSoCState XlnxZynqMPPMUSoCState; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPPMUSoCState, XLNX_ZYNQMP_PMU_SOC, - TYPE_XLNX_ZYNQMP_PMU_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPPMUSoCState, XLNX_ZYNQMP_PMU_SOC) =20 #define XLNX_ZYNQMP_PMU_ROM_SIZE 0x8000 #define XLNX_ZYNQMP_PMU_ROM_ADDR 0xFFD00000 diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index b613e1e011..e091bc4ed5 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -231,9 +231,7 @@ =20 #define TYPE_GT64120_PCI_HOST_BRIDGE "gt64120" =20 -typedef struct GT64120State GT64120State; -DECLARE_INSTANCE_CHECKER(GT64120State, GT64120_PCI_HOST_BRIDGE, - TYPE_GT64120_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(GT64120State, GT64120_PCI_HOST_BRIDGE) =20 struct GT64120State { PCIHostState parent_obj; diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 5b73ea4692..4019c9dc1a 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -89,9 +89,7 @@ typedef struct { } MaltaFPGAState; =20 #define TYPE_MIPS_MALTA "mips-malta" -typedef struct MaltaState MaltaState; -DECLARE_INSTANCE_CHECKER(MaltaState, MIPS_MALTA, - TYPE_MIPS_MALTA) +OBJECT_DECLARE_SIMPLE_TYPE(MaltaState, MIPS_MALTA) =20 struct MaltaState { SysBusDevice parent_obj; diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index dca3fba028..a4deb3e7a0 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -90,9 +90,7 @@ struct AppleSMCData { QLIST_ENTRY(AppleSMCData) node; }; =20 -typedef struct AppleSMCState AppleSMCState; -DECLARE_INSTANCE_CHECKER(AppleSMCState, APPLE_SMC, - TYPE_APPLE_SMC) +OBJECT_DECLARE_SIMPLE_TYPE(AppleSMCState, 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 822deffc0c..ec0d4b90d3 100644 --- a/hw/misc/arm_integrator_debug.c +++ b/hw/misc/arm_integrator_debug.c @@ -21,9 +21,7 @@ #include "qemu/module.h" #include "qom/object.h" =20 -typedef struct IntegratorDebugState IntegratorDebugState; -DECLARE_INSTANCE_CHECKER(IntegratorDebugState, INTEGRATOR_DEBUG, - TYPE_INTEGRATOR_DEBUG) +OBJECT_DECLARE_SIMPLE_TYPE(IntegratorDebugState, INTEGRATOR_DEBUG) =20 struct IntegratorDebugState { SysBusDevice parent_obj; diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c index 93948c3bd8..75c3eb8982 100644 --- a/hw/misc/arm_l2x0.c +++ b/hw/misc/arm_l2x0.c @@ -30,9 +30,7 @@ #define CACHE_ID 0x410000c8 =20 #define TYPE_ARM_L2X0 "l2x0" -typedef struct L2x0State L2x0State; -DECLARE_INSTANCE_CHECKER(L2x0State, ARM_L2X0, - TYPE_ARM_L2X0) +OBJECT_DECLARE_SIMPLE_TYPE(L2x0State, ARM_L2X0) =20 struct L2x0State { SysBusDevice parent_obj; diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index f0f49e76e8..42d4693854 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -23,9 +23,7 @@ #define LOCK_VALUE 0xa05f =20 #define TYPE_ARM_SYSCTL "realview_sysctl" -typedef struct arm_sysctl_state arm_sysctl_state; -DECLARE_INSTANCE_CHECKER(arm_sysctl_state, ARM_SYSCTL, - TYPE_ARM_SYSCTL) +OBJECT_DECLARE_SIMPLE_TYPE(arm_sysctl_state, ARM_SYSCTL) =20 struct arm_sysctl_state { SysBusDevice parent_obj; diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index c6b0cffd77..ab6de69ce7 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -14,9 +14,7 @@ #include "qom/object.h" =20 #define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit" -typedef struct ISADebugExitState ISADebugExitState; -DECLARE_INSTANCE_CHECKER(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE, - TYPE_ISA_DEBUG_EXIT_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE) =20 struct ISADebugExitState { ISADevice parent_obj; diff --git a/hw/misc/eccmemctl.c b/hw/misc/eccmemctl.c index 468c2a491d..c65806e3d9 100644 --- a/hw/misc/eccmemctl.c +++ b/hw/misc/eccmemctl.c @@ -127,9 +127,7 @@ #define ECC_DIAG_MASK (ECC_DIAG_SIZE - 1) =20 #define TYPE_ECC_MEMCTL "eccmemctl" -typedef struct ECCState ECCState; -DECLARE_INSTANCE_CHECKER(ECCState, ECC_MEMCTL, - TYPE_ECC_MEMCTL) +OBJECT_DECLARE_SIMPLE_TYPE(ECCState, ECC_MEMCTL) =20 struct ECCState { SysBusDevice parent_obj; diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index 57dcdfbe14..37b0ddfb02 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -18,9 +18,7 @@ #include "qom/object.h" =20 #define TYPE_EMPTY_SLOT "empty_slot" -typedef struct EmptySlot EmptySlot; -DECLARE_INSTANCE_CHECKER(EmptySlot, EMPTY_SLOT, - TYPE_EMPTY_SLOT) +OBJECT_DECLARE_SIMPLE_TYPE(EmptySlot, EMPTY_SLOT) =20 struct EmptySlot { SysBusDevice parent_obj; diff --git a/hw/misc/exynos4210_clk.c b/hw/misc/exynos4210_clk.c index 4b469f6419..58cec282f7 100644 --- a/hw/misc/exynos4210_clk.c +++ b/hw/misc/exynos4210_clk.c @@ -25,9 +25,7 @@ #include "qom/object.h" =20 #define TYPE_EXYNOS4210_CLK "exynos4210.clk" -typedef struct Exynos4210ClkState Exynos4210ClkState; -DECLARE_INSTANCE_CHECKER(Exynos4210ClkState, EXYNOS4210_CLK, - TYPE_EXYNOS4210_CLK) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210ClkState, 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 b19b82a88c..e24139c630 100644 --- a/hw/misc/exynos4210_pmu.c +++ b/hw/misc/exynos4210_pmu.c @@ -395,9 +395,7 @@ 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; -DECLARE_INSTANCE_CHECKER(Exynos4210PmuState, EXYNOS4210_PMU, - TYPE_EXYNOS4210_PMU) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210PmuState, EXYNOS4210_PMU) =20 struct Exynos4210PmuState { SysBusDevice parent_obj; diff --git a/hw/misc/exynos4210_rng.c b/hw/misc/exynos4210_rng.c index 13ec6e188b..1b9e8347a1 100644 --- a/hw/misc/exynos4210_rng.c +++ b/hw/misc/exynos4210_rng.c @@ -36,9 +36,7 @@ } while (0) =20 #define TYPE_EXYNOS4210_RNG "exynos4210.rng" -typedef struct Exynos4210RngState Exynos4210RngState; -DECLARE_INSTANCE_CHECKER(Exynos4210RngState, EXYNOS4210_RNG, - TYPE_EXYNOS4210_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210RngState, EXYNOS4210_RNG) =20 /* * Exynos4220, PRNG, only polling mode is supported. diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c index f25715e09e..5e26d90ceb 100644 --- a/hw/misc/milkymist-hpdmc.c +++ b/hw/misc/milkymist-hpdmc.c @@ -44,9 +44,7 @@ enum { }; =20 #define TYPE_MILKYMIST_HPDMC "milkymist-hpdmc" -typedef struct MilkymistHpdmcState MilkymistHpdmcState; -DECLARE_INSTANCE_CHECKER(MilkymistHpdmcState, MILKYMIST_HPDMC, - TYPE_MILKYMIST_HPDMC) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistHpdmcState, MILKYMIST_HPDMC) =20 struct MilkymistHpdmcState { SysBusDevice parent_obj; diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c index 489bb8873f..83491dbca2 100644 --- a/hw/misc/milkymist-pfpu.c +++ b/hw/misc/milkymist-pfpu.c @@ -121,9 +121,7 @@ static const char *opcode_to_str[] =3D { #endif =20 #define TYPE_MILKYMIST_PFPU "milkymist-pfpu" -typedef struct MilkymistPFPUState MilkymistPFPUState; -DECLARE_INSTANCE_CHECKER(MilkymistPFPUState, MILKYMIST_PFPU, - TYPE_MILKYMIST_PFPU) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistPFPUState, MILKYMIST_PFPU) =20 struct MilkymistPFPUState { SysBusDevice parent_obj; diff --git a/hw/misc/mst_fpga.c b/hw/misc/mst_fpga.c index f74d8cdd4a..edfc35d5f0 100644 --- a/hw/misc/mst_fpga.c +++ b/hw/misc/mst_fpga.c @@ -41,9 +41,7 @@ #define MST_PCMCIA_CD1_IRQ 13 =20 #define TYPE_MAINSTONE_FPGA "mainstone-fpga" -typedef struct mst_irq_state mst_irq_state; -DECLARE_INSTANCE_CHECKER(mst_irq_state, MAINSTONE_FPGA, - TYPE_MAINSTONE_FPGA) +OBJECT_DECLARE_SIMPLE_TYPE(mst_irq_state, 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 577a15bf58..e389651869 100644 --- a/hw/misc/pc-testdev.c +++ b/hw/misc/pc-testdev.c @@ -54,11 +54,9 @@ struct PCTestdev { uint32_t ioport_data; char iomem_buf[IOMEM_LEN]; }; -typedef struct PCTestdev PCTestdev; =20 #define TYPE_TESTDEV "pc-testdev" -DECLARE_INSTANCE_CHECKER(PCTestdev, TESTDEV, - TYPE_TESTDEV) +OBJECT_DECLARE_SIMPLE_TYPE(PCTestdev, TESTDEV) =20 static uint64_t test_irq_line_read(void *opaque, hwaddr addr, unsigned siz= e) { diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 86d4816769..03845c8de3 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -92,12 +92,10 @@ struct PCITestDevState { uint64_t membar_size; MemoryRegion membar; }; -typedef struct PCITestDevState PCITestDevState; =20 #define TYPE_PCI_TEST_DEV "pci-testdev" =20 -DECLARE_INSTANCE_CHECKER(PCITestDevState, PCI_TEST_DEV, - TYPE_PCI_TEST_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(PCITestDevState, 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 cac8497f81..676c23f7db 100644 --- a/hw/misc/puv3_pm.c +++ b/hw/misc/puv3_pm.c @@ -19,9 +19,7 @@ #include "qemu/log.h" =20 #define TYPE_PUV3_PM "puv3_pm" -typedef struct PUV3PMState PUV3PMState; -DECLARE_INSTANCE_CHECKER(PUV3PMState, PUV3_PM, - TYPE_PUV3_PM) +OBJECT_DECLARE_SIMPLE_TYPE(PUV3PMState, PUV3_PM) =20 struct PUV3PMState { SysBusDevice parent_obj; diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 477f587ef3..4dbe6d78f9 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -34,9 +34,7 @@ #define SGABIOS_FILENAME "sgabios.bin" =20 #define TYPE_SGA "sga" -typedef struct ISASGAState ISASGAState; -DECLARE_INSTANCE_CHECKER(ISASGAState, SGA, - TYPE_SGA) +OBJECT_DECLARE_SIMPLE_TYPE(ISASGAState, SGA) =20 struct ISASGAState { ISADevice parent_obj; diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c index ab27ad462e..e8eb71570a 100644 --- a/hw/misc/slavio_misc.c +++ b/hw/misc/slavio_misc.c @@ -40,9 +40,7 @@ */ =20 #define TYPE_SLAVIO_MISC "slavio_misc" -typedef struct MiscState MiscState; -DECLARE_INSTANCE_CHECKER(MiscState, SLAVIO_MISC, - TYPE_SLAVIO_MISC) +OBJECT_DECLARE_SIMPLE_TYPE(MiscState, SLAVIO_MISC) =20 struct MiscState { SysBusDevice parent_obj; diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c index bedf09a6f5..a2b28019e3 100644 --- a/hw/misc/zynq_slcr.c +++ b/hw/misc/zynq_slcr.c @@ -183,9 +183,7 @@ 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; -DECLARE_INSTANCE_CHECKER(ZynqSLCRState, ZYNQ_SLCR, - TYPE_ZYNQ_SLCR) +OBJECT_DECLARE_SIMPLE_TYPE(ZynqSLCRState, ZYNQ_SLCR) =20 struct ZynqSLCRState { SysBusDevice parent_obj; diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 56b96e9b0f..674b04b354 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -151,9 +151,7 @@ do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA= _ARGS__); } while (0) #define SONIC_DESC_ADDR 0xFFFE =20 #define TYPE_DP8393X "dp8393x" -typedef struct dp8393xState dp8393xState; -DECLARE_INSTANCE_CHECKER(dp8393xState, DP8393X, - TYPE_DP8393X) +OBJECT_DECLARE_SIMPLE_TYPE(dp8393xState, DP8393X) =20 struct dp8393xState { SysBusDevice parent_obj; diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index 938d44f198..b6f1ae3c8f 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -56,9 +56,7 @@ #include "qom/object.h" =20 #define TYPE_E1000E "e1000e" -typedef struct E1000EState E1000EState; -DECLARE_INSTANCE_CHECKER(E1000EState, E1000E, - TYPE_E1000E) +OBJECT_DECLARE_SIMPLE_TYPE(E1000EState, E1000E) =20 struct E1000EState { PCIDevice parent_obj; diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index 36d898ad16..1b82aec794 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -324,9 +324,7 @@ 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; -DECLARE_INSTANCE_CHECKER(ETRAXFSEthState, ETRAX_FS_ETH, - TYPE_ETRAX_FS_ETH) +OBJECT_DECLARE_SIMPLE_TYPE(ETRAXFSEthState, ETRAX_FS_ETH) =20 struct ETRAXFSEthState { SysBusDevice parent_obj; diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index 57a59accd0..ab57c02c8e 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -181,9 +181,7 @@ static const VMStateDescription vmstate_lan9118_packet = =3D { } }; =20 -typedef struct lan9118_state lan9118_state; -DECLARE_INSTANCE_CHECKER(lan9118_state, LAN9118, - TYPE_LAN9118) +OBJECT_DECLARE_SIMPLE_TYPE(lan9118_state, LAN9118) =20 struct lan9118_state { SysBusDevice parent_obj; diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 41a8543edf..78c20c94e5 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -99,9 +99,7 @@ struct MilkymistMinimac2MdioState { typedef struct MilkymistMinimac2MdioState MilkymistMinimac2MdioState; =20 #define TYPE_MILKYMIST_MINIMAC2 "milkymist-minimac2" -typedef struct MilkymistMinimac2State MilkymistMinimac2State; -DECLARE_INSTANCE_CHECKER(MilkymistMinimac2State, MILKYMIST_MINIMAC2, - TYPE_MILKYMIST_MINIMAC2) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistMinimac2State, MILKYMIST_MINIMAC2) =20 struct MilkymistMinimac2State { SysBusDevice parent_obj; diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c index 61dbd575da..2ade72dea0 100644 --- a/hw/net/mipsnet.c +++ b/hw/net/mipsnet.c @@ -25,9 +25,7 @@ #define MAX_ETH_FRAME_SIZE 1514 =20 #define TYPE_MIPS_NET "mipsnet" -typedef struct MIPSnetState MIPSnetState; -DECLARE_INSTANCE_CHECKER(MIPSnetState, MIPS_NET, - TYPE_MIPS_NET) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSnetState, MIPS_NET) =20 struct MIPSnetState { SysBusDevice parent_obj; diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 688a0cc4f6..dd6f6e34d3 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -33,9 +33,7 @@ #include "qemu/module.h" #include "qom/object.h" =20 -typedef struct ISANE2000State ISANE2000State; -DECLARE_INSTANCE_CHECKER(ISANE2000State, ISA_NE2000, - TYPE_ISA_NE2000) +OBJECT_DECLARE_SIMPLE_TYPE(ISANE2000State, ISA_NE2000) =20 struct ISANE2000State { ISADevice parent_obj; diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c index 5cd204c30c..0b3dc3146e 100644 --- a/hw/net/opencores_eth.c +++ b/hw/net/opencores_eth.c @@ -272,9 +272,7 @@ typedef struct desc { #define DEFAULT_PHY 1 =20 #define TYPE_OPEN_ETH "open_eth" -typedef struct OpenEthState OpenEthState; -DECLARE_INSTANCE_CHECKER(OpenEthState, OPEN_ETH, - TYPE_OPEN_ETH) +OBJECT_DECLARE_SIMPLE_TYPE(OpenEthState, OPEN_ETH) =20 struct OpenEthState { SysBusDevice parent_obj; diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 449970bc52..ccc3fce2a0 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -52,9 +52,7 @@ =20 #define TYPE_PCI_PCNET "pcnet" =20 -typedef struct PCIPCNetState PCIPCNetState; -DECLARE_INSTANCE_CHECKER(PCIPCNetState, PCI_PCNET, - TYPE_PCI_PCNET) +OBJECT_DECLARE_SIMPLE_TYPE(PCIPCNetState, PCI_PCNET) =20 struct PCIPCNetState { /*< private >*/ diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 9246388f58..ba5ace1ab7 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -94,9 +94,7 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *= fmt, ...) =20 #define TYPE_RTL8139 "rtl8139" =20 -typedef struct RTL8139State RTL8139State; -DECLARE_INSTANCE_CHECKER(RTL8139State, RTL8139, - TYPE_RTL8139) +OBJECT_DECLARE_SIMPLE_TYPE(RTL8139State, RTL8139) =20 /* Symbolic offsets to registers. */ enum RTL8139_registers { diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index 9fad904321..ad778cd8fc 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -25,9 +25,7 @@ #define NUM_PACKETS 4 =20 #define TYPE_SMC91C111 "smc91c111" -typedef struct smc91c111_state smc91c111_state; -DECLARE_INSTANCE_CHECKER(smc91c111_state, SMC91C111, - TYPE_SMC91C111) +OBJECT_DECLARE_SIMPLE_TYPE(smc91c111_state, SMC91C111) =20 struct smc91c111_state { SysBusDevice parent_obj; diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index d34cb29607..2093f1bad0 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -85,9 +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; -DECLARE_INSTANCE_CHECKER(SpaprVioVlan, VIO_SPAPR_VLAN_DEVICE, - TYPE_VIO_SPAPR_VLAN_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprVioVlan, 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 9f13afa4e4..8dd60783d8 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -51,9 +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; -DECLARE_INSTANCE_CHECKER(stellaris_enet_state, STELLARIS_ENET, - TYPE_STELLARIS_ENET) +OBJECT_DECLARE_SIMPLE_TYPE(stellaris_enet_state, STELLARIS_ENET) =20 typedef struct { uint8_t data[2048]; diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 91753830a7..33c3722df6 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -23,9 +23,7 @@ =20 #define TYPE_SUNGEM "sungem" =20 -typedef struct SunGEMState SunGEMState; -DECLARE_INSTANCE_CHECKER(SunGEMState, SUNGEM, - TYPE_SUNGEM) +OBJECT_DECLARE_SIMPLE_TYPE(SunGEMState, SUNGEM) =20 #define MAX_PACKET_SIZE 9016 =20 diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 7364ba1019..fc34905f87 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -130,9 +130,7 @@ #define MII_COMMAND_WRITE 0x1 =20 #define TYPE_SUNHME "sunhme" -typedef struct SunHMEState SunHMEState; -DECLARE_INSTANCE_CHECKER(SunHMEState, SUNHME, - TYPE_SUNHME) +OBJECT_DECLARE_SIMPLE_TYPE(SunHMEState, SUNHME) =20 /* Maximum size of buffer */ #define HME_FIFO_SIZE 0x800 diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index a066550023..00859a7d50 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -140,9 +140,7 @@ typedef struct RxTxStats { } RxTxStats; =20 #define TYPE_XGMAC "xgmac" -typedef struct XgmacState XgmacState; -DECLARE_INSTANCE_CHECKER(XgmacState, XGMAC, - TYPE_XGMAC) +OBJECT_DECLARE_SIMPLE_TYPE(XgmacState, XGMAC) =20 struct XgmacState { SysBusDevice parent_obj; diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 4e13786e50..f8cf5290e1 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -43,9 +43,7 @@ #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; -DECLARE_INSTANCE_CHECKER(XilinxAXIEnet, XILINX_AXI_ENET, - TYPE_XILINX_AXI_ENET) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxAXIEnet, XILINX_AXI_ENET) =20 typedef struct XilinxAXIEnetStreamSlave XilinxAXIEnetStreamSlave; DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSlave, XILINX_AXI_ENET_DATA_ST= REAM, diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c index 44fb7a94d3..3660a47c51 100644 --- a/hw/nvram/ds1225y.c +++ b/hw/nvram/ds1225y.c @@ -110,9 +110,7 @@ static const VMStateDescription vmstate_nvram =3D { }; =20 #define TYPE_DS1225Y "ds1225y" -typedef struct SysBusNvRamState SysBusNvRamState; -DECLARE_INSTANCE_CHECKER(SysBusNvRamState, DS1225Y, - TYPE_DS1225Y) +OBJECT_DECLARE_SIMPLE_TYPE(SysBusNvRamState, DS1225Y) =20 struct SysBusNvRamState { SysBusDevice parent_obj; diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index 57ccc174f2..fc53a42572 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -48,11 +48,9 @@ struct SpaprNvram { BlockBackend *blk; VMChangeStateEntry *vmstate; }; -typedef struct SpaprNvram SpaprNvram; =20 #define TYPE_VIO_SPAPR_NVRAM "spapr-nvram" -DECLARE_INSTANCE_CHECKER(SpaprNvram, VIO_SPAPR_NVRAM, - TYPE_VIO_SPAPR_NVRAM) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprNvram, 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 e88998d88c..4773d07e6d 100644 --- a/hw/pci-bridge/dec.c +++ b/hw/pci-bridge/dec.c @@ -34,9 +34,7 @@ #include "hw/pci/pci_bus.h" #include "qom/object.h" =20 -typedef struct DECState DECState; -DECLARE_INSTANCE_CHECKER(DECState, DEC_21154, - TYPE_DEC_21154) +OBJECT_DECLARE_SIMPLE_TYPE(DECState, 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 67c71d566b..8931afc049 100644 --- a/hw/pci-bridge/gen_pcie_root_port.c +++ b/hw/pci-bridge/gen_pcie_root_port.c @@ -20,9 +20,7 @@ #include "qom/object.h" =20 #define TYPE_GEN_PCIE_ROOT_PORT "pcie-root-port" -typedef struct GenPCIERootPort GenPCIERootPort; -DECLARE_INSTANCE_CHECKER(GenPCIERootPort, GEN_PCIE_ROOT_PORT, - TYPE_GEN_PCIE_ROOT_PORT) +OBJECT_DECLARE_SIMPLE_TYPE(GenPCIERootPort, 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 b86d76caf3..657a06ddbe 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -35,9 +35,7 @@ =20 #define TYPE_PCI_BRIDGE_DEV "pci-bridge" #define TYPE_PCI_BRIDGE_SEAT_DEV "pci-bridge-seat" -typedef struct PCIBridgeDev PCIBridgeDev; -DECLARE_INSTANCE_CHECKER(PCIBridgeDev, PCI_BRIDGE_DEV, - TYPE_PCI_BRIDGE_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(PCIBridgeDev, PCI_BRIDGE_DEV) =20 struct PCIBridgeDev { /*< private >*/ diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridg= e.c index abc98f8cd9..1cd917a459 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -27,11 +27,9 @@ struct PCIEPCIBridge { MemoryRegion shpc_bar; /*< public >*/ }; -typedef struct PCIEPCIBridge PCIEPCIBridge; =20 #define TYPE_PCIE_PCI_BRIDGE_DEV "pcie-pci-bridge" -DECLARE_INSTANCE_CHECKER(PCIEPCIBridge, PCIE_PCI_BRIDGE_DEV, - TYPE_PCIE_PCI_BRIDGE_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(PCIEPCIBridge, 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 d10fbd39d3..a99eced065 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -240,12 +240,10 @@ struct BonitoState { }; =20 #define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" -DECLARE_INSTANCE_CHECKER(BonitoState, BONITO_PCI_HOST_BRIDGE, - TYPE_BONITO_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(BonitoState, BONITO_PCI_HOST_BRIDGE) =20 #define TYPE_PCI_BONITO "Bonito" -DECLARE_INSTANCE_CHECKER(PCIBonitoState, PCI_BONITO, - TYPE_PCI_BONITO) +OBJECT_DECLARE_SIMPLE_TYPE(PCIBonitoState, 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 fd7d6dcc06..57c29b20af 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -35,9 +35,7 @@ #include "trace.h" #include "qom/object.h" =20 -typedef struct GrackleState GrackleState; -DECLARE_INSTANCE_CHECKER(GrackleState, GRACKLE_PCI_HOST_BRIDGE, - TYPE_GRACKLE_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(GrackleState, 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 93c62235ca..aecbcc2446 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -42,9 +42,7 @@ * https://wiki.qemu.org/File:29054901.pdf */ =20 -typedef struct I440FXState I440FXState; -DECLARE_INSTANCE_CHECKER(I440FXState, I440FX_PCI_HOST_BRIDGE, - TYPE_I440FX_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(I440FXState, I440FX_PCI_HOST_BRIDGE) =20 struct I440FXState { PCIHostState parent_obj; diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index f376374e24..9517aab913 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -92,9 +92,7 @@ struct pci_inbound { =20 #define TYPE_PPC_E500_PCI_HOST_BRIDGE "e500-pcihost" =20 -typedef struct PPCE500PCIState PPCE500PCIState; -DECLARE_INSTANCE_CHECKER(PPCE500PCIState, PPC_E500_PCI_HOST_BRIDGE, - TYPE_PPC_E500_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PPCE500PCIState, PPC_E500_PCI_HOST_BRIDGE) =20 struct PPCE500PCIState { PCIHostState parent_obj; @@ -116,9 +114,7 @@ struct PPCE500PCIState { }; =20 #define TYPE_PPC_E500_PCI_BRIDGE "e500-host-bridge" -typedef struct PPCE500PCIBridgeState PPCE500PCIBridgeState; -DECLARE_INSTANCE_CHECKER(PPCE500PCIBridgeState, PPC_E500_PCI_BRIDGE, - TYPE_PPC_E500_PCI_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PPCE500PCIBridgeState, PPC_E500_PCI_BRIDGE) =20 struct PPCE500PCIBridgeState { /*< private >*/ diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index b234fd7c8a..d0323fefb1 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -43,9 +43,7 @@ #define TYPE_RAVEN_PCI_DEVICE "raven" #define TYPE_RAVEN_PCI_HOST_BRIDGE "raven-pcihost" =20 -typedef struct RavenPCIState RavenPCIState; -DECLARE_INSTANCE_CHECKER(RavenPCIState, RAVEN_PCI_DEVICE, - TYPE_RAVEN_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(RavenPCIState, RAVEN_PCI_DEVICE) =20 struct RavenPCIState { PCIDevice dev; diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index b76b5e4701..e8d2d51c20 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -55,9 +55,7 @@ #define MPC8544_GUTS_ADDR_SRDS2CR3 0xF18 =20 #define TYPE_MPC8544_GUTS "mpc8544-guts" -typedef struct GutsState GutsState; -DECLARE_INSTANCE_CHECKER(GutsState, MPC8544_GUTS, - TYPE_MPC8544_GUTS) +OBJECT_DECLARE_SIMPLE_TYPE(GutsState, MPC8544_GUTS) =20 struct GutsState { /*< private >*/ diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index a564fcd600..ee952314c8 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -46,9 +46,7 @@ struct PLBInMap { }; =20 #define TYPE_PPC440_PCIX_HOST_BRIDGE "ppc440-pcix-host" -typedef struct PPC440PCIXState PPC440PCIXState; -DECLARE_INSTANCE_CHECKER(PPC440PCIXState, PPC440_PCIX_HOST_BRIDGE, - TYPE_PPC440_PCIX_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PPC440PCIXState, 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 d9ca6bba9b..f6f89058ab 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1033,9 +1033,7 @@ 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; -DECLARE_INSTANCE_CHECKER(PPC460EXPCIEState, PPC460EX_PCIE_HOST, - TYPE_PPC460EX_PCIE_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(PPC460EXPCIEState, PPC460EX_PCIE_HOST) =20 struct PPC460EXPCIEState { PCIExpressHost host; diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index c24bac96c3..c812d3408f 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -44,9 +44,7 @@ struct PCITargetMap { uint32_t la; }; =20 -typedef struct PPC4xxPCIState PPC4xxPCIState; -DECLARE_INSTANCE_CHECKER(PPC4xxPCIState, PPC4xx_PCI_HOST_BRIDGE, - TYPE_PPC4xx_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PPC4xxPCIState, 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 cd8000ad73..25c9ce745f 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -47,9 +47,7 @@ typedef struct spin_info { } QEMU_PACKED SpinInfo; =20 #define TYPE_E500_SPIN "e500-spin" -typedef struct SpinState SpinState; -DECLARE_INSTANCE_CHECKER(SpinState, E500_SPIN, - TYPE_E500_SPIN) +OBJECT_DECLARE_SIMPLE_TYPE(SpinState, E500_SPIN) =20 struct SpinState { SysBusDevice parent_obj; diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index d1e2fb3f8b..4e48ef245c 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -36,9 +36,7 @@ #include "trace.h" =20 #define TYPE_PREP_SYSTEMIO "prep-systemio" -typedef struct PrepSystemIoState PrepSystemIoState; -DECLARE_INSTANCE_CHECKER(PrepSystemIoState, PREP_SYSTEMIO, - TYPE_PREP_SYSTEMIO) +OBJECT_DECLARE_SIMPLE_TYPE(PrepSystemIoState, 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 8611ffa96d..4db5b51a2d 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -29,9 +29,7 @@ #include "qom/object.h" =20 #define TYPE_RS6000MC "rs6000-mc" -typedef struct RS6000MCState RS6000MCState; -DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC, - TYPE_RS6000MC) +OBJECT_DECLARE_SIMPLE_TYPE(RS6000MCState, RS6000MC) =20 struct RS6000MCState { ISADevice parent_obj; diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index 6c99633faa..d14800e9de 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -30,9 +30,7 @@ #include "kvm_ppc.h" #include "qom/object.h" =20 -typedef struct SpaprRngState SpaprRngState; -DECLARE_INSTANCE_CHECKER(SpaprRngState, SPAPR_RNG, - TYPE_SPAPR_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprRngState, SPAPR_RNG) =20 struct SpaprRngState { /*< private >*/ diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c index 10fac3d9c9..bc5ce1a9f4 100644 --- a/hw/rtc/ds1338.c +++ b/hw/rtc/ds1338.c @@ -30,9 +30,7 @@ #define CTRL_OSF 0x20 =20 #define TYPE_DS1338 "ds1338" -typedef struct DS1338State DS1338State; -DECLARE_INSTANCE_CHECKER(DS1338State, DS1338, - TYPE_DS1338) +OBJECT_DECLARE_SIMPLE_TYPE(DS1338State, DS1338) =20 struct DS1338State { I2CSlave parent_obj; diff --git a/hw/rtc/exynos4210_rtc.c b/hw/rtc/exynos4210_rtc.c index f8a4fe8a47..4c97624478 100644 --- a/hw/rtc/exynos4210_rtc.c +++ b/hw/rtc/exynos4210_rtc.c @@ -85,9 +85,7 @@ #define RTC_BASE_FREQ 32768 =20 #define TYPE_EXYNOS4210_RTC "exynos4210.rtc" -typedef struct Exynos4210RTCState Exynos4210RTCState; -DECLARE_INSTANCE_CHECKER(Exynos4210RTCState, EXYNOS4210_RTC, - TYPE_EXYNOS4210_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210RTCState, EXYNOS4210_RTC) =20 struct Exynos4210RTCState { SysBusDevice parent_obj; diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c index 0b7048c3f4..396d110ba2 100644 --- a/hw/rtc/m41t80.c +++ b/hw/rtc/m41t80.c @@ -17,9 +17,7 @@ #include "qom/object.h" =20 #define TYPE_M41T80 "m41t80" -typedef struct M41t80State M41t80State; -DECLARE_INSTANCE_CHECKER(M41t80State, M41T80, - TYPE_M41T80) +OBJECT_DECLARE_SIMPLE_TYPE(M41t80State, M41T80) =20 struct M41t80State { I2CSlave parent_obj; diff --git a/hw/rtc/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c index 18979d25d0..e037acd1b5 100644 --- a/hw/rtc/sun4v-rtc.c +++ b/hw/rtc/sun4v-rtc.c @@ -20,9 +20,7 @@ =20 =20 #define TYPE_SUN4V_RTC "sun4v_rtc" -typedef struct Sun4vRtc Sun4vRtc; -DECLARE_INSTANCE_CHECKER(Sun4vRtc, SUN4V_RTC, - TYPE_SUN4V_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(Sun4vRtc, SUN4V_RTC) =20 struct Sun4vRtc { SysBusDevice parent_obj; diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c index 4f83eff5c3..f838913b37 100644 --- a/hw/rtc/twl92230.c +++ b/hw/rtc/twl92230.c @@ -34,9 +34,7 @@ #define VERBOSE 1 =20 #define TYPE_TWL92230 "twl92230" -typedef struct MenelausState MenelausState; -DECLARE_INSTANCE_CHECKER(MenelausState, TWL92230, - TYPE_TWL92230) +OBJECT_DECLARE_SIMPLE_TYPE(MenelausState, TWL92230) =20 struct MenelausState { I2CSlave parent_obj; diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index e8354a47da..7d13c7dc1c 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -305,13 +305,11 @@ struct LSIState { =20 uint8_t script_ram[2048 * sizeof(uint32_t)]; }; -typedef struct LSIState LSIState; =20 #define TYPE_LSI53C810 "lsi53c810" #define TYPE_LSI53C895A "lsi53c895a" =20 -DECLARE_INSTANCE_CHECKER(LSIState, LSI53C895A, - TYPE_LSI53C895A) +OBJECT_DECLARE_SIMPLE_TYPE(LSIState, LSI53C895A) =20 static const char *scsi_phases[] =3D { "DOUT", diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index c3e6d1ecef..4aa0224c47 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -91,9 +91,7 @@ typedef struct vscsi_req { } vscsi_req; =20 #define TYPE_VIO_SPAPR_VSCSI_DEVICE "spapr-vscsi" -typedef struct VSCSIState VSCSIState; -DECLARE_INSTANCE_CHECKER(VSCSIState, VIO_SPAPR_VSCSI_DEVICE, - TYPE_VIO_SPAPR_VSCSI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(VSCSIState, VIO_SPAPR_VSCSI_DEVICE) =20 struct VSCSIState { SpaprVioDevice vdev; diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index 4d3ec28f5d..8cde32049e 100644 --- a/hw/sd/milkymist-memcard.c +++ b/hw/sd/milkymist-memcard.c @@ -64,9 +64,7 @@ enum { }; =20 #define TYPE_MILKYMIST_MEMCARD "milkymist-memcard" -typedef struct MilkymistMemcardState MilkymistMemcardState; -DECLARE_INSTANCE_CHECKER(MilkymistMemcardState, MILKYMIST_MEMCARD, - TYPE_MILKYMIST_MEMCARD) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistMemcardState, MILKYMIST_MEMCARD) =20 #define TYPE_MILKYMIST_SDBUS "milkymist-sdbus" =20 diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 7829e933a5..960f155098 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -23,9 +23,7 @@ #define PL181_FIFO_LEN 16 =20 #define TYPE_PL181 "pl181" -typedef struct PL181State PL181State; -DECLARE_INSTANCE_CHECKER(PL181State, PL181, - TYPE_PL181) +OBJECT_DECLARE_SIMPLE_TYPE(PL181State, PL181) =20 #define TYPE_PL181_BUS "pl181-bus" =20 diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index dd07258d4e..14c8e04a89 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -52,11 +52,9 @@ struct ssi_sd_state { int32_t stopping; SDBus sdbus; }; -typedef struct ssi_sd_state ssi_sd_state; =20 #define TYPE_SSI_SD "ssi-sd" -DECLARE_INSTANCE_CHECKER(ssi_sd_state, SSI_SD, - TYPE_SSI_SD) +OBJECT_DECLARE_SIMPLE_TYPE(ssi_sd_state, 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 dc73845125..73d2d0bccb 100644 --- a/hw/sh4/sh_pci.c +++ b/hw/sh4/sh_pci.c @@ -35,9 +35,7 @@ =20 #define TYPE_SH_PCI_HOST_BRIDGE "sh_pci" =20 -typedef struct SHPCIState SHPCIState; -DECLARE_INSTANCE_CHECKER(SHPCIState, SH_PCI_HOST_BRIDGE, - TYPE_SH_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(SHPCIState, SH_PCI_HOST_BRIDGE) =20 struct SHPCIState { PCIHostState parent_obj; diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 947b69d159..54a2b2f9ef 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -582,9 +582,7 @@ static void idreg_init(hwaddr addr) idreg_data, sizeof(idreg_data)); } =20 -typedef struct IDRegState IDRegState; -DECLARE_INSTANCE_CHECKER(IDRegState, MACIO_ID_REGISTER, - TYPE_MACIO_ID_REGISTER) +OBJECT_DECLARE_SIMPLE_TYPE(IDRegState, MACIO_ID_REGISTER) =20 struct IDRegState { SysBusDevice parent_obj; @@ -625,9 +623,7 @@ static const TypeInfo idreg_info =3D { }; =20 #define TYPE_TCX_AFX "tcx_afx" -typedef struct AFXState AFXState; -DECLARE_INSTANCE_CHECKER(AFXState, TCX_AFX, - TYPE_TCX_AFX) +OBJECT_DECLARE_SIMPLE_TYPE(AFXState, TCX_AFX) =20 struct AFXState { SysBusDevice parent_obj; diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index b4aabfc076..ad5ca2472a 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -90,11 +90,9 @@ struct EbusState { MemoryRegion bar0; MemoryRegion bar1; }; -typedef struct EbusState EbusState; =20 #define TYPE_EBUS "ebus" -DECLARE_INSTANCE_CHECKER(EbusState, EBUS, - TYPE_EBUS) +OBJECT_DECLARE_SIMPLE_TYPE(EbusState, EBUS) =20 const char *fw_cfg_arch_key_name(uint16_t key) { @@ -229,9 +227,7 @@ typedef struct ResetData { } ResetData; =20 #define TYPE_SUN4U_POWER "power" -typedef struct PowerDevice PowerDevice; -DECLARE_INSTANCE_CHECKER(PowerDevice, SUN4U_POWER, - TYPE_SUN4U_POWER) +OBJECT_DECLARE_SIMPLE_TYPE(PowerDevice, SUN4U_POWER) =20 struct PowerDevice { SysBusDevice parent_obj; diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index faf7633e70..4278d0e444 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -24,8 +24,7 @@ struct SSIBus { }; =20 #define TYPE_SSI_BUS "SSI" -DECLARE_INSTANCE_CHECKER(SSIBus, SSI_BUS, - TYPE_SSI_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SSIBus, 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 34fc8da69a..fec8817d94 100644 --- a/hw/ssi/xilinx_spi.c +++ b/hw/ssi/xilinx_spi.c @@ -79,9 +79,7 @@ #define FIFO_CAPACITY 256 =20 #define TYPE_XILINX_SPI "xlnx.xps-spi" -typedef struct XilinxSPI XilinxSPI; -DECLARE_INSTANCE_CHECKER(XilinxSPI, XILINX_SPI, - TYPE_XILINX_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxSPI, XILINX_SPI) =20 struct XilinxSPI { SysBusDevice parent_obj; diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c index c694c98d08..c6e02d2b5a 100644 --- a/hw/timer/altera_timer.c +++ b/hw/timer/altera_timer.c @@ -45,9 +45,7 @@ #define CONTROL_STOP 0x0008 =20 #define TYPE_ALTERA_TIMER "ALTR.timer" -typedef struct AlteraTimer AlteraTimer; -DECLARE_INSTANCE_CHECKER(AlteraTimer, ALTERA_TIMER, - TYPE_ALTERA_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(AlteraTimer, ALTERA_TIMER) =20 struct AlteraTimer { SysBusDevice busdev; diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 79117f45b0..98e70b2d26 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -191,9 +191,7 @@ static arm_timer_state *arm_timer_init(uint32_t freq) */ =20 #define TYPE_SP804 "sp804" -typedef struct SP804State SP804State; -DECLARE_INSTANCE_CHECKER(SP804State, SP804, - TYPE_SP804) +OBJECT_DECLARE_SIMPLE_TYPE(SP804State, SP804) =20 struct SP804State { SysBusDevice parent_obj; @@ -313,9 +311,7 @@ static void sp804_realize(DeviceState *dev, Error **err= p) /* Integrator/CP timer module. */ =20 #define TYPE_INTEGRATOR_PIT "integrator_pit" -typedef struct icp_pit_state icp_pit_state; -DECLARE_INSTANCE_CHECKER(icp_pit_state, INTEGRATOR_PIT, - TYPE_INTEGRATOR_PIT) +OBJECT_DECLARE_SIMPLE_TYPE(icp_pit_state, 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 52e637545a..64108241ba 100644 --- a/hw/timer/cadence_ttc.c +++ b/hw/timer/cadence_ttc.c @@ -70,9 +70,7 @@ typedef struct { } CadenceTimerState; =20 #define TYPE_CADENCE_TTC "cadence_ttc" -typedef struct CadenceTTCState CadenceTTCState; -DECLARE_INSTANCE_CHECKER(CadenceTTCState, CADENCE_TTC, - TYPE_CADENCE_TTC) +OBJECT_DECLARE_SIMPLE_TYPE(CadenceTTCState, CADENCE_TTC) =20 struct CadenceTTCState { SysBusDevice parent_obj; diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c index 0329cae3d9..08ee3ca76c 100644 --- a/hw/timer/exynos4210_mct.c +++ b/hw/timer/exynos4210_mct.c @@ -243,9 +243,7 @@ typedef struct { } Exynos4210MCTLT; =20 #define TYPE_EXYNOS4210_MCT "exynos4210.mct" -typedef struct Exynos4210MCTState Exynos4210MCTState; -DECLARE_INSTANCE_CHECKER(Exynos4210MCTState, EXYNOS4210_MCT, - TYPE_EXYNOS4210_MCT) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210MCTState, EXYNOS4210_MCT) =20 struct Exynos4210MCTState { SysBusDevice parent_obj; diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c index 5340fc0425..4fa3d87396 100644 --- a/hw/timer/exynos4210_pwm.c +++ b/hw/timer/exynos4210_pwm.c @@ -103,9 +103,7 @@ typedef struct { } Exynos4210PWM; =20 #define TYPE_EXYNOS4210_PWM "exynos4210.pwm" -typedef struct Exynos4210PWMState Exynos4210PWMState; -DECLARE_INSTANCE_CHECKER(Exynos4210PWMState, EXYNOS4210_PWM, - TYPE_EXYNOS4210_PWM) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210PWMState, EXYNOS4210_PWM) =20 struct Exynos4210PWMState { SysBusDevice parent_obj; diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c index e539fc24f0..d511890109 100644 --- a/hw/timer/grlib_gptimer.c +++ b/hw/timer/grlib_gptimer.c @@ -56,9 +56,7 @@ #define COUNTER_RELOAD_OFFSET 0x04 #define TIMER_BASE 0x10 =20 -typedef struct GPTimerUnit GPTimerUnit; -DECLARE_INSTANCE_CHECKER(GPTimerUnit, GRLIB_GPTIMER, - TYPE_GRLIB_GPTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(GPTimerUnit, GRLIB_GPTIMER) =20 typedef struct GPTimer GPTimer; =20 diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 44bbe3a536..b5d4072490 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -48,9 +48,7 @@ =20 #define HPET_MSI_SUPPORT 0 =20 -typedef struct HPETState HPETState; -DECLARE_INSTANCE_CHECKER(HPETState, HPET, - TYPE_HPET) +OBJECT_DECLARE_SIMPLE_TYPE(HPETState, HPET) =20 struct HPETState; typedef struct HPETTimer { /* timers */ diff --git a/hw/timer/lm32_timer.c b/hw/timer/lm32_timer.c index 93ecb51a97..be87c65b3e 100644 --- a/hw/timer/lm32_timer.c +++ b/hw/timer/lm32_timer.c @@ -56,9 +56,7 @@ enum { }; =20 #define TYPE_LM32_TIMER "lm32-timer" -typedef struct LM32TimerState LM32TimerState; -DECLARE_INSTANCE_CHECKER(LM32TimerState, LM32_TIMER, - TYPE_LM32_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(LM32TimerState, LM32_TIMER) =20 struct LM32TimerState { SysBusDevice parent_obj; diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c index 29500e0457..950437b685 100644 --- a/hw/timer/milkymist-sysctl.c +++ b/hw/timer/milkymist-sysctl.c @@ -63,9 +63,7 @@ enum { }; =20 #define TYPE_MILKYMIST_SYSCTL "milkymist-sysctl" -typedef struct MilkymistSysctlState MilkymistSysctlState; -DECLARE_INSTANCE_CHECKER(MilkymistSysctlState, MILKYMIST_SYSCTL, - TYPE_MILKYMIST_SYSCTL) +OBJECT_DECLARE_SIMPLE_TYPE(MilkymistSysctlState, MILKYMIST_SYSCTL) =20 struct MilkymistSysctlState { SysBusDevice parent_obj; diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index 3a35ac2b0a..d5bf26b56b 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -21,9 +21,7 @@ #include "hw/unicore32/puv3.h" =20 #define TYPE_PUV3_OST "puv3_ost" -typedef struct PUV3OSTState PUV3OSTState; -DECLARE_INSTANCE_CHECKER(PUV3OSTState, PUV3_OST, - TYPE_PUV3_OST) +OBJECT_DECLARE_SIMPLE_TYPE(PUV3OSTState, PUV3_OST) =20 /* puv3 ostimer implementation. */ struct PUV3OSTState { diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c index 8c3a1f5489..2ae5ae3212 100644 --- a/hw/timer/pxa2xx_timer.c +++ b/hw/timer/pxa2xx_timer.c @@ -67,9 +67,7 @@ static int pxa2xx_timer4_freq[8] =3D { }; =20 #define TYPE_PXA2XX_TIMER "pxa2xx-timer" -typedef struct PXA2xxTimerInfo PXA2xxTimerInfo; -DECLARE_INSTANCE_CHECKER(PXA2xxTimerInfo, PXA2XX_TIMER, - TYPE_PXA2XX_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxTimerInfo, PXA2XX_TIMER) =20 =20 typedef struct { diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index 08d6888015..5b2d20cb6a 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -60,9 +60,7 @@ typedef struct CPUTimerState { } CPUTimerState; =20 #define TYPE_SLAVIO_TIMER "slavio_timer" -typedef struct SLAVIO_TIMERState SLAVIO_TIMERState; -DECLARE_INSTANCE_CHECKER(SLAVIO_TIMERState, SLAVIO_TIMER, - TYPE_SLAVIO_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(SLAVIO_TIMERState, SLAVIO_TIMER) =20 struct SLAVIO_TIMERState { SysBusDevice parent_obj; diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index fafdcffa9c..6fd876eebf 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -38,10 +38,8 @@ struct TPMStateISA { /*< public >*/ TPMState state; /* not a QOM object */ }; -typedef struct TPMStateISA TPMStateISA; =20 -DECLARE_INSTANCE_CHECKER(TPMStateISA, TPM_TIS_ISA, - TYPE_TPM_TIS_ISA) +OBJECT_DECLARE_SIMPLE_TYPE(TPMStateISA, 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 20b28eeb28..2c32aa7099 100644 --- a/hw/tpm/tpm_tis_sysbus.c +++ b/hw/tpm/tpm_tis_sysbus.c @@ -38,10 +38,8 @@ struct TPMStateSysBus { /*< public >*/ TPMState state; /* not a QOM object */ }; -typedef struct TPMStateSysBus TPMStateSysBus; =20 -DECLARE_INSTANCE_CHECKER(TPMStateSysBus, TPM_TIS_SYSBUS, - TYPE_TPM_TIS_SYSBUS) +OBJECT_DECLARE_SIMPLE_TYPE(TPMStateSysBus, TPM_TIS_SYSBUS) =20 static int tpm_tis_pre_save_sysbus(void *opaque) { diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 65247ca799..e1486f81e0 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -654,11 +654,9 @@ struct USBAudioState { uint32_t buffer_user, buffer; bool multi; }; -typedef struct USBAudioState USBAudioState; =20 #define TYPE_USB_AUDIO "usb-audio" -DECLARE_INSTANCE_CHECKER(USBAudioState, USB_AUDIO, - TYPE_USB_AUDIO) +OBJECT_DECLARE_SIMPLE_TYPE(USBAudioState, 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 05cfe6baca..fc39bab79f 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -44,11 +44,9 @@ struct USBHIDState { char *display; uint32_t head; }; -typedef struct USBHIDState USBHIDState; =20 #define TYPE_USB_HID "usb-hid" -DECLARE_INSTANCE_CHECKER(USBHIDState, USB_HID, - TYPE_USB_HID) +OBJECT_DECLARE_SIMPLE_TYPE(USBHIDState, USB_HID) =20 enum { STR_MANUFACTURER =3D 1, diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 7a182f9bec..40c1f90694 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -50,11 +50,9 @@ struct USBHubState { QEMUTimer *port_timer; USBHubPort ports[MAX_PORTS]; }; -typedef struct USBHubState USBHubState; =20 #define TYPE_USB_HUB "usb-hub" -DECLARE_INSTANCE_CHECKER(USBHubState, USB_HUB, - TYPE_USB_HUB) +OBJECT_DECLARE_SIMPLE_TYPE(USBHubState, 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 c61c0e0878..bbb8274344 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -238,8 +238,7 @@ typedef struct { } QEMU_PACKED ObjectInfo; =20 #define TYPE_USB_MTP "usb-mtp" -DECLARE_INSTANCE_CHECKER(MTPState, USB_MTP, - TYPE_USB_MTP) +OBJECT_DECLARE_SIMPLE_TYPE(MTPState, USB_MTP) =20 #define QEMU_STORAGE_ID 0x00010001 =20 diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index cd32f57685..6c49c16015 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -653,11 +653,9 @@ struct USBNetState { NICConf conf; QTAILQ_HEAD(, rndis_response) rndis_resp; }; -typedef struct USBNetState USBNetState; =20 #define TYPE_USB_NET "usb-net" -DECLARE_INSTANCE_CHECKER(USBNetState, USB_NET, - TYPE_USB_NET) +OBJECT_DECLARE_SIMPLE_TYPE(USBNetState, USB_NET) =20 static int is_rndis(USBNetState *s) { diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 1a038a222e..b1622b7c7f 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -110,11 +110,9 @@ struct USBSerialState { int latency; /* ms */ CharBackend cs; }; -typedef struct USBSerialState USBSerialState; =20 #define TYPE_USB_SERIAL "usb-serial-dev" -DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL, - TYPE_USB_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(USBSerialState, 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 59b2248f34..946df9734a 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -61,9 +61,7 @@ do { \ #define D_VERBOSE 4 =20 #define TYPE_USB_CCID_DEV "usb-ccid" -typedef struct USBCCIDState USBCCIDState; -DECLARE_INSTANCE_CHECKER(USBCCIDState, USB_CCID_DEV, - TYPE_USB_CCID_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(USBCCIDState, USB_CCID_DEV) /* * The two options for variable sized buffers: * make them constant size, for large enough constant, @@ -1177,8 +1175,7 @@ static Property ccid_props[] =3D { }; =20 #define TYPE_CCID_BUS "ccid-bus" -DECLARE_INSTANCE_CHECKER(CCIDBus, CCID_BUS, - TYPE_CCID_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(CCIDBus, CCID_BUS) =20 static const TypeInfo ccid_bus_info =3D { .name =3D TYPE_CCID_BUS, diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index c36c8e7820..cec071d96c 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -133,8 +133,7 @@ struct UASDevice { }; =20 #define TYPE_USB_UAS "usb-uas" -DECLARE_INSTANCE_CHECKER(UASDevice, USB_UAS, - TYPE_USB_UAS) +OBJECT_DECLARE_SIMPLE_TYPE(UASDevice, USB_UAS) =20 struct UASRequest { uint16_t tag; diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c index 85c4d827bf..b595048635 100644 --- a/hw/usb/dev-wacom.c +++ b/hw/usb/dev-wacom.c @@ -53,11 +53,9 @@ struct USBWacomState { uint8_t idle; int changed; }; -typedef struct USBWacomState USBWacomState; =20 #define TYPE_USB_WACOM "usb-wacom-tablet" -DECLARE_INSTANCE_CHECKER(USBWacomState, USB_WACOM, - TYPE_USB_WACOM) +OBJECT_DECLARE_SIMPLE_TYPE(USBWacomState, 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 f8168a06a3..f95199e0bb 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -32,9 +32,7 @@ #include "qom/object.h" =20 #define TYPE_PCI_OHCI "pci-ohci" -typedef struct OHCIPCIState OHCIPCIState; -DECLARE_INSTANCE_CHECKER(OHCIPCIState, PCI_OHCI, - TYPE_PCI_OHCI) +OBJECT_DECLARE_SIMPLE_TYPE(OHCIPCIState, PCI_OHCI) =20 struct OHCIPCIState { /*< private >*/ diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 8b02bee547..b950501d10 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -61,9 +61,7 @@ /* -----------------------------------------------------------------------= - */ =20 #define TYPE_USB_HOST_DEVICE "usb-host" -typedef struct USBHostDevice USBHostDevice; -DECLARE_INSTANCE_CHECKER(USBHostDevice, USB_HOST_DEVICE, - TYPE_USB_HOST_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(USBHostDevice, USB_HOST_DEVICE) =20 typedef struct USBHostRequest USBHostRequest; typedef struct USBHostIsoXfer USBHostIsoXfer; diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index dd20996d13..1dd4071e68 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_TUSB6010 "tusb6010" -typedef struct TUSBState TUSBState; -DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010, - TYPE_TUSB6010) +OBJECT_DECLARE_SIMPLE_TYPE(TUSBState, TUSB6010) =20 struct TUSBState { SysBusDevice parent_obj; diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 582c091a24..9571c2f91f 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -36,10 +36,8 @@ struct VFIOAPDevice { APDevice apdev; VFIODevice vdev; }; -typedef struct VFIOAPDevice VFIOAPDevice; =20 -DECLARE_INSTANCE_CHECKER(VFIOAPDevice, VFIO_AP_DEVICE, - TYPE_VFIO_AP_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(VFIOAPDevice, VFIO_AP_DEVICE) =20 static void vfio_ap_compute_needs_reset(VFIODevice *vdev) { diff --git a/hw/virtio/virtio-input-pci.c b/hw/virtio/virtio-input-pci.c index 85acd3d2eb..48e9ff38e2 100644 --- a/hw/virtio/virtio-input-pci.c +++ b/hw/virtio/virtio-input-pci.c @@ -14,14 +14,11 @@ #include "qemu/module.h" #include "qom/object.h" =20 -typedef struct VirtIOInputPCI VirtIOInputPCI; -typedef struct VirtIOInputHIDPCI VirtIOInputHIDPCI; =20 /* * virtio-input-pci: This extends VirtioPCIProxy. */ -DECLARE_INSTANCE_CHECKER(VirtIOInputPCI, VIRTIO_INPUT_PCI, - TYPE_VIRTIO_INPUT_PCI) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputPCI, VIRTIO_INPUT_PCI) =20 struct VirtIOInputPCI { VirtIOPCIProxy parent_obj; @@ -32,8 +29,7 @@ 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" -DECLARE_INSTANCE_CHECKER(VirtIOInputHIDPCI, VIRTIO_INPUT_HID_PCI, - TYPE_VIRTIO_INPUT_HID_PCI) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHIDPCI, VIRTIO_INPUT_HID_PCI) =20 struct VirtIOInputHIDPCI { VirtIOPCIProxy parent_obj; diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index 4f64899a56..502f45a939 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -102,11 +102,9 @@ struct I6300State { */ }; =20 -typedef struct I6300State I6300State; =20 #define TYPE_WATCHDOG_I6300ESB_DEVICE "i6300esb" -DECLARE_INSTANCE_CHECKER(I6300State, WATCHDOG_I6300ESB_DEVICE, - TYPE_WATCHDOG_I6300ESB_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(I6300State, 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/migration/rdma.c b/migration/rdma.c index 1dc563ec3f..6546509ebf 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -398,9 +398,7 @@ typedef struct RDMAContext { } RDMAContext; =20 #define TYPE_QIO_CHANNEL_RDMA "qio-channel-rdma" -typedef struct QIOChannelRDMA QIOChannelRDMA; -DECLARE_INSTANCE_CHECKER(QIOChannelRDMA, QIO_CHANNEL_RDMA, - TYPE_QIO_CHANNEL_RDMA) +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelRDMA, QIO_CHANNEL_RDMA) =20 =20 =20 diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c index f933bd2db2..ce8c2549ed 100644 --- a/net/can/can_socketcan.c +++ b/net/can/can_socketcan.c @@ -47,9 +47,7 @@ #endif /*DEBUG_CAN*/ =20 #define TYPE_CAN_HOST_SOCKETCAN "can-host-socketcan" -typedef struct CanHostSocketCAN CanHostSocketCAN; -DECLARE_INSTANCE_CHECKER(CanHostSocketCAN, CAN_HOST_SOCKETCAN, - TYPE_CAN_HOST_SOCKETCAN) +OBJECT_DECLARE_SIMPLE_TYPE(CanHostSocketCAN, CAN_HOST_SOCKETCAN) =20 #define CAN_READ_BUF_LEN 5 struct CanHostSocketCAN { diff --git a/net/dump.c b/net/dump.c index 42e64a6f29..7fd448d2e1 100644 --- a/net/dump.c +++ b/net/dump.c @@ -140,9 +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; -DECLARE_INSTANCE_CHECKER(NetFilterDumpState, FILTER_DUMP, - TYPE_FILTER_DUMP) +OBJECT_DECLARE_SIMPLE_TYPE(NetFilterDumpState, FILTER_DUMP) =20 struct NetFilterDumpState { NetFilterState nfs; diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 6ade7a19b8..d8392be53c 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -18,9 +18,7 @@ =20 #define TYPE_FILTER_BUFFER "filter-buffer" =20 -typedef struct FilterBufferState FilterBufferState; -DECLARE_INSTANCE_CHECKER(FilterBufferState, FILTER_BUFFER, - TYPE_FILTER_BUFFER) +OBJECT_DECLARE_SIMPLE_TYPE(FilterBufferState, FILTER_BUFFER) =20 struct FilterBufferState { NetFilterState parent_obj; diff --git a/net/filter-replay.c b/net/filter-replay.c index 78696c162e..eef8443059 100644 --- a/net/filter-replay.c +++ b/net/filter-replay.c @@ -23,9 +23,7 @@ =20 #define TYPE_FILTER_REPLAY "filter-replay" =20 -typedef struct NetFilterReplayState NetFilterReplayState; -DECLARE_INSTANCE_CHECKER(NetFilterReplayState, FILTER_REPLAY, - TYPE_FILTER_REPLAY) +OBJECT_DECLARE_SIMPLE_TYPE(NetFilterReplayState, FILTER_REPLAY) =20 struct NetFilterReplayState { NetFilterState nfs; diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index 3070b6d59e..dc3c27a489 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -24,9 +24,7 @@ #include "util.h" =20 #define TYPE_FILTER_REWRITER "filter-rewriter" -typedef struct RewriterState RewriterState; -DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_REWRITER, - TYPE_FILTER_REWRITER) +OBJECT_DECLARE_SIMPLE_TYPE(RewriterState, 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 d735b1e7f6..b531dae2e8 100644 --- a/scsi/pr-manager-helper.c +++ b/scsi/pr-manager-helper.c @@ -27,9 +27,7 @@ =20 #define TYPE_PR_MANAGER_HELPER "pr-manager-helper" =20 -typedef struct PRManagerHelper PRManagerHelper; -DECLARE_INSTANCE_CHECKER(PRManagerHelper, PR_MANAGER_HELPER, - TYPE_PR_MANAGER_HELPER) +OBJECT_DECLARE_SIMPLE_TYPE(PRManagerHelper, PR_MANAGER_HELPER) =20 struct PRManagerHelper { /* */ diff --git a/target/i386/sev.c b/target/i386/sev.c index d976634b8f..93c4d60b82 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -31,9 +31,7 @@ #include "qom/object.h" =20 #define TYPE_SEV_GUEST "sev-guest" -typedef struct SevGuestState SevGuestState; -DECLARE_INSTANCE_CHECKER(SevGuestState, SEV_GUEST, - TYPE_SEV_GUEST) +OBJECT_DECLARE_SIMPLE_TYPE(SevGuestState, SEV_GUEST) =20 =20 /** --=20 2.26.2