mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/3] sandbox: specify sizeof(dma_addr_t) == sizeof(phys_addr_t) == 8 on 64BIT
Date: Thu,  2 Jul 2020 17:25:06 +0200	[thread overview]
Message-ID: <20200702152507.13694-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200702152507.13694-1-a.fatoum@pengutronix.de>

sizeof(dma_addr_t) == 8 shouldn't introduce any functional change, because
we can't have DMA on sandbox. For now it suppresses benign warnings about
mismatched pointer and integer sizes when some headers are included.

sizeof(phys_addr_t) == 8 was already the case on systems with
__x86_64__. As CONFIG_64BIT now is set according to the bitness
of the compiler, we can migrate this fully to Kconfig.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/sandbox/Kconfig             | 5 +++++
 arch/sandbox/include/asm/elf.h   | 1 -
 arch/sandbox/include/asm/types.h | 6 ------
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 3f10709021a7..40e04919d21e 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -24,6 +24,9 @@ config SANDBOX_UNWIND
 	select ARCH_HAS_STACK_DUMP
 	depends on UBSAN || KASAN
 
+config PHYS_ADDR_T_64BIT
+	bool
+
 config CC_IS_64BIT
 	def_bool $(success,$(srctree)/scripts/gcc-64bitptr.sh $(CC))
 
@@ -34,6 +37,8 @@ config 64BIT
 	bool
 	default n if SANDBOX_LINUX_I386
 	default CC_IS_64BIT
+	select ARCH_DMA_ADDR_T_64BIT
+	select PHYS_ADDR_T_64BIT
 
 config SANDBOX_LINUX_I386
 	bool "32-bit x86 barebox" if CC_HAS_LINUX_I386_SUPPORT
diff --git a/arch/sandbox/include/asm/elf.h b/arch/sandbox/include/asm/elf.h
index 3939336ccba4..e71a60aeb93f 100644
--- a/arch/sandbox/include/asm/elf.h
+++ b/arch/sandbox/include/asm/elf.h
@@ -3,7 +3,6 @@
 
 #if __SIZEOF_POINTER__ == 8
 #define ELF_CLASS	ELFCLASS64
-#define CONFIG_PHYS_ADDR_T_64BIT
 #else
 #define ELF_CLASS	ELFCLASS32
 #endif
diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h
index 3e4a8f7ba34f..28046670f4e2 100644
--- a/arch/sandbox/include/asm/types.h
+++ b/arch/sandbox/include/asm/types.h
@@ -10,12 +10,6 @@
  */
 #define INTERNAL_SIZE_T unsigned long
 
-/*
- * This is a Kconfig variable in the Kernel, but we want to detect
- * this during compile time, so we set it here.
- */
-#define CONFIG_PHYS_ADDR_T_64BIT
-
 #endif
 
 #endif
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-07-02 15:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 15:25 [PATCH 1/3] x86: Kconfig: specify sizeof(dma_addr_t) == 8 for 64BIT Ahmad Fatoum
2020-07-02 15:25 ` Ahmad Fatoum [this message]
2020-07-02 15:25 ` [PATCH 3/3] sandbox: include: <asm/types.h>: don't define INTERNAL_SIZE_T Ahmad Fatoum
2020-07-05 14:09 ` [PATCH 1/3] x86: Kconfig: specify sizeof(dma_addr_t) == 8 for 64BIT Sascha Hauer

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=20200702152507.13694-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox