mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-27 00:19:54 +02:00
c8e4b6534a
Now it compiles with the new toolchain. These are mostly backports from mainline linux and newer linux kernels from openwrt. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18345 3c298f89-4303-0410-b956-a3cf2f4a3e73
22 lines
807 B
Diff
22 lines
807 B
Diff
[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];
|
|
|