powerpc/mm: Refactor pte_update() on nohash/32
[linux-2.6-microblaze.git] / arch / powerpc / include / asm / nohash / 32 / pgtable.h
index 7e908a1..db17f50 100644 (file)
@@ -222,12 +222,9 @@ static inline void pmd_clear(pmd_t *pmdp)
  * to properly flush the virtually tagged instruction cache of
  * those implementations.
  */
-#ifndef CONFIG_PTE_64BIT
-static inline unsigned long pte_update(pte_t *p,
-                                      unsigned long clr,
-                                      unsigned long set)
+static inline pte_basic_t pte_update(pte_t *p, unsigned long clr, unsigned long set)
 {
-#ifdef PTE_ATOMIC_UPDATES
+#if defined(PTE_ATOMIC_UPDATES) && !defined(CONFIG_PTE_64BIT)
        unsigned long old, tmp;
 
        __asm__ __volatile__("\
@@ -241,8 +238,8 @@ static inline unsigned long pte_update(pte_t *p,
        : "r" (p), "r" (clr), "r" (set), "m" (*p)
        : "cc" );
 #else /* PTE_ATOMIC_UPDATES */
-       unsigned long old = pte_val(*p);
-       unsigned long new = (old & ~clr) | set;
+       pte_basic_t old = pte_val(*p);
+       pte_basic_t new = (old & ~(pte_basic_t)clr) | set;
 
 #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PPC_16K_PAGES)
        p->pte = p->pte1 = p->pte2 = p->pte3 = new;
@@ -257,21 +254,6 @@ static inline unsigned long pte_update(pte_t *p,
 #endif
        return old;
 }
-#else /* CONFIG_PTE_64BIT */
-static inline unsigned long long pte_update(pte_t *p,
-                                           unsigned long clr,
-                                           unsigned long set)
-{
-       unsigned long long old = pte_val(*p);
-       *p = __pte((old & ~(unsigned long long)clr) | set);
-
-#ifdef CONFIG_44x
-       if ((old & _PAGE_USER) && (old & _PAGE_EXEC))
-               icache_44x_need_flush = 1;
-#endif
-       return old;
-}
-#endif /* CONFIG_PTE_64BIT */
 
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 static inline int __ptep_test_and_clear_young(unsigned int context, unsigned long addr, pte_t *ptep)