From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwGVF-0004uO-FC for qemu-devel@nongnu.org; Sun, 06 Mar 2011 11:08:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwGVA-00037r-Ok for qemu-devel@nongnu.org; Sun, 06 Mar 2011 11:08:17 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:53737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwGVA-00036a-7c for qemu-devel@nongnu.org; Sun, 06 Mar 2011 11:08:12 -0500 Message-ID: <4D73B169.2030008@web.de> Date: Sun, 06 Mar 2011 17:08:09 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4D73A3CC.3080901@web.de> <4D73AAB6.8000407@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8F14DD255A9CA39A03C7C2AC" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 4/4] i8254: convert to qdev List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8F14DD255A9CA39A03C7C2AC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-03-06 17:06, Blue Swirl wrote: > On Sun, Mar 6, 2011 at 5:39 PM, Jan Kiszka wrote: >> On 2011-03-06 16:35, Blue Swirl wrote: >>> On Sun, Mar 6, 2011 at 5:10 PM, Jan Kiszka wrote:= >>>> On 2011-02-13 22:10, Blue Swirl wrote: >>>>> Convert to qdev. Don't expose PITState. >>>>> >>>> >>>> ... >>>> >>>>> diff --git a/hw/pc.h b/hw/pc.h >>>>> index 60f8c42..feb8a7a 100644 >>>>> --- a/hw/pc.h >>>>> +++ b/hw/pc.h >>>>> @@ -82,14 +82,23 @@ void isa_irq_handler(void *opaque, int n, int l= evel); >>>>> >>>>> #define PIT_FREQ 1193182 >>>>> >>>>> -typedef struct PITState PITState; >>>>> +static inline ISADevice *pit_init(int base, int irq) >>>>> +{ >>>>> + ISADevice *dev; >>>>> + >>>>> + dev =3D isa_create("isa-pit"); >>>>> + qdev_prop_set_uint32(&dev->qdev, "iobase", base); >>>>> + qdev_prop_set_uint32(&dev->qdev, "irq", irq); >>>>> + qdev_init_nofail(&dev->qdev); >>>>> + >>>>> + return dev; >>>>> +} >>>> >>>> This should be moved to i8254.c. We cannot compile the PIT out, and = the >>>> above contains no board information. So I see no reason for this inl= ining. >>> >>> I see no reason for moving this back. In fact, if this was only used >>> by PC, it could be moved to pc.c. >> >> To my understanding, it's a factory helper for the PIT, avoiding >> boilerplate code at the creator site. And if we get >1 users, this >> cleanup would definitely pay off. >=20 > It should be possible to leave PIT out, with small changes to pcspk > (which obviously has a hard dependency to PIT) and HPET. Then this > makes even more sense. A PC without a PIT makes _no_ sense. Jan --------------enig8F14DD255A9CA39A03C7C2AC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk1zsWkACgkQitSsb3rl5xTDXwCfRvZ+A6mXsD8f+PTokplg3O+0 c7sAn2YXXDfu6tpEePOcYmk1gcMS3p3X =OhaI -----END PGP SIGNATURE----- --------------enig8F14DD255A9CA39A03C7C2AC--