| 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 |
} mm_context_t; |
| 25 |
|
| 26 |
#define INIT_MM_CONTEXT(mm) \ |
| 27 |
.context = { \ |
| 28 |
.turnstile = __MUTEX_INITIALIZER(mm.context.turnstile), \ |
| 29 |
.sync_tlb_lock = __SPIN_LOCK_INITIALIZER(mm.context.sync_tlb_lock), \ |
| 30 |
} |
| 31 |
|
| 32 |
#endif |