aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-08-13 07:44:41 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-08-26 21:16:56 -0400
commit9975e77df5428a1afff57fd8f76a1bc0bfc247fc (patch)
tree8ebe240bcbec6c17402ab2c69013fa2106157f48
parentbdd3ede0e11b5bc2d8424f73fb0219b8236d98bb (diff)
[MIPS] Gcc 3.3 build fixes.
Work around gcc 3.3's unability to evaluate that certain expressions indeed are constant. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/mm/init.c9
-rw-r--r--include/asm-mips/pgtable.h6
2 files changed, 13 insertions, 2 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index b8cb0dde3af..09d91505b90 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -26,6 +26,7 @@
26#include <linux/proc_fs.h> 26#include <linux/proc_fs.h>
27#include <linux/pfn.h> 27#include <linux/pfn.h>
28 28
29#include <asm/asm-offsets.h>
29#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
30#include <asm/cachectl.h> 31#include <asm/cachectl.h>
31#include <asm/cpu.h> 32#include <asm/cpu.h>
@@ -498,7 +499,13 @@ unsigned long pgd_current[NR_CPUS];
498 * different layout ... 499 * different layout ...
499 */ 500 */
500#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order))) 501#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order)))
501pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); 502
503/*
504 * gcc 3.3 and older have trouble determining that PTRS_PER_PGD and PGD_ORDER
505 * are constants. So we use the variants from asm-offset.h until that gcc
506 * will officially be retired.
507 */
508pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER);
502#ifdef CONFIG_64BIT 509#ifdef CONFIG_64BIT
503#ifdef MODULE_START 510#ifdef MODULE_START
504pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); 511pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index e2fb9dbac3f..d2ee2815674 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -172,7 +172,11 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
172#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1) 172#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
173#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) 173#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
174 174
175extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 175/*
176 * We used to declare this array with size but gcc 3.3 and older are not able
177 * to find that this expression is a constant, so the size is dropped.
178 */
179extern pgd_t swapper_pg_dir[];
176 180
177/* 181/*
178 * The following only work if pte_present() is true. 182 * The following only work if pte_present() is true.