Linux-Sparse Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/3] add the predefines for endianness
@ 2020-07-08 21:53 Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 1/3] mips: add predefines __MIPSEL__ or __MIPSEB__ & friends Luc Van Oostenryck
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luc Van Oostenryck @ 2020-07-08 21:53 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

This series adds the missing predefines for testing the
endinaness on ARM, ARM64 & MIPS.

Luc Van Oostenryck (3):
  mips: add predefines __MIPSEL__ or __MIPSEB__ & friends
  arm64: add predefine for endianness
  arm: add predefine __ARMEL__ or __ARMEB__

 target-arm.c   |  5 +++++
 target-arm64.c |  5 +++++
 target-mips.c  | 10 ++++++++++
 3 files changed, 20 insertions(+)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] mips: add predefines __MIPSEL__ or __MIPSEB__ & friends
  2020-07-08 21:53 [PATCH 0/3] add the predefines for endianness Luc Van Oostenryck
@ 2020-07-08 21:53 ` Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 2/3] arm64: add predefine for endianness Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 3/3] arm: add predefine __ARMEL__ or __ARMEB__ Luc Van Oostenryck
  2 siblings, 0 replies; 4+ messages in thread
From: Luc Van Oostenryck @ 2020-07-08 21:53 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 target-mips.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/target-mips.c b/target-mips.c
index 3d73236feffd..1ff0760c2446 100644
--- a/target-mips.c
+++ b/target-mips.c
@@ -10,6 +10,16 @@ static void predefine_mips(const struct target *self)
 	predefine("_MIPS_SZINT", 1, "%d", int_ctype.bit_size);
 	predefine("_MIPS_SZLONG", 1, "%d", long_ctype.bit_size);
 	predefine("_MIPS_SZPTR", 1, "%d", ptr_ctype.bit_size);
+
+	if (arch_big_endian) {
+		predefine("_MIPSEB", 1, "1");
+		predefine("__MIPSEB", 1, "1");
+		predefine("__MIPSEB__", 1, "1");
+	} else {
+		predefine("_MIPSEL", 1, "1");
+		predefine("__MIPSEL", 1, "1");
+		predefine("__MIPSEL__", 1, "1");
+	}
 }
 
 
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] arm64: add predefine for endianness
  2020-07-08 21:53 [PATCH 0/3] add the predefines for endianness Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 1/3] mips: add predefines __MIPSEL__ or __MIPSEB__ & friends Luc Van Oostenryck
@ 2020-07-08 21:53 ` Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 3/3] arm: add predefine __ARMEL__ or __ARMEB__ Luc Van Oostenryck
  2 siblings, 0 replies; 4+ messages in thread
From: Luc Van Oostenryck @ 2020-07-08 21:53 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

Depending on the endianness, predefine '__AARCH64EL__' or '__AARCH64EB__'.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 target-arm64.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target-arm64.c b/target-arm64.c
index 8619bd842f9b..d92ab16be592 100644
--- a/target-arm64.c
+++ b/target-arm64.c
@@ -20,6 +20,11 @@ static void predefine_arm64(const struct target *self)
 
 	predefine("__aarch64__", 1, "1");
 
+	if (arch_big_endian)
+		predefine("__AARCH64EB__", 0, "1");
+	else
+		predefine("__AARCH64EL__", 0, "1");
+
 	if (cmodel)
 		predefine_strong("__AARCH64_CMODEL_%s__", cmodel);
 }
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] arm: add predefine __ARMEL__ or __ARMEB__
  2020-07-08 21:53 [PATCH 0/3] add the predefines for endianness Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 1/3] mips: add predefines __MIPSEL__ or __MIPSEB__ & friends Luc Van Oostenryck
  2020-07-08 21:53 ` [PATCH 2/3] arm64: add predefine for endianness Luc Van Oostenryck
@ 2020-07-08 21:53 ` Luc Van Oostenryck
  2 siblings, 0 replies; 4+ messages in thread
From: Luc Van Oostenryck @ 2020-07-08 21:53 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

Depending on the endianness, predefine '__ARMEL__' or '__ARMEB__'.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 target-arm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target-arm.c b/target-arm.c
index 0d7c6134795f..382bd3decfe1 100644
--- a/target-arm.c
+++ b/target-arm.c
@@ -19,6 +19,11 @@ static void predefine_arm(const struct target *self)
 		predefine("__ARM_PCS", 1, "1");
 		break;
 	}
+
+	if (arch_big_endian)
+		predefine("__ARMEB__", 0, "1");
+	else
+		predefine("__ARMEL__", 0, "1");
 }
 
 const struct target target_arm = {
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 21:53 [PATCH 0/3] add the predefines for endianness Luc Van Oostenryck
2020-07-08 21:53 ` [PATCH 1/3] mips: add predefines __MIPSEL__ or __MIPSEB__ & friends Luc Van Oostenryck
2020-07-08 21:53 ` [PATCH 2/3] arm64: add predefine for endianness Luc Van Oostenryck
2020-07-08 21:53 ` [PATCH 3/3] arm: add predefine __ARMEL__ or __ARMEB__ Luc Van Oostenryck

Linux-Sparse Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-sparse/0 linux-sparse/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-sparse linux-sparse/ https://lore.kernel.org/linux-sparse \
		linux-sparse@vger.kernel.org
	public-inbox-index linux-sparse

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-sparse


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git