Browse Source

parisc: Fix pmd code to depend on PT_NLEVELS value, not on CONFIG_64BIT

Make the code which sets up the pmd depend on PT_NLEVELS == 3, not on
CONFIG_64BIT. The reason is, that a 64bit kernel with a page size
greater than 4k doesn't need the pmd and thus has PT_NLEVELS = 2.

Signed-off-by: Helge Deller <deller@gmx.de>
Helge Deller 10 years ago
parent
commit
2e3f0ab2bb
1 changed files with 3 additions and 5 deletions
  1. 3 5
      arch/parisc/include/asm/pgalloc.h

+ 3 - 5
arch/parisc/include/asm/pgalloc.h

@@ -26,7 +26,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 
 	if (likely(pgd != NULL)) {
 	if (likely(pgd != NULL)) {
 		memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER);
 		memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER);
-#ifdef CONFIG_64BIT
+#if PT_NLEVELS == 3
 		actual_pgd += PTRS_PER_PGD;
 		actual_pgd += PTRS_PER_PGD;
 		/* Populate first pmd with allocated memory.  We mark it
 		/* Populate first pmd with allocated memory.  We mark it
 		 * with PxD_FLAG_ATTACHED as a signal to the system that this
 		 * with PxD_FLAG_ATTACHED as a signal to the system that this
@@ -45,7 +45,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
 {
-#ifdef CONFIG_64BIT
+#if PT_NLEVELS == 3
 	pgd -= PTRS_PER_PGD;
 	pgd -= PTRS_PER_PGD;
 #endif
 #endif
 	free_pages((unsigned long)pgd, PGD_ALLOC_ORDER);
 	free_pages((unsigned long)pgd, PGD_ALLOC_ORDER);
@@ -72,7 +72,6 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 
 
 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 {
 {
-#ifdef CONFIG_64BIT
 	if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
 	if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
 		/*
 		/*
 		 * This is the permanent pmd attached to the pgd;
 		 * This is the permanent pmd attached to the pgd;
@@ -82,7 +81,6 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 		 */
 		 */
 		mm_inc_nr_pmds(mm);
 		mm_inc_nr_pmds(mm);
 		return;
 		return;
-#endif
 	free_pages((unsigned long)pmd, PMD_ORDER);
 	free_pages((unsigned long)pmd, PMD_ORDER);
 }
 }
 
 
@@ -104,7 +102,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 static inline void
 static inline void
 pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
 pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
 {
 {
-#ifdef CONFIG_64BIT
+#if PT_NLEVELS == 3
 	/* preserve the gateway marker if this is the beginning of
 	/* preserve the gateway marker if this is the beginning of
 	 * the permanent pmd */
 	 * the permanent pmd */
 	if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
 	if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)