From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcmKU-0007ML-GH for qemu-devel@nongnu.org; Sun, 25 Nov 2012 19:13:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcmKS-0000GD-Mi for qemu-devel@nongnu.org; Sun, 25 Nov 2012 19:13:42 -0500 Received: from cantor2.suse.de ([195.135.220.15]:46218 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcmKS-0000Fx-GC for qemu-devel@nongnu.org; Sun, 25 Nov 2012 19:13:40 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 26 Nov 2012 01:12:20 +0100 Message-Id: <1353888766-6951-9-git-send-email-afaerber@suse.de> In-Reply-To: <1353888766-6951-1-git-send-email-afaerber@suse.de> References: <1353888766-6951-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC 08/34] debugcon: QOM'ify ISA debug console List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas F=C3=A4rber --- hw/debugcon.c | 13 +++++++++---- 1 Datei ge=C3=A4ndert, 9 Zeilen hinzugef=C3=BCgt(+), 4 Zeilen entfernt(-= ) diff --git a/hw/debugcon.c b/hw/debugcon.c index 14ab326..02846ed 100644 --- a/hw/debugcon.c +++ b/hw/debugcon.c @@ -36,8 +36,13 @@ typedef struct DebugconState { uint32_t readback; } DebugconState; =20 +#define TYPE_ISA_DEBUG_CONSOLE "isa-debugcon" +#define ISA_DEBUG_CONSOLE(obj) \ + OBJECT_CHECK(ISADebugconState, (obj), TYPE_ISA_DEBUG_CONSOLE) + typedef struct ISADebugconState { - ISADevice dev; + ISADevice parent_obj; + uint32_t iobase; DebugconState state; } ISADebugconState; @@ -78,7 +83,7 @@ static void debugcon_init_core(DebugconState *s) =20 static int debugcon_isa_initfn(ISADevice *dev) { - ISADebugconState *isa =3D DO_UPCAST(ISADebugconState, dev, dev); + ISADebugconState *isa =3D ISA_DEBUG_CONSOLE(dev); DebugconState *s =3D &isa->state; =20 debugcon_init_core(s); @@ -102,8 +107,8 @@ static void debugcon_isa_class_initfn(ObjectClass *kl= ass, void *data) dc->props =3D debugcon_isa_properties; } =20 -static TypeInfo debugcon_isa_info =3D { - .name =3D "isa-debugcon", +static const TypeInfo debugcon_isa_info =3D { + .name =3D TYPE_ISA_DEBUG_CONSOLE, .parent =3D TYPE_ISA_DEVICE, .instance_size =3D sizeof(ISADebugconState), .class_init =3D debugcon_isa_class_initfn, --=20 1.7.10.4