Received: from eggs.gnu.org ([140.186.70.92]:38085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUglW-0001Pl-ND for qemu-devel@nongnu.org; Thu, 09 Jun 2011 11:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUglU-0005sG-4i for qemu-devel@nongnu.org; Thu, 09 Jun 2011 11:03:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUglT-0005s1-QV for qemu-devel@nongnu.org; Thu, 09 Jun 2011 11:03:20 -0400 From: Markus Armbruster References: <4DEF2F25.5070104@redhat.com> <1307559319-16183-1-git-send-email-andreas.faerber@web.de> <1307559319-16183-2-git-send-email-andreas.faerber@web.de> <1307559319-16183-3-git-send-email-andreas.faerber@web.de> <1307559319-16183-4-git-send-email-andreas.faerber@web.de> <1307559319-16183-5-git-send-email-andreas.faerber@web.de> Date: Thu, 09 Jun 2011 17:03:09 +0200 In-Reply-To: <1307559319-16183-5-git-send-email-andreas.faerber@web.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22's?= message of "Wed, 8 Jun 2011 20:55:11 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC v4 04/12] isa: Allow to un-assign I/O ports List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: hpoussin@reactos.org, qemu-devel@nongnu.org, kraxel@redhat.com Andreas F=C3=A4rber writes: > Signed-off-by: Andreas F=C3=A4rber > --- > hw/isa-bus.c | 14 ++++++++++++++ > hw/isa.h | 1 + > 2 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/hw/isa-bus.c b/hw/isa-bus.c > index d258932..1f64673 100644 > --- a/hw/isa-bus.c > +++ b/hw/isa-bus.c > @@ -105,6 +105,20 @@ void isa_init_ioport(ISADevice *dev, uint16_t ioport) > isa_init_ioport_range(dev, ioport, 1); > } >=20=20 > +void isa_discard_ioport_range(ISADevice *dev, uint16_t start, uint16_t l= ength) > +{ > + int i, j; > + for (i =3D 0; i < dev->nioports; i++) { > + if (dev->ioports[i] =3D=3D start) { > + for (j =3D 0; j < dev->nioports - i; j++) { > + dev->ioports[i + j] =3D dev->ioports[i + length + j]; > + } > + dev->nioports -=3D length; > + break; > + } > + } > +} > + "discard"? It's the opposite of isa_init_ioport_range(), name should make that obvious. "uninit"? Note: this only affects the I/O-port bookkeeping within ISADevice, not the actual I/O port handler registration. Any use must be accompanied by a matching handler de-registration. Just like any use of isa_init_ioport_range() must be accompanied by matching register_ioport_FOO()s. You can thank Gleb for this mess. [...]