From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmnXd-00008z-83 for qemu-devel@nongnu.org; Sun, 23 Dec 2012 10:32:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TmnXb-0007Te-D4 for qemu-devel@nongnu.org; Sun, 23 Dec 2012 10:32:41 -0500 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:44031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmnXa-0007TX-Pu for qemu-devel@nongnu.org; Sun, 23 Dec 2012 10:32:39 -0500 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 23 Dec 2012 16:32:48 +0100 Message-Id: <1356276769-7357-9-git-send-email-hpoussin@reactos.org> In-Reply-To: <1356276769-7357-1-git-send-email-hpoussin@reactos.org> References: <1356276769-7357-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC 8/8] memory: remove old_portio-style callbacks support 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?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann Signed-off-by: Herv=C3=A9 Poussineau --- memory.c | 44 -------------------------------------------- memory.h | 4 ---- 2 files changed, 48 deletions(-) diff --git a/memory.c b/memory.c index 7419853..ea3bb8a 100644 --- a/memory.c +++ b/memory.c @@ -365,21 +365,6 @@ static void access_with_adjusted_size(hwaddr addr, } } =20 -static const MemoryRegionPortio *find_portio(MemoryRegion *mr, uint64_t = offset, - unsigned width, bool write) -{ - const MemoryRegionPortio *mrp; - - for (mrp =3D mr->ops->old_portio; mrp->size; ++mrp) { - if (offset >=3D mrp->offset && offset < mrp->offset + mrp->len - && width =3D=3D mrp->size - && (write ? (bool)mrp->write : (bool)mrp->read)) { - return mrp; - } - } - return NULL; -} - static void memory_region_iorange_read(IORange *iorange, uint64_t offset, unsigned width, @@ -390,21 +375,6 @@ static void memory_region_iorange_read(IORange *iora= nge, MemoryRegion *mr =3D mrio->mr; =20 offset +=3D mrio->offset; - if (mr->ops->old_portio) { - const MemoryRegionPortio *mrp =3D find_portio(mr, offset - mrio-= >offset, - width, false); - - *data =3D ((uint64_t)1 << (width * 8)) - 1; - if (mrp) { - *data =3D mrp->read(mr->opaque, offset); - } else if (width =3D=3D 2) { - mrp =3D find_portio(mr, offset - mrio->offset, 1, false); - assert(mrp); - *data =3D mrp->read(mr->opaque, offset) | - (mrp->read(mr->opaque, offset + 1) << 8); - } - return; - } *data =3D 0; access_with_adjusted_size(offset, data, width, mr->ops->impl.min_access_size, @@ -422,20 +392,6 @@ static void memory_region_iorange_write(IORange *ior= ange, MemoryRegion *mr =3D mrio->mr; =20 offset +=3D mrio->offset; - if (mr->ops->old_portio) { - const MemoryRegionPortio *mrp =3D find_portio(mr, offset - mrio-= >offset, - width, true); - - if (mrp) { - mrp->write(mr->opaque, offset, data); - } else if (width =3D=3D 2) { - mrp =3D find_portio(mr, offset - mrio->offset, 1, true); - assert(mrp); - mrp->write(mr->opaque, offset, data & 0xff); - mrp->write(mr->opaque, offset + 1, data >> 8); - } - return; - } access_with_adjusted_size(offset, &data, width, mr->ops->impl.min_access_size, mr->ops->impl.max_access_size, diff --git a/memory.h b/memory.h index 9462bfd..bdde0d0 100644 --- a/memory.h +++ b/memory.h @@ -103,10 +103,6 @@ struct MemoryRegionOps { bool unaligned; } impl; =20 - /* If .read and .write are not present, old_portio may be used for - * backwards compatibility with old portio registration - */ - const MemoryRegionPortio *old_portio; /* If .read and .write are not present, old_mmio may be used for * backwards compatibility with old mmio registration */ --=20 1.7.10.4