2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2009-09-21 17:03:51 -07:00
|
|
|
#ifndef _LINUX_MMU_CONTEXT_H
|
|
|
|
|
#define _LINUX_MMU_CONTEXT_H
|
|
|
|
|
|
2016-04-26 09:39:06 -07:00
|
|
|
#include <asm/mmu_context.h>
|
2020-08-12 12:22:17 +02:00
|
|
|
#include <asm/mmu.h>
|
2016-04-26 09:39:06 -07:00
|
|
|
|
|
|
|
|
/* Architectures that care about IRQ state in switch_mm can override this. */
|
|
|
|
|
#ifndef switch_mm_irqs_off
|
|
|
|
|
# define switch_mm_irqs_off switch_mm
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-08-12 12:22:17 +02:00
|
|
|
#ifndef leave_mm
|
2024-01-26 08:06:43 +00:00
|
|
|
static inline void leave_mm(void) { }
|
2020-08-12 12:22:17 +02:00
|
|
|
#endif
|
|
|
|
|
|
2021-07-30 12:24:28 +01:00
|
|
|
/*
|
|
|
|
|
* CPUs that are capable of running user task @p. Must contain at least one
|
|
|
|
|
* active CPU. It is assumed that the kernel can run on all CPUs, so calling
|
|
|
|
|
* this for a kernel thread is pointless.
|
|
|
|
|
*
|
|
|
|
|
* By default, we assume a sane, homogeneous system.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef task_cpu_possible_mask
|
|
|
|
|
# define task_cpu_possible_mask(p) cpu_possible_mask
|
|
|
|
|
# define task_cpu_possible(cpu, p) true
|
2025-06-03 21:15:32 +02:00
|
|
|
# define task_cpu_fallback_mask(p) housekeeping_cpumask(HK_TYPE_DOMAIN)
|
2021-07-30 12:24:28 +01:00
|
|
|
#else
|
|
|
|
|
# define task_cpu_possible(cpu, p) cpumask_test_cpu((cpu), task_cpu_possible_mask(p))
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-03-12 14:26:04 +03:00
|
|
|
#ifndef mm_untag_mask
|
|
|
|
|
static inline unsigned long mm_untag_mask(struct mm_struct *mm)
|
|
|
|
|
{
|
|
|
|
|
return -1UL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-03-12 14:26:06 +03:00
|
|
|
#ifndef arch_pgtable_dma_compat
|
|
|
|
|
static inline bool arch_pgtable_dma_compat(struct mm_struct *mm)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-09-21 17:03:51 -07:00
|
|
|
#endif
|