GNU Linux-libre 4.4.285-gnu1
[releases.git] / arch / x86 / include / asm / mmu.h
1 #ifndef _ASM_X86_MMU_H
2 #define _ASM_X86_MMU_H
3
4 #include <linux/spinlock.h>
5 #include <linux/mutex.h>
6 #include <linux/atomic.h>
7
8 /*
9  * x86 has arch-specific MMU state beyond what lives in mm_struct.
10  */
11 typedef struct {
12         /*
13          * ctx_id uniquely identifies this mm_struct.  A ctx_id will never
14          * be reused, and zero is not a valid ctx_id.
15          */
16         u64 ctx_id;
17
18 #ifdef CONFIG_MODIFY_LDT_SYSCALL
19         struct ldt_struct *ldt;
20 #endif
21
22 #ifdef CONFIG_X86_64
23         /* True if mm supports a task running in 32 bit compatibility mode. */
24         unsigned short ia32_compat;
25 #endif
26
27         struct mutex lock;
28         void __user *vdso;
29
30         atomic_t perf_rdpmc_allowed;    /* nonzero if rdpmc is allowed */
31 } mm_context_t;
32
33 #define INIT_MM_CONTEXT(mm)                                             \
34         .context = {                                                    \
35                 .ctx_id = 1,                                            \
36         }
37
38 void leave_mm(int cpu);
39
40 #endif /* _ASM_X86_MMU_H */