From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrEqW-0000dT-5u for qemu-devel@nongnu.org; Fri, 04 Jan 2013 16:30:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrEqU-0005az-Uz for qemu-devel@nongnu.org; Fri, 04 Jan 2013 16:30:32 -0500 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:35241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrEqU-0005aY-Be for qemu-devel@nongnu.org; Fri, 04 Jan 2013 16:30:30 -0500 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 4 Jan 2013 22:29:45 +0100 Message-Id: <1357334986-13941-11-git-send-email-hpoussin@reactos.org> In-Reply-To: <1357334986-13941-1-git-send-email-hpoussin@reactos.org> References: <1357334986-13941-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] [PATCH 10/10] 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?= Signed-off-by: Herv=C3=A9 Poussineau --- include/exec/memory.h | 4 ---- memory.c | 44 -------------------------------------------= - 2 files changed, 48 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 2322732..4a757f0 100644 --- a/include/exec/memory.h +++ b/include/exec/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 */ diff --git a/memory.c b/memory.c index 410c5f8..e56ca3c 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, --=20 1.7.10.4