From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1GaB-0005w1-AZ for qemu-devel@nongnu.org; Mon, 22 Jul 2013 09:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1Ga6-0005xT-DD for qemu-devel@nongnu.org; Mon, 22 Jul 2013 09:55:23 -0400 Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:64719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Ga6-0005xN-85 for qemu-devel@nongnu.org; Mon, 22 Jul 2013 09:55:18 -0400 Received: by mail-ee0-f42.google.com with SMTP id c4so3933006eek.1 for ; Mon, 22 Jul 2013 06:55:17 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 22 Jul 2013 15:54:22 +0200 Message-Id: <1374501278-31549-13-git-send-email-pbonzini@redhat.com> In-Reply-To: <1374501278-31549-1-git-send-email-pbonzini@redhat.com> References: <1374501278-31549-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 12/28] sparc64: remove indirection for I/O port access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, aik@ozlabs.ru, agraf@suse.de, hpoussin@reactos.org, jan.kiszka@siemens.com, aurelien@aurel32.net This fixes endianness bugs in I/O port access. Signed-off-by: Paolo Bonzini --- hw/pci-host/apb.c | 54 ++---------------------------------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c index 06ace08..208ac85 100644 --- a/hw/pci-host/apb.c +++ b/hw/pci-host/apb.c @@ -302,56 +302,6 @@ static uint64_t apb_pci_config_read(void *opaque, hwaddr addr, return ret; } -static void pci_apb_iowriteb (void *opaque, hwaddr addr, - uint32_t val) -{ - cpu_outb(addr & IOPORTS_MASK, val); -} - -static void pci_apb_iowritew (void *opaque, hwaddr addr, - uint32_t val) -{ - cpu_outw(addr & IOPORTS_MASK, bswap16(val)); -} - -static void pci_apb_iowritel (void *opaque, hwaddr addr, - uint32_t val) -{ - cpu_outl(addr & IOPORTS_MASK, bswap32(val)); -} - -static uint32_t pci_apb_ioreadb (void *opaque, hwaddr addr) -{ - uint32_t val; - - val = cpu_inb(addr & IOPORTS_MASK); - return val; -} - -static uint32_t pci_apb_ioreadw (void *opaque, hwaddr addr) -{ - uint32_t val; - - val = bswap16(cpu_inw(addr & IOPORTS_MASK)); - return val; -} - -static uint32_t pci_apb_ioreadl (void *opaque, hwaddr addr) -{ - uint32_t val; - - val = bswap32(cpu_inl(addr & IOPORTS_MASK)); - return val; -} - -static const MemoryRegionOps pci_ioport_ops = { - .old_mmio = { - .read = { pci_apb_ioreadb, pci_apb_ioreadw, pci_apb_ioreadl }, - .write = { pci_apb_iowriteb, pci_apb_iowritew, pci_apb_iowritel, }, - }, - .endianness = DEVICE_NATIVE_ENDIAN, -}; - /* The APB host has an IRQ line for each IRQ line of each slot. */ static int pci_apb_map_irq(PCIDevice *pci_dev, int irq_num) { @@ -536,8 +486,8 @@ static int pci_pbm_init_device(SysBusDevice *dev) sysbus_init_mmio(dev, &s->pci_config); /* pci_ioport */ - memory_region_init_io(&s->pci_ioport, OBJECT(s), &pci_ioport_ops, s, - "apb-pci-ioport", 0x10000); + memory_region_init_alias(&s->pci_ioport, OBJECT(s), "apb-pci-ioport", + get_system_io(), 0, 0x10000); /* at region 2 */ sysbus_init_mmio(dev, &s->pci_ioport); -- 1.8.1.4