Declare device little or big endian
Subsystems (8)
cover Declare device little or big endian
This series is an attempt to re-declare devices with DEVICE_NATIVE_ENDIAN as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN.
This clean up was split out from an earlier series which collapsed byte swaps along the I/O path.
Quoted 11 lines · Paolo Bonzini
Quoted 7 lines · On 07/08/19 10:31, tony.nguyen@bt wrote:
Device realizing code with MemorRegionOps endianness as
DEVICE_NATIVE_ENDIANis not common code.Corrected devices were identified by making the declaration of
DEVICE_NATIVE_ENDIANconditional uponNEED_CPU_Hand then listing what failed to compile.The general approach makes sense. However, most of these should not be
DEVICE_NATIVE_ENDIAN. I can help with some of them.
Quoted 4 lines · Peter Maydell
OTOH it's worth noting that it's quite likely that most of the implementations of these
DEVICE_NATIVE_ENDIANdevices picked it in an equally naive way, by just copying some other device's code...
Approach this in two steps.
1. Naively. For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
2. Manually. Inspect with heuristics (thanks Paolo):
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
Likely still not %100 correct, but I think more than before.
Since RFC:
- Applied Paolo's heuristics
Tony Nguyen (19):
hw/audio: Declare device little or big endian hw/block: Declare device little or big endian hw/char: Declare device little or big endian hw/core: Declare device little or big endian hw/display: Declare device little or big endian hw/dma: Declare device little or big endian hw/gpio: Declare device little or big endian hw/i2c: Declare device little or big endian hw/input: Declare device little or big endian hw/intc: Declare device little or big endian hw/ipack: Declare device little or big endian hw/isa: Declare device little or big endian hw/misc: Declare device little or big endian hw/net: Declare device little or big endian hw/pci-host: Declare device little or big endian hw/sd: Declare device little or big endian hw/ssi: Declare device little or big endian hw/timer: Declare device little or big endian
build: Correct non-common common-obj-* to obj-*
hw/audio/cs4231.c | 2 +- hw/audio/intel-hda.c | 2 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/milkymist-ac97.c | 2 +- hw/audio/pl041.c | 2 +- hw/block/Makefile.objs | 4 ++-- hw/block/fdc.c | 4 ++-- hw/block/onenand.c | 2 +- hw/char/Makefile.objs | 4 ++-- hw/char/cadence_uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/pl011.c | 2 +- hw/core/empty_slot.c | 2 +- hw/display/Makefile.objs | 2 +- hw/display/exynos4210_fimd.c | 2 +- hw/display/jazz_led.c | 2 +- hw/display/pl110.c | 2 +- hw/display/tc6393xb.c | 2 +- hw/dma/Makefile.objs | 4 ++-- hw/dma/bcm2835_dma.c | 4 ++-- hw/dma/etraxfs_dma.c | 14 +++++++------- hw/dma/i8257.c | 4 ++-- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/puv3_dma.c | 2 +- hw/dma/sparc32_dma.c | 2 +- hw/gpio/pl061.c | 2 +- hw/gpio/puv3_gpio.c | 2 +- hw/gpio/zaurus.c | 2 +- hw/i2c/exynos4210_i2c.c | 2 +- hw/i2c/imx_i2c.c | 2 +- hw/i2c/mpc_i2c.c | 2 +- hw/i2c/versatile_i2c.c | 2 +- hw/input/Makefile.objs | 2 +- hw/input/pl050.c | 2 +- hw/intc/Makefile.objs | 2 +- hw/intc/arm_gic.c | 12 ++++++------ hw/intc/arm_gicv3.c | 4 ++-- hw/intc/arm_gicv3_its_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/imx_avic.c | 2 +- hw/intc/imx_gpcv2.c | 2 +- hw/intc/pl190.c | 2 +- hw/intc/puv3_intc.c | 2 +- hw/intc/slavio_intctl.c | 4 ++-- hw/ipack/tpci200.c | 10 +++++----- hw/isa/vt82c686.c | 2 +- hw/misc/a9scu.c | 2 +- hw/misc/applesmc.c | 6 +++--- hw/misc/arm11scu.c | 2 +- hw/misc/arm_integrator_debug.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/edu.c | 2 +- hw/misc/mos6522.c | 2 +- hw/misc/puv3_pm.c | 2 +- hw/misc/unimp.c | 2 +- hw/net/Makefile.objs | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 4 ++-- hw/net/lance.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/stellaris_enet.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 4 ++-- hw/scsi/Makefile.objs | 2 +- hw/sd/pl181.c | 2 +- hw/ssi/Makefile.objs | 2 +- hw/ssi/mss-spi.c | 2 +- hw/ssi/pl022.c | 2 +- hw/ssi/stm32f2xx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- hw/timer/Makefile.objs | 2 +- hw/timer/a9gtimer.c | 4 ++-- hw/timer/arm_mptimer.c | 4 ++-- hw/timer/arm_timer.c | 4 ++-- hw/timer/armv7m_systick.c | 2 +- hw/timer/aspeed_rtc.c | 2 +- hw/timer/cadence_ttc.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/imx_epit.c | 2 +- hw/timer/imx_gpt.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/mss-timer.c | 2 +- hw/timer/pl031.c | 2 +- hw/timer/puv3_ost.c | 2 +- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/sun4v-rtc.c | 2 +- hw/virtio/Makefile.objs | 2 +- 98 files changed, 128 insertions(+), 128 deletions(-)
Signature · 1 line
2.23.0
PATCH 1/19 hw/audio: Declare device little or big endian
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/audio/cs4231.c | 2 +- hw/audio/intel-hda.c | 2 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/milkymist-ac97.c | 2 +- hw/audio/pl041.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
hw/audio/cs4231.c +1 -1
@@ -133,7 +133,7 @@ static void cs_mem_write(void *opaque, hwaddr addr,static const MemoryRegionOps cs_mem_ops = { .read = cs_mem_read, .write = cs_mem_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_cs4231 = {
hw/audio/intel-hda.c +1 -1
@@ -1069,7 +1069,7 @@ static const MemoryRegionOps intel_hda_mmio_ops = { .min_access_size = 1, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };/* --------------------------------------------------------------------- */
hw/audio/marvell_88w8618.c +1 -1
@@ -242,7 +242,7 @@ static void mv88w8618_audio_reset(DeviceState *d)static const MemoryRegionOps mv88w8618_audio_ops = { .read = mv88w8618_audio_read, .write = mv88w8618_audio_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void mv88w8618_audio_init (Object *obj)
hw/audio/milkymist-ac97.c +1 -1
@@ -177,7 +177,7 @@ static const MemoryRegionOps ac97_mmio_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void ac97_in_cb (void *opaque,int avail_b)
hw/audio/pl041.c +1 -1
@@ -522,7 +522,7 @@ static void pl041_device_reset(DeviceState *d)static const MemoryRegionOps pl041_ops = { .read = pl041_read, .write = pl041_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl041_init (Object *obj)
Signature · 1 line
2.23.0
PATCH 2/19 hw/block: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if ununsed, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-delcare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/block/fdc.c | 4 ++-- hw/block/onenand.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
hw/block/fdc.c +2 -2
@@ -984,13 +984,13 @@ static void fdctrl_write_mem (void *opaque, hwaddr reg,static const MemoryRegionOps fdctrl_mem_ops = { .read = fdctrl_read_mem, .write = fdctrl_write_mem, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , };static const MemoryRegionOps fdctrl_mem_strict_ops = { .read = fdctrl_read_mem, .write = fdctrl_write_mem, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =1 ,
hw/block/onenand.c +1 -1
@@ -771,7 +771,7 @@ static void onenand_write(void *opaque, hwaddr addr,static const MemoryRegionOps onenand_ops = { .read = onenand_read, .write = onenand_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void onenand_realize (DeviceState *dev,Error **errp)
Signature · 1 line
2.23.0
PATCH 3/19 hw/char: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/char/cadence_uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/pl011.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
hw/char/cadence_uart.c +1 -1
@@ -459,7 +459,7 @@ static uint64_t uart_read(void *opaque, hwaddr offset,static const MemoryRegionOps uart_ops = { .read = uart_read, .write = uart_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void cadence_uart_reset (DeviceState *dev)
hw/char/escc.c +1 -1
@@ -576,7 +576,7 @@ static uint64_t escc_mem_read(void *opaque, hwaddr addr,static const MemoryRegionOps escc_mem_ops = { .read = escc_mem_read, .write = escc_mem_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =1 ,
hw/char/etraxfs_ser.c +1 -1
@@ -157,7 +157,7 @@ ser_write(void *opaque, hwaddr addr,static const MemoryRegionOps ser_ops = { .read = ser_read, .write = ser_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4
hw/char/grlib_apbuart.c +1 -1
@@ -239,7 +239,7 @@ static void grlib_apbuart_write(void *opaque, hwaddr addr,static const MemoryRegionOps grlib_apbuart_ops = { .write = grlib_apbuart_write, .read = grlib_apbuart_read, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , };static void grlib_apbuart_realize (DeviceState *dev,Error **errp)
hw/char/imx_serial.c +1 -1
@@ -334,7 +334,7 @@ static void imx_event(void *opaque, int event)static const struct MemoryRegionOps imx_serial_ops = { .read = imx_serial_read, .write = imx_serial_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void imx_serial_realize (DeviceState *dev,Error **errp)
hw/char/lm32_uart.c +1 -1
@@ -207,7 +207,7 @@ static void uart_write(void *opaque, hwaddr addr,static const MemoryRegionOps uart_ops = { .read = uart_read, .write = uart_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
hw/char/milkymist-uart.c +1 -1
@@ -158,7 +158,7 @@ static const MemoryRegionOps uart_mmio_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, };static void uart_rx (void *opaque,const uint8_t *buf,int size)
hw/char/pl011.c +1 -1
@@ -289,7 +289,7 @@ static void pl011_event(void *opaque, int event)static const MemoryRegionOps pl011_ops = { .read = pl011_read, .write = pl011_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_pl011 = {
Signature · 1 line
2.23.0
PATCH 4/19 hw/core: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if ununsed, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-delcare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/core/empty_slot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/empty_slot.c +1 -1
@@ -49,7 +49,7 @@ static void empty_slot_write(void *opaque, hwaddr addr,static const MemoryRegionOps empty_slot_ops = { .read = empty_slot_read, .write = empty_slot_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , };void empty_slot_init (hwaddr addr,uint64_t slot_size)
Signature · 1 line
2.23.0
Re: [Qemu-devel] [PATCH 04/19] hw/core: Declare device little or big endian
Quoted 8 lines · Tony Nguyen
For each device declared with
DEVICE_NATIVE_ENDIAN, find the set of targets from the set oftarget/hw/*/device.o.If the set of targets are all little or all big endian, re-declare as
DEVICE_LITTLE_ENDIANorDEVICE_BIG_ENDIANrespectively.Then, on inspection:
- if ununsed, re-declare asDEVICE_HOST_ENDIAN.
In all the series: 'ununsed' -> 'unused'
Quoted 2 lines
- if max/min size=1, re-declare as
DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-delcare asDEVICE_HOST_ENDIAN
In all the series: 're-delcare' -> 're-declare'
Quoted 14 lines
- if PCI, re-declare as
DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare asDEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare asDEVICE_BIG_ENDIAN.Signed-off-by Tony Nguyen <[email protected]>--- hw/core/empty_slot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/core/empty_slot.c +0
-0
hw/core/empty_slot.c static void empty_slot_write(void *opaque, hwaddr addr, · line 52
Quoted 5 lines
hw/core/empty_slot.c +1
-1@@ -49,7 +49,7 @@ static void empty_slot_write(void *opaque, hwaddr addr,static const MemoryRegionOps empty_slot_ops = { .read = empty_slot_read, .write = empty_slot_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN ,
Quoted 4 lines
hw/core/empty_slot.c +0
-0};void empty_slot_init (hwaddr addr,uint64_t slot_size)
PATCH 5/19 hw/display: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/display/exynos4210_fimd.c | 2 +- hw/display/jazz_led.c | 2 +- hw/display/pl110.c | 2 +- hw/display/tc6393xb.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
hw/display/exynos4210_fimd.c +1 -1
@@ -1821,7 +1821,7 @@ static const MemoryRegionOps exynos4210_fimd_mmio_ops = { .max_access_size = 4, .unaligned = false }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static int exynos4210_fimd_load (void *opaque,int version_id)
hw/display/jazz_led.c +1 -1
@@ -73,7 +73,7 @@ static void jazz_led_write(void *opaque, hwaddr addr,static const MemoryRegionOps led_ops = { .read = jazz_led_read, .write = jazz_led_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .impl.min_access_size =1 , .impl.max_access_size =1 , };
hw/display/pl110.c +1 -1
@@ -473,7 +473,7 @@ static void pl110_write(void *opaque, hwaddr offset,static const MemoryRegionOps pl110_ops = { .read = pl110_read, .write = pl110_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl110_mux_ctrl_set (void *opaque,int line,int level)
hw/display/tc6393xb.c +1 -1
@@ -549,7 +549,7 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq)static const MemoryRegionOps tc6393xb_ops = { .read = tc6393xb_readb, .write = tc6393xb_writeb, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
Signature · 1 line
2.23.0
PATCH 6/19 hw/dma: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/dma/bcm2835_dma.c | 4 ++-- hw/dma/etraxfs_dma.c | 14 +++++++------- hw/dma/i8257.c | 4 ++-- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/puv3_dma.c | 2 +- hw/dma/sparc32_dma.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-)
hw/dma/bcm2835_dma.c +2 -2
@@ -290,7 +290,7 @@ static void bcm2835_dma15_write(void *opaque, hwaddr offset, uint64_t value,static const MemoryRegionOps bcm2835_dma0_ops = { .read = bcm2835_dma0_read, .write = bcm2835_dma0_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid.min_access_size =4 , .valid.max_access_size =4 , };
@@ -298,7 +298,7 @@ static const MemoryRegionOps bcm2835_dma0_ops = {static const MemoryRegionOps bcm2835_dma15_ops = { .read = bcm2835_dma15_read, .write = bcm2835_dma15_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid.min_access_size =4 , .valid.max_access_size =4 , };
hw/dma/etraxfs_dma.c +7 -7
@@ -698,13 +698,13 @@ dma_write(void *opaque, hwaddr addr, }static const MemoryRegionOps dma_ops = { - .read = dma_read, - .write = dma_write, - .endianness =DEVICE_NATIVE_ENDIAN , - .valid = { - .min_access_size =1 , - .max_access_size =4 - } + .read = dma_read, + .write = dma_write, + .endianness =DEVICE_LITTLE_ENDIAN , + .valid = { + .min_access_size =1 , + .max_access_size =4 + } };static int etraxfs_dmac_run (void *opaque)
hw/dma/i8257.c +2 -2
@@ -476,7 +476,7 @@ static int i8257_phony_handler(void *opaque, int nchan, int dma_pos,static const MemoryRegionOps channel_io_ops = { .read = i8257_read_chan, .write = i8257_write_chan, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
@@ -500,7 +500,7 @@ static const MemoryRegionPortio pageh_portio_list[] = {static const MemoryRegionOps cont_io_ops = { .read = i8257_read_cont, .write = i8257_write_cont, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
hw/dma/pl080.c +1 -1
@@ -350,7 +350,7 @@ static void pl080_write(void *opaque, hwaddr offset,static const MemoryRegionOps pl080_ops = { .read = pl080_read, .write = pl080_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl080_reset (DeviceState *dev)
hw/dma/pl330.c +1 -1
@@ -1496,7 +1496,7 @@ static uint64_t pl330_iomem_read(void *opaque, hwaddr offset,static const MemoryRegionOps pl330_ops = { .read = pl330_iomem_read, .write = pl330_iomem_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .impl = { .min_access_size =4 , .max_access_size =4 ,
hw/dma/puv3_dma.c +1 -1
@@ -74,7 +74,7 @@ static const MemoryRegionOps puv3_dma_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void puv3_dma_realize (DeviceState *dev,Error **errp)
hw/dma/sparc32_dma.c +1 -1
@@ -226,7 +226,7 @@ static void dma_mem_write(void *opaque, hwaddr addr,static const MemoryRegionOps dma_mem_ops = { .read = dma_mem_read, .write = dma_mem_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
Signature · 1 line
2.23.0
PATCH 7/19 hw/gpio: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/gpio/pl061.c | 2 +- hw/gpio/puv3_gpio.c | 2 +- hw/gpio/zaurus.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
hw/gpio/pl061.c +1 -1
@@ -341,7 +341,7 @@ static void pl061_set_irq(void * opaque, int irq, int level)static const MemoryRegionOps pl061_ops = { .read = pl061_read, .write = pl061_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl061_luminary_init (Object *obj)
hw/gpio/puv3_gpio.c +1 -1
@@ -97,7 +97,7 @@ static const MemoryRegionOps puv3_gpio_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void puv3_gpio_realize (DeviceState *dev,Error **errp)
hw/gpio/zaurus.c +1 -1
@@ -157,7 +157,7 @@ static void scoop_write(void *opaque, hwaddr addr,static const MemoryRegionOps scoop_ops = { .read = scoop_read, .write = scoop_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void scoop_gpio_set (void *opaque,int line,int level)
Signature · 1 line
2.23.0
PATCH 8/19 hw/i2c: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if ununsed, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-delcare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/i2c/exynos4210_i2c.c | 2 +- hw/i2c/imx_i2c.c | 2 +- hw/i2c/mpc_i2c.c | 2 +- hw/i2c/versatile_i2c.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
hw/i2c/exynos4210_i2c.c +1 -1
@@ -266,7 +266,7 @@ static void exynos4210_i2c_write(void *opaque, hwaddr offset,static const MemoryRegionOps exynos4210_i2c_ops = { .read = exynos4210_i2c_read, .write = exynos4210_i2c_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription exynos4210_i2c_vmstate = {
hw/i2c/imx_i2c.c +1 -1
@@ -278,7 +278,7 @@ static const MemoryRegionOps imx_i2c_ops = { .write = imx_i2c_write, .valid.min_access_size = 1, .valid.max_access_size = 2, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static const VMStateDescription imx_i2c_vmstate = {
hw/i2c/mpc_i2c.c +1 -1
@@ -306,7 +306,7 @@ static const MemoryRegionOps i2c_ops = { .read = mpc_i2c_read, .write = mpc_i2c_write, .valid.max_access_size = 1, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, };static const VMStateDescription mpc_i2c_vmstate = {
hw/i2c/versatile_i2c.c +1 -1
@@ -77,7 +77,7 @@ static void versatile_i2c_write(void *opaque, hwaddr offset,static const MemoryRegionOps versatile_i2c_ops = { .read = versatile_i2c_read, .write = versatile_i2c_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void versatile_i2c_init (Object *obj)
Signature · 1 line
2.23.0
PATCH 9/19 hw/input: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/input/pl050.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/input/pl050.c +1 -1
@@ -139,7 +139,7 @@ static void pl050_write(void *opaque, hwaddr offset,static const MemoryRegionOps pl050_ops = { .read = pl050_read, .write = pl050_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl050_realize (DeviceState *dev,Error **errp)
Signature · 1 line
2.23.0
PATCH 10/19 hw/intc: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/intc/arm_gic.c | 12 ++++++------ hw/intc/arm_gicv3.c | 4 ++-- hw/intc/arm_gicv3_its_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/imx_avic.c | 2 +- hw/intc/imx_gpcv2.c | 2 +- hw/intc/pl190.c | 2 +- hw/intc/puv3_intc.c | 2 +- hw/intc/slavio_intctl.c | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-)
hw/intc/arm_gic.c +6 -6
@@ -2000,38 +2000,38 @@ static const MemoryRegionOps gic_ops[2] = { { .read_with_attrs = gic_dist_read, .write_with_attrs = gic_dist_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }, { .read_with_attrs = gic_thiscpu_read, .write_with_attrs = gic_thiscpu_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, } };static const MemoryRegionOps gic_cpu_ops = { .read_with_attrs = gic_do_cpu_read, .write_with_attrs = gic_do_cpu_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const MemoryRegionOps gic_virt_ops[2 ] = { { .read_with_attrs = gic_thiscpu_hyp_read, .write_with_attrs = gic_thiscpu_hyp_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , }, { .read_with_attrs = gic_thisvcpu_read, .write_with_attrs = gic_thisvcpu_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , } };static const MemoryRegionOps gic_viface_ops = { .read_with_attrs = gic_do_hyp_read, .write_with_attrs = gic_do_hyp_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void arm_gic_realize (DeviceState *dev,Error **errp)
hw/intc/arm_gicv3.c +2 -2
@@ -352,12 +352,12 @@ static const MemoryRegionOps gic_ops[] = { { .read_with_attrs = gicv3_dist_read, .write_with_attrs = gicv3_dist_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }, { .read_with_attrs = gicv3_redist_read, .write_with_attrs = gicv3_redist_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, } };
hw/intc/arm_gicv3_its_common.c +1 -1
@@ -96,7 +96,7 @@ static MemTxResult gicv3_its_trans_write(void *opaque, hwaddr offset,static const MemoryRegionOps gicv3_its_trans_ops = { .read_with_attrs = gicv3_its_trans_read, .write_with_attrs = gicv3_its_trans_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };void gicv3_its_init_mmio (GICv3ITSState *s,const MemoryRegionOps *ops)
hw/intc/etraxfs_pic.c +1 -1
@@ -112,7 +112,7 @@ static void pic_write(void *opaque, hwaddr addr,static const MemoryRegionOps pic_ops = { .read = pic_read, .write = pic_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4
hw/intc/imx_avic.c +1 -1
@@ -310,7 +310,7 @@ static void imx_avic_write(void *opaque, hwaddr offset,static const MemoryRegionOps imx_avic_ops = { .read = imx_avic_read, .write = imx_avic_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void imx_avic_reset (DeviceState *dev)
hw/intc/imx_gpcv2.c +1 -1
@@ -65,7 +65,7 @@ static void imx_gpcv2_write(void *opaque, hwaddr offset,static const struct MemoryRegionOps imx_gpcv2_ops = { .read = imx_gpcv2_read, .write = imx_gpcv2_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .impl = {/* * Our device would not work correctly if the guest was doing
hw/intc/pl190.c +1 -1
@@ -222,7 +222,7 @@ static void pl190_write(void *opaque, hwaddr offset,static const MemoryRegionOps pl190_ops = { .read = pl190_read, .write = pl190_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl190_reset (DeviceState *d)
hw/intc/puv3_intc.c +1 -1
@@ -101,7 +101,7 @@ static const MemoryRegionOps puv3_intc_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void puv3_intc_realize (DeviceState *dev,Error **errp)
hw/intc/slavio_intctl.c +2 -2
@@ -136,7 +136,7 @@ static void slavio_intctl_mem_writel(void *opaque, hwaddr addr,static const MemoryRegionOps slavio_intctl_mem_ops = { .read = slavio_intctl_mem_readl, .write = slavio_intctl_mem_writel, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
@@ -206,7 +206,7 @@ static void slavio_intctlm_mem_writel(void *opaque, hwaddr addr,static const MemoryRegionOps slavio_intctlm_mem_ops = { .read = slavio_intctlm_mem_readl, .write = slavio_intctlm_mem_writel, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
Signature · 1 line
2.23.0
PATCH 11/19 hw/ipack: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if ununsed, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-delcare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/ipack/tpci200.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
hw/ipack/tpci200.c +5 -5
@@ -526,7 +526,7 @@ static void tpci200_write_las3(void *opaque, hwaddr addr, uint64_t val,static const MemoryRegionOps tpci200_cfg_ops = { .read = tpci200_read_cfg, .write = tpci200_write_cfg, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =4
@@ -540,7 +540,7 @@ static const MemoryRegionOps tpci200_cfg_ops = {static const MemoryRegionOps tpci200_las0_ops = { .read = tpci200_read_las0, .write = tpci200_write_las0, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =2 , .max_access_size =2
@@ -550,7 +550,7 @@ static const MemoryRegionOps tpci200_las0_ops = {static const MemoryRegionOps tpci200_las1_ops = { .read = tpci200_read_las1, .write = tpci200_write_las1, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =2
@@ -560,7 +560,7 @@ static const MemoryRegionOps tpci200_las1_ops = {static const MemoryRegionOps tpci200_las2_ops = { .read = tpci200_read_las2, .write = tpci200_write_las2, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =2
@@ -570,7 +570,7 @@ static const MemoryRegionOps tpci200_las2_ops = {static const MemoryRegionOps tpci200_las3_ops = { .read = tpci200_read_las3, .write = tpci200_write_las3, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =1
Signature · 1 line
2.23.0
Re: [Qemu-devel] [PATCH 11/19] hw/ipack: Declare device little or big endian
Quoted 14 lines · Tony Nguyen
For each device declared with
DEVICE_NATIVE_ENDIAN, find the set of targets from the set oftarget/hw/*/device.o.If the set of targets are all little or all big endian, re-declare as
DEVICE_LITTLE_ENDIANorDEVICE_BIG_ENDIANrespectively.Then, on inspection:
- if ununsed, re-declare asDEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare asDEVICE_HOST_ENDIAN.
- if just a bit bucket, re-delcare asDEVICE_HOST_ENDIAN
- if PCI, re-declare asDEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare asDEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare asDEVICE_BIG_ENDIAN.
Quoted 1 line
Signed-off-by Tony Nguyen <[email protected]>
Berto
PATCH 12/19 hw/isa: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/isa/vt82c686.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/isa/vt82c686.c +1 -1
@@ -109,7 +109,7 @@ static uint64_t superio_ioport_readb(void *opaque, hwaddr addr, unsigned size)static const MemoryRegionOps superio_ops = { .read = superio_ioport_readb, .write = superio_ioport_writeb, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
Signature · 1 line
2.23.0
Re: [Qemu-devel] [PATCH 12/19] hw/isa: Declare device little or big endian
Quoted 9 lines · Tony Nguyen
For each device declared with
DEVICE_NATIVE_ENDIAN, find the set of targets from the set oftarget/hw/*/device.o.If the set of targets are all little or all big endian, re-declare as
DEVICE_LITTLE_ENDIANorDEVICE_BIG_ENDIANrespectively.Then, on inspection:
- if not used, re-declare asDEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare asDEVICE_HOST_ENDIAN.
Here you say DEVICE_HOST_ENDIAN,
Quoted 15 lines
- if just a bit bucket, re-declare as
DEVICE_HOST_ENDIAN
- if PCI, re-declare asDEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare asDEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare asDEVICE_BIG_ENDIAN.Signed-off-by Tony Nguyen <[email protected]>--- hw/isa/vt82c686.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/isa/vt82c686.c +0
-0
hw/isa/vt82c686.c static uint64_t superio_ioport_readb(void *opaque, hwaddr addr, unsigned size) · line 112
Quoted 5 lines
hw/isa/vt82c686.c +1
-1@@ -109,7 +109,7 @@ static uint64_t superio_ioport_readb(void *opaque, hwaddr addr, unsigned size)static const MemoryRegionOps superio_ops = { .read = superio_ioport_readb, .write = superio_ioport_writeb, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN ,
But here you use DEVICE_LITTLE_ENDIAN.
For 8-bit I/O port endianess doesn't matter, so I'm not sure what is the correct choice. Can we simply remove the .endianness line, since the won't be ever used?
Quoted 4 lines
hw/isa/vt82c686.c +0
-0.impl = { .min_access_size = 1, .max_access_size = 1,
PATCH 13/19 hw/misc: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/misc/a9scu.c | 2 +- hw/misc/applesmc.c | 6 +++--- hw/misc/arm11scu.c | 2 +- hw/misc/arm_integrator_debug.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/edu.c | 2 +- hw/misc/mos6522.c | 2 +- hw/misc/puv3_pm.c | 2 +- hw/misc/unimp.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-)
hw/misc/a9scu.c +1 -1
@@ -96,7 +96,7 @@ static void a9_scu_write(void *opaque, hwaddr offset,static const MemoryRegionOps a9_scu_ops = { .read = a9_scu_read, .write = a9_scu_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void a9_scu_reset (DeviceState *dev)
hw/misc/applesmc.c +3 -3
@@ -285,7 +285,7 @@ static void qdev_applesmc_isa_reset(DeviceState *dev)static const MemoryRegionOps applesmc_data_io_ops = { .write = applesmc_io_data_write, .read = applesmc_io_data_read, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
@@ -295,7 +295,7 @@ static const MemoryRegionOps applesmc_data_io_ops = {static const MemoryRegionOps applesmc_cmd_io_ops = { .write = applesmc_io_cmd_write, .read = applesmc_io_cmd_read, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
@@ -305,7 +305,7 @@ static const MemoryRegionOps applesmc_cmd_io_ops = {static const MemoryRegionOps applesmc_err_io_ops = { .write = applesmc_io_err_write, .read = applesmc_io_err_read, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .impl = { .min_access_size =1 , .max_access_size =1 ,
hw/misc/arm11scu.c +1 -1
@@ -58,7 +58,7 @@ static void mpcore_scu_write(void *opaque, hwaddr offset,static const MemoryRegionOps mpcore_scu_ops = { .read = mpcore_scu_read, .write = mpcore_scu_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void arm11_scu_realize (DeviceState *dev,Error **errp)
hw/misc/arm_integrator_debug.c +1 -1
@@ -72,7 +72,7 @@ static void intdbg_control_write(void *opaque, hwaddr offset,static const MemoryRegionOps intdbg_control_ops = { .read = intdbg_control_read, .write = intdbg_control_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void intdbg_control_init (Object *obj)
hw/misc/arm_l2x0.c +1 -1
@@ -159,7 +159,7 @@ static void l2x0_priv_reset(DeviceState *dev)static const MemoryRegionOps l2x0_mem_ops = { .read = l2x0_priv_read, .write = l2x0_priv_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void l2x0_priv_init (Object *obj)
hw/misc/edu.c +1 -1
@@ -295,7 +295,7 @@ static void edu_mmio_write(void *opaque, hwaddr addr, uint64_t val,static const MemoryRegionOps edu_mmio_ops = { .read = edu_mmio_read, .write = edu_mmio_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =8 ,
hw/misc/mos6522.c +1 -1
@@ -365,7 +365,7 @@ void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)static const MemoryRegionOps mos6522_ops = { .read = mos6522_read, .write = mos6522_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_HOST_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =1 ,
hw/misc/puv3_pm.c +1 -1
@@ -117,7 +117,7 @@ static const MemoryRegionOps puv3_pm_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void puv3_pm_realize (DeviceState *dev,Error **errp)
hw/misc/unimp.c +1 -1
@@ -46,7 +46,7 @@ static const MemoryRegionOps unimp_ops = { .impl.max_access_size = 8, .valid.min_access_size = 1, .valid.max_access_size = 8, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_HOST_ENDIAN, };static void unimp_realize (DeviceState *dev,Error **errp)
Signature · 1 line
2.23.0
PATCH 14/19 hw/net: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/net/allwinner_emac.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 4 ++-- hw/net/lance.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/stellaris_enet.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-)
hw/net/allwinner_emac.c +1 -1
@@ -421,7 +421,7 @@ static void aw_emac_set_link(NetClientState *nc)static const MemoryRegionOps aw_emac_mem_ops = { .read = aw_emac_read, .write = aw_emac_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
hw/net/imx_fec.c +1 -1
@@ -1285,7 +1285,7 @@ static const MemoryRegionOps imx_eth_ops = { .write = imx_eth_write, .valid.min_access_size = 4, .valid.max_access_size = 4, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void imx_eth_cleanup (NetClientState *nc)
hw/net/lan9118.c +2 -2
@@ -1308,13 +1308,13 @@ static uint64_t lan9118_16bit_mode_read(void *opaque, hwaddr offset,static const MemoryRegionOps lan9118_mem_ops = { .read = lan9118_readl, .write = lan9118_writel, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const MemoryRegionOps lan9118_16bit_mem_ops = { .read = lan9118_16bit_mode_read, .write = lan9118_16bit_mode_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static NetClientInfo net_lan9118_info = {
hw/net/lance.c +1 -1
@@ -76,7 +76,7 @@ static uint64_t lance_mem_read(void *opaque, hwaddr addr,static const MemoryRegionOps lance_mem_ops = { .read = lance_mem_read, .write = lance_mem_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =2 , .max_access_size =2 ,
hw/net/smc91c111.c +1 -1
@@ -760,7 +760,7 @@ static const MemoryRegionOps smc91c111_mem_ops = { .write = smc91c111_writefn, .valid.min_access_size = 1, .valid.max_access_size = 4, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static NetClientInfo net_smc91c111_info = {
hw/net/stellaris_enet.c +1 -1
@@ -459,7 +459,7 @@ static void stellaris_enet_write(void *opaque, hwaddr offset,static const MemoryRegionOps stellaris_enet_ops = { .read = stellaris_enet_read, .write = stellaris_enet_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void stellaris_enet_reset (DeviceState *dev)
Signature · 1 line
2.23.0
PATCH 15/19 hw/pci-host: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/pci-host/bonito.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
hw/pci-host/bonito.c +1 -1
@@ -526,7 +526,7 @@ static const MemoryRegionOps bonito_spciconf_ops = { .valid.max_access_size = 4, .impl.min_access_size = 1, .impl.max_access_size = 4, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };#define BONITO_IRQ_BASE 32
hw/pci-host/q35.c +1 -1
@@ -289,7 +289,7 @@ static void tseg_blackhole_write(void *opaque, hwaddr addr, uint64_t val,static const MemoryRegionOps tseg_blackhole_ops = { .read = tseg_blackhole_read, .write = tseg_blackhole_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid.min_access_size =1 , .valid.max_access_size =4 , .impl.min_access_size =4 ,
hw/pci-host/versatile.c +2 -2
@@ -243,7 +243,7 @@ static uint64_t pci_vpb_reg_read(void *opaque, hwaddr addr,static const MemoryRegionOps pci_vpb_reg_ops = { .read = pci_vpb_reg_read, .write = pci_vpb_reg_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
@@ -309,7 +309,7 @@ static uint64_t pci_vpb_config_read(void *opaque, hwaddr addr,static const MemoryRegionOps pci_vpb_config_ops = { .read = pci_vpb_config_read, .write = pci_vpb_config_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static int pci_vpb_map_irq (PCIDevice *d,int irq_num)
Signature · 1 line
2.23.0
PATCH 16/19 hw/sd: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/sd/pl181.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/sd/pl181.c +1 -1
@@ -451,7 +451,7 @@ static void pl181_write(void *opaque, hwaddr offset,static const MemoryRegionOps pl181_ops = { .read = pl181_read, .write = pl181_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl181_reset (DeviceState *d)
Signature · 1 line
2.23.0
PATCH 17/19 hw/ssi: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/ssi/mss-spi.c | 2 +- hw/ssi/pl022.c | 2 +- hw/ssi/stm32f2xx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
hw/ssi/mss-spi.c +1 -1
@@ -361,7 +361,7 @@ static void spi_write(void *opaque, hwaddr addr,static const MemoryRegionOps spi_ops = { .read = spi_read, .write = spi_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =4
hw/ssi/pl022.c +1 -1
@@ -228,7 +228,7 @@ static void pl022_reset(DeviceState *dev)static const MemoryRegionOps pl022_ops = { .read = pl022_read, .write = pl022_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static int pl022_post_load (void *opaque,int version_id)
hw/ssi/stm32f2xx_spi.c +1 -1
@@ -167,7 +167,7 @@ static void stm32f2xx_spi_write(void *opaque, hwaddr addr,static const MemoryRegionOps stm32f2xx_spi_ops = { .read = stm32f2xx_spi_read, .write = stm32f2xx_spi_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_stm32f2xx_spi = {
hw/ssi/xilinx_spips.c +1 -1
@@ -1240,7 +1240,7 @@ static MemTxResult lqspi_write(void *opaque, hwaddr offset, uint64_t value,static const MemoryRegionOps lqspi_ops = { .read_with_attrs = lqspi_read, .write_with_attrs = lqspi_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .impl = { .min_access_size =4 , .max_access_size =4 ,
Signature · 1 line
2.23.0
PATCH 18/19 hw/timer: Declare device little or big endian
In reply to Tony NguyenFor each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
--- hw/timer/a9gtimer.c | 4 ++-- hw/timer/arm_mptimer.c | 4 ++-- hw/timer/arm_timer.c | 4 ++-- hw/timer/armv7m_systick.c | 2 +- hw/timer/aspeed_rtc.c | 2 +- hw/timer/cadence_ttc.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/imx_epit.c | 2 +- hw/timer/imx_gpt.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/mss-timer.c | 2 +- hw/timer/pl031.c | 2 +- hw/timer/puv3_ost.c | 2 +- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/sun4v-rtc.c | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-)
hw/timer/a9gtimer.c +2 -2
@@ -258,7 +258,7 @@ static const MemoryRegionOps a9_gtimer_this_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static const MemoryRegionOps a9_gtimer_ops = {
@@ -268,7 +268,7 @@ static const MemoryRegionOps a9_gtimer_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void a9_gtimer_reset (DeviceState *dev)
hw/timer/arm_mptimer.c +2 -2
@@ -194,7 +194,7 @@ static const MemoryRegionOps arm_thistimer_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static const MemoryRegionOps timerblock_ops = {
@@ -204,7 +204,7 @@ static const MemoryRegionOps timerblock_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void timerblock_reset (TimerBlock *tb)
hw/timer/arm_timer.c +2 -2
@@ -267,7 +267,7 @@ static void sp804_write(void *opaque, hwaddr offset,static const MemoryRegionOps sp804_ops = { .read = sp804_read, .write = sp804_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_sp804 = {
@@ -348,7 +348,7 @@ static void icp_pit_write(void *opaque, hwaddr offset,static const MemoryRegionOps icp_pit_ops = { .read = icp_pit_read, .write = icp_pit_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void icp_pit_init (Object *obj)
hw/timer/armv7m_systick.c +1 -1
@@ -193,7 +193,7 @@ static MemTxResult systick_write(void *opaque, hwaddr addr,static const MemoryRegionOps systick_ops = { .read_with_attrs = systick_read, .write_with_attrs = systick_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid.min_access_size =4 , .valid.max_access_size =4 , };
hw/timer/aspeed_rtc.c +1 -1
@@ -131,7 +131,7 @@ static void aspeed_rtc_reset(DeviceState *d)static const MemoryRegionOps aspeed_rtc_ops = { .read = aspeed_rtc_read, .write = aspeed_rtc_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_aspeed_rtc = {
hw/timer/cadence_ttc.c +1 -1
@@ -391,7 +391,7 @@ static void cadence_ttc_write(void *opaque, hwaddr offset,static const MemoryRegionOps cadence_ttc_ops = { .read = cadence_ttc_read, .write = cadence_ttc_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void cadence_timer_reset (CadenceTimerState *s)
hw/timer/grlib_gptimer.c +1 -1
@@ -315,7 +315,7 @@ static void grlib_gptimer_write(void *opaque, hwaddr addr,static const MemoryRegionOps grlib_gptimer_ops = { .read = grlib_gptimer_read, .write = grlib_gptimer_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
hw/timer/hpet.c +1 -1
@@ -676,7 +676,7 @@ static const MemoryRegionOps hpet_ram_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void hpet_reset (DeviceState *d)
hw/timer/imx_epit.c +1 -1
@@ -284,7 +284,7 @@ static void imx_epit_cmp(void *opaque)static const MemoryRegionOps imx_epit_ops = { .read = imx_epit_read, .write = imx_epit_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_imx_timer_epit = {
hw/timer/imx_gpt.c +1 -1
@@ -476,7 +476,7 @@ static void imx_gpt_timeout(void *opaque)static const MemoryRegionOps imx_gpt_ops = { .read = imx_gpt_read, .write = imx_gpt_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };
hw/timer/lm32_timer.c +1 -1
@@ -146,7 +146,7 @@ static void timer_write(void *opaque, hwaddr addr,static const MemoryRegionOps timer_ops = { .read = timer_read, .write = timer_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
hw/timer/milkymist-sysctl.c +1 -1
@@ -223,7 +223,7 @@ static const MemoryRegionOps sysctl_mmio_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, };static void timer0_hit (void *opaque)
hw/timer/mss-timer.c +1 -1
@@ -200,7 +200,7 @@ timer_write(void *opaque, hwaddr offset,static const MemoryRegionOps timer_ops = { .read = timer_read, .write = timer_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .valid = { .min_access_size =1 , .max_access_size =4
hw/timer/pl031.c +1 -1
@@ -178,7 +178,7 @@ static void pl031_write(void * opaque, hwaddr offset,static const MemoryRegionOps pl031_ops = { .read = pl031_read, .write = pl031_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static void pl031_init (Object *obj)
hw/timer/puv3_ost.c +1 -1
@@ -99,7 +99,7 @@ static const MemoryRegionOps puv3_ost_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void puv3_ost_tick (void *opaque)
hw/timer/slavio_timer.c +1 -1
@@ -322,7 +322,7 @@ static void slavio_timer_mem_writel(void *opaque, hwaddr addr,static const MemoryRegionOps slavio_timer_mem_ops = { .read = slavio_timer_mem_readl, .write = slavio_timer_mem_writel, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , .valid = { .min_access_size =4 , .max_access_size =4 ,
hw/timer/stm32f2xx_timer.c +1 -1
@@ -268,7 +268,7 @@ static void stm32f2xx_timer_write(void *opaque, hwaddr offset,static const MemoryRegionOps stm32f2xx_timer_ops = { .read = stm32f2xx_timer_read, .write = stm32f2xx_timer_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , };static const VMStateDescription vmstate_stm32f2xx_timer = {
hw/timer/sun4v-rtc.c +1 -1
@@ -47,7 +47,7 @@ static void sun4v_rtc_write(void *opaque, hwaddr addr,static const MemoryRegionOps sun4v_rtc_ops = { .read = sun4v_rtc_read, .write = sun4v_rtc_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_BIG_ENDIAN , };void sun4v_rtc_init (hwaddr addr)
Signature · 1 line
2.23.0
Re: [Qemu-devel] [PATCH 18/19] hw/timer: Declare device little or big endian
Quoted 26 lines · Tony Nguyen
For each device declared with
DEVICE_NATIVE_ENDIAN, find the set of targets from the set oftarget/hw/*/device.o.If the set of targets are all little or all big endian, re-declare as
DEVICE_LITTLE_ENDIANorDEVICE_BIG_ENDIANrespectively.Then, on inspection:
- if not used, re-declare asDEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare asDEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare asDEVICE_HOST_ENDIAN
- if PCI, re-declare asDEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare asDEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare asDEVICE_BIG_ENDIAN.Signed-off-by Tony Nguyen <[email protected]>--- hw/timer/a9gtimer.c | 4 ++-- hw/timer/arm_mptimer.c | 4 ++-- hw/timer/arm_timer.c | 4 ++-- hw/timer/armv7m_systick.c | 2 +- hw/timer/aspeed_rtc.c | 2 +- hw/timer/cadence_ttc.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/imx_epit.c | 2 +- hw/timer/imx_gpt.c | 2 +-
Quoted 8 lines
hw/timer/lm32_timer.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/mss-timer.c | 2 +- hw/timer/pl031.c | 2 +- hw/timer/puv3_ost.c | 2 +- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/sun4v-rtc.c | 2 +-
This patch affects various areas, maybe it is worth splitting in at least big/little changes? Or 3: ARM first, then big/little.
[...]
PATCH 19/19 build: Correct non-common common-obj-* to obj-*
In reply to Tony NguyenDevice realizing code with MemorRegionOps endianness as DEVICE_NATIVE_ENDIAN is not common code.
Corrected devices were identified by making the declaration of DEVICE_NATIVE_ENDIAN conditional upon NEED_CPU_H and then listing what failed to compile.
--- hw/block/Makefile.objs | 4 ++-- hw/char/Makefile.objs | 4 ++-- hw/display/Makefile.objs | 2 +- hw/dma/Makefile.objs | 4 ++-- hw/input/Makefile.objs | 2 +- hw/intc/Makefile.objs | 2 +- hw/net/Makefile.objs | 2 +- hw/scsi/Makefile.objs | 2 +- hw/ssi/Makefile.objs | 2 +- hw/timer/Makefile.objs | 2 +- hw/virtio/Makefile.objs | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-)
hw/block/Makefile.objs +2 -2
@@ -2,8 +2,8 @@ common-obj-y += block.o cdrom.o hd-geometry.o common-obj-$(CONFIG_FDC) += fdc.o common-obj-$(CONFIG_SSI_M25P80) += m25p80.o common-obj-$(CONFIG_NAND) += nand.o -common-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o -common-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o +obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o +obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o common-obj-$(CONFIG_XEN) += xen-block.o common-obj-$(CONFIG_ECC) += ecc.o common-obj-$(CONFIG_ONENAND) += onenand.o
hw/char/Makefile.objs +2 -2
@@ -1,7 +1,6 @@ common-obj-$(CONFIG_IPACK) += ipoctal232.o common-obj-$(CONFIG_ESCC) += escc.o common-obj-$(CONFIG_NRF51_SOC) += nrf51_uart.o -common-obj-$(CONFIG_PARALLEL) += parallel.o common-obj-$(CONFIG_ISA_BUS) += parallel-isa.o common-obj-$(CONFIG_PL011) += pl011.o common-obj-$(CONFIG_SERIAL) += serial.o
@@ -9,7 +8,6 @@ common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o common-obj-$(CONFIG_SERIAL_PCI) += serial-pci.o common-obj-$(CONFIG_SERIAL_PCI_MULTI) += serial-pci-multi.o common-obj-$(CONFIG_VIRTIO_SERIAL) += virtio-console.o -common-obj-$(CONFIG_XILINX) += xilinx_uartlite.o common-obj-$(CONFIG_XEN) += xen_console.o common-obj-$(CONFIG_CADENCE) += cadence_uart.o
@@ -21,6 +19,8 @@ obj-$(CONFIG_PSERIES) += spapr_vty.o obj-$(CONFIG_DIGIC) += digic-uart.o obj-$(CONFIG_STM32F2XX_USART) += stm32f2xx_usart.o obj-$(CONFIG_RASPI) += bcm2835_aux.o +obj-$(CONFIG_PARALLEL) += parallel.o +obj-$(CONFIG_XILINX) += xilinx_uartlite.o common-obj-$(CONFIG_CMSDK_APB_UART) += cmsdk-apb-uart.o common-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o
hw/display/Makefile.objs +1 -1
@@ -17,7 +17,7 @@ common-obj-$(CONFIG_XEN) += xenfb.o common-obj-$(CONFIG_VGA_PCI) += vga-pci.o common-obj-$(CONFIG_VGA_ISA) += vga-isa.o -common-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o +obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o common-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o common-obj-$(CONFIG_BOCHS_DISPLAY) += bochs-display.o
hw/dma/Makefile.objs +2 -2
@@ -1,10 +1,10 @@ common-obj-$(CONFIG_PUV3) += puv3_dma.o -common-obj-$(CONFIG_RC4030) += rc4030.o +obj-$(CONFIG_RC4030) += rc4030.o common-obj-$(CONFIG_PL080) += pl080.o common-obj-$(CONFIG_PL330) += pl330.o common-obj-$(CONFIG_I82374) += i82374.o common-obj-$(CONFIG_I8257) += i8257.o -common-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o +obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o common-obj-$(CONFIG_ZYNQ_DEVCFG) += xlnx-zynq-devcfg.o common-obj-$(CONFIG_ETRAXFS) += etraxfs_dma.o common-obj-$(CONFIG_STP2000) += sparc32_dma.o
hw/input/Makefile.objs +1 -1
@@ -1,7 +1,7 @@ common-obj-$(CONFIG_ADB) += adb.o adb-mouse.o adb-kbd.o common-obj-y += hid.o common-obj-$(CONFIG_LM832X) += lm832x.o -common-obj-$(CONFIG_PCKBD) += pckbd.o +obj-$(CONFIG_PCKBD) += pckbd.o common-obj-$(CONFIG_PL050) += pl050.o common-obj-$(CONFIG_PS2) += ps2.o common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
hw/intc/Makefile.objs +1 -1
@@ -2,7 +2,7 @@ common-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o common-obj-$(CONFIG_PL190) += pl190.o common-obj-$(CONFIG_PUV3) += puv3_intc.o -common-obj-$(CONFIG_XILINX) += xilinx_intc.o +obj-$(CONFIG_XILINX) += xilinx_intc.o common-obj-$(CONFIG_XLNX_ZYNQMP_PMU) += xlnx-pmu-iomod-intc.o common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-ipi.o common-obj-$(CONFIG_ETRAXFS) += etraxfs_pic.o
hw/net/Makefile.objs +1 -1
@@ -1,4 +1,4 @@ -common-obj-$(CONFIG_DP8393X) += dp8393x.o +obj-$(CONFIG_DP8393X) += dp8393x.o common-obj-$(CONFIG_XEN) += xen_nic.o common-obj-$(CONFIG_NE2000_COMMON) += ne2000.o
hw/scsi/Makefile.objs +1 -1
@@ -4,7 +4,7 @@ common-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o common-obj-$(CONFIG_MPTSAS_SCSI_PCI) += mptsas.o mptconfig.o mptendian.o common-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o common-obj-$(CONFIG_VMW_PVSCSI_SCSI_PCI) += vmw_pvscsi.o -common-obj-$(CONFIG_ESP) += esp.o +obj-$(CONFIG_ESP) += esp.o common-obj-$(CONFIG_ESP_PCI) += esp-pci.o obj-$(CONFIG_SPAPR_VSCSI) += spapr_vscsi.o
hw/ssi/Makefile.objs +1 -1
@@ -1,6 +1,6 @@ common-obj-$(CONFIG_PL022) += pl022.o common-obj-$(CONFIG_SSI) += ssi.o -common-obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o +obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o common-obj-$(CONFIG_XILINX_SPIPS) += xilinx_spips.o common-obj-$(CONFIG_ASPEED_SOC) += aspeed_smc.o common-obj-$(CONFIG_STM32F2XX_SPI) += stm32f2xx_spi.o
hw/timer/Makefile.objs +1 -1
@@ -14,7 +14,7 @@ endif common-obj-$(CONFIG_PL031) += pl031.o common-obj-$(CONFIG_PUV3) += puv3_ost.o common-obj-$(CONFIG_TWL92230) += twl92230.o -common-obj-$(CONFIG_XILINX) += xilinx_timer.o +obj-$(CONFIG_XILINX) += xilinx_timer.o common-obj-$(CONFIG_SLAVIO) += slavio_timer.o common-obj-$(CONFIG_ETRAXFS) += etraxfs_timer.o common-obj-$(CONFIG_GRLIB) += grlib_gptimer.o
hw/virtio/Makefile.objs +1 -1
@@ -8,7 +8,7 @@ obj-$(CONFIG_VHOST_USER) += vhost-user.o common-obj-$(CONFIG_VIRTIO_RNG) += virtio-rng.o common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o -common-obj-$(CONFIG_VIRTIO_MMIO) += virtio-mmio.o +obj-$(CONFIG_VIRTIO_MMIO) += virtio-mmio.o obj-$(CONFIG_VIRTIO_BALLOON) += virtio-balloon.o obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-crypto.o obj-$(call land,$(CONFIG_VIRTIO_CRYPTO),$(CONFIG_VIRTIO_PCI)) += virtio-crypto-pci.o
Signature · 1 line
2.23.0
Quoted 33 lines · Tony Nguyen
This series is an attempt to re-declare devices with
DEVICE_NATIVE_ENDIANasDEVICE_LITTLE_ENDIANorDEVICE_BIG_ENDIAN.This clean up was split out from an earlier series which collapsed byte swaps along the I/O path.
Quoted 11 lines · Paolo Bonzini
Quoted 7 lines · On 07/08/19 10:31, tony.nguyen@bt wrote:
Device realizing code with MemorRegionOps endianness as
DEVICE_NATIVE_ENDIANis not common code.Corrected devices were identified by making the declaration of
DEVICE_NATIVE_ENDIANconditional uponNEED_CPU_Hand then listing what failed to compile.The general approach makes sense. However, most of these should not be
DEVICE_NATIVE_ENDIAN. I can help with some of them.Quoted 4 lines · Peter Maydell
OTOH it's worth noting that it's quite likely that most of the implementations of these
DEVICE_NATIVE_ENDIANdevices picked it in an equally naive way, by just copying some other device's code...Approach this in two steps.
1. Naively. For each device declared with
DEVICE_NATIVE_ENDIAN, find the set of targets from the set oftarget/hw/*/device.o.If the set of targets are all little or all big endian, re-declare as
DEVICE_LITTLE_ENDIANorDEVICE_BIG_ENDIANrespectively.
Quoted 7 lines
2. Manually. Inspect with heuristics (thanks Paolo):
- if not used, re-declare asDEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare asDEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare asDEVICE_HOST_ENDIAN
- if PCI, re-declare asDEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare asDEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare asDEVICE_BIG_ENDIAN.
Maybe this list is better to split your patches.
Which are the 'not used' ones?
TYPE_TPCI200 (from IndustryPack) can go with PCI.
You can put all the PrimeCell devices together (eventually with the other ARM devices):
hw/audio/pl041.c
hw/char/pl011.c
hw/display/pl110.c
hw/dma/pl080.c
hw/dma/pl330.c
hw/gpio/pl061.c
hw/input/pl050.c
hw/intc/pl190.c
hw/sd/pl181.c
hw/ssi/pl022.c
hw/timer/pl031.c