18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __ARM_MMU_H
38c2ecf20Sopenharmony_ci#define __ARM_MMU_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#ifdef CONFIG_MMU
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_citypedef struct {
88c2ecf20Sopenharmony_ci#ifdef CONFIG_CPU_HAS_ASID
98c2ecf20Sopenharmony_ci	atomic64_t	id;
108c2ecf20Sopenharmony_ci#else
118c2ecf20Sopenharmony_ci	int		switch_pending;
128c2ecf20Sopenharmony_ci#endif
138c2ecf20Sopenharmony_ci	unsigned int	vmalloc_seq;
148c2ecf20Sopenharmony_ci	unsigned long	sigpage;
158c2ecf20Sopenharmony_ci#ifdef CONFIG_VDSO
168c2ecf20Sopenharmony_ci	unsigned long	vdso;
178c2ecf20Sopenharmony_ci#endif
188c2ecf20Sopenharmony_ci#ifdef CONFIG_BINFMT_ELF_FDPIC
198c2ecf20Sopenharmony_ci	unsigned long	exec_fdpic_loadmap;
208c2ecf20Sopenharmony_ci	unsigned long	interp_fdpic_loadmap;
218c2ecf20Sopenharmony_ci#endif
228c2ecf20Sopenharmony_ci} mm_context_t;
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#ifdef CONFIG_CPU_HAS_ASID
258c2ecf20Sopenharmony_ci#define ASID_BITS	8
268c2ecf20Sopenharmony_ci#define ASID_MASK	((~0ULL) << ASID_BITS)
278c2ecf20Sopenharmony_ci#define ASID(mm)	((unsigned int)((mm)->context.id.counter & ~ASID_MASK))
288c2ecf20Sopenharmony_ci#else
298c2ecf20Sopenharmony_ci#define ASID(mm)	(0)
308c2ecf20Sopenharmony_ci#endif
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#else
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/*
358c2ecf20Sopenharmony_ci * From nommu.h:
368c2ecf20Sopenharmony_ci *  Copyright (C) 2002, David McCullough <davidm@snapgear.com>
378c2ecf20Sopenharmony_ci *  modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
388c2ecf20Sopenharmony_ci */
398c2ecf20Sopenharmony_citypedef struct {
408c2ecf20Sopenharmony_ci	unsigned long	end_brk;
418c2ecf20Sopenharmony_ci#ifdef CONFIG_BINFMT_ELF_FDPIC
428c2ecf20Sopenharmony_ci	unsigned long	exec_fdpic_loadmap;
438c2ecf20Sopenharmony_ci	unsigned long	interp_fdpic_loadmap;
448c2ecf20Sopenharmony_ci#endif
458c2ecf20Sopenharmony_ci} mm_context_t;
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#endif
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#endif
50