[PATCH v2 6/6] x86: move CONFIG_PHYS_ADDR_T_64BIT setting into Kconfig

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Mar 13 00:54:16 PDT 2025


sizeof(phys_addr_t) depends on whether CONFIG_PHYS_ADDR_T_64BIT is
enabled, which we so far defined depending on __x86_64__ in a header
file.

Given that we have a 64BIT symbol already in Kconfig that's selected
when building for 64-bit, let's have it select PHYS_ADDR_T_64BIT.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
v1 -> v2:
  - drop CONFIG_PHYS_ADDR_T_64BIT assignment in header file
  - reword commit message accordingly
---
 arch/x86/Kconfig             | 1 +
 arch/x86/include/asm/types.h | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cea8e25b81f0..b453890f022b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,6 +28,7 @@ menu "ARCH specific settings"
 config 64BIT
 	def_bool y if X86_EFI
 	select ARCH_DMA_ADDR_T_64BIT
+	select PHYS_ADDR_T_64BIT
 	help
 	  Say yes to build a 64-bit binary - formerly known as x86_64
 	  Say no to build a 32-bit binary - formerly known as i386.
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index 52a6e51fd4b1..feb5843b9c92 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -14,12 +14,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.39.5




More information about the barebox mailing list