From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH] arm: explicitly mark loads as little-endian
Date: Fri, 4 Dec 2015 13:28:51 +0100 [thread overview]
Message-ID: <1449232131-17317-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1449232131-17317-1-git-send-email-pbonzini@redhat.com>
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 <pbonzini@redhat.com>
---
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
next prev parent reply other threads:[~2015-12-04 12:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 12:28 [Qemu-devel] [PATCH] arm: soc-dma: use hwaddr instead of target_ulong in printf Paolo Bonzini
2015-12-04 12:28 ` Paolo Bonzini [this message]
2015-12-04 12:51 ` [Qemu-devel] [PATCH] arm: explicitly mark loads as little-endian Peter Maydell
2015-12-15 11:24 ` Peter Maydell
2015-12-04 12:33 ` [Qemu-devel] [PATCH] arm: soc-dma: use hwaddr instead of target_ulong in printf Peter Maydell
2015-12-04 12:36 ` Paolo Bonzini
2015-12-04 13:09 ` Peter Maydell
2015-12-04 16:39 ` Paolo Bonzini
2015-12-04 16:52 ` Peter Maydell
2015-12-15 11:28 ` Peter Maydell
2015-12-15 11:32 ` Paolo Bonzini
2015-12-04 12:55 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449232131-17317-2-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).