From 4ec0edbd1cc2e6165e29f8ba466324e975e1cd73 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 7 Feb 2012 17:21:43 -0800 Subject: [PATCH] compat: backport phys_addr_t (CONFIG_PHYS_ADDR_T_64BIT) mcgrof@tux ~/linux-stable (git::linux-3.2.y)$ \ git describe --contains 600715dcdf567c86f8b2c6173fcfb4b873e25a19 v2.6.28-rc1~271^2^4~6 The CONFIG_PHYS_ADDR_T_64BIT was added as of v2.6.28-rc1~271^2^4~6, this is either u32 or u64 dependent on 64BIT || ARCH_PHYS_ADDR_T_64BIT. The ARCH_PHYS_ADDR_T_64BIT allows architectures to override the value even if the platform does not have CONFIG_64BIT. We simplify this check by just checking for all known architecture variables and also the CONFIG_64BIT -- but we skip adding this if the arch is x86 or PPC which already had phys_addr_t. Signed-off-by: Luis R. Rodriguez --- include/linux/compat-2.6.28.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/compat-2.6.28.h b/include/linux/compat-2.6.28.h index c92c8b4..c4865f0 100644 --- a/include/linux/compat-2.6.28.h +++ b/include/linux/compat-2.6.28.h @@ -8,6 +8,7 @@ #include #include #include +#include #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ @@ -15,6 +16,21 @@ #include +#if defined(CONFIG_X86) || defined(CONFIG_X86_64) || defined(CONFIG_PPC) +/* + * CONFIG_PHYS_ADDR_T_64BIT was added as new to all architectures + * as of 2.6.28 but x86 and ppc had it already. + */ +#else +#if defined(CONFIG_64BIT) || defined(CONFIG_X86_PAE) || defned(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT) +#define CONFIG_PHYS_ADDR_T_64BIT 1 +typedef u64 phys_addr_t; +#else +typedef u32 phys_addr_t; +#endif + +#endif /* non x86 and ppc */ + #ifndef WARN_ONCE #define WARN_ONCE(condition, format...) ({ \ static int __warned; \ -- 2.41.0