xref: /openbmc/linux/include/linux/mmu_context.h (revision 23e5d9ec)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
23d2d827fSMichael S. Tsirkin #ifndef _LINUX_MMU_CONTEXT_H
33d2d827fSMichael S. Tsirkin #define _LINUX_MMU_CONTEXT_H
43d2d827fSMichael S. Tsirkin 
5f98db601SAndy Lutomirski #include <asm/mmu_context.h>
6bf9282dcSPeter Zijlstra #include <asm/mmu.h>
7f98db601SAndy Lutomirski 
8f98db601SAndy Lutomirski /* Architectures that care about IRQ state in switch_mm can override this. */
9f98db601SAndy Lutomirski #ifndef switch_mm_irqs_off
10f98db601SAndy Lutomirski # define switch_mm_irqs_off switch_mm
11f98db601SAndy Lutomirski #endif
12f98db601SAndy Lutomirski 
13bf9282dcSPeter Zijlstra #ifndef leave_mm
leave_mm(int cpu)14bf9282dcSPeter Zijlstra static inline void leave_mm(int cpu) { }
15bf9282dcSPeter Zijlstra #endif
16bf9282dcSPeter Zijlstra 
179ae606bcSWill Deacon /*
189ae606bcSWill Deacon  * CPUs that are capable of running user task @p. Must contain at least one
199ae606bcSWill Deacon  * active CPU. It is assumed that the kernel can run on all CPUs, so calling
209ae606bcSWill Deacon  * this for a kernel thread is pointless.
219ae606bcSWill Deacon  *
229ae606bcSWill Deacon  * By default, we assume a sane, homogeneous system.
239ae606bcSWill Deacon  */
249ae606bcSWill Deacon #ifndef task_cpu_possible_mask
259ae606bcSWill Deacon # define task_cpu_possible_mask(p)	cpu_possible_mask
269ae606bcSWill Deacon # define task_cpu_possible(cpu, p)	true
279ae606bcSWill Deacon #else
289ae606bcSWill Deacon # define task_cpu_possible(cpu, p)	cpumask_test_cpu((cpu), task_cpu_possible_mask(p))
299ae606bcSWill Deacon #endif
309ae606bcSWill Deacon 
31f7d30434SKirill A. Shutemov #ifndef mm_untag_mask
mm_untag_mask(struct mm_struct * mm)32f7d30434SKirill A. Shutemov static inline unsigned long mm_untag_mask(struct mm_struct *mm)
33f7d30434SKirill A. Shutemov {
34f7d30434SKirill A. Shutemov 	return -1UL;
35f7d30434SKirill A. Shutemov }
36f7d30434SKirill A. Shutemov #endif
37f7d30434SKirill A. Shutemov 
38*23e5d9ecSKirill A. Shutemov #ifndef arch_pgtable_dma_compat
arch_pgtable_dma_compat(struct mm_struct * mm)39*23e5d9ecSKirill A. Shutemov static inline bool arch_pgtable_dma_compat(struct mm_struct *mm)
40*23e5d9ecSKirill A. Shutemov {
41*23e5d9ecSKirill A. Shutemov 	return true;
42*23e5d9ecSKirill A. Shutemov }
43*23e5d9ecSKirill A. Shutemov #endif
44*23e5d9ecSKirill A. Shutemov 
453d2d827fSMichael S. Tsirkin #endif
46