From: Tony Nguyen <tony.nguyen@bt.com> To: qemu-devel@nongnu.org Cc: "Peter Maydell" <peter.maydell@linaro.org>, "Tony Nguyen" <tony.nguyen@bt.com>, "Alistair Francis" <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael Walle" <michael@walle.cc>, "Fabien Chouteau" <chouteau@adacore.com>, "KONRAD Frederic" <frederic.konrad@adacore.com>, qemu-arm@nongnu.org, "Peter Chubb" <peter.chubb@nicta.com.au>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Paolo Bonzini" <pbonzini@redhat.com> Subject: [Qemu-devel] [RFC PATCH 03/17] hw/char: Declare device little or big endian Date: Sat, 24 Aug 2019 04:56:24 +1000 Message-ID: <cece576078bb043c7f98b899c643159aaaf3f0d8.1566467963.git.tony.nguyen@bt.com> (raw) In-Reply-To: <cover.1566467963.git.tony.nguyen@bt.com> 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 the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result in genuinely native endian devices being incorrectly declared as little or big endian, but should not introduce regressions for current targets. These devices should be re-declared as DEVICE_NATIVE_ENDIAN if 1) it has a new target with an opposite endian or 2) someone informed knows better =) Signed-off-by: Tony Nguyen <tony.nguyen@bt.com> --- 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(-) diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index 0e315b2376..5a128aa5b3 100644 --- a/hw/char/cadence_uart.c +++ b/hw/char/cadence_uart.c @@ -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) diff --git a/hw/char/escc.c b/hw/char/escc.c index e185522e27..e2130e04e5 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -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, diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index 15ac12ef22..6096158188 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -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 diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index fe3cbf41a3..880878ab4d 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -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) diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index fddde9b43d..8a2f10d7bd 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -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) diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 32f29c44cf..372c7d60d8 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -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, diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index c358ca07f3..ed4f02c500 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -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) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 84ad8ff9fb..0a86f6f340 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -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 = { -- 2.23.0
next prev parent reply index Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-23 18:56 [Qemu-devel] [RFC PATCH 00/17] " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 01/17] hw/audio: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 02/17] hw/block: " Tony Nguyen 2019-08-23 18:56 ` Tony Nguyen [this message] 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 04/17] hw/display: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 05/17] hw/dma: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 06/17] hw/gpio: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 07/17] hw/i2c: " Tony Nguyen 2019-08-24 9:27 ` David Gibson 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 08/17] hw/input: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 09/17] hw/intc: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 10/17] hw/isa: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 11/17] hw/misc: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 12/17] hw/net: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 13/17] hw/pci-host: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 14/17] hw/sd: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 15/17] hw/ssi: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 16/17] hw/timer: " Tony Nguyen 2019-08-23 18:56 ` [Qemu-devel] [RFC PATCH 17/17] build: Correct non-common common-obj-* to obj-* Tony Nguyen 2019-08-23 20:05 ` Paolo Bonzini 2019-08-23 19:42 ` [Qemu-devel] [RFC PATCH 00/17] Declare device little or big endian no-reply
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=cece576078bb043c7f98b899c643159aaaf3f0d8.1566467963.git.tony.nguyen@bt.com \ --to=tony.nguyen@bt.com \ --cc=alistair@alistair23.me \ --cc=chouteau@adacore.com \ --cc=edgar.iglesias@gmail.com \ --cc=frederic.konrad@adacore.com \ --cc=marcandre.lureau@redhat.com \ --cc=michael@walle.cc \ --cc=pbonzini@redhat.com \ --cc=peter.chubb@nicta.com.au \ --cc=peter.maydell@linaro.org \ --cc=qemu-arm@nongnu.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
QEMU-Devel Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git git clone --mirror https://lore.kernel.org/qemu-devel/2 qemu-devel/git/2.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \ qemu-devel@nongnu.org public-inbox-index qemu-devel Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git