1 [MIPS] Fix computation of {PGD,PMD,PTE}_T_LOG2.
3 For the generation of asm-offset.h to work these need to be evaulatable
4 by gcc as a constant expression. This issue did exist for a while but
5 didn't bite because they're only in asm-offset.h for debugging purposes.
7 --- a/include/asm-mips/pgtable.h
8 +++ b/include/asm-mips/pgtable.h
9 @@ -168,9 +168,9 @@ static inline void pte_clear(struct mm_s
10 #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
13 -#define PGD_T_LOG2 ffz(~sizeof(pgd_t))
14 -#define PMD_T_LOG2 ffz(~sizeof(pmd_t))
15 -#define PTE_T_LOG2 ffz(~sizeof(pte_t))
16 +#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
17 +#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
18 +#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
20 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];