From patchwork Thu Jan 19 23:35:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 136919 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 788431007D3 for ; Fri, 20 Jan 2012 10:38:34 +1100 (EST) Received: from localhost ([::1]:52438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro1Ys-00083B-J1 for incoming@patchwork.ozlabs.org; Thu, 19 Jan 2012 18:38:30 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro1YG-0007J4-R6 for qemu-devel@nongnu.org; Thu, 19 Jan 2012 18:37:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ro1YF-0004p9-4k for qemu-devel@nongnu.org; Thu, 19 Jan 2012 18:37:52 -0500 Received: from mout.web.de ([212.227.15.4]:59927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro1Y6-0004jw-MO; Thu, 19 Jan 2012 18:37:43 -0500 Received: from localhost.localdomain ([84.148.33.51]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0MfqSa-1S2Pfp1LXA-00NsVc; Fri, 20 Jan 2012 00:37:37 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 20 Jan 2012 00:35:25 +0100 Message-Id: <1327016131-5344-5-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1327016131-5344-1-git-send-email-andreas.faerber@web.de> References: <1327016131-5344-1-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Provags-ID: V02:K0:falrD7C1ti83SfSP2cicj7fcDy4GdHXvSaaFrped+Dj O+rlf0UvBY13n2XgmxywuNJMWV8yAjA359wD6Ti5nI4QLtrC13 24ZrJiWx22isXa19W74/iufoRDJ6Fe6cF8W4j0r9D+pqbEC7So FjQzj2X1Zit4ZdUJfadXbo3FnY3eu2drRBH5ZC4C6+2AxxuzmO HiYtCOhA3RN8n+j5Gd5ew== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.15.4 Cc: Anthony Liguori , "Michael S. Tsirkin" , Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-ppc@nongnu.org, Avi Kivity , Richard Henderson Subject: [Qemu-devel] [PATCH 04/10] prep_pci: Simplify I/O endianness 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 The prep PowerPC CPU is Big Endian. An explicit byte swap therefore effectively becomes Little Endian. Remove explicit byte swaps and mark as Little Endian. Signed-off-by: Andreas Färber Reviewed-by: Alexander Graf Cc: Michael S. Tsirkin --- hw/prep_pci.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/hw/prep_pci.c b/hw/prep_pci.c index 741b273..edfb25d 100644 --- a/hw/prep_pci.c +++ b/hw/prep_pci.c @@ -53,14 +53,12 @@ static void PPC_PCIIO_writeb (void *opaque, target_phys_addr_t addr, uint32_t va static void PPC_PCIIO_writew (void *opaque, target_phys_addr_t addr, uint32_t val) { PREPPCIState *s = opaque; - val = bswap16(val); pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 2); } static void PPC_PCIIO_writel (void *opaque, target_phys_addr_t addr, uint32_t val) { PREPPCIState *s = opaque; - val = bswap32(val); pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 4); } @@ -77,7 +75,6 @@ static uint32_t PPC_PCIIO_readw (void *opaque, target_phys_addr_t addr) PREPPCIState *s = opaque; uint32_t val; val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 2); - val = bswap16(val); return val; } @@ -86,7 +83,6 @@ static uint32_t PPC_PCIIO_readl (void *opaque, target_phys_addr_t addr) PREPPCIState *s = opaque; uint32_t val; val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 4); - val = bswap32(val); return val; } @@ -95,7 +91,7 @@ static const MemoryRegionOps PPC_PCIIO_ops = { .read = { PPC_PCIIO_readb, PPC_PCIIO_readw, PPC_PCIIO_readl, }, .write = { PPC_PCIIO_writeb, PPC_PCIIO_writew, PPC_PCIIO_writel, }, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static int prep_map_irq(PCIDevice *pci_dev, int irq_num)