1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 4 */ 5 6 #ifndef __ARCH_UM_MMU_H 7 #define __ARCH_UM_MMU_H 8 9 #include "linux/types.h" 10 #include <linux/mutex.h> 11 #include <linux/spinlock.h> 12 #include <mm_id.h> 13 14 typedef struct mm_context { 15 struct mm_id id; 16 struct mutex turnstile; 17 18 struct list_head list; 19 20 /* Address range in need of a TLB sync */ 21 spinlock_t sync_tlb_lock; 22 unsigned long sync_tlb_range_from; 23 unsigned long sync_tlb_range_to; 24 25 #ifndef CONFIG_MMU 26 unsigned long end_brk; 27 #ifdef CONFIG_BINFMT_ELF_FDPIC 28 unsigned long exec_fdpic_loadmap; 29 unsigned long interp_fdpic_loadmap; 30 #endif 31 #endif /* !CONFIG_MMU */ 32 } mm_context_t; 33 34 #define INIT_MM_CONTEXT(mm) \ 35 .context = { \ 36 .turnstile = __MUTEX_INITIALIZER(mm.context.turnstile), \ 37 .sync_tlb_lock = __SPIN_LOCK_INITIALIZER(mm.context.sync_tlb_lock), \ 38 } 39 40 #endif 41