From patchwork Sat Jun 8 17:44:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 249970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D3EFA2C02ED for ; Sun, 9 Jun 2013 03:45:04 +1000 (EST) Received: from localhost ([::1]:41956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlNCI-0002yw-W5 for incoming@patchwork.ozlabs.org; Sat, 08 Jun 2013 13:45:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlNAZ-0000Nt-Lx for qemu-devel@nongnu.org; Sat, 08 Jun 2013 13:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlNAY-0006K9-DN for qemu-devel@nongnu.org; Sat, 08 Jun 2013 13:43:15 -0400 Received: from [101.78.175.194] (port=46147 helo=ibis.ibis) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlNAX-0006IX-LL for qemu-devel@nongnu.org; Sat, 08 Jun 2013 13:43:14 -0400 Received: from [172.19.126.47] (helo=localhost.localdomain) by ibis.ibis with esmtp (Exim 4.70) (envelope-from ) id 1UlNAW-0000wp-2I; Sun, 09 Jun 2013 01:43:12 +0800 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Sun, 9 Jun 2013 01:44:02 +0800 Message-Id: <1370713446-9460-5-git-send-email-hpoussin@reactos.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370713446-9460-1-git-send-email-hpoussin@reactos.org> References: <1370713446-9460-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 101.78.175.194 Cc: Paolo Bonzini , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Subject: [Qemu-devel] [PATCH v2 4/8] memory: remove code dealing with old_portio X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Last user of old_portio callbacks has been removed in previous commit. Signed-off-by: Hervé Poussineau --- include/exec/memory.h | 4 ---- memory.c | 60 ------------------------------------------------- 2 files changed, 64 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index d53a6a1..3c225c9 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -105,10 +105,6 @@ struct MemoryRegionOps { bool unaligned; } impl; - /* 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 f27167c..8ac9e66 100644 --- a/memory.c +++ b/memory.c @@ -401,21 +401,6 @@ static void access_with_adjusted_size(hwaddr addr, } } -static const MemoryRegionPortio *find_portio(MemoryRegion *mr, uint64_t offset, - unsigned width, bool write) -{ - const MemoryRegionPortio *mrp; - - for (mrp = mr->ops->old_portio; mrp->size; ++mrp) { - if (offset >= mrp->offset && offset < mrp->offset + mrp->len - && width == 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, @@ -426,21 +411,6 @@ static void memory_region_iorange_read(IORange *iorange, MemoryRegion *mr = mrio->mr; offset += mrio->offset; - if (mr->ops->old_portio) { - const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset, - width, false); - - *data = ((uint64_t)1 << (width * 8)) - 1; - if (mrp) { - *data = mrp->read(mr->opaque, offset); - } else if (width == 2) { - mrp = find_portio(mr, offset - mrio->offset, 1, false); - assert(mrp); - *data = mrp->read(mr->opaque, offset) | - (mrp->read(mr->opaque, offset + 1) << 8); - } - return; - } *data = 0; access_with_adjusted_size(offset, data, width, mr->ops->impl.min_access_size, @@ -458,20 +428,6 @@ static void memory_region_iorange_write(IORange *iorange, MemoryRegion *mr = mrio->mr; offset += mrio->offset; - if (mr->ops->old_portio) { - const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset, - width, true); - - if (mrp) { - mrp->write(mr->opaque, offset, data); - } else if (width == 2) { - mrp = 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, @@ -933,14 +889,6 @@ static uint64_t memory_region_dispatch_read1(MemoryRegion *mr, mr->ops->impl.min_access_size, mr->ops->impl.max_access_size, memory_region_read_accessor, mr); - } else if (mr->ops->old_portio) { - MemoryRegionIORange mrio; - MemoryRegionSection mrs = memory_region_find(get_system_io(), addr, - size); - mrio.mr = mr; - mrio.offset = mrs.offset_within_region; - memory_region_iorange_read(&mrio.iorange, addr - mrio.offset, size, - &data); } else { access_with_adjusted_size(addr, &data, size, 1, 4, memory_region_oldmmio_read_accessor, mr); @@ -1002,14 +950,6 @@ static bool memory_region_dispatch_write(MemoryRegion *mr, mr->ops->impl.min_access_size, mr->ops->impl.max_access_size, memory_region_write_accessor, mr); - } else if (mr->ops->old_portio) { - MemoryRegionIORange mrio; - MemoryRegionSection mrs = memory_region_find(get_system_io(), addr, - size); - mrio.mr = mr; - mrio.offset = mrs.offset_within_region; - memory_region_iorange_write(&mrio.iorange, addr - mrio.offset, size, - data); } else { access_with_adjusted_size(addr, &data, size, 1, 4, memory_region_oldmmio_write_accessor, mr);