1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_SCORE_TLBFLUSH_H
3 #define _ASM_SCORE_TLBFLUSH_H
10 * - flush_tlb_all() flushes all processes TLB entries
11 * - flush_tlb_mm(mm) flushes the specified mm context TLB entries
12 * - flush_tlb_page(vma, vmaddr) flushes one page
13 * - flush_tlb_range(vma, start, end) flushes a range of pages
14 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
16 extern void local_flush_tlb_all(void);
17 extern void local_flush_tlb_mm(struct mm_struct
*mm
);
18 extern void local_flush_tlb_range(struct vm_area_struct
*vma
,
19 unsigned long start
, unsigned long end
);
20 extern void local_flush_tlb_kernel_range(unsigned long start
,
22 extern void local_flush_tlb_page(struct vm_area_struct
*vma
,
24 extern void local_flush_tlb_one(unsigned long vaddr
);
26 #define flush_tlb_all() local_flush_tlb_all()
27 #define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
28 #define flush_tlb_range(vma, vmaddr, end) \
29 local_flush_tlb_range(vma, vmaddr, end)
30 #define flush_tlb_kernel_range(vmaddr, end) \
31 local_flush_tlb_kernel_range(vmaddr, end)
32 #define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page)
33 #define flush_tlb_one(vaddr) local_flush_tlb_one(vaddr)
37 static inline unsigned long pevn_get(void)
49 static inline void pevn_set(unsigned long val
)
53 "nop\nnop\nnop\nnop\nnop\n"
57 static inline void pectx_set(unsigned long val
)
61 "nop\nnop\nnop\nnop\nnop\n"
65 static inline unsigned long pectx_get(void)
74 static inline unsigned long tlblock_get(void)
84 static inline void tlblock_set(unsigned long val
)
88 "nop\nnop\nnop\nnop\nnop\n"
92 static inline void tlbpt_set(unsigned long val
)
96 "nop\nnop\nnop\nnop\nnop\n"
100 static inline long tlbpt_get(void)
104 __asm__
__volatile__(
112 static inline void peaddr_set(unsigned long val
)
114 __asm__
__volatile__(
116 "nop\nnop\nnop\nnop\nnop\n"
120 /* TLB operations. */
121 static inline void tlb_probe(void)
123 __asm__
__volatile__("stlb;nop;nop;nop;nop;nop");
126 static inline void tlb_read(void)
128 __asm__
__volatile__("mftlb;nop;nop;nop;nop;nop");
131 static inline void tlb_write_indexed(void)
133 __asm__
__volatile__("mtptlb;nop;nop;nop;nop;nop");
136 static inline void tlb_write_random(void)
138 __asm__
__volatile__("mtrtlb;nop;nop;nop;nop;nop");
141 #endif /* Not __ASSEMBLY__ */
143 #endif /* _ASM_SCORE_TLBFLUSH_H */