0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _ASM_POWERPC_TLB_H
0009 #define _ASM_POWERPC_TLB_H
0010 #ifdef __KERNEL__
0011
0012 #ifndef __powerpc64__
0013 #include <linux/pgtable.h>
0014 #endif
0015 #ifndef __powerpc64__
0016 #include <asm/page.h>
0017 #include <asm/mmu.h>
0018 #endif
0019
0020 #include <linux/pagemap.h>
0021
0022 #define __tlb_remove_tlb_entry __tlb_remove_tlb_entry
0023
0024 #define tlb_flush tlb_flush
0025 extern void tlb_flush(struct mmu_gather *tlb);
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #define tlb_needs_table_invalidate() radix_enabled()
0037
0038
0039 #include <asm-generic/tlb.h>
0040
0041 static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
0042 unsigned long address)
0043 {
0044 #ifdef CONFIG_PPC_BOOK3S_32
0045 if (pte_val(*ptep) & _PAGE_HASHPTE)
0046 flush_hash_entry(tlb->mm, ptep, address);
0047 #endif
0048 }
0049
0050 #ifdef CONFIG_SMP
0051 static inline int mm_is_core_local(struct mm_struct *mm)
0052 {
0053 return cpumask_subset(mm_cpumask(mm),
0054 topology_sibling_cpumask(smp_processor_id()));
0055 }
0056
0057 #ifdef CONFIG_PPC_BOOK3S_64
0058 static inline int mm_is_thread_local(struct mm_struct *mm)
0059 {
0060 if (atomic_read(&mm->context.active_cpus) > 1)
0061 return false;
0062 return cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm));
0063 }
0064 #else
0065 static inline int mm_is_thread_local(struct mm_struct *mm)
0066 {
0067 return cpumask_equal(mm_cpumask(mm),
0068 cpumask_of(smp_processor_id()));
0069 }
0070 #endif
0071
0072 #else
0073 static inline int mm_is_core_local(struct mm_struct *mm)
0074 {
0075 return 1;
0076 }
0077
0078 static inline int mm_is_thread_local(struct mm_struct *mm)
0079 {
0080 return 1;
0081 }
0082 #endif
0083
0084 #define arch_supports_page_table_move arch_supports_page_table_move
0085 static inline bool arch_supports_page_table_move(void)
0086 {
0087 return radix_enabled();
0088 }
0089
0090 #endif
0091 #endif