]> git.openfabrics.org - ~aditr/compat.git/commitdiff
compat: backport phys_addr_t (CONFIG_PHYS_ADDR_T_64BIT)
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Wed, 8 Feb 2012 01:21:43 +0000 (17:21 -0800)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Wed, 8 Feb 2012 02:43:20 +0000 (18:43 -0800)
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 <mcgrof@frijolero.org>
include/linux/compat-2.6.28.h

index c92c8b48de2e836e6444dec72a582dc41bd931bb..c4865f0919ed3bb75d924edd0680139acde3dc8d 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/skbuff.h>
 #include <linux/if_ether.h>
 #include <linux/usb.h>
+#include <linux/types.h>
 
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E      /* Port Access Entity (IEEE 802.1X) */
 
 #include <linux/pci.h>
 
+#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;                                    \