From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4pU0-0003Az-JK for qemu-devel@nongnu.org; Fri, 04 Dec 2015 07:29:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4pTx-00031w-6p for qemu-devel@nongnu.org; Fri, 04 Dec 2015 07:29:04 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:37991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4pTx-00031s-0u for qemu-devel@nongnu.org; Fri, 04 Dec 2015 07:29:01 -0500 Received: by wmec201 with SMTP id c201so63130574wme.1 for ; Fri, 04 Dec 2015 04:29:00 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 4 Dec 2015 13:28:51 +0100 Message-Id: <1449232131-17317-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1449232131-17317-1-git-send-email-pbonzini@redhat.com> References: <1449232131-17317-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] arm: explicitly mark loads as little-endian List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org ARM softmmu is always compiled as little endian; BE8/BE32 can be done as part of CPU emulation. Thus, devices need not use the endian-dependent loads and swaps. Signed-off-by: Paolo Bonzini --- hw/display/omap_lcd_template.h | 4 ++-- hw/display/pxa2xx_lcd.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/display/omap_lcd_template.h b/hw/display/omap_lcd_template.h index e5dd447..f0ce71f 100644 --- a/hw/display/omap_lcd_template.h +++ b/hw/display/omap_lcd_template.h @@ -136,7 +136,7 @@ static void glue(draw_line12_, DEPTH)(void *opaque, uint8_t r, g, b; do { - v = lduw_p((void *) s); + v = lduw_le_p((void *) s); r = (v >> 4) & 0xf0; g = v & 0xf0; b = (v << 4) & 0xf0; @@ -159,7 +159,7 @@ static void glue(draw_line16_, DEPTH)(void *opaque, uint8_t r, g, b; do { - v = lduw_p((void *) s); + v = lduw_le_p((void *) s); r = (v >> 8) & 0xf8; g = (v >> 3) & 0xfc; b = (v << 3) & 0xf8; diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index 494700d..4d36c94 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -309,10 +309,10 @@ static void pxa2xx_descriptor_load(PXA2xxLCDState *s) } cpu_physical_memory_read(descptr, &desc, sizeof(desc)); - s->dma_ch[i].descriptor = tswap32(desc.fdaddr); - s->dma_ch[i].source = tswap32(desc.fsaddr); - s->dma_ch[i].id = tswap32(desc.fidr); - s->dma_ch[i].command = tswap32(desc.ldcmd); + s->dma_ch[i].descriptor = le32_to_cpu(desc.fdaddr); + s->dma_ch[i].source = le32_to_cpu(desc.fsaddr); + s->dma_ch[i].id = le32_to_cpu(desc.fidr); + s->dma_ch[i].command = le32_to_cpu(desc.ldcmd); } } -- 1.8.3.1