Skip to content

Commit

Permalink
[MIPS] Fix computation of {PGD,PMD,PTE}_T_LOG2.
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Aug 27, 2007
1 parent 4c8081e commit 5ff9747
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/asm-mips/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
#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];

Expand Down

0 comments on commit 5ff9747

Please sign in to comment.