Path: blob/master/arch/hexagon/include/asm/mmu_context.h
26481 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* MM context support for the Hexagon architecture3*4* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.5*/67#ifndef _ASM_MMU_CONTEXT_H8#define _ASM_MMU_CONTEXT_H910#include <linux/mm_types.h>1112#include <asm/setup.h>13#include <asm/page.h>14#include <asm/pgalloc.h>15#include <asm/mem-layout.h>1617/*18* VM port hides all TLB management, so "lazy TLB" isn't very19* meaningful. Even for ports to architectures with visble TLBs,20* this is almost invariably a null function.21*22* mm->context is set up by pgd_alloc, so no init_new_context required.23*/2425/*26* Switch active mm context27*/28static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,29struct task_struct *tsk)30{31int l1;3233/*34* For virtual machine, we have to update system map if it's been35* touched.36*/37if (next->context.generation < prev->context.generation) {38for (l1 = MIN_KERNEL_SEG; l1 <= max_kernel_seg; l1++)39next->pgd[l1] = init_mm.pgd[l1];4041next->context.generation = prev->context.generation;42}4344__vmnewmap((void *)next->context.ptbase);45}4647/*48* Activate new memory map for task49*/50#define activate_mm activate_mm51static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)52{53unsigned long flags;5455local_irq_save(flags);56switch_mm(prev, next, current_thread_info()->task);57local_irq_restore(flags);58}5960/* Generic hooks for arch_dup_mmap and arch_exit_mmap */61#include <asm-generic/mm_hooks.h>6263#include <asm-generic/mmu_context.h>6465#endif666768