[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/25] arm: explicitly mark device loads as little-en
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 02/25] arm: explicitly mark device loads as little-endian |
Date: |
Thu, 17 Dec 2015 11:49:57 +0000 |
From: Paolo Bonzini <address@hidden>
Behaviour of emulated devices should not depend on the endianness
of the CPU, so avoid using the endian-dependent load and store
functions in the PXA2xx and OMAP display devices. These devices
are little endian when they do DMA access.
(Since ARM softmmu is always compiled as little endian, this means
that the endian-dependent load and store functions are always little
endian, so this commit makes no functionally visible change.)
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
[PMM: rewrote commit message]
Signed-off-by: Peter Maydell <address@hidden>
---
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.9.1
- [Qemu-devel] [PULL 07/25] acpi: extend aml_interrupt() to support multiple irqs, (continued)
- [Qemu-devel] [PULL 07/25] acpi: extend aml_interrupt() to support multiple irqs, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 12/25] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 08/25] ARM: Virt: Add a GPIO controller, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 03/25] arm: soc-dma: use hwaddr instead of target_ulong in printf, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 01/25] i.MX: add support for lower and upper interrupt in GPIO., Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 04/25] target-arm: raise exception on misaligned LDREX operands, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 09/25] ARM: ACPI: Add GPIO controller in ACPI DSDT table, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 13/25] ARM: ACPI: Add _E03 for Power Button, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 11/25] ACPI: Add GPIO Connection Descriptor, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 06/25] acpi: support serialized method, Peter Maydell, 2015/12/17
- [Qemu-devel] [PULL 02/25] arm: explicitly mark device loads as little-endian,
Peter Maydell <=
- Re: [Qemu-devel] [PULL 00/25] target-arm queue, Peter Maydell, 2015/12/17