arch/arm/include/asm/mmu_context.h
Source file repositories/reference/linux-study-clean/arch/arm/include/asm/mmu_context.h
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/include/asm/mmu_context.h- Extension
.h- Size
- 3848 bytes
- Lines
- 153
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/sched.hlinux/mm_types.hlinux/preempt.hasm/cacheflush.hasm/cachetype.hasm/proc-fns.hasm/smp_plat.hasm-generic/mm_hooks.hasm-generic/mmu_context.h
Detected Declarations
function check_vmalloc_seqfunction init_new_contextfunction a15_erratum_get_cpumaskfunction finish_arch_post_lock_switchfunction switch_mmfunction enter_lazy_tlb
Annotated Snippet
if (mm->context.switch_pending) {
mm->context.switch_pending = 0;
cpu_switch_mm(mm->pgd, mm);
}
preempt_enable_no_resched();
}
}
#endif /* !MODULE */
#endif /* CONFIG_MMU */
#endif /* CONFIG_CPU_HAS_ASID */
#define activate_mm(prev,next) switch_mm(prev, next, NULL)
/*
* This is the actual mm switch as far as the scheduler
* is concerned. No registers are touched. We avoid
* calling the CPU specific function when the mm hasn't
* actually changed.
*/
static inline void
switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
#ifdef CONFIG_MMU
unsigned int cpu = smp_processor_id();
/*
* __sync_icache_dcache doesn't broadcast the I-cache invalidation,
* so check for possible thread migration and invalidate the I-cache
* if we're new to this CPU.
*/
if (cache_ops_need_broadcast() &&
!cpumask_empty(mm_cpumask(next)) &&
!cpumask_test_cpu(cpu, mm_cpumask(next)))
__flush_icache_all();
if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) {
check_and_switch_context(next, tsk);
if (cache_is_vivt())
cpumask_clear_cpu(cpu, mm_cpumask(prev));
}
#endif
}
#ifdef CONFIG_VMAP_STACK
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
if (mm != &init_mm)
check_vmalloc_seq(mm);
}
#define enter_lazy_tlb enter_lazy_tlb
#endif
#include <asm-generic/mmu_context.h>
#endif
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/sched.h`, `linux/mm_types.h`, `linux/preempt.h`, `asm/cacheflush.h`, `asm/cachetype.h`, `asm/proc-fns.h`, `asm/smp_plat.h`.
- Detected declarations: `function check_vmalloc_seq`, `function init_new_context`, `function a15_erratum_get_cpumask`, `function finish_arch_post_lock_switch`, `function switch_mm`, `function enter_lazy_tlb`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.