summaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2009-11-08 21:56:59 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2009-11-08 21:56:59 +0000
commit343e9ffa203702c68e846fd3618ed6b30c2a8713 (patch)
tree8970b881c98964509c8b6dc48a7c7b91095a5e92 /target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch
parentae0457f76a2a1e67cd0231e978c19911fe386064 (diff)
downloadmaster-31e0f0ae-343e9ffa203702c68e846fd3618ed6b30c2a8713.tar.gz
master-31e0f0ae-343e9ffa203702c68e846fd3618ed6b30c2a8713.tar.bz2
master-31e0f0ae-343e9ffa203702c68e846fd3618ed6b30c2a8713.zip
Add some build fixes for kernel 2.6.21 and the infineon amazon target.
Now it compiles with the new toolchain. These are mostly backports from mainline linux and newer linux kernels from openwrt. SVN-Revision: 18345
Diffstat (limited to 'target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch')
-rw-r--r--target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch b/target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch
new file mode 100644
index 0000000000..45c753b55b
--- /dev/null
+++ b/target/linux/generic-2.6/patches-2.6.21/31-use_kbuild.h.patch
@@ -0,0 +1,21 @@
+[MIPS] Fix computation of {PGD,PMD,PTE}_T_LOG2.
+
+For the generation of asm-offset.h to work these need to be evaulatable
+by gcc as a constant expression. This issue did exist for a while but
+didn't bite because they're only in asm-offset.h for debugging purposes.
+
+--- a/include/asm-mips/pgtable.h
++++ b/include/asm-mips/pgtable.h
+@@ -168,9 +168,9 @@ static inline void pte_clear(struct mm_s
+ #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
+ #endif
+
+-#define PGD_T_LOG2 ffz(~sizeof(pgd_t))
+-#define PMD_T_LOG2 ffz(~sizeof(pmd_t))
+-#define PTE_T_LOG2 ffz(~sizeof(pte_t))
++#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
++#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
++#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
+
+ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+