18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * OpenRISC Linux
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Linux architectural port borrowing liberally from similar works of
68c2ecf20Sopenharmony_ci * others.  All original copyrights apply as per the original source
78c2ecf20Sopenharmony_ci * declaration.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * OpenRISC implementation:
108c2ecf20Sopenharmony_ci * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
118c2ecf20Sopenharmony_ci * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
128c2ecf20Sopenharmony_ci * et al.
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#ifndef __ASM_OPENRISC_MMU_CONTEXT_H
168c2ecf20Sopenharmony_ci#define __ASM_OPENRISC_MMU_CONTEXT_H
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#include <asm-generic/mm_hooks.h>
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciextern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
218c2ecf20Sopenharmony_ciextern void destroy_context(struct mm_struct *mm);
228c2ecf20Sopenharmony_ciextern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
238c2ecf20Sopenharmony_ci		      struct task_struct *tsk);
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define deactivate_mm(tsk, mm)	do { } while (0)
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define activate_mm(prev, next) switch_mm((prev), (next), NULL)
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* current active pgd - this is similar to other processors pgd
308c2ecf20Sopenharmony_ci * registers like cr3 on the i386
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciextern volatile pgd_t *current_pgd[]; /* defined in arch/openrisc/mm/fault.c */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_cistatic inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
368c2ecf20Sopenharmony_ci{
378c2ecf20Sopenharmony_ci}
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#endif
40