powerpc/mm: Move pte_user() into nohash/pgtable.h
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 9 Oct 2018 13:52:06 +0000 (13:52 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 14 Oct 2018 07:04:09 +0000 (18:04 +1100)
Now the pte-common.h is only for nohash platforms, lets
move pte_user() helper out of pte-common.h to put it
together with other helpers.

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/nohash/pgtable.h
arch/powerpc/include/asm/pte-common.h

index 062d962336732fff8a25feceb94d67d516b4e744..8de3b7eb88b0ed1587a162ecb0c26e7f40b91d1d 100644 (file)
@@ -51,6 +51,16 @@ static inline bool pte_hw_valid(pte_t pte)
        return pte_val(pte) & _PAGE_PRESENT;
 }
 
+/*
+ * Don't just check for any non zero bits in __PAGE_USER, since for book3e
+ * and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in
+ * _PAGE_USER.  Need to explicitly match _PAGE_BAP_UR bit in that case too.
+ */
+static inline bool pte_user(pte_t pte)
+{
+       return (pte_val(pte) & (_PAGE_USER | _PAGE_PRIVILEGED)) == _PAGE_USER;
+}
+
 /*
  * We only find page table entry in the last level
  * Hence no need for other accessors
index 3a8ec18ffd22e5f05aec858236f38c0cf59b2fee..556a914ff8454b74bf7b5cbf67f2765e7c8cc77b 100644 (file)
 #define _PTE_NONE_MASK 0
 #endif
 
-#ifndef __ASSEMBLY__
-
-/*
- * Don't just check for any non zero bits in __PAGE_USER, since for book3e
- * and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in
- * _PAGE_USER.  Need to explicitly match _PAGE_BAP_UR bit in that case too.
- */
-static inline bool pte_user(pte_t pte)
-{
-       return (pte_val(pte) & (_PAGE_USER | _PAGE_PRIVILEGED)) == _PAGE_USER;
-}
-#endif /* __ASSEMBLY__ */
-
 /* Location of the PFN in the PTE. Most 32-bit platforms use the same
  * as _PAGE_SHIFT here (ie, naturally aligned).
  * Platform who don't just pre-define the value so we don't override it here