From patchwork Mon Oct 8 12:23:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 190006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ABCD22C00F8 for ; Mon, 8 Oct 2012 23:24:28 +1100 (EST) Received: from localhost ([::1]:51716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLCNm-00049S-JH for incoming@patchwork.ozlabs.org; Mon, 08 Oct 2012 08:24:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLCNR-00048z-8O for qemu-devel@nongnu.org; Mon, 08 Oct 2012 08:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLCNP-0005JS-Uy for qemu-devel@nongnu.org; Mon, 08 Oct 2012 08:24:05 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52987 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLCNP-0005Iw-OO; Mon, 08 Oct 2012 08:24:03 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id DADD8A341E; Mon, 8 Oct 2012 14:24:02 +0200 (CEST) From: Alexander Graf To: qemu-devel qemu-devel Date: Mon, 8 Oct 2012 14:23:43 +0200 Message-Id: <1349699033-6703-5-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1349699033-6703-1-git-send-email-agraf@suse.de> References: <1349699033-6703-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Anthony Liguori , xen-devel@lists.xensource.com, Stefano Stabellini , "qemu-ppc@nongnu.org List" , Avi Kivity , Scott Wood , David Gibson Subject: [Qemu-devel] [PATCH 04/14] i8254: convert PIO to new memory api read/write 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 Signed-off-by: Alexander Graf --- hw/i8254.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/i8254.c b/hw/i8254.c index 77bd5e8..cea8d13 100644 --- a/hw/i8254.c +++ b/hw/i8254.c @@ -111,7 +111,8 @@ static void pit_latch_count(PITChannelState *s) } } -static void pit_ioport_write(void *opaque, uint32_t addr, uint32_t val) +static void pit_ioport_write(void *opaque, target_phys_addr_t addr, + uint64_t val, unsigned size) { PITCommonState *pit = opaque; int channel, access; @@ -178,7 +179,8 @@ static void pit_ioport_write(void *opaque, uint32_t addr, uint32_t val) } } -static uint32_t pit_ioport_read(void *opaque, uint32_t addr) +static uint64_t pit_ioport_read(void *opaque, target_phys_addr_t addr, + unsigned size) { PITCommonState *pit = opaque; int ret, count; @@ -290,14 +292,14 @@ static void pit_irq_control(void *opaque, int n, int enable) } } -static const MemoryRegionPortio pit_portio[] = { - { 0, 4, 1, .write = pit_ioport_write }, - { 0, 3, 1, .read = pit_ioport_read }, - PORTIO_END_OF_LIST() -}; - static const MemoryRegionOps pit_ioport_ops = { - .old_portio = pit_portio + .read = pit_ioport_read, + .write = pit_ioport_write, + .impl = { + .min_access_size = 1, + .max_access_size = 1, + }, + .endianness = DEVICE_LITTLE_ENDIAN, }; static void pit_post_load(PITCommonState *s)