From patchwork Thu Nov 24 15:57:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 127548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 15006B7134 for ; Fri, 25 Nov 2011 02:57:41 +1100 (EST) Received: from localhost ([::1]:37722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTbg8-0000Eo-G5 for incoming@patchwork.ozlabs.org; Thu, 24 Nov 2011 10:57:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]:49176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTbfr-0008RW-DX for qemu-devel@nongnu.org; Thu, 24 Nov 2011 10:57:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTbfo-0007Oz-Ol for qemu-devel@nongnu.org; Thu, 24 Nov 2011 10:57:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTbfo-0007Oe-FP for qemu-devel@nongnu.org; Thu, 24 Nov 2011 10:57:16 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAOFvFns013694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Nov 2011 10:57:15 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAOFvE9m009348 for ; Thu, 24 Nov 2011 10:57:14 -0500 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id A93D1250B9A; Thu, 24 Nov 2011 17:57:09 +0200 (IST) From: Avi Kivity To: qemu-devel@nongnu.org Date: Thu, 24 Nov 2011 17:57:01 +0200 Message-Id: <1322150222-12869-3-git-send-email-avi@redhat.com> In-Reply-To: <1322150222-12869-1-git-send-email-avi@redhat.com> References: <1322150222-12869-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] omap: eliminate l4_register_io_memory 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 This is a trivial wrapper around cpu_register_io_memory(), adding no value. Inline it into all callers. Signed-off-by: Avi Kivity --- hw/omap.h | 2 -- hw/omap2.c | 12 ++++++------ hw/omap_dss.c | 16 ++++++++-------- hw/omap_gptimer.c | 4 ++-- hw/omap_i2c.c | 4 ++-- hw/omap_l4.c | 12 ++---------- hw/omap_mmc.c | 4 ++-- hw/omap_spi.c | 4 ++-- hw/omap_synctimer.c | 5 +++-- hw/omap_tap.c | 5 +++-- 10 files changed, 30 insertions(+), 38 deletions(-) diff --git a/hw/omap.h b/hw/omap.h index 8bd1810..d12f402 100644 --- a/hw/omap.h +++ b/hw/omap.h @@ -96,8 +96,6 @@ target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region, int iotype); target_phys_addr_t omap_l4_region_base(struct omap_target_agent_s *ta, int region); -int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read, - CPUWriteMemoryFunc * const *mem_write, void *opaque); /* OMAP2 SDRAM controller */ struct omap_sdrc_s; diff --git a/hw/omap2.c b/hw/omap2.c index e299884..8a0fa73 100644 --- a/hw/omap2.c +++ b/hw/omap2.c @@ -784,8 +784,8 @@ static void omap_sti_fifo_write(void *opaque, target_phys_addr_t addr, s->chr = chr ?: qemu_chr_new("null", "null", NULL); - iomemtype = l4_register_io_memory(omap_sti_readfn, - omap_sti_writefn, s); + iomemtype = cpu_register_io_memory(omap_sti_readfn, + omap_sti_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); iomemtype = cpu_register_io_memory(omap_sti_fifo_readfn, @@ -1798,8 +1798,8 @@ static void omap_prcm_coldreset(struct omap_prcm_s *s) s->mpu = mpu; omap_prcm_coldreset(s); - iomemtype = l4_register_io_memory(omap_prcm_readfn, - omap_prcm_writefn, s); + iomemtype = cpu_register_io_memory(omap_prcm_readfn, + omap_prcm_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); omap_l4_attach(ta, 1, iomemtype); @@ -2168,8 +2168,8 @@ static void omap_sysctl_reset(struct omap_sysctl_s *s) s->mpu = mpu; omap_sysctl_reset(s); - iomemtype = l4_register_io_memory(omap_sysctl_readfn, - omap_sysctl_writefn, s); + iomemtype = cpu_register_io_memory(omap_sysctl_readfn, + omap_sysctl_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); return s; diff --git a/hw/omap_dss.c b/hw/omap_dss.c index b4a8b4c..b138c23 100644 --- a/hw/omap_dss.c +++ b/hw/omap_dss.c @@ -1037,14 +1037,14 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta, s->drq = drq; omap_dss_reset(s); - iomemtype[0] = l4_register_io_memory(omap_diss1_readfn, - omap_diss1_writefn, s); - iomemtype[1] = l4_register_io_memory(omap_disc1_readfn, - omap_disc1_writefn, s); - iomemtype[2] = l4_register_io_memory(omap_rfbi1_readfn, - omap_rfbi1_writefn, s); - iomemtype[3] = l4_register_io_memory(omap_venc1_readfn, - omap_venc1_writefn, s); + iomemtype[0] = cpu_register_io_memory(omap_diss1_readfn, + omap_diss1_writefn, s, DEVICE_NATIVE_ENDIAN); + iomemtype[1] = cpu_register_io_memory(omap_disc1_readfn, + omap_disc1_writefn, s, DEVICE_NATIVE_ENDIAN); + iomemtype[2] = cpu_register_io_memory(omap_rfbi1_readfn, + omap_rfbi1_writefn, s, DEVICE_NATIVE_ENDIAN); + iomemtype[3] = cpu_register_io_memory(omap_venc1_readfn, + omap_venc1_writefn, s, DEVICE_NATIVE_ENDIAN); iomemtype[4] = cpu_register_io_memory(omap_im3_readfn, omap_im3_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype[0]); diff --git a/hw/omap_gptimer.c b/hw/omap_gptimer.c index 704b000..c1cbdf8 100644 --- a/hw/omap_gptimer.c +++ b/hw/omap_gptimer.c @@ -476,8 +476,8 @@ struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta, omap_gp_timer_reset(s); omap_gp_timer_clk_setup(s); - iomemtype = l4_register_io_memory(omap_gp_timer_readfn, - omap_gp_timer_writefn, s); + iomemtype = cpu_register_io_memory(omap_gp_timer_readfn, + omap_gp_timer_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); return s; diff --git a/hw/omap_i2c.c b/hw/omap_i2c.c index 11577b1..52c38ba 100644 --- a/hw/omap_i2c.c +++ b/hw/omap_i2c.c @@ -457,8 +457,8 @@ struct omap_i2c_s *omap2_i2c_init(struct omap_target_agent_s *ta, s->bus = i2c_init_bus(NULL, "i2c"); omap_i2c_reset(s); - iomemtype = l4_register_io_memory(omap_i2c_readfn, - omap_i2c_writefn, s); + iomemtype = cpu_register_io_memory(omap_i2c_readfn, + omap_i2c_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); return s; diff --git a/hw/omap_l4.c b/hw/omap_l4.c index ebec874..a19ea70 100644 --- a/hw/omap_l4.c +++ b/hw/omap_l4.c @@ -20,14 +20,6 @@ #include "hw.h" #include "omap.h" -int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read, - CPUWriteMemoryFunc * const *mem_write, - void *opaque) -{ - return cpu_register_io_memory(mem_read, mem_write, opaque, - DEVICE_NATIVE_ENDIAN); -} - struct omap_l4_s { target_phys_addr_t base; int ta_num; @@ -132,8 +124,8 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, ta->status = 0x00000000; ta->control = 0x00000200; /* XXX 01000200 for L4TAO */ - iomemtype = l4_register_io_memory(omap_l4ta_readfn, - omap_l4ta_writefn, ta); + iomemtype = cpu_register_io_memory(omap_l4ta_readfn, + omap_l4ta_writefn, ta, DEVICE_NATIVE_ENDIAN); ta->base = omap_l4_attach(ta, info->ta_region, iomemtype); return ta; diff --git a/hw/omap_mmc.c b/hw/omap_mmc.c index a1afeb5..b42cf90 100644 --- a/hw/omap_mmc.c +++ b/hw/omap_mmc.c @@ -612,8 +612,8 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, omap_mmc_reset(s); - iomemtype = l4_register_io_memory(omap_mmc_readfn, - omap_mmc_writefn, s); + iomemtype = cpu_register_io_memory(omap_mmc_readfn, + omap_mmc_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); /* Instantiate the storage */ diff --git a/hw/omap_spi.c b/hw/omap_spi.c index 6030ad9..c20f425 100644 --- a/hw/omap_spi.c +++ b/hw/omap_spi.c @@ -327,8 +327,8 @@ struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum, } omap_mcspi_reset(s); - iomemtype = l4_register_io_memory(omap_mcspi_readfn, - omap_mcspi_writefn, s); + iomemtype = cpu_register_io_memory(omap_mcspi_readfn, + omap_mcspi_writefn, s, DEVICE_NATIVE_ENDIAN); omap_l4_attach(ta, 0, iomemtype); return s; diff --git a/hw/omap_synctimer.c b/hw/omap_synctimer.c index b47ca88..ece5388 100644 --- a/hw/omap_synctimer.c +++ b/hw/omap_synctimer.c @@ -89,8 +89,9 @@ struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta, struct omap_synctimer_s *s = g_malloc0(sizeof(*s)); omap_synctimer_reset(s); - omap_l4_attach(ta, 0, l4_register_io_memory( - omap_synctimer_readfn, omap_synctimer_writefn, s)); + omap_l4_attach(ta, 0, cpu_register_io_memory( + omap_synctimer_readfn, omap_synctimer_writefn, s, + DEVICE_NATIVE_ENDIAN)); return s; } diff --git a/hw/omap_tap.c b/hw/omap_tap.c index 1f18ddd..e685288 100644 --- a/hw/omap_tap.c +++ b/hw/omap_tap.c @@ -107,6 +107,7 @@ static void omap_tap_write(void *opaque, target_phys_addr_t addr, void omap_tap_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu) { - omap_l4_attach(ta, 0, l4_register_io_memory( - omap_tap_readfn, omap_tap_writefn, mpu)); + omap_l4_attach(ta, 0, cpu_register_io_memory( + omap_tap_readfn, omap_tap_writefn, mpu, + DEVICE_NATIVE_ENDIAN)); }