[RFC][PATCH 34/35] powerpc use generic ptemap.h

From: Dave Hansen
Date: Fri May 01 2009 - 10:55:42 EST



powerpc is a bid of an oddball here. It seems to have CONFIG_HIGHPTE
behavior at all times when compiled as 32-bit. There's even an
#ifdef CONFIG_HIGHPTE in arch/powerpc/mm/pgtable_32.c, but there's no
trace of HIGHPTE in Kconfig anywhere.

This gives ppc32 an explicit HIGHPTE in Kconfig so that we can use
the #ifdef in asm-generic/ptemap.h and let ppc use the generic code
with x86 and frv.

Signed-off-by: Dave Hansen <dave@xxxxxxxxxxxxxxxxxx>
---

linux-2.6.git-dave/arch/powerpc/Kconfig | 4 ++++
linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h | 18 ++++++------------
2 files changed, 10 insertions(+), 12 deletions(-)

diff -puN arch/powerpc/include/asm/ptemap.h~powerpc-pte_offset_kernel arch/powerpc/include/asm/ptemap.h
--- linux-2.6.git/arch/powerpc/include/asm/ptemap.h~powerpc-pte_offset_kernel 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h 2009-04-30 15:11:13.000000000 -0700
@@ -2,19 +2,13 @@
#define _POWERPC_ASM_PTEMAP_H

#ifndef __powerpc64__
-
-#define pte_offset_map(dir, addr) \
- ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
-#define pte_offset_map_nested(dir, addr) \
- ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
-
-#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
-
-#else /* __powerpc64__ */
+/*
+ * This lets us use the x86 implementation
+ * in the generic ptemap.h
+ */
+#define kmap_atomic_pte(page, type) kmap_atomic(page, type)
+#endif

#include <asm-generic/ptemap.h>

-#endif
-
#endif /* _POWERPC_ASM_PTEMAP_H */
diff -puN arch/powerpc/Kconfig~powerpc-pte_offset_kernel arch/powerpc/Kconfig
--- linux-2.6.git/arch/powerpc/Kconfig~powerpc-pte_offset_kernel 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/Kconfig 2009-04-30 15:11:13.000000000 -0700
@@ -244,6 +244,10 @@ config HIGHMEM
bool "High memory support"
depends on PPC32

+config HIGHPTE
+ def_bool y
+ depends on HIGHMEM
+
source kernel/time/Kconfig
source kernel/Kconfig.hz
source kernel/Kconfig.preempt
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/