QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Tony Nguyen <tony.nguyen@bt.com>
To: qemu-devel@nongnu.org
Cc: Tony Nguyen <tony.nguyen@bt.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel]  [PATCH 8/9] exec: Delete DEVICE_HOST_ENDIAN
Date: Sat, 24 Aug 2019 05:42:47 +1000
Message-ID: <11377fa49c502c61e74f5cab4d20ea89e317597b.1566588034.git.tony.nguyen@bt.com> (raw)
In-Reply-To: <cover.1566588033.git.tony.nguyen@bt.com>

Simplify code with MemOp short hand for host endianness, 0.

 typedef enum MemOp {
     /* snip */
 #ifdef HOST_WORDS_BIGENDIAN
     MO_LE    = MO_BSWAP,
     MO_BE    = 0,
 #else
     MO_LE    = 0,
     MO_BE    = MO_BSWAP,
 #endif
     /* snip */
 };

Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
---
 include/exec/cpu-common.h | 8 --------
 memory.c                  | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 7eeb78c48b..b33dc0c9f5 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -16,14 +16,6 @@ void tcg_flush_softmmu_tlb(CPUState *cs);
 
 #if !defined(CONFIG_USER_ONLY)
 
-#include "exec/memop.h"
-
-#if defined(HOST_WORDS_BIGENDIAN)
-#define DEVICE_HOST_ENDIAN MO_BE
-#else
-#define DEVICE_HOST_ENDIAN MO_LE
-#endif
-
 /* address in the RAM (different from a physical address) */
 #if defined(CONFIG_XEN_BACKEND)
 typedef uint64_t ram_addr_t;
diff --git a/memory.c b/memory.c
index d78d6e46db..ee7559a18c 100644
--- a/memory.c
+++ b/memory.c
@@ -1353,7 +1353,7 @@ static void memory_region_ram_device_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps ram_device_mem_ops = {
     .read = memory_region_ram_device_read,
     .write = memory_region_ram_device_write,
-    .endianness = DEVICE_HOST_ENDIAN,
+    .endianness = 0, /* Host endianness */
     .valid = {
         .min_access_size = 1,
         .max_access_size = 8,
-- 
2.23.0



  parent reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 19:42 [Qemu-devel] [PATCH 0/9] Delete enum device_endian Tony Nguyen
2019-08-23 19:42 ` [Qemu-devel] [PATCH 1/9] exec: Map device_endian onto MemOp Tony Nguyen
2019-08-23 19:42 ` [Qemu-devel] [PATCH 2/9] exec: Replace DEVICE_NATIVE_ENDIAN with MO_TE Tony Nguyen
2019-08-23 19:42 ` [Qemu-devel] [PATCH 3/9] exec: Replace DEVICE_LITTLE_ENDIAN with MO_LE Tony Nguyen
2019-08-23 19:42 ` [Qemu-devel] [PATCH 4/9] exec: Replace DEVICE_BIG_ENDIAN with MO_BE Tony Nguyen
2019-08-23 19:42 ` [Qemu-devel] [PATCH 5/9] exec: Replace enum device_endian with MemOp Tony Nguyen
2019-08-23 19:42 ` [Qemu-devel] [PATCH 6/9] memory: Delete devend_memop Tony Nguyen
2019-08-24 22:30   ` Richard Henderson
2019-08-23 19:42 ` [Qemu-devel] [PATCH 7/9] exec: Delete device_endian Tony Nguyen
2019-08-23 19:42 ` Tony Nguyen [this message]
2019-08-24 22:31   ` [Qemu-devel] [PATCH 8/9] exec: Delete DEVICE_HOST_ENDIAN Richard Henderson
2019-08-23 19:42 ` [Qemu-devel] [PATCH 9/9] memory: Delete memory_region_big_endian Tony Nguyen
2019-08-24 22:32   ` Richard Henderson

Reply instructions:

You may reply publically 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=11377fa49c502c61e74f5cab4d20ea89e317597b.1566588034.git.tony.nguyen@bt.com \
    --to=tony.nguyen@bt.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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

	# 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